Skip to main content
100%

d3-indented-tree API example #22

✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Aug 27, 2019

This example demonstrates dynamic link strength in a d3-indented-tree hierarchical chart, where the strength of each link is mapped from the data’s “size” field using a logarithmic scale. It first renders a tree from the flare.json dataset, then after a two-second delay, increases the link width to 100 pixels to show an interactive update. The code uses the d3-indented-tree API, specifically the `linkStrength()` method with a scale, along with d3.v6 for data handling and selection. The visualization is created via a custom `showChart` function that appends a chart div to the body.

AI-generated description

API examples for d3-indented-tree


myChart.linkStrength() - 3

This example shows how

  • to set a link strength dynamically based on a data field
  • to pass a scale for the mapping of the link strength

Acknowledgements:

mit Licensed

Similar vizzes