A lightweight vanilla Javascript micro-library for making collapsible trees with JSON
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist es6 Nov 25, 2017
src es6 Nov 25, 2017
test
.gitignore Update .gitignore Feb 28, 2017
LICENSE Initial commit Aug 12, 2015
README.md
package.json es6 Nov 25, 2017

README.md

jsonTree

A lightweight vanilla Javascript micro-library for making collapsible trees with JSON

usage

new jsonTree(object, selector, depth);

Because jsonTree uses document.querySelector(selector), selector can either be an ID or class, just be sure to specify with the proper identifier (. for class and # for ID).

"depth" is a boolean which decides if jsonTree should apply a class to all children elements ("depth-#"). This can be used for custom styling but may increase loading times.

The JSON object must be a valid JavaScript object or a properly formatted URL (http://, etc), as XMLHttpRequests are annoying that way.