🌍 Public
Viewing a saved revision (read-only)
9e122b3fee364596b0966b5b872146c4
Fork of array to tree
This example converts a shuffled array of integers into a hierarchical tree structure. Using D3 v6’s `d3.stratify` and `d3.tree` layouts, it maps array indices to parent-child relationships and renders nodes as red-bordered circles connected by black paths. Text labels display each node’s value, with transitions animating their appearance based on tree depth. The visualization updates dynamically by re-rendering with a new random array, demonstrating data binding and enter/update/exit patterns in an SVG.
AI-generated descriptionConverts an Array into tree.