Skip to main content
100%

World Countries Tree with D3.js!

✓ Published1🌍 Public
Fframptonb
Last edited Feb 17, 2023
Created on Feb 17, 2023

This example visualizes the hierarchical relationships among world countries and regions as a collapsible-style tree. It displays continents branching into subregions and individual countries, using a horizontal layout with adjustable text size based on depth. The visualization implements pan and zoom functionality through D3’s `zoom` behavior, applying the transform to an SVG group. The tree structure is generated with `d3.hierarchy` and `d3.tree`, while curved links are drawn using `d3.linkHorizontal` from a local `data.json` file.

AI-generated description

Demonstrates how to create hierachical tree with zoom and pan features using D3.js. (based on a tutorial by Curran Kelleher)

<iframe width="560" height="315" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
MIT Licensed

Similar vizzes