question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

plotly_click event doesn't fire when clicking non-root/leaf nodes of sunburst trace

See original GitHub issue

Originally reported in https://github.com/ropensci/plotly/issues/1648

Minimal example (note how clicking on the middle ring doesn’t trigger plotly_click) https://codepen.io/cpsievert/pen/OJJZyrZ

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
etpinardcommented, Nov 18, 2019

Personally, I’m very (very) much in favour of 2).

0reactions
alexcjohnsoncommented, Nov 20, 2019
  1. user clicks on the root node OR a leaf node:
  • current: fires plotly_click
  • wanted: same
  1. user clicks on an inner node:
  • current: executes plotly_sunburstclick handler, triggers transition
  • wanted: executes plotly_sunburstclick handler, fires plotly_click, triggers transition
  1. user clicks on an inner node AND had set up a plotly_sunburstclick handler that returns false:
  • current: executes plotly_sunburstclick handler, fires plotly_click
  • wanted (by AJ 😏 ): executes plotly_sunburstclick hander

Is that correct?

yep, that’s what I had in mind! 🍻

I can’t really imagine placing the transition info inside the points array, so maybe the event data could have three subcontainers when a transition is triggered:

{
  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 🤔

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?

Moreover, theses changes are borderline breaking, so at the very least they would have to be released in a minor.

For sure, minor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sunburst: onclick events with non-terminal nodes - plotly.js
Hey Folks, Does anyone know if there's an option to have an onclick event associated with something in a sunburst that isn't a...
Read more >
Plotly sunburst and callbacks - Dash Python
However, i am finding that i only get 'clickData' callbacks to fire if a leaf is clicked. Id like to crossfilter a table...
Read more >
Get currentPath from sunburst in dash - Plotly Community Forum
On using click data, am not able to get the click events for the non-root or non-leaf part of the graph. Is there...
Read more >
Click events in Python - Plotly
Scatter instance Register function to be called when the user clicks on one or more points in this trace. Note: Callbacks will only...
Read more >
Disabling default click behaviour on Sunburst - plotly.js
Hi. I've been able to add and remove my own event handlers processing the 'plotly_click' event, but I can't seem to stop a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found