Export jupyter notebook to html with FigureWidget

Hello everybody,

I am new to the use of plotly and I find it very useful.
I go directly to the problem that I am facing. I would like to create an interactive plot to insert in a website. I have read many examples, but I could not find a proper solution. My script is very similar to the one that is in the example on this page:

I have a set of points, and I want that when the user clicks on a point a given callback function is called and there is a change in the plot, exactly as it is in this example. I managed to realize this with my data in a jupyter notebook, but when I export to the plotly dashboard, in such a way that I can share the plot in a website, the callback function does not work anymore. Basically, I added to the example the following lines to the example that I mentioned:
import plotly.plotly as py
py.plot(f, filename = β€˜from_tutorial’)

This opens the plot in the plotly website and save it in my dashboard, but now the callback function is not working anymore.
What am I missinig?

Thank you in advance for your help.

Hi @fnac,

The FigureWidget callback interactions are only available in the Jupyter Notebook. This is because the callback functions require a running Python kernel which is not available in the web browser.

The best way to have callback interactions available in a website outside of the Jupyter Notebook is to use Dash: https://dash.plot.ly/interactive-graphing

Hope that helps clear things up,
-Jon

1 Like