ANY JSON tree (DRAFT)
This example displays any JavaScript object or array as an interactive tree diagram, with nodes labeled by key names, data types (object, array, string, number), and values. It converts flat or nested JSON data into a hierarchical structure using a custom `hierarchify` function, then renders it with D3’s `tree` layout and `linkHorizontal` paths in SVG. Users can zoom and pan the tree via `d3.zoom`, and clicking a node toggles its children, allowing exploration of arbitrarily nested data. The code imports D3 v5 modules and includes a sample dataset with nested objects and arrays.