Fork of Fork for plotting tree
✓ Published0🌍 Public
This example displays a hierarchical tree of 2011 electric vehicle stock values, organized by country (China, India, United Kingdom, USA) and vehicle type (Buses, Cars), with leaf nodes representing BEV and PHEV quantities. The tree uses d3.hierarchy and d3.tree to compute node positions, with curved paths drawn between nodes via a cubic Bézier command in the `d` attribute. Node colors vary by depth—dark red for root and country levels, indigo for vehicle types, and green for leaf values—while links inherit their stroke color from the target node’s type. The SVG is rendered inside a styled container with a gradient background.
AI-generated descriptionMIT Licensed