D3 World Countries - Tree
✓ Published0🌍 Public
This D3.js v7 visualization renders a node-link tree of world countries, organized hierarchically from continents through sub-regions to individual nations. The tree uses a tidy layout with horizontal links, displaying country names as text labels positioned at each node. Panning and zooming is enabled through D3’s zoom module, which transforms the entire graph. The visualization leverages D3’s tree, hierarchy, and linkHorizontal components, with a scaleOrdinal function controlling font sizes by depth. Data is loaded from a local JSON file, and the custom Work Sans font is applied via Google Fonts.
AI-generated description- Constructing a node-link tree visualization
- Adding text labels to the nodes
- Using the Margin Convention
- Tweaking label alignment and size
- Panning & Zooming
- Using a custom font
MIT Licensed