🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

hortree is a small and easy jQuery plugin that helps render a horizontal treeview-like diagram from hierarchical data you specify in a JSON file.

tree-view

Documentation

jquery-hortree

This jQuery plugin will render an horizontal hierarchical tree starting from a JSON schema

jQuery HorTree example

Demo

See a demo here

Usage

  1. Include jQuery
  2. Include jquery.line.js plugin (credits to tbem)
  3. Include dist/jquery.hortree.min.js and dist/jquery.hortree.css
$('#your-div').hortree({     data: [         {             description: 'root',             tooltip: 'tooltip is optional',             children: []         }     ] });

Options

You can provide a configuration object as first parameter to manage content and graphic stuff.

property required data type default notes
data Yes Array [] Each object in this array should have the properties description and children, where children is an array containing objects with the same structure. This is the basic schema, you can modify the source code adding properties and managing it in your template according to your data structure.
lineStrokeWidth No int 2
lineZindex No int 8
lineColor No string #4b86b7
onComplete No function - This function is called when the tree is rendered

description content is rendered in a <div> element with the class .hortree-label. Modify it as your need to get the best look and feel.

Project Setup

This project uses gulp as its build system.

  • Install gulp: $ npm install -g gulp
  1. Install dependencies: $ npm install
  2. Build: $ gulp build

License

MIT © 2017 alesmit


You May Also Like