plotly / plotly/plotly.R

Plot_ly sunburst restyle event puts sunburst in weird state

Open
#2,371 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

I have a large sunburst it is laid out with three levels. I have implemented click events to synchronize other tables and charts as a user navigates the sunburst.

I am trying to implement a search box that takes the user directly to a node in the sunburst. I am using plotlyProxy and send the restyle

gotothis<-sbd %>% filter(labels==input$sunburstquery) %>% pull(ids)
sunburstproxy %>% plotlyProxyInvoke("restyle", list(level=gotothis))

In this case gotothis would be the id of the table that the sunburst was created from. In most cases this works in the desired method. If I restyle to one of the levels in the middle it draws the sunburst as if I had just clicked on that node. However, when the level is a leaf. It draws a single circle with that leaf in it no parents.

Which is fine I suppose, however when I try to navigate to the parent by clicking the circle as if it were the center circle, then it doesn't rerender the parent, though the click event is registered. To reiterate this works as expected when I restyle the level to the parent level. There doesn't appear to be anyway to rescue the state of the plotly sunburst after it is restyled to a leaf node.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the plotlyProxyInvoke("restyle", ...) call in the issue and reproduce navigation after restyling a three-level sunburst to a leaf id. Trace the leaf-node state and click handling; done when clicking the leaf view can navigate back to its parent and rerender it correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.