Skip to content

Commit 94ca974

Browse files
authored
Update README.md
1 parent 47742f4 commit 94ca974

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,35 @@ https://github.com/cheton/infinite-tree/wiki/Functions:-Tree
208208

209209
https://github.com/cheton/infinite-tree/wiki/Functions:-Node
210210

211+
### Node State
212+
213+
Name | Type | Description
214+
:--- | :--- | :----------
215+
depth | Number | The depth of a node.
216+
open | Boolean | Whether the node is expanded.
217+
path | String | A unique path string representing a node.
218+
prefixMask | String | The prefix mask.
219+
total | Number | The total number of child nodes.
220+
221+
#### Flat Tree Structure
222+
223+
https://github.com/cheton/flattree/blob/master/examples/tree1.js
224+
225+
```
226+
<root>: path=".0", parent="", children=2, total=11, depth=0, prefix="0", open=1, lastChild=1
227+
Alpha: path=".0.0", parent=".0", children=0, total=0, depth=1, prefix="00", open=0, lastChild=0
228+
Bravo: path=".0.1", parent=".0", children=3, total=9, depth=1, prefix="00", open=1, lastChild=1
229+
Charlie: path=".0.1.0", parent=".0.1", children=2, total=4, depth=2, prefix="000", open=1, lastChild=0
230+
Delta: path=".0.1.0.0", parent=".0.1.0", children=2, total=2, depth=3, prefix="0001", open=1, lastChild=0
231+
Echo: path=".0.1.0.0.0", parent=".0.1.0.0", children=0, total=0, depth=4, prefix="00011", open=0, lastChild=0
232+
Foxtrot: path=".0.1.0.0.1", parent=".0.1.0.0", children=0, total=0, depth=4, prefix="00011", open=0, lastChild=1
233+
Golf: path=".0.1.0.1", parent=".0.1.0", children=0, total=0, depth=3, prefix="0001", open=0, lastChild=1
234+
Hotel: path=".0.1.1", parent=".0.1", children=1, total=2, depth=2, prefix="000", open=1, lastChild=0
235+
India: path=".0.1.1.0", parent=".0.1.1", children=1, total=1, depth=3, prefix="0001", open=1, lastChild=1
236+
Juliet: path=".0.1.1.0.0", parent=".0.1.1.0", children=0, total=0, depth=4, prefix="00010", open=0, lastChild=1
237+
Kilo: path=".0.1.2", parent=".0.1", children=0, total=0, depth=2, prefix="000", open=0, lastChild=1
238+
```
239+
211240
## License
212241

213242
MIT

0 commit comments

Comments
 (0)