forked from Lab1not/coranos.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroadmap.js
55 lines (40 loc) · 1.12 KB
/
roadmap.js
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
const tasks = [];
const taskStatus = {
"SUCCEEDED": "bar-succeeded",
"FAILED": "bar-failed",
"RUNNING": "bar-running",
"NOT STARTED": "bar-not-started",
"KILLED": "bar-killed"
};
const margin = {
top: 5,
right: 5,
bottom: 20,
left: 300
};
const format = "%Y-%m-%d";
const callback = (response) => {
response.forEach((elt) => {
elt.startDate = new Date(elt.startDate);
elt.endDate = new Date(elt.endDate);
tasks.push(elt);
});
const taskNames = [];
tasks.forEach((task) => {
taskNames.push(task.taskName);
});
tasks.sort((a, b) => {
return a.endDate - b.endDate;
});
const maxDate = tasks[tasks.length - 1].endDate;
tasks.sort((a, b) => {
return a.startDate - b.startDate;
});
const minDate = tasks[0].startDate;
const chartHeight = tasks.length * 25;
const gantt = d3.gantt(1024, chartHeight, margin, 5, 5).taskTypes(taskNames).taskStatus(taskStatus).tickFormat(format);
gantt("#hardware-wallet-gantt", tasks);
}
const onLoad = () => {
loadJson('roadmap.json', callback);
}