MaxLeiter / jsonTree

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

Home Page:https://maxleiter.github.io/jsonTree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

https://maxleiter.github.io/jsonTree

License:MIT License


Languages

Language:JavaScript 74.0%Language:HTML 24.1%Language:CSS 1.9%