You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This javascript module aims at providing an easy interface in order to represent tree diagrams on screen with the ability to handle dynamic data flows. The data format must be JSON.
4
8
5
9

@@ -71,16 +75,15 @@ The table below lists all the avalaible key that the config object can have
71
75
|`htmlID`| string (Required) || The HTML id tag on the page where the tree should be drawn. It must have a width and an height specified |
72
76
|`nodeField`| string | "id" | The unique identifier field in the dataset representing the node |
73
77
|`relationnalField`| string | "father" | In case of flat dataset, usually the relationnal field between each node is the field representing the father of the node, linking it to the id of the field. (See example below). |
74
-
|`flatData`| boolean | true | Specify whether the data passed to the tree is flat or already hierarchical |
75
-
|`zoomBehavior`| boolean | true | Toggle the ability to pan and zoom the tree |
78
+
|`hasFlatData`| boolean | true | Specify whether the data passed to the tree is flat or already hierarchical |
79
+
|`hasPanAndZoom`| boolean | true | Toggle the ability to pan and zoom the tree |
76
80
|`nodeWidth`| number | 160 | Width of a node in px |
77
81
|`nodeHeight`| number | 100 | Height of a node in px |
78
-
|`nodeColor`| function | (nodeData) => "#2196f3" | Color of the node |
79
82
|`linkColor`| function | (nodeData) => "#ffcc80" | Color of the link |
80
83
|`linkWidth`| function | (nodeData) => 10 | Width of the link |
81
84
|`linkShape`| "quadraticBeziers" \| "orthogonal" | "quadraticBeziers" | Shape of the link |
82
-
|`nodeTemplate`| function | (nodeData) => null | HTML template for every node |
83
-
|`horizontalLayout`| boolean | true | Direction of the tree. If true, the tree expands from left to right. If false, it goes from top to bottom |
85
+
|`renderNode`| function | (nodeData) => null | HTML template for every node |
86
+
|`isHorizontal`| boolean | true | Direction of the tree. If true, the tree expands from left to right. If false, it goes from top to bottom |
84
87
|`onNodeClick`| function | (nodeData) => null | Function handling the event when someone click on it |
85
88
|`onNodeMouseEnter`| function | (nodeData) => null | Function handling the event when someone hover a node |
86
89
|`onNodeMouseLeave`| function | (nodeData) => null | Function handling the event when the mouse pointer leaves a node |
@@ -93,7 +96,7 @@ The table below lists all the avalaible key that the config object can have
93
96
94
97
## Example
95
98
96
-
Assuming that you already have an HTML element on the pagh with the tag `id="a_tree"`
99
+
Assuming that you already have an HTML element on the page with the tag `id="a_tree"`
0 commit comments