d3-indented-tree API example #29
This example demonstrates how to customize node images in a d3-indented-tree chart by adding SVG elements. It shows expanded nodes with green circles and collapsed nodes with red circles, with the colors updating dynamically based on the node’s collapsed state. The chart uses the d3.indentedTree API with custom appendNodeSVG and updateNodeSVG functions, while the data is loaded from an HTML aside element. The visualization also links edge width and labels to the "weight" and "size" fields, and the chart re-renders after two seconds to reflect the change.
AI-generated descriptionAPI examples for d3-indented-tree
myChart.nodeImageSelection()
This example shows how to set the the node image based on adding SVG elements. The expanded nodes are shown with a green circle. If the node is collapsed, it changes to a red circle.
- for documentation, go to https://github.com/EE2dev/d3-indented-tree
- for other examples, go to https://github.com/EE2dev/d3-indented-tree#examples
Acknowledgements: