-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfamilyTreeDisplayer.template.html
73 lines (63 loc) · 2.96 KB
/
familyTreeDisplayer.template.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html lang="fr" xml:lang="fr">
<head>
<title>Family Tree Displayer</title>
<meta content="text/html; charset=utf-8" />
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="https://image.flaticon.com/icons/png/512/1504/1504315.png" />
<style type="text/css">
.anyone {
font-family: Helvetica;
background-color: #edf7ff;
background: -webkit-gradient(linear, left top, left bottom, from(#edf7ff), to(#cde7ee));
border: 2px solid rgb(125, 125, 125);
-webkit-border-radius: 5px;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 3px;
}
.this_one {
background-color: rgb(81, 177, 255);
background: -webkit-gradient(linear, left top, left bottom, from(#8ec8f7), to(#8ec8f7));
border: 2px solid rgb(30, 30, 30);
}
</style>
<script>
function alertHelp() {
alert("Double-clickez sur une personne pour réduire ses ancêtres\nPassez la souris dessus pour plus d'infos");
}
</script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', { packages: ["orgchart"] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('string', 'Son');
data.addColumn('string', 'ToolTip');
// data.addRows([
// [{ 'v': 'Mike', 'f': 'Mike<div style="color:red; font-style:italic">President</div>' },
// '', 'The President'],
// [{ 'v': 'Jim', 'f': 'Jim<div style="color:red; font-style:italic">Vice President</div>' },
// 'Mike', 'VP'],
// ['Alice', 'Mike', ''],
// ['Bob', 'Jim', 'Bob Sponge'],
// ['Carol', 'Bob', '']
// ]);
// 1) Convert the ged file (UTF-8) into JSON
// 2) Add the generated file below
// For each orgchart box, provide the name, child, and tooltip to show.
data.addRows(GENERATED_DATA)
// Create the chart.
var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
// Draw the chart. Options:
// -allowHtml to allow the <div/> behaviour in the rows
// -allowCollapse to allow the user to double click on a person to collapse its ancestors
// -nodeClass and selectedNodeClass to set the class names for the CSS
chart.draw(data, { 'allowHtml': true, 'allowCollapse': true, 'nodeClass': 'anyone', 'selectedNodeClass': 'this_one' });
}
</script>
</head>
<body onload="alertHelp()">
<div id="chart_div"></div>
</body>
</html>