How to use 'scatter.on_change' to grab event?

Hi @plotlek,

The trace.on_* methods are only designed for use in the Jupyter Notebook with the FigureWidget class. If you’re using Dash, as in your code example, then you’ll need to use the @app.callback approach like you have in your example. The reason that you’re not seeing a callback in response to clicking the legend is that this is considered a restyle rather than relayout event.

Unfortunately, it looks like Dash doesn’t have support for restyle events yet. See https://github.com/plotly/dash-core-components/issues/197 for current status.

Hope that helps clear things up.
-Jon