Skip to main content
100%

d3-indented-tree API example #5

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

This example demonstrates how to pass a JSON object stored in a variable to the d3-indented-tree API, rendering a hierarchical dataset of world continents and populations as an indented tree. The visualization initializes with a static chart, then after two seconds uses the `linkWidth("population")` method to dynamically resize links based on population values. The code loads D3 v6 and the d3-indented-tree library, defines a data specification with a `source` key, and appends the chart to the body via a custom `showChart` function. The JSON data includes nested children for Asia and North America, with population metrics shown on hover or through link thickness.

AI-generated description

API examples for hierarchy explorer


data format, JSON data from variable

This example shows how to reference a JSON data from a variable


Acknowledgements:

mit Licensed

Similar vizzes