Skip to main content
100%

d3-indented-tree API example #26

✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Jan 14, 2020

This example demonstrates how to add a second numeric value to tree nodes using the `nodeBar()` method from the d3-indented-tree library, which visualizes hierarchical data as an indented tree. It shows how to configure the bar’s minimum horizontal translation with `translateX`, append a custom unit to the displayed value, and place labels inside the bars when space allows. The chart uses D3 v6 to parse semicolon-delimited data from an aside element and applies the `nodeSort` method to order nodes by the "size1" field. The visualization renders with the d3-indented-tree plugin, using its link and node bar APIs.

AI-generated description

API examples for d3-indented-tree


myChart.nodeBar() - 3

This example shows how to a second numeric value to a node with myChart.nodeBar(). This example also shows:

  • how to specify the minimum translation of the nodeBars (with translateX)
  • how to add a unit to the numeric value of the node bar
  • how to put the node bar labels inside the bar (if possible)

Acknowledgements:

mit Licensed

Similar vizzes