ANY JSON tree (DRAFT) more data
This example visualizes a hierarchical JSON tree structure from a FileMaker Data API response, using a left-to-right tree layout to display nested data fields and values. Nodes represent objects, arrays, and leaf values, with text labels showing the data type and content. The visualization uses D3 v5’s `tree()` layout, `hierarchy()`, `linkHorizontal()` for the curved links, and `zoom()` for pan and zoom interaction. SVG rendering displays the nodes and paths, with color coding applied via `scaleSequential()` and `interpolateRainbow` from D3’s color module.
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.