Is there a way to clear clickData?


#1

When filtering a chart through clickData, it is not possible to clear the click and show the entire plot again after that. Has anyone figured out a way to do this? We have ‘clear_on_unhover = True’, but I don’t see a way to do the same when using clickData.


#2

There isn’t yet. I’d like for this to be added as a “selection” mode in plotly.js. This issue is in https://github.com/plotly/plotly.js/issues/1852 . We’ll likely need a commercial sponsor to help pull this one through, so if your organization or company can help fund these feature, please reach out (https://plotly.typeform.com/to/rkO85m).


#3

This is a major gap in functionality. I get it, the software is free and I am super appreciative of the work that’s been done but this is the kind of thing that pushes tableau back into the conversation…


#4

It definitely was! That’s why we prioritized it :slight_smile: As you can see from the open source GitHub issue that I posted above (https://github.com/plotly/plotly.js/issues/1852) this was actually solved via the selectedpoints property through this monumental PR: https://github.com/plotly/plotly.js/pull/2944/. I don’t think any Dash-specific examples have made it through to the docs yet, but you may be able to figure it out via the plotly.js examples included in that PR.

Always appreciate the feedback!


#5

That sounds promising. However, from what i can tell selectedpoints is not a property of graphs in Dash - there is selectedData which corresponds to box/lasso selections, which I guess is a workable alternative but the natural inclination is to click to select. I dunno, that also brings up why dont the selection tools allow u to click on a point. oh well.


#6

clickmode:“event+select” FTW!


#7

Exactly. The issue that I linked to (I recommend reading through all of the threads on GitHub) was to add click-to-select as part of the selected data, rather than just lasso.