Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Methods To Node Class's Internal Handlers #462

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dev-john-nguyen
Copy link
Contributor

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

  • Removes the node and all of its children.

replaceChildren: (children: RawNodeDatum[]) => void

  • Replaces the node's children with the given children.

updateNodeAttributes: (attributes: Omit<RawNodeDatum, 'children'>) => void

  • Updates the attributes & name of the given node

Additional

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant