Open dev-john-nguyen opened 1 year ago
The purpose of these enhancements is to give the user the ability to make dynamic updates to the tree without completely re-rendering the whole tree.
Handling dynamic updates like removing a node, combining nodes, and renaming nodes.
removeNode: () => void
replaceChildren: (children: RawNodeDatum[]) => void
updateNodeAttributes: (attributes: Omit<RawNodeDatum, 'children'>) => void
attributes
name
Updated the key value for Node to be more unique ( key={'node-' + hierarchyPointNode.data.__rd3t.id} ). Since the tree will be dynamically updating, we want the key to be unique to it's node instead of using index to prevent buggy behavior.
key
key={'node-' + hierarchyPointNode.data.__rd3t.id}
Enhancements
The purpose of these enhancements is to give the user the ability to make dynamic updates to the tree without completely re-rendering the whole tree.
Use Case
Handling dynamic updates like removing a node, combining nodes, and renaming nodes.
Node Class's Internal Handlers
removeNode: () => void
replaceChildren: (children: RawNodeDatum[]) => void
updateNodeAttributes: (attributes: Omit<RawNodeDatum, 'children'>) => void
attributes
&name
of the given nodeAdditional
Updated the
key
value for Node to be more unique (key={'node-' + hierarchyPointNode.data.__rd3t.id}
). Since the tree will be dynamically updating, we want the key to be unique to it's node instead of using index to prevent buggy behavior.