https://github.com/raphamorim/treedata.js
A JavaScript plugin to easy create an tree data structure.
https://github.com/raphamorim/treedata.js
Last synced: about 1 year ago
JSON representation
A JavaScript plugin to easy create an tree data structure.
- Host: GitHub
- URL: https://github.com/raphamorim/treedata.js
- Owner: raphamorim
- Created: 2014-02-27T03:08:50.000Z (over 12 years ago)
- Default Branch: gh-pages
- Last Pushed: 2025-01-22T13:03:06.000Z (over 1 year ago)
- Last Synced: 2025-02-26T02:17:58.752Z (over 1 year ago)
- Language: CSS
- Homepage: http://raphamorim.io/treeData.js/
- Size: 49.8 KB
- Stars: 18
- Watchers: 6
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# treeData.js
> A JavaScript plugin to easy create an tree data structure.
## What's a Tree data structure?
In computer science, a tree is a widely used abstract data type (ADT) or data structure implementing this ADT that simulates a hierarchical tree structure, with a root value and subtrees of children, represented as a set of linked nodes.
A tree data structure can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated, and none points to the root.
## Guide to use
It's super simple to use this javascript plugin.
**1.** First you have css in the Head
```html
```
**2.** Start treeData.js in body end
```html
var tree = {
father : {value : "Tree Data Structure", parent : ""},
a : {value : "A", parent : "father"},
b : {value : "B", parent : "a"},
c : {value : "C", parent : "a"},
d : {value : "D", parent : "c"},
e : {value : "E", parent : "b"},
f : {value : "F", parent : "c"},
g : {value : "G", parent : "f"}
};
TreeData(tree, "#element");