-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plotly_click event doesn't fire when clicking non-root/leaf nodes of sunburst trace #4338
Comments
|
Oh, nice; thanks, and why is a new event needed? It'd be nice if the event was mentioned in the release notes. |
@archmoj @etpinard can we please dredge up a clear answer as to why this odd behavior exists with |
For reference |
First off, the current behaviour is very much intended (see the logic here). So the discussion here should be about is the current behaviour correct. Here's some background: for most traces (maybe all, but I'd have to double-check) gd.on('plotly_sunburstclick', () => {
/* new logic e.g. make a request to a database */
return false; // cancel the default handler
}) This was one of the original requirements for sunburst traces. Note that returning So, is this ticket asking to:
|
Personally, I'm very (very) much in favour of 2). |
Thanks @etpinard! I think the behavior you describe in 2 is more intuitive for most users. |
Thanks for clarifying, @etpinard - we were missing that context. It does make sense to keep the transition-canceling property only in the But according to the existing logic, you get a |
So, there are three scenarios:
Is that correct?
Yeah, that's a good idea. The sunburst/treemap event data currently looks like: I can't really imagine placing the transition info inside the {
event: { /* instanceof MouseEvent */ }
points: [{ /* */ }],
transition: {
duration: /* value from the constant file */,
easing: /* value from the constant file */
}
} or maybe a just a boolean would suffice 🤔 Moreover, theses changes are borderline breaking, so at the very least they would have to be released in a minor. |
yep, that's what I had in mind! 🍻
As a user what I would want to know is not the transition parameters, but: did the root node of the view change, and if so to which node?
For sure, minor. |
Originally reported in plotly/plotly.R#1648
Minimal example (note how clicking on the middle ring doesn't trigger
plotly_click
) https://codepen.io/cpsievert/pen/OJJZyrZThe text was updated successfully, but these errors were encountered: