-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroboeco.html
252 lines (235 loc) · 5.53 KB
/
roboeco.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
#chartdiv {
width: 100%;
height: 700px;
max-width: 100%;
font-size: 15px;
text-align: center;
}
</style>
</head>
<body>
<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
<script src="https://cdn.amcharts.com/lib/5/hierarchy.js"></script>
<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>
<div id="chartdiv"></div>
<script>
/**
* ---------------------------------------
* This demo was created using amCharts 5.
*
* For more information visit:
* https://www.amcharts.com/
*
* Documentation is available at:
* https://www.amcharts.com/docs/v5/
* ---------------------------------------
*/
// Create root element
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
var root = am5.Root.new("chartdiv");
// Set themes
// https://www.amcharts.com/docs/v5/concepts/themes/
root.setThemes([am5themes_Animated.new(root)]);
// Create wrapper container
var container = root.container.children.push(
am5.Container.new(root, {
width: am5.percent(100),
height: am5.percent(100),
layout: root.horizontalLayout
})
);
// Create series
// https://www.amcharts.com/docs/v5/charts/hierarchy/#Adding
var series = container.children.push(
am5hierarchy.ForceDirected.new(root, {
singleBranchOnly: false,
downDepth: 1,
initialDepth: 2,
valueField: "value",
categoryField: "name",
childDataField: "children",
manyBodyStrength: -8,
centerStrength: 0.8
})
);
series.nodes.template.set("tooltipText", "");
// Generate and set data
// https://www.amcharts.com/docs/v5/charts/hierarchy/#Setting_data
var maxLevels = 2;
var maxNodes = 5;
var maxValue = 100;
var data = {
name: "Robotics \nEcosystem",
value: 100,
children: [
{
name: " New \n Tech",
value: 80,
children: [
{
name: "mmwave",
value: 70
},
{
name: "Stereo \n Camera",
value: 70
},
{
name: "iToF",
value: 50
},
{
name: "RTK GPS",
value: 80
},
{
name: "Hybrid \n MCUs",
value: 50
},
{
name: "HPD BLDC \n Motor",
value: 50
},
{
name: "Thread",
value: 50
},
{
name: "Augmented \n Reality",
value: 70
},
{
name: "Machine \n Learning",
value: 50
},
{
name: "BLE 5.x",
value: 50
},
{
name: "SLAM",
value: 50
}
]
},
{
name: " Modular \n Frameworks",
value: 80,
children: [
{
name: " Modular \n FW \n Architecture",
value: 60
},
{
name: " Universal \n Debug \n Protocol \n (UTDP)",
value: 60
},
{
name: " Robotics \n Operating \n System \n (ROS)",
value: 60
}
]
},
{
name: " User-facing \n Solutions",
value: 80,
children: [
{
name: "Virtual Zone \n System",
value: 80
},
{
name: "Mobile App \n for Robots",
value: 70
},
{
name: "Web App",
value: 70
},
{
name: "User \n Data \n Analytics",
value: 70
},
{
name: "Customer \n Relationship \n Management \n (CRM)",
value: 30
},
{
name: "Content \n Management \n Solution \n (CMS)",
value: 40
},
{
name: "Customer \n Relationship \n Management \n (CRM)",
value: 40
}
]
},
{
name: "Agile Dev. Infra.",
value: 80,
children: [
{
name: "FW Debug \n & Online Testing \n System (FDOT)",
value: 80
},
{
name: "Sprint \n management \n tools",
value: 70
},
{
name: "Continuous \n Integration \n& Deployment \n (CI / CD)",
value: 70
},
{
name: "Testing Management \n Tools",
value: 50
},
{
name: "Testing Automation \n Tools",
value: 50
}
]
}
]
};
//generateLevel(data, "", 0);
series.data.setAll([data]);
series.set("selectedDataItem", series.dataItems[0]);
function generateLevel(data, name, level) {
for (var i = 0; i < Math.ceil(maxNodes * Math.random()) + 1; i++) {
var nodeName = name + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i];
var child;
if (level < maxLevels) {
child = {
name: nodeName + level
};
if (level > 0 && Math.random() < 0.5) {
child.value = Math.round(Math.random() * maxValue);
} else {
child.children = [];
generateLevel(child, nodeName + i, level + 1);
}
} else {
child = {
name: name + i,
value: Math.round(Math.random() * maxValue)
};
}
data.children.push(child);
}
level++;
return data;
}
// Make stuff animate on load
series.appear(1000, 100);
</script>
</body>
</html>