Skip to main content
100%

d3-indented-tree API example #33

✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Sep 29, 2019

This example demonstrates how to reorder tree nodes after initial rendering, using the `nodeSort` method to sort by the `size1` column. The chart is built with the d3-indented-tree API, which parses semicolon-delimited data from an HTML `<aside>` element into hierarchical levels. A `convertTypes` function explicitly converts `size1`, `size2`, and `size3` from strings to numeric values, while `linkLabel` displays the `size1` value as an edge label. After a two-second delay, `nodeSort("size1")` triggers the re-sort, showing dynamic updates to the tree layout.

AI-generated description

API examples for d3-indented-tree


myChart.nodeSort() - 3

This example shows how to resort the nodes of the tree and how to provide a convertTypes function that converts the columns size1, size2, size3 to numeric types.


Acknowledgements:

mit Licensed

Similar vizzes