I’ve written a shiny app to demonstrate what I’m trying to do: https://dave-j-guenther.shinyapps.io/pyshiny_highlight_deselect_issue1/
Plotly appears to allow the use of on_deselect as an exit event for on_selection, by double-clicking on the white space of a plot after a selection has been make using box or lasso tools:
However, I cannot find a similar “deselect” event for on_click to double-clicking on the whitespace of a plot after a selection has been made using the normal point selector:
So far I have tried to manually capture click events on the penguin_plot object using javascript and passing that to a call back function, however doing that causes the callback to execute on ANY click of the bar chart object, including the tool shelf where you select the box tool or lasso tool. I couldn’t figure out how to get that to focus only on the whitespace of the bar chart.
Is there any way to achieve a deselect this way without adding something like a “reset” button to the visual itself?