Effortlessly visualize JSON structures as dynamic tree diagrams
See the codeEffortlessly visualize JSON structures as interactive and dynamic tree diagrams. See example
jsontr.ee is a lightweight JavaScript library that transforms JSON data into beautifully rendered, interactive tree diagrams using SVG. Designed for simplicity and flexibility, it supports both arrays and nested objects, ensuring clear and intuitive visualizations of complex data structures.
To get started, include the jsontr.ee library in your HTML:
<script src="path/to/jsontr.ee.js"></script>
Basic Usage
Ensure you have your JSON data ready. For example:
const jsonData = {
"name": "Lou Alcalá",
"projects": [
{
"name": "JSONtr.ee",
"description": "JSON Formatter, Validator & Viewer Online | JSONtr.ee",
"url": "https://jsontr.ee"
},
{
"name": "PixSpeed.com",
"description": "Image compressor | Compress and optimize WebP, PNG, JPG, JPeG and AVIF",
"url": "https://pixspeed.com"
}
]
};
Add a <div> element in your HTML where the diagram will be rendered.
<div id="json-tree"></div>
Use the jsontr.ee function to visualize the JSON data.
const container = document.getElementById('json-tree');
container.innerHTML = generateJSONTree(jsonData);
/* Change graph styles */
const options = {
arrowColor: "#475872",
nodeBorderColor: "#475872",
nodeBackgroundColor: "#f6f8fa",
keyColor: "#b16b2a",
valueColor: "#008000",
};
// Pass options
generateJSONTree(jsonData, options);
/* Change node styles */
rect {
fill: #ffffff !important; /* background white */
stroke: #000000 !important; /* border black */
stroke-width: 2pt !important; /* border width */
}
You can install this extension directly from the Visual Studio Code Marketplace.
or follow these instructions:
Ctrl+Shift+X or Cmd+Shift+X).JSON Tree VisualizerVisualize JSON as Tree from the Command Palette.499 followers · starred Dec 2024
6,586 followers · starred Jan 2025
671 followers · starred Nov 2024
267 followers · starred Feb 2025
Effortlessly visualize JSON structures as dynamic tree diagrams
See the codeEffortlessly visualize JSON structures as interactive and dynamic tree diagrams. See example
jsontr.ee is a lightweight JavaScript library that transforms JSON data into beautifully rendered, interactive tree diagrams using SVG. Designed for simplicity and flexibility, it supports both arrays and nested objects, ensuring clear and intuitive visualizations of complex data structures.
To get started, include the jsontr.ee library in your HTML:
<script src="path/to/jsontr.ee.js"></script>
Basic Usage
Ensure you have your JSON data ready. For example:
const jsonData = {
"name": "Lou Alcalá",
"projects": [
{
"name": "JSONtr.ee",
"description": "JSON Formatter, Validator & Viewer Online | JSONtr.ee",
"url": "https://jsontr.ee"
},
{
"name": "PixSpeed.com",
"description": "Image compressor | Compress and optimize WebP, PNG, JPG, JPeG and AVIF",
"url": "https://pixspeed.com"
}
]
};
Add a <div> element in your HTML where the diagram will be rendered.
<div id="json-tree"></div>
Use the jsontr.ee function to visualize the JSON data.
const container = document.getElementById('json-tree');
container.innerHTML = generateJSONTree(jsonData);
/* Change graph styles */
const options = {
arrowColor: "#475872",
nodeBorderColor: "#475872",
nodeBackgroundColor: "#f6f8fa",
keyColor: "#b16b2a",
valueColor: "#008000",
};
// Pass options
generateJSONTree(jsonData, options);
/* Change node styles */
rect {
fill: #ffffff !important; /* background white */
stroke: #000000 !important; /* border black */
stroke-width: 2pt !important; /* border width */
}
You can install this extension directly from the Visual Studio Code Marketplace.
or follow these instructions:
Ctrl+Shift+X or Cmd+Shift+X).JSON Tree VisualizerVisualize JSON as Tree from the Command Palette.499 followers · starred Dec 2024
6,586 followers · starred Jan 2025
671 followers · starred Nov 2024
267 followers · starred Feb 2025