d3-indented-tree API example #5
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 descriptionAPI examples for hierarchy explorer
data format, JSON data from variable
This example shows how to reference a JSON data from a variable
- for documentation, go to https://github.com/EE2dev/hierarchy-explorer
- for other examples, go to https://github.com/EE2dev/hierarchy-explorer#examples
Acknowledgements: