Closed Jomimoses closed 2 years ago
@Jomimoses thanks for reaching out.
There's context missing to give a better answer, f.e. the implementation of setSelectedIds
. Could you make a reduced example on https://codepen.io/ ?
@Jomimoses thanks for reaching out.
There's context missing to give a better answer, f.e. the implementation of
setSelectedIds
. Could you make a reduced example on https://codepen.io/ ?
Here is the example https://codepen.io/jomimoses/pen/PoQVydB
Thanks for that @Jomimoses.
I see, it's a React application. The real issue is that you're re-instantiating a SunburstChart
at every component re-render. That leads to a reinitialization of the component and a start from scratch. You shouldn't need to do that. Just instantiate the chart once and reuse it on sequential updates. You may want to do a similar thing with the data structure, memoize it at component mount so you can reuse it on incremental updates.
Describe the solution you'd like I need the solution to highlight the entire node path by clicking the particular node. the ultimate goal is to updating the color without re-render
Describe alternatives you've considered I tired to get all the children node ids by click and updated the color values, but it requires re-render to update the colors in chart
`
const scoreChart = Sunburst().color(getColor).onClick(onItemClick)
`
Additional context @vasturiano Expected result without re-rendering