Skip to main content
100%

d3-indented-tree API example #19

✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Jul 25, 2019

This example demonstrates how numeric values propagate through a hierarchical tree and appear as link labels, with colors indicating magnitude. The chart loads `flare.json` and displays it using the `d3-indented-tree` plugin, where the `propagateValue("size")` method sums child values into their parents and `linkLabel("size", {color})` renders each link’s label with a color function turning values over 6000 green and others red. The visualization also shows dynamic interaction by widening the link labels from their default to 100 pixels after a two-second delay, while relying on D3 v6 for data binding and DOM manipulation.

AI-generated description

API examples for d3-indented-tree


myChart.linkLabel() - 5

This example shows how to

  • set the link label based on the numeric column size
  • set the color of the link label based on the value of the column size
  • propagate the value of data column size from the leaves all the way to the root by summing up the value directly descandants.

Acknowledgements:

mit Licensed

Similar vizzes