Skip to content
프로젝트

소개

JSON 구조를 동적 트리 다이어그램으로 손쉽게 시각화합니다.

디자인 및 미디어

이 수치를 측정하는 방법

What you can do

  • Automatically generates tree diagrams from JSON data.
  • Dynamically positions nodes to avoid overlaps.
  • Supports arrays and nested objects with labeled parent nodes.
  • Interactive SVG-based rendering with customizable styles.

측정된 스타 증가

in 24h
0
in 7 days
-1
in 15 days
0
in 1 month
업데이트 지연

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

jsontr.ee

Effortlessly visualize JSON structures as interactive and dynamic tree diagrams. See example

Description:

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.

Features:

  • Automatically generates tree diagrams from JSON data.
  • Dynamically positions nodes to avoid overlaps.
  • Supports arrays and nested objects with labeled parent nodes.
  • Interactive SVG-based rendering with customizable styles.
  • Lightweight and easy to integrate into any web project.

Perfect for:

  • Debugging JSON structures.
  • Visualizing API responses.
  • Representing hierarchical data.

How to Use

To get started, include the jsontr.ee library in your HTML:

<script src="path/to/jsontr.ee.js"></script>

Basic Usage

  1. Prepare Your JSON Data:

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"
        }
    ]
};
  1. Create a Container for the Diagram:

Add a <div> element in your HTML where the diagram will be rendered.

<div id="json-tree"></div>
  1. Render the Tree Diagram:

Use the jsontr.ee function to visualize the JSON data.

const container = document.getElementById('json-tree');
container.innerHTML = generateJSONTree(jsonData);
  1. Graph customization
  • Customize with initial options
/* Change graph styles */
const options = {
    arrowColor: "#475872",
    nodeBorderColor: "#475872",
    nodeBackgroundColor: "#f6f8fa",
    keyColor: "#b16b2a",
    valueColor: "#008000",
};
// Pass options
generateJSONTree(jsonData, options);
  • Customize with CSS
/* Change node styles */
rect {
    fill: #ffffff !important; /* background white */
    stroke: #000000 !important; /* border black */
    stroke-width: 2pt !important; /* border width */
}

VS Code Extension

You can install this extension directly from the Visual Studio Code Marketplace.

or follow these instructions:

  1. Open the Extensions view in Visual Studio Code (Ctrl+Shift+X or Cmd+Shift+X).
  2. Search for JSON Tree Visualizer
  3. Click Install.
  4. Done! Run the command Visualize JSON as Tree from the Command Palette.

관련 프로젝트 살펴보기

불러오는 중…