Black Lives Matter. Please consider donating to Black Girls Code today.

Is it possible to drag and select the values without using lasso and zooming event?

I want to get the only the selected values while dragging in the graph without using lasso or zooming event. But at present if I am disabling the zooming event then I am not able to drag and select any of the values. Can you give any suggestions what to do?

Thanks for writing in.

If I understand correctly, you’re trying to listen to the plotly_selected event when layout.dragmode is 'zoom' ?

Yes you are right. But not able to implement it because plotly_selected function working when the layout_dragmode in “lasso”

Yes, that’s correct the plotly_selected event is only emitted on dragmode 'lasso' and 'select' at the moment.

We don’t have a zoom-specific event at the moment, so I would recommend listening to plotly_relayout and write a lookup function comparing your data with the new axis ranges. See example:

Hiya! Plotly now has improved and consolidated Plotly.js event documentation here:

Please feel free to suggest documentation improvements in a pull request: