Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 1.01 KB

README.md

File metadata and controls

23 lines (20 loc) · 1.01 KB

TrialViewer

TrialViewer is a vanilla JavaScript tool for visualising trial JSON data. We use JSONViewer to display json structure.

Demo Site: oncokb.github.io/trial-viewer

Development

  1. Create new instance of JSONViewer object.
    var jsonViewer = new JSONViewer();
  2. Append instance container to the DOM using "getContainer()" method.
    document.querySelector("#json").appendChild(jsonViewer.getContainer());
  3. Visualise json using "showJSON()" method, which accepts 3 arguments - json file, optional: visualise to max level (-1 unlimited, 0..n), optional: collapse all at level (-1 unlimited, 0..n).
    jsonViewer.showJSON(jsonObj); // visualize the whole json structure.
    jsonViewer.showJSON(jsonObj, 1); // visualise json to max level 1.
    jsonViewer.showJSON(jsonObj, null, 1); // collapse all at level 1.