summaryrefslogtreecommitdiff
path: root/tree-source/templates/graph.dot
blob: c3c82e30c180f5274dda1a7aca41736e051cacf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
graph G {
graph [bgcolor="#1d1f21"];
node [shape="box", color="#c5c8c6", fontcolor="#c5c8c6"];

{% for node in nodes %}
{% if node.person == person %}
N{{ node.person.index }} [label="{{ node.person.name }}", URL="http://memories.blaise.zone/tree/{{ '%03d' | format(node.person.index) }}/", fillcolor="#c5c8c6", style="filled", fontcolor="#1d1f21"];
{% else %}
N{{ node.person.index }} [label="{{ node.person.name }}", URL="../{{ '%03d' | format(node.person.index) }}"];
{% endif %}
{% endfor %}

{% for node in nodes %}
{% if node.level == max_level %}
{ rank=source N{{ node.person.index }} }
{% elif node.level == min_level %}
{ rank=max N{{ node.person.index }} }
{% endif %}
{% endfor %}

{% for edge in edges %}
N{{ edge.a }} -- N{{ edge.b }} [color="{{ edge.relationship }}"];
{% endfor %}

{% for edge in edges %}
{% if edge.relationship == "#b5db68" %}
{ rank=same  N{{ edge.a }} N{{ edge.b }} }
{% endif %}
{% endfor %}

}