A lightweight JavaScript library that generates customizable tree views to better visualize and edit JSON data.
v4.0.0
What Features Does JsonTree.js Have?
- Zero-dependencies and extremely lightweight!
- 100% TypeScript, allowing greater support for React, Angular, and other libraries!
- Full API available via public functions.
- 52 language translations available!
- Fully styled in CSS/SASS, fully responsive, and compatible with the Bootstrap library!
- Full CSS theme support (using :root variables), with dark and light themes.
- 22 types supported by default (such as Object, Array, primitive types, and even Sets, Maps, and HTML DOM elements).
- Support to show the data types, array/object sizes, commas, and opening/closing symbols!
- Fully configurable per DOM element!
- Close and open all objects, arrays, sets, and maps.
- Clickable values via custom triggers!
- Custom value rendering.
- Array paging, with configurable column count support (show array objects on different pages)!
- Drag & Drop JSON files support!
- Copy to clipboard (all JSON, or just the current page).
- Full editing support (double click a value, property, index, or anywhere for everything).
- Keyboard navigation keys support!
- Toggle between regular and full-screen views.
- Assign tooltips to any JSON value!
- Show value/key memory sizes, page numbers, and status updates in the footer!
Where Can I View the Examples?
You can view all the examples here.
Where Can I Find the Documentation?
All the documentation can be found here.
What Browsers Are Supported?
All modern browsers (such as Google Chrome, Firefox, and Opera) are fully supported.
What Types Are Supported?
- boolean
- number
- bigint
- string
- object
- array
- date
- float
- null
- symbol
- function
- lambda
- undefined
- color
- guid
- regexp
- map
- set
- url
- image
- html
- any
What Languages Are Supported?
- af – Afrikaans
- ar – Arabic
- hy – Armenian
- be – Belarusian
- bn – Bengali
- bg – Bulgarian
- ca – Catalan
- zh – Chinese (simplified)
- da – Danish
- nl – Dutch
- en – English (default)
- eo – Esperanto
- et – Estonian
- fa – Farsi
- fi – Finnish
- fr – French
- fy – Frisian
- gl – Galician
- ka – Georgian
- de – German
- el – Greek
- he – Hebrew
- hi – Hindi
- hu – Hungarian
- is – Icelandic
- id – Indonesian
- ga – Irish
- it – Italian
- ja – Japanese
- ko – Korean
- lv – Latvian
- lt – Lithuanian
- lb – Luxembourgish
- ms – Malay
- ne – Nepali
- no – Norwegian
- pl – Polish
- pt – Portuguese
- ro – Romanian
- si – Sinhalese
- sk – Slovak
- sl – Slovenian
- es – Spanish
- sv – Swedish
- tl – Tagalog
- ta – Tamil
- zh-tw – Taiwanese
- te – Telugu
- th – Thai
- tr – Turkish
- uk – Ukrainian
- vi – Vietnamese
What Are the Most Recent Changes?
To see a list of all the most recent changes, click here.
How Do I Install JsonTree.js?
You can install the library with npm into your local modules directory using the following command:
npm install jjsontree.js
Or, you can download the latest zipped version here.
Or, you can also use the following CDN links:
https://cdn.jsdelivr.net/gh/williamtroup/JsonTree.js@4.0.0/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/JsonTree.js@4.0.0/dist/jsontree.js.min.css
How Do I Get Started?
To get started using JsonTree.js, do the following steps:
1. Prerequisites:
Make sure you include the DOCTYPE html tag at the top of your HTML, as follows:
!DOCTYPE html
2. Include Files:
<link rel="stylesheet" href="dist/jsontree.js.css">
<script src="dist/jsontree.js"></script>
3. DOM Element Binding:
<div id="tree-1" data-jsontree-js="showObjectSizes: true, data: [ true, false, 5, 10, 'A String' ]"></div>
To see a list of all the available binding options for data-jsontree-js, click here.
To see a list of all the available custom triggers you can use for data-jsontree-js, click here.
4. Finishing Up:
That’s it! Nice and simple. Please refer to the code above if you need more help (fully documented).
How Do I Go About Customizing JsonTree.js?
To customize, and get more out of JsonTree.js, please read through the following documentation.
1. Public Functions:
To see a list of all the public functions available, click here.
2. Configuration:
Configuration options allow you to customize how JsonTree.js will function. You can set them as follows:
script
$jsontree.setConfiguration(
safeMode: false
);
To see a list of all the available configuration options you can use, click here.
Troubleshooting
If you encounter issues while integrating JsonTree.js, consider the following troubleshooting steps:
- Ensure that you have included all required files correctly.
- Double-check your DOM element bindings for any syntax errors.
- If the tree view does not render properly, check your JSON data format.
- Confirm that your browser supports the latest JavaScript features used by the library.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.