Skip to main content
100%

Simple Tree with D3.js

✓ Published0🌍 Public
VVenkat-Sumith-Thota
Last edited Jul 16, 2023
Created on Jul 16, 2023
Forked from Hello VizHub

A simple hierarchical tree diagram visualizes a root node with three branches—Animals, Vehicles, and Countries—each leading to two leaf nodes. The code uses D3.js v6’s `d3.hierarchy` and `d3.tree` layouts to compute node positions, and renders the structure as an SVG with curved links via path elements. Nodes appear as steelblue circles, with labels added as text elements, and a custom `project` function converts the tree layout’s polar coordinates into Cartesian coordinates for placement.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes