Skip to main content
100%

D3.js Tree Example

✓ Published0🌍 Public
Aakshayvenishetty1437
Last edited Jul 21, 2023
Created on Jul 21, 2023
Forked from Hello VizHub

This example shows a hierarchical tree layout with three levels of nodes—root, category, and subcategory—rendered as SVG shapes with distinct colors and symbols for each layer. It uses D3.js v5, loading the library via UNPKG, and applies the d3.tree layout, d3.hierarchy, d3.linkHorizontal, and d3.symbol APIs to position nodes and draw curved links. The data is hardcoded in JavaScript, and the visualization distinguishes node types using d3.scaleOrdinal for both color and shape.

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