What exactly can I do with Box Select or Lasso Select?


I am using a code like the following to add drawing instruments to my modebar:

import plotly.graph_objects as go
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
    title_text='Draw a path to separate versicolor and virginica',

I can use lasso or box select to select data in mu y chart:


Once I select, what can I do with the selection?

Is there any Python code sample to get a call back to at leas have the selected data in a NumPy array or Python list? Is that the intention of the selection tools in the toolbar?

Thank youm


Here’s an example of crossfiltering in a Jupyter notebook:

Alternatively, you can use it in Dash in a more generic way (see here for example).