Skip to content

Commit 9d43f1c

Browse files
committed
add family tree to doc
1 parent 08fe251 commit 9d43f1c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,47 @@ You need the solution based on new datasource structure with **levelOffset data
165165

166166
**compact data property** is designed for your use case. Once node data includes a "compact" prop with truthy value, itself and its descendant nodes will be arranged with compact mode.
167167

168+
- [ I want to visualize genealogy/pedigree/family tree information](https://dabeng.github.io/OrgChart/family-tree.html)
169+
170+
![family-tree](http://dabeng.github.io/OrgChart/img/family-tree.png)
171+
172+
We use the following two-dimensional array datasource to build up the Family Tree.
173+
```
174+
var datascource = [
175+
[
176+
{ 'id': '8', 'name': 'Lao Ye', 'title': 'Grandfather', 'gender': 'male' },
177+
{
178+
'id': '1', 'name': 'Lao Lao', 'title': 'Grandmother', 'gender': 'female', 'outsider': true,
179+
'children': [
180+
[
181+
{ 'id': '2', 'name': 'Bo miao', 'title': 'Aunt', 'gender': 'female'}
182+
],
183+
[
184+
{ 'id': '3', 'name': 'Su Miao', 'title': 'Mother', 'gender': 'female',
185+
'children': [
186+
[
187+
188+
{ 'id': '12', 'name': 'Pang Pang', 'title': 'Wife', 'gender': 'female', 'outsider': true,
189+
'children': [
190+
[{ 'id': '7', 'name': 'Dan Dan', 'title': 'Daughter', 'gender': 'female' }],
191+
[{ 'id': '6', 'name': 'Er Dan', 'title': 'Daughter', 'gender': 'female' }],
192+
]
193+
},
194+
{ 'id': '5', 'name': 'Hei Hei', 'title': 'Me', 'gender': 'male' },
195+
]
196+
]
197+
},
198+
{ 'id': '9', 'name': 'Tie Hua', 'title': 'Father', 'gender': 'male', 'outsider': true }
199+
],
200+
[
201+
{ 'id': '10', 'name': 'Hong miao', 'title': 'Aunt', 'gender': 'female'}
202+
]
203+
]
204+
}
205+
]
206+
];
207+
```
208+
168209
### how to start up demos locally
169210

170211
- you have to install node.js v6+ because our unit tests are based on jsdom v11

0 commit comments

Comments
 (0)