Skip to content

Commit 97ce5d1

Browse files
author
Benjamin W. Portner
committed
update readme
1 parent f04829d commit 97ce5d1

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,60 @@ New features:
2121
- introduces union nodes to connect parents and children via common way point
2222
- nodes are collapsible in all directions: children, parents, partners (nodes memorize their dependencies)
2323
- use [d3-tip](https://github.com/caged/d3-tip) to show metadata on hover
24-
- use d3-zoom to enable zooming and panning
24+
- use d3-zoom to enable zooming and panning
25+
26+
## How to use
27+
- edit `data/data.js` to represent your family tree
28+
- open `familytree.html`
29+
- done.
30+
31+
The file `data/data.js` contains a single javascript object with the following fields:
32+
- `start`: Enter here the id of the person, which should be the starting point of the family tree.
33+
- `persons`: Contains metadata about each person. Make sure each `id` is unique. Also, make sure each element in `own_unions` refers to a valid `union` defined in `data.unions`.
34+
- `unions`: Contains metadata about each family. Each entry in `partner` and `children` must refer to a valid `person` defined in `data.persons`.
35+
- `links`: Defines how unions and persons are to be linked (edge list). Basically an alternative representation of the information contained in `person.own_unions`, `union.partner` and `union.children`. Unfortunately, this redundancy is for now necessary to ensure proper functioning of the code!
36+
37+
```javascript
38+
data = {
39+
"start":"id4",
40+
"persons": {
41+
"id1": { "id": "id1", "name": "Adam", "birthyear": 1900, "deathyear": 1980, "own_unions": ["u1"], "birthplace":"Alberta", "deathplace":"Austin"},
42+
"id2": { "id": "id2", "name": "Berta", "birthyear": 1901, "deathyear": 1985, "own_unions": ["u1"], "birthplace":"Berlin", "deathplace":"Bern" },
43+
"id3": { "id": "id3", "name": "Charlene", "birthyear": 1930, "deathyear": 2010, "own_unions": ["u3", "u4"], "parent_union": "u1", "birthplace":"Château", "deathplace":"Cuxhaven" },
44+
"id4": { "id": "id4", "name": "Dan", "birthyear": 1926, "deathyear": 2009, "own_unions": [], "parent_union": "u1", "birthplace":"den Haag", "deathplace":"Derince" },
45+
"id5": { "id": "id5", "name": "Eric", "birthyear": 1931, "deathyear": 2015, "own_unions": ["u3"], "parent_union": "u2", "birthplace":"Essen", "deathplace":"Edinburgh" },
46+
"id6": { "id": "id6", "name": "Francis", "birthyear": 1902, "deathyear": 1970, "own_unions": ["u2"], "birthplace":"Firenze", "deathplace":"Faizabad" },
47+
"id7": { "id": "id7", "name": "Greta", "birthyear": 1905, "deathyear": 1990, "own_unions": ["u2"] },
48+
"id8": { "id": "id8", "name": "Heinz", "birthyear": 1970, "own_unions": ["u5"], "parent_union": "u3" },
49+
"id9": { "id": "id9", "name": "Iver", "birthyear": 1925, "deathyear": 1963, "own_unions": ["u4"] },
50+
"id10": { "id": "id10", "name": "Jennifer", "birthyear": 1950, "own_unions": [], "parent_union": "u4" },
51+
"id11": { "id": "id11", "name": "Klaus", "birthyear": 1933, "deathyear": 2013, "own_unions": [], "parent_union": "u1" },
52+
"id12": { "id": "id12", "name": "Lennart", "birthyear": 1999, "own_unions": [], "parent_union": "u5" },
53+
},
54+
"unions": {
55+
"u1": { "id": "u1", "partner": ["id1", "id2"], "children": ["id3", "id4", "id11"] },
56+
"u2": { "id": "u2", "partner": ["id6", "id7"], "children": ["id5"] },
57+
"u3": { "id": "u3", "partner": ["id3", "id5"], "children": ["id8"] },
58+
"u4": { "id": "u4", "partner": ["id3", "id9"], "children": ["id10"] },
59+
"u5": { "id": "u5", "partner": ["id8"], "children": ["id12"] },
60+
},
61+
"links": [
62+
["id1", "u1"],
63+
["id2", "u1"],
64+
["u1", "id3"],
65+
["u1", "id4"],
66+
["id6", "u2"],
67+
["id7", "u2"],
68+
["u2", "id5"],
69+
["id3", "u3"],
70+
["id5", "u3"],
71+
["u3", "id8"],
72+
["id3", "u4"],
73+
["id9", "u4"],
74+
["u4", "id10"],
75+
["u1", "id11"],
76+
["id8", "u5"],
77+
["u5", "id12"],
78+
]
79+
}
80+
```

0 commit comments

Comments
 (0)