d3-indented-tree API example #13
✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Jul 25, 2019
This example demonstrates how to style link colors in a d3-indented-tree chart based on a data column. It shows a tree layout where each link’s stroke color is determined by the `color` field in the CSV-like data, sourced from an `<aside>` element. The code uses `d3.indentedTree` from the d3-indented-tree library, with `.linkColor("color")` to map data values to link strokes. After rendering, a `window.setTimeout` triggers `.linkWidth(100)` to adjust link thickness, though the primary focus remains on color mapping. The chart is appended to the body via a custom `showChart` function.
AI-generated descriptionAPI examples for d3-indented-tree
myChart.linkColor()
This example shows how to set the color of the links based on values of the column color.
- for documentation, go to https://github.com/EE2dev/d3-indented-tree
- for other examples, go to https://github.com/EE2dev/d3-indented-tree#examples
Acknowledgements:
mit Licensed