Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

add clear_on_doubleclick prop for clearing clickData #193

Closed
wants to merge 2 commits into from

Conversation

cpsievert
Copy link
Contributor

No description provided.

@@ -212,6 +219,12 @@ PlotlyGraph.propTypes = {
*/
clickData: PropTypes.object,

/**
* If True, `clear_on_doubleclick` will clear the `clickData` property
* when the user double clicks (when dragmode='zoom').
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only on dragmode='zoom'? Also, could we be more specific about dragmode, like figure['layout']['dragmode'] = 'zoom' or config['dragmode'] = 'zoom'

@chriddyp
Copy link
Member

Seems reasonable and a natural extension of the existing API. I would imagine that clear_on_click would be more common / easier to use, why the doubleclick?

Ultimately I really want the plotly.js to make this natural behaviour by adding a click mode to select so that we don't need to program in hacks like this and so that the behaviour is consistent across all contexts (cc @alexcjohnson ), this is being tracked in plotly/plotly.js#1852

@cpsievert
Copy link
Contributor Author

I would imagine that clear_on_click would be more common / easier to use, why the doubleclick?

By clear_on_click, I assume you mean any click event on the plot? It seems as though that would make it too easy to clear a selection, which would be especially problematic if you want selections to persist. In plotly's shiny integration, I've actually been 'clearing click data' on any double-click event (regardless of dragmode) for quite some time now and haven't really run into issues with it. Note that d00621f clears clickData on "plotly_deselect" events as well now which is consistent with that shiny behavior (and should've been included in the initial PR)

@alexcjohnson
Copy link
Collaborator

@chriddyp @cpsievert can we drop this PR now that plotly.js has built-in click-to-select plotly/plotly.js#2944?

@chriddyp
Copy link
Member

definitely

@chriddyp chriddyp closed this Dec 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants