🌍 Public
Viewing a saved revision (read-only)
81900cdb3c5b46f9ad263a55c4d7c4a7
Fork of HTML Starter
This example shows a company employee hierarchy as a tree diagram, with nodes colored by depth: red for the root, green for level-one employees, and blue for deeper levels. Each node displays two text labels—the employee name and position—and hover states change node fill and label styling. The code uses D3 v7’s `d3.stratify` to convert flat CSV data from a GitHub Gist into a hierarchy, then lays it out with `d3.tree`. Links are drawn as SVG lines, and nodes are styled via appended circles and text elements.
AI-generated description