ANY JSON tree (DRAFT) more data
This visualization displays a hierarchical tree representing a JSON response from a FileMaker Data API call, with nodes for objects, arrays, and leaf values. The D3.js v5 code builds the tree layout using `d3.tree()` and renders nodes as SVG text elements and links as horizontal paths. The data includes nested JSON strings within the records, creating deep hierarchies that expose overlapping text at level 4. The visualization uses a rainbow color scale for node values and supports zoom interaction, though the text-heavy rendering struggles with long data values.
AI-generated descriptionThis builds on v0.1 by first adding more data, so we can see the overlapping problems of the first solution.
Problems
Overlap (within the level / vertical)
Items at level 4 are in trouble.
Data value width
When data content is too long it goes off screen, or crashes into structures at lower levels
Leaf values and names
The name of the leaves are not visually distinct from the values
Represenation of Node type (object,array,[and leaf & value])
The representation of obects and arrays usng a suffix ' {' and ' [' is suboptimal
Maybe remove "{" entirely, and place the array index in '[]'?
data -- response -- data -- [0] -- fieldData --
d3 code dependency on node-form
Here we are using
svg.selectAll('text')...The node-selector 'text' should be independent of the representation of the node.
Is div best? Or a specific class?
svg.selectAll('.node')...Is this possibly what vega aims to solve? A predefined semantic?
Maybe check out Vega lite on Observable
Interaction
The zoom alone is quickly limited
Maybe check out collapsible-tree
Data Structure
The data structure here is the response to a FileMaker Data API call, which delivers the records including a bunch of metadata.
What's special about the returned data, is that the record data (data.response.data[n|.fieldData) is TWO levels below the data array table container (data.response.data) ... There is a metadata tag 'fieldData' in between.