bkrem / react-d3-tree

:deciduous_tree: React component to create interactive D3 tree graphs
https://bkrem.github.io/react-d3-tree
MIT License
1.09k stars 270 forks source link

Problem with adding new childrens to node without reseting the collapse state #512

Open Kamilos1337 opened 4 weeks ago

Kamilos1337 commented 4 weeks ago

Thank you for taking the time to report an issue with react-d3-tree!

Feel free to delete any questions that do not apply.

Are you reporting a bug, or opening a feature request?

Reporting a bug

What is the actual behavior/output?

I used the example from a repo of a tree, i try to add a nodes on a click. When i add a tree all the nodes are collapsed (i set initialDepth to 1 beacuse i need it). So every time i append some childrens to node with setState it all refresh.

What is the behavior/output you expect?

I expect a method or a way to add some children to a node without reseting the whole tree. Or a way so i can define which nodes are collapsed and which are not, currently as i see it's not possible to open a nodes in "data" object

Can you consistently reproduce the issue/create a reproduction case (e.g. on https://codesandbox.io)?

If needed but it's simple example.

What version of react-d3-tree are you using?

latest