Skip to main content
100%

Tree diagram using symbols for nodes in v5

✓ Published0🌍 Public
Dd3noob
Last edited Nov 26, 2019
Created on Nov 26, 2019

A tree diagram in d3.js v5 uses symbols for nodes instead of circles, with each symbol’s shape and size reflecting a numeric value from the hierarchical JSON data. The example applies `d3.tree()` layout, `d3.hierarchy()`, and `d3.symbol()` with conditional types (`d3.symbolCross` for values ≥9, `d3.symbolDiamond` otherwise). Links are drawn as cubic Bézier paths, with stroke colors set from each child’s `level` field, while node fills use the `type` field. Rendering is SVG, styled via CSS.

AI-generated description

This is a tree diagram with symbols used for nodes written with d3.js v5. It is based on the styled tree version here

This is designed to be used as part of documenting an update to the book D3 Tips and Tricks to version 5 of d3.js.

mit Licensed

Similar vizzes