Skip to main content
100%

d3-indented-tree API example #29

✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Sep 15, 2019

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 description

API 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.


Acknowledgements:

mit Licensed

Similar vizzes