bkrem / react-d3-tree

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

How to use non-copyable objects as data? #482

Closed khokm closed 7 months ago

khokm commented 9 months ago

I have a following tree structure:

interface Node extends RawNodeDatum {
children: Node[];
foo();
}

But d3 makes a copy of data when converting RawNodeDatum to TreeNodeDatum, so the foo method is lost in resulting TreeNodeDatum object.