Skip to content

A JavaScript plugin to easy create an tree data structure.

Notifications You must be signed in to change notification settings

sectri-sitler/treeData.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

<link rel="stylesheet" href="treeData.min.css" />

2. Start treeData.js in body end

<script src="treeData.min.js"></script>
<script type="text/javascript"> 

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");

</script>
</body>

About

Created with <3 by raphamorim

About

A JavaScript plugin to easy create an tree data structure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 49.5%
  • HTML 38.7%
  • JavaScript 11.8%