In the examples about plotly event handling (Plotly — Panel v1.8.10) are the events only fired when the user clicks on a point in the plot. Is it possible to always get the click and move events ?
The use case is that the user needs to draw a region on the plot by hand to select contained items.
Activate the freedraw functionality and listen to the relayout event (Plotly — Panel v1.8.10), you get the path of the drawing in event.new.shapes as an svg path in a string: M0.7521739130434782,0.7176932404006737L0.7695652173913043,0.7176932404006737L0.8014492753623188,0.69740338532821L0.8231884057971014,0.678562805618065L0.8304347826086956,0.6539251244586447
hey @TdO
you can use Plotly’s drawing tools here
For example, in the Plotly mode bar you can enable drawclosedpath/drawopenpath and then watch Panel’s relayout_data event.
When you are finished with ur drawing, Plotly updates the shapes in the layout, and you can use that information to get the region they drew and then check which points fall inside it.
So the flow would be:
draw on map -> Plotly updates shapes -> Panel gets relayout_data -> process the drawn region