World Countries
✓ Published0🌍 Public
This example presents the hierarchical structure of world countries as an interactive zoomable tree diagram. The visualization organizes countries by continent and subregion, revealing geographic groupings at a glance. Using D3.js v5, the code loads data from a JSON file and applies the `d3.tree()` layout with `d3.hierarchy()`, rendering horizontal links via `d3.linkHorizontal()`. Pan and zoom functionality is implemented with the `d3.zoom()` behavior, while text labels display country names with size scaling by depth. The SVG-based rendering allows smooth exploration of the global hierarchy.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed