Hi,
I’m using this little snippet:
import plotly.express as px
df = px.data.iris()
fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
color='species')
to create a plot. But now I want to insert that into a webpage using js, so I used fig.to_plotly_json
.
However, when I paste that javascript dictionary into JS, (so I can render it using Plotly.newPlot('graph', data);
I keep getting errors indicating that the to_plotly_json method is not actually javascript code. What gives? Can anyone point me in the right direction? thank you!