UNPKG

186 kBHTMLView Raw
1<html>
2 <head>
3 <meta charset="utf-8" />
4 <title>Vis Graph3D Examples</title>
5
6 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7 <meta name="viewport" content="width=device-width, initial-scale=1" />
8
9 <style>
10 body {
11 margin: 50px auto 200px;
12 min-width: calc(200px + 2em);
13 width: calc(100vw - 200px);
14 }
15
16 a {
17 color: #2b7ce9;
18 }
19 a:visited {
20 color: #46417a;
21 }
22
23 .example-link {
24 position: relative;
25 margin: 1em;
26 width: 200px;
27
28 display: inline-block;
29 text-align: center;
30 }
31
32 .example-link .example-image {
33 position: relative;
34 margin-top: 1ex;
35 width: 200px;
36 height: 200px;
37 }
38 .example-link .example-image > img {
39 position: absolute;
40 top: 0px;
41 left: 0px;
42 width: 200px;
43 height: 200px;
44
45 border: 1px solid #2b7ce9;
46
47 transition: transform 0.5s ease 0s, z-index 0.5s linear 0s;
48 z-index: 1;
49 }
50 .example-link:hover .example-image > img {
51 transform: translate(0px, 95px) scale(2, 2);
52 z-index: 100;
53 }
54
55 .playgrounds {
56 margin-left: 1em;
57 white-space: nowrap;
58 }
59 .playgrounds form {
60 display: inline-block;
61 margin: 0px;
62 }
63 .icon {
64 width: 2em;
65 height: 2em;
66
67 background: none;
68 border: none;
69 cursor: pointer;
70 }
71 .icon.jsfiddle {
72 background-size: contain;
73 background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%232b7ce9' d='M16.45,17.5C17.45,17.5 18.3,17.15 19,16.5C19.67,15.8 20,15 20,14C20,13.05 19.66,12.22 18.96,11.53C18.26,10.84 17.41,10.5 16.41,10.5C15.47,10.5 14.64,10.83 13.92,11.5L9.14,15.56C8.7,16 8.17,16.22 7.55,16.22C6.92,16.22 6.39,16 5.95,15.56C5.5,15.13 5.3,14.61 5.3,14C5.3,13.42 5.5,12.91 5.95,12.47C6.39,12.03 6.92,11.81 7.55,11.81C8.14,11.81 8.69,12.03 9.19,12.47L9.94,13.13L10.92,12.23L10.08,11.53C9.39,10.84 8.55,10.5 7.55,10.5C6.58,10.5 5.74,10.84 5.04,11.53C4.34,12.22 4,13.05 4,14C4,15 4.34,15.8 5.04,16.5C5.74,17.15 6.59,17.5 7.59,17.5C8.53,17.5 9.36,17.16 10.08,16.5L14.86,12.42C15.27,12 15.8,11.81 16.45,11.81C17.08,11.81 17.61,12.03 18.05,12.47C18.5,12.91 18.7,13.42 18.7,14C18.7,14.61 18.5,15.13 18.05,15.56C17.61,16 17.08,16.22 16.45,16.22C15.89,16.22 15.34,16 14.81,15.5L14.06,14.86L13.08,15.75L13.92,16.45C14.61,17.14 15.45,17.5 16.45,17.5M19.36,10.03C20.64,10.13 21.73,10.65 22.64,11.6C23.55,12.55 24,13.69 24,15C24,16.38 23.5,17.55 22.5,18.54C21.54,19.5 20.36,20 19,20H6C4.34,20 2.93,19.43 1.76,18.26C0.59,17.09 0,15.67 0,14C0,12.55 0.5,11.23 1.57,10.05C2.62,8.88 3.88,8.22 5.34,8.06C6,6.84 6.92,5.86 8.11,5.11C9.3,4.36 10.59,4 12,4C13.69,4 15.26,4.58 16.71,5.77C18.16,6.95 19.05,8.38 19.36,10.03Z' /%3E%3C/svg%3E");
74 }
75 .icon.codepen {
76 background-size: contain;
77 background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%232b7ce9' d='M15.09,12L12,14.08V14.09L8.91,12L12,9.92V9.92L15.09,12M12,2C11.84,2 11.68,2.06 11.53,2.15L2.5,8.11C2.27,8.22 2.09,8.43 2,8.67V14.92C2,15.33 2,15.33 2.15,15.53L11.53,21.86C11.67,21.96 11.84,22 12,22C12.16,22 12.33,21.95 12.47,21.85L21.85,15.5C22,15.33 22,15.33 22,14.92V8.67C21.91,8.42 21.73,8.22 21.5,8.1L12.47,2.15C12.32,2.05 12.16,2 12,2M16.58,13L19.59,15.04L12.83,19.6V15.53L16.58,13M19.69,8.9L16.58,11L12.83,8.47V4.38L19.69,8.9M20.33,10.47V13.53L18.07,12L20.33,10.47M7.42,13L11.17,15.54V19.6L4.41,15.04L7.42,13M4.31,8.9L11.17,4.39V8.5L7.42,11L4.31,8.9M3.67,10.5L5.93,12L3.67,13.54V10.5Z' /%3E%3C/svg%3E");
78 }
79 </style>
80 </head>
81 <body>
82 <div>
83 <div>
84 <h1>Graph 3D</h1>
85 <div>
86 <span class="example-link"
87 ><div>
88 <a href="graph3d/04_animation.html">Animation</a
89 ><span class="playgrounds"
90 ><form
91 action="http://jsfiddle.net/api/post/library/pure/"
92 method="post"
93 target="_blank"
94 >
95 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
96 &#xA0;</button
97 ><input
98 type="hidden"
99 name="js"
100 value='var data = null;
101var graph = null;
102
103function custom(x, y, t) {
104 return Math.sin(x / 50 + t / 10) * Math.cos(y / 50 + t / 10) * 50 + 50;
105}
106
107// Called when the Visualization API is loaded.
108function drawVisualization() {
109 // Create and populate a data table.
110 data = new vis.DataSet();
111 // create some nice looking data with sin/cos
112 var steps = 25;
113 var axisMax = 314;
114 var tMax = 31;
115 var axisStep = axisMax / steps;
116 for (var t = 0; t &lt; tMax; t++) {
117 for (var x = 0; x &lt; axisMax; x += axisStep) {
118 for (var y = 0; y &lt; axisMax; y += axisStep) {
119 var value = custom(x, y, t);
120 data.add([{ x: x, y: y, z: value, filter: t, style: value }]);
121 }
122 }
123 }
124
125 // specify options
126 var options = {
127 width: "600px",
128 height: "600px",
129 style: "surface",
130 showPerspective: true,
131 showGrid: true,
132 showShadow: false,
133 // showAnimationControls: false,
134 keepAspectRatio: true,
135 verticalRatio: 0.5,
136 animationInterval: 100, // milliseconds
137 animationPreload: true
138 };
139
140 // create our graph
141 var container = document.getElementById("mygraph");
142 graph = new vis.Graph3d(container, data, options);
143}
144
145window.addEventListener("load", () =&gt; {
146 drawVisualization();
147});
148'
149 /><input
150 type="hidden"
151 name="css"
152 value="body {
153 font: 10pt arial;
154}
155"
156 /><input
157 type="hidden"
158 name="html"
159 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
160
161&lt;div id="info"&gt;&lt;/div&gt;
162'
163 /><input
164 type="hidden"
165 name="resources"
166 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
167 /><input type="hidden" name="wrap" value="b" /><input
168 type="hidden"
169 name="title"
170 value="Graph 3D | Animation"
171 />
172 </form>
173
174 <form
175 action="https://codepen.io/pen/define"
176 method="post"
177 target="_blank"
178 >
179 <button class="icon codepen" alt="CodePen" title="CodePen">
180 &#xA0;</button
181 ><input
182 type="hidden"
183 name="data"
184 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y, t) {\n return Math.sin(x / 50 + t / 10) * Math.cos(y / 50 + t / 10) * 50 + 50;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n // create some nice looking data with sin/cos\n var steps = 25;\n var axisMax = 314;\n var tMax = 31;\n var axisStep = axisMax / steps;\n for (var t = 0; t &lt; tMax; t++) {\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y, t);\n data.add([{ x: x, y: y, z: value, filter: t, style: value }]);\n }\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"surface\",\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n // showAnimationControls: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n animationInterval: 100, // milliseconds\n animationPreload: true\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Animation"}'
185 /><input
186 type="hidden"
187 name="js"
188 value='var data = null;
189var graph = null;
190
191function custom(x, y, t) {
192 return Math.sin(x / 50 + t / 10) * Math.cos(y / 50 + t / 10) * 50 + 50;
193}
194
195// Called when the Visualization API is loaded.
196function drawVisualization() {
197 // Create and populate a data table.
198 data = new vis.DataSet();
199 // create some nice looking data with sin/cos
200 var steps = 25;
201 var axisMax = 314;
202 var tMax = 31;
203 var axisStep = axisMax / steps;
204 for (var t = 0; t &lt; tMax; t++) {
205 for (var x = 0; x &lt; axisMax; x += axisStep) {
206 for (var y = 0; y &lt; axisMax; y += axisStep) {
207 var value = custom(x, y, t);
208 data.add([{ x: x, y: y, z: value, filter: t, style: value }]);
209 }
210 }
211 }
212
213 // specify options
214 var options = {
215 width: "600px",
216 height: "600px",
217 style: "surface",
218 showPerspective: true,
219 showGrid: true,
220 showShadow: false,
221 // showAnimationControls: false,
222 keepAspectRatio: true,
223 verticalRatio: 0.5,
224 animationInterval: 100, // milliseconds
225 animationPreload: true
226 };
227
228 // create our graph
229 var container = document.getElementById("mygraph");
230 graph = new vis.Graph3d(container, data, options);
231}
232
233window.addEventListener("load", () =&gt; {
234 drawVisualization();
235});
236'
237 /><input
238 type="hidden"
239 name="css"
240 value="body {
241 font: 10pt arial;
242}
243"
244 /><input
245 type="hidden"
246 name="html"
247 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
248
249&lt;div id="info"&gt;&lt;/div&gt;
250'
251 /></form
252 ></span>
253 </div>
254 <a href="graph3d/04_animation.html"
255 ><div class="example-image">
256 <img
257 src="thumbnails/44b2da471c68f49cb41dc0690487d082929fbb022a888327d2b1a035e0c36c66.png"
258 alt="Animation"
259 /></div></a></span
260 ><span class="example-link"
261 ><div>
262 <a href="graph3d/06_moving_dots.html">Animation Moving Dots</a
263 ><span class="playgrounds"
264 ><form
265 action="http://jsfiddle.net/api/post/library/pure/"
266 method="post"
267 target="_blank"
268 >
269 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
270 &#xA0;</button
271 ><input
272 type="hidden"
273 name="js"
274 value='var data = null;
275var graph = null;
276
277// Called when the Visualization API is loaded.
278function drawVisualization() {
279 // create the data table.
280 data = new vis.DataSet();
281
282 // create some shortcuts to math functions
283 var sin = Math.sin;
284 var cos = Math.cos;
285 var pi = Math.PI;
286
287 // create the animation data
288 var tmax = 2.0 * pi;
289 var tstep = tmax / 75;
290 var dotCount = 1; // set this to 1, 2, 3, 4, ...
291 for (var t = 0; t &lt; tmax; t += tstep) {
292 var tgroup = parseFloat(t.toFixed(2));
293 var value = t;
294
295 // a dot in the center
296 data.add({ x: 0, y: 0, z: 0, filter: tgroup, style: value });
297
298 // one or multiple dots moving around the center
299 for (var dot = 0; dot &lt; dotCount; dot++) {
300 var tdot = t + (2 * pi * dot) / dotCount;
301 data.add({
302 x: sin(tdot),
303 y: cos(tdot),
304 z: sin(tdot),
305 filter: tgroup,
306 style: value
307 });
308 data.add({
309 x: sin(tdot),
310 y: -cos(tdot),
311 z: sin(tdot + (tmax * 1) / 2),
312 filter: tgroup,
313 style: value
314 });
315 }
316 }
317
318 // specify options
319 var options = {
320 width: "600px",
321 height: "600px",
322 style: "dot-color",
323 showPerspective: true,
324 showGrid: true,
325 keepAspectRatio: true,
326 verticalRatio: 1.0,
327 animationInterval: 35, // milliseconds
328 animationPreload: false,
329 animationAutoStart: true,
330 legendLabel: "color value",
331 cameraPosition: {
332 horizontal: 2.7,
333 vertical: 0.0,
334 distance: 1.65
335 }
336 };
337
338 // create our graph
339 var container = document.getElementById("mygraph");
340 graph = new vis.Graph3d(container, data, options);
341}
342
343window.addEventListener("load", () =&gt; {
344 drawVisualization();
345});
346'
347 /><input
348 type="hidden"
349 name="css"
350 value="body {
351 font: 10pt arial;
352}
353"
354 /><input
355 type="hidden"
356 name="html"
357 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
358
359&lt;div id="info"&gt;&lt;/div&gt;
360'
361 /><input
362 type="hidden"
363 name="resources"
364 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
365 /><input type="hidden" name="wrap" value="b" /><input
366 type="hidden"
367 name="title"
368 value="Graph 3D | Animation Moving Dots"
369 />
370 </form>
371
372 <form
373 action="https://codepen.io/pen/define"
374 method="post"
375 target="_blank"
376 >
377 <button class="icon codepen" alt="CodePen" title="CodePen">
378 &#xA0;</button
379 ><input
380 type="hidden"
381 name="data"
382 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create some shortcuts to math functions\n var sin = Math.sin;\n var cos = Math.cos;\n var pi = Math.PI;\n\n // create the animation data\n var tmax = 2.0 * pi;\n var tstep = tmax / 75;\n var dotCount = 1; // set this to 1, 2, 3, 4, ...\n for (var t = 0; t &lt; tmax; t += tstep) {\n var tgroup = parseFloat(t.toFixed(2));\n var value = t;\n\n // a dot in the center\n data.add({ x: 0, y: 0, z: 0, filter: tgroup, style: value });\n\n // one or multiple dots moving around the center\n for (var dot = 0; dot &lt; dotCount; dot++) {\n var tdot = t + (2 * pi * dot) / dotCount;\n data.add({\n x: sin(tdot),\n y: cos(tdot),\n z: sin(tdot),\n filter: tgroup,\n style: value\n });\n data.add({\n x: sin(tdot),\n y: -cos(tdot),\n z: sin(tdot + (tmax * 1) / 2),\n filter: tgroup,\n style: value\n });\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"dot-color\",\n showPerspective: true,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0,\n animationInterval: 35, // milliseconds\n animationPreload: false,\n animationAutoStart: true,\n legendLabel: \"color value\",\n cameraPosition: {\n horizontal: 2.7,\n vertical: 0.0,\n distance: 1.65\n }\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Animation Moving Dots"}'
383 /><input
384 type="hidden"
385 name="js"
386 value='var data = null;
387var graph = null;
388
389// Called when the Visualization API is loaded.
390function drawVisualization() {
391 // create the data table.
392 data = new vis.DataSet();
393
394 // create some shortcuts to math functions
395 var sin = Math.sin;
396 var cos = Math.cos;
397 var pi = Math.PI;
398
399 // create the animation data
400 var tmax = 2.0 * pi;
401 var tstep = tmax / 75;
402 var dotCount = 1; // set this to 1, 2, 3, 4, ...
403 for (var t = 0; t &lt; tmax; t += tstep) {
404 var tgroup = parseFloat(t.toFixed(2));
405 var value = t;
406
407 // a dot in the center
408 data.add({ x: 0, y: 0, z: 0, filter: tgroup, style: value });
409
410 // one or multiple dots moving around the center
411 for (var dot = 0; dot &lt; dotCount; dot++) {
412 var tdot = t + (2 * pi * dot) / dotCount;
413 data.add({
414 x: sin(tdot),
415 y: cos(tdot),
416 z: sin(tdot),
417 filter: tgroup,
418 style: value
419 });
420 data.add({
421 x: sin(tdot),
422 y: -cos(tdot),
423 z: sin(tdot + (tmax * 1) / 2),
424 filter: tgroup,
425 style: value
426 });
427 }
428 }
429
430 // specify options
431 var options = {
432 width: "600px",
433 height: "600px",
434 style: "dot-color",
435 showPerspective: true,
436 showGrid: true,
437 keepAspectRatio: true,
438 verticalRatio: 1.0,
439 animationInterval: 35, // milliseconds
440 animationPreload: false,
441 animationAutoStart: true,
442 legendLabel: "color value",
443 cameraPosition: {
444 horizontal: 2.7,
445 vertical: 0.0,
446 distance: 1.65
447 }
448 };
449
450 // create our graph
451 var container = document.getElementById("mygraph");
452 graph = new vis.Graph3d(container, data, options);
453}
454
455window.addEventListener("load", () =&gt; {
456 drawVisualization();
457});
458'
459 /><input
460 type="hidden"
461 name="css"
462 value="body {
463 font: 10pt arial;
464}
465"
466 /><input
467 type="hidden"
468 name="html"
469 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
470
471&lt;div id="info"&gt;&lt;/div&gt;
472'
473 /></form
474 ></span>
475 </div>
476 <a href="graph3d/06_moving_dots.html"
477 ><div class="example-image">
478 <img
479 src="thumbnails/7ce1dc306703919a19090e8f70fc8a7ef0d161412f936d705442ef38aca3ce3a.png"
480 alt="Animation Moving Dots"
481 /></div></a></span
482 ><span class="example-link"
483 ><div>
484 <a href="graph3d/01_basics.html">Basics</a
485 ><span class="playgrounds"
486 ><form
487 action="http://jsfiddle.net/api/post/library/pure/"
488 method="post"
489 target="_blank"
490 >
491 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
492 &#xA0;</button
493 ><input
494 type="hidden"
495 name="js"
496 value='var data = null;
497var graph = null;
498
499function custom(x, y) {
500 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
501}
502
503// Called when the Visualization API is loaded.
504function drawVisualization() {
505 // Create and populate a data table.
506 data = new vis.DataSet();
507 // create some nice looking data with sin/cos
508 var counter = 0;
509 var steps = 50; // number of datapoints will be steps*steps
510 var axisMax = 314;
511 var axisStep = axisMax / steps;
512 for (var x = 0; x &lt; axisMax; x += axisStep) {
513 for (var y = 0; y &lt; axisMax; y += axisStep) {
514 var value = custom(x, y);
515 data.add({ id: counter++, x: x, y: y, z: value, style: value });
516 }
517 }
518
519 // specify options
520 var options = {
521 width: "600px",
522 height: "600px",
523 style: "surface",
524 showPerspective: true,
525 showGrid: true,
526 showShadow: false,
527 keepAspectRatio: true,
528 verticalRatio: 0.5
529 };
530
531 // Instantiate our graph object.
532 var container = document.getElementById("mygraph");
533 graph = new vis.Graph3d(container, data, options);
534}
535
536window.addEventListener("load", () =&gt; {
537 drawVisualization();
538});
539'
540 /><input
541 type="hidden"
542 name="css"
543 value="body {
544 font: 10pt arial;
545}
546"
547 /><input
548 type="hidden"
549 name="html"
550 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
551
552&lt;div id="info"&gt;&lt;/div&gt;
553'
554 /><input
555 type="hidden"
556 name="resources"
557 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
558 /><input type="hidden" name="wrap" value="b" /><input
559 type="hidden"
560 name="title"
561 value="Graph 3D | Basics"
562 />
563 </form>
564
565 <form
566 action="https://codepen.io/pen/define"
567 method="post"
568 target="_blank"
569 >
570 <button class="icon codepen" alt="CodePen" title="CodePen">
571 &#xA0;</button
572 ><input
573 type="hidden"
574 name="data"
575 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n // create some nice looking data with sin/cos\n var counter = 0;\n var steps = 50; // number of datapoints will be steps*steps\n var axisMax = 314;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y);\n data.add({ id: counter++, x: x, y: y, z: value, style: value });\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"surface\",\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5\n };\n\n // Instantiate our graph object.\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Basics"}'
576 /><input
577 type="hidden"
578 name="js"
579 value='var data = null;
580var graph = null;
581
582function custom(x, y) {
583 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
584}
585
586// Called when the Visualization API is loaded.
587function drawVisualization() {
588 // Create and populate a data table.
589 data = new vis.DataSet();
590 // create some nice looking data with sin/cos
591 var counter = 0;
592 var steps = 50; // number of datapoints will be steps*steps
593 var axisMax = 314;
594 var axisStep = axisMax / steps;
595 for (var x = 0; x &lt; axisMax; x += axisStep) {
596 for (var y = 0; y &lt; axisMax; y += axisStep) {
597 var value = custom(x, y);
598 data.add({ id: counter++, x: x, y: y, z: value, style: value });
599 }
600 }
601
602 // specify options
603 var options = {
604 width: "600px",
605 height: "600px",
606 style: "surface",
607 showPerspective: true,
608 showGrid: true,
609 showShadow: false,
610 keepAspectRatio: true,
611 verticalRatio: 0.5
612 };
613
614 // Instantiate our graph object.
615 var container = document.getElementById("mygraph");
616 graph = new vis.Graph3d(container, data, options);
617}
618
619window.addEventListener("load", () =&gt; {
620 drawVisualization();
621});
622'
623 /><input
624 type="hidden"
625 name="css"
626 value="body {
627 font: 10pt arial;
628}
629"
630 /><input
631 type="hidden"
632 name="html"
633 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
634
635&lt;div id="info"&gt;&lt;/div&gt;
636'
637 /></form
638 ></span>
639 </div>
640 <a href="graph3d/01_basics.html"
641 ><div class="example-image">
642 <img
643 src="thumbnails/a2093f3aab17f34ce73003b929d4508870f32390487c6befe784394ef93e5479.png"
644 alt="Basics"
645 /></div></a></span
646 ><span class="example-link"
647 ><div>
648 <a href="graph3d/02_camera.html">Camera Position</a
649 ><span class="playgrounds"
650 ><form
651 action="http://jsfiddle.net/api/post/library/pure/"
652 method="post"
653 target="_blank"
654 >
655 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
656 &#xA0;</button
657 ><input
658 type="hidden"
659 name="js"
660 value='var data = null;
661var graph = null;
662
663function custom(x, y) {
664 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
665}
666
667// callback function, called when the camera position has changed
668function onCameraPositionChange() {
669 // adjust the values of startDate and endDate
670 var pos = graph.getCameraPosition();
671 document.getElementById("horizontal").value = parseFloat(
672 pos.horizontal.toFixed(3)
673 );
674 document.getElementById("vertical").value = parseFloat(
675 pos.vertical.toFixed(3)
676 );
677 document.getElementById("distance").value = parseFloat(
678 pos.distance.toFixed(3)
679 );
680}
681
682// set the camera position
683function setCameraPosition() {
684 var horizontal = parseFloat(document.getElementById("horizontal").value);
685 var vertical = parseFloat(document.getElementById("vertical").value);
686 var distance = parseFloat(document.getElementById("distance").value);
687 var pos = {
688 horizontal: horizontal,
689 vertical: vertical,
690 distance: distance
691 };
692 graph.setCameraPosition(pos);
693
694 // retrieve the camera position again, to get the applied values
695 onCameraPositionChange();
696}
697
698// Called when the Visualization API is loaded.
699function drawVisualization() {
700 // Create and populate a data table.
701 data = new vis.DataSet();
702 // create some nice looking data with sin/cos
703 var steps = 50; // number of datapoints will be steps*steps
704 var axisMax = 314;
705 var axisStep = axisMax / steps;
706 for (var x = 0; x &lt; axisMax; x += axisStep) {
707 for (var y = 0; y &lt; axisMax; y += axisStep) {
708 var value = custom(x, y);
709 data.add([{ x: x, y: y, z: value, t: 0, style: value }]);
710 }
711 }
712
713 // specify options
714 var options = {
715 width: "600px",
716 height: "600px",
717 style: "surface",
718 showPerspective: true,
719 showGrid: true,
720 showShadow: false,
721 keepAspectRatio: true,
722 verticalRatio: 0.5
723 };
724
725 // create our graph
726 var container = document.getElementById("mygraph");
727 graph = new vis.Graph3d(container, data, options);
728
729 graph.on("cameraPositionChange", onCameraPositionChange);
730}
731
732window.addEventListener("load", () =&gt; {
733 drawVisualization();
734});
735'
736 /><input
737 type="hidden"
738 name="css"
739 value="body {
740 font: 10pt arial;
741}
742td {
743 font: 10pt arial;
744}
745"
746 /><input
747 type="hidden"
748 name="html"
749 value='&lt;h1&gt;Graph 3d camera position&lt;/h1&gt;
750&lt;table&gt;
751 &lt;tbody&gt;
752 &lt;tr&gt;
753 &lt;td&gt;Horizontal angle (0 to 2*pi)&lt;/td&gt;
754 &lt;td&gt;&lt;input type="text" id="horizontal" value="1.0" /&gt;&lt;/td&gt;
755 &lt;/tr&gt;
756 &lt;tr&gt;
757 &lt;td&gt;Vertical angle (0 to 0.5*pi)&lt;/td&gt;
758 &lt;td&gt;&lt;input type="text" id="vertical" value="0.5" /&gt;&lt;/td&gt;
759 &lt;/tr&gt;
760 &lt;tr&gt;
761 &lt;td&gt;Distance (0.71 to 5.0)&lt;/td&gt;
762 &lt;td&gt;&lt;input type="text" id="distance" value="1.7" /&gt;&lt;/td&gt;
763 &lt;/tr&gt;
764 &lt;tr&gt;
765 &lt;td&gt;&lt;/td&gt;
766 &lt;td&gt;
767 &lt;input type="button" value="Set" onclick="setCameraPosition();" /&gt;
768 &lt;/td&gt;
769 &lt;/tr&gt;
770 &lt;/tbody&gt;
771&lt;/table&gt;
772
773&lt;div id="mygraph"&gt;&lt;/div&gt;
774
775&lt;div id="info"&gt;&lt;/div&gt;
776'
777 /><input
778 type="hidden"
779 name="resources"
780 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
781 /><input type="hidden" name="wrap" value="b" /><input
782 type="hidden"
783 name="title"
784 value="Graph 3D | Camera Position"
785 />
786 </form>
787
788 <form
789 action="https://codepen.io/pen/define"
790 method="post"
791 target="_blank"
792 >
793 <button class="icon codepen" alt="CodePen" title="CodePen">
794 &#xA0;</button
795 ><input
796 type="hidden"
797 name="data"
798 value='{"css":"body {\n font: 10pt arial;\n}\ntd {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;h1&gt;Graph 3d camera position&lt;/h1&gt;\n&lt;table&gt;\n &lt;tbody&gt;\n &lt;tr&gt;\n &lt;td&gt;Horizontal angle (0 to 2*pi)&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"horizontal\" value=\"1.0\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;Vertical angle (0 to 0.5*pi)&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"vertical\" value=\"0.5\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;Distance (0.71 to 5.0)&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"distance\" value=\"1.7\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;/td&gt;\n &lt;td&gt;\n &lt;input type=\"button\" value=\"Set\" onclick=\"setCameraPosition();\" /&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;/tbody&gt;\n&lt;/table&gt;\n\n&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;\n}\n\n// callback function, called when the camera position has changed\nfunction onCameraPositionChange() {\n // adjust the values of startDate and endDate\n var pos = graph.getCameraPosition();\n document.getElementById(\"horizontal\").value = parseFloat(\n pos.horizontal.toFixed(3)\n );\n document.getElementById(\"vertical\").value = parseFloat(\n pos.vertical.toFixed(3)\n );\n document.getElementById(\"distance\").value = parseFloat(\n pos.distance.toFixed(3)\n );\n}\n\n// set the camera position\nfunction setCameraPosition() {\n var horizontal = parseFloat(document.getElementById(\"horizontal\").value);\n var vertical = parseFloat(document.getElementById(\"vertical\").value);\n var distance = parseFloat(document.getElementById(\"distance\").value);\n var pos = {\n horizontal: horizontal,\n vertical: vertical,\n distance: distance\n };\n graph.setCameraPosition(pos);\n\n // retrieve the camera position again, to get the applied values\n onCameraPositionChange();\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n // create some nice looking data with sin/cos\n var steps = 50; // number of datapoints will be steps*steps\n var axisMax = 314;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y);\n data.add([{ x: x, y: y, z: value, t: 0, style: value }]);\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"surface\",\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n\n graph.on(\"cameraPositionChange\", onCameraPositionChange);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Camera Position"}'
799 /><input
800 type="hidden"
801 name="js"
802 value='var data = null;
803var graph = null;
804
805function custom(x, y) {
806 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
807}
808
809// callback function, called when the camera position has changed
810function onCameraPositionChange() {
811 // adjust the values of startDate and endDate
812 var pos = graph.getCameraPosition();
813 document.getElementById("horizontal").value = parseFloat(
814 pos.horizontal.toFixed(3)
815 );
816 document.getElementById("vertical").value = parseFloat(
817 pos.vertical.toFixed(3)
818 );
819 document.getElementById("distance").value = parseFloat(
820 pos.distance.toFixed(3)
821 );
822}
823
824// set the camera position
825function setCameraPosition() {
826 var horizontal = parseFloat(document.getElementById("horizontal").value);
827 var vertical = parseFloat(document.getElementById("vertical").value);
828 var distance = parseFloat(document.getElementById("distance").value);
829 var pos = {
830 horizontal: horizontal,
831 vertical: vertical,
832 distance: distance
833 };
834 graph.setCameraPosition(pos);
835
836 // retrieve the camera position again, to get the applied values
837 onCameraPositionChange();
838}
839
840// Called when the Visualization API is loaded.
841function drawVisualization() {
842 // Create and populate a data table.
843 data = new vis.DataSet();
844 // create some nice looking data with sin/cos
845 var steps = 50; // number of datapoints will be steps*steps
846 var axisMax = 314;
847 var axisStep = axisMax / steps;
848 for (var x = 0; x &lt; axisMax; x += axisStep) {
849 for (var y = 0; y &lt; axisMax; y += axisStep) {
850 var value = custom(x, y);
851 data.add([{ x: x, y: y, z: value, t: 0, style: value }]);
852 }
853 }
854
855 // specify options
856 var options = {
857 width: "600px",
858 height: "600px",
859 style: "surface",
860 showPerspective: true,
861 showGrid: true,
862 showShadow: false,
863 keepAspectRatio: true,
864 verticalRatio: 0.5
865 };
866
867 // create our graph
868 var container = document.getElementById("mygraph");
869 graph = new vis.Graph3d(container, data, options);
870
871 graph.on("cameraPositionChange", onCameraPositionChange);
872}
873
874window.addEventListener("load", () =&gt; {
875 drawVisualization();
876});
877'
878 /><input
879 type="hidden"
880 name="css"
881 value="body {
882 font: 10pt arial;
883}
884td {
885 font: 10pt arial;
886}
887"
888 /><input
889 type="hidden"
890 name="html"
891 value='&lt;h1&gt;Graph 3d camera position&lt;/h1&gt;
892&lt;table&gt;
893 &lt;tbody&gt;
894 &lt;tr&gt;
895 &lt;td&gt;Horizontal angle (0 to 2*pi)&lt;/td&gt;
896 &lt;td&gt;&lt;input type="text" id="horizontal" value="1.0" /&gt;&lt;/td&gt;
897 &lt;/tr&gt;
898 &lt;tr&gt;
899 &lt;td&gt;Vertical angle (0 to 0.5*pi)&lt;/td&gt;
900 &lt;td&gt;&lt;input type="text" id="vertical" value="0.5" /&gt;&lt;/td&gt;
901 &lt;/tr&gt;
902 &lt;tr&gt;
903 &lt;td&gt;Distance (0.71 to 5.0)&lt;/td&gt;
904 &lt;td&gt;&lt;input type="text" id="distance" value="1.7" /&gt;&lt;/td&gt;
905 &lt;/tr&gt;
906 &lt;tr&gt;
907 &lt;td&gt;&lt;/td&gt;
908 &lt;td&gt;
909 &lt;input type="button" value="Set" onclick="setCameraPosition();" /&gt;
910 &lt;/td&gt;
911 &lt;/tr&gt;
912 &lt;/tbody&gt;
913&lt;/table&gt;
914
915&lt;div id="mygraph"&gt;&lt;/div&gt;
916
917&lt;div id="info"&gt;&lt;/div&gt;
918'
919 /></form
920 ></span>
921 </div>
922 <a href="graph3d/02_camera.html"
923 ><div class="example-image">
924 <img
925 src="thumbnails/e67f2e28c3dc1af39bc23e96b7ea0bbc5b632ede8d58793884ce4f3f242dd733.png"
926 alt="Camera Position"
927 /></div></a></span
928 ><span class="example-link"
929 ><div>
930 <a href="graph3d/07_dot_cloud_colors.html"
931 >Cloud with Colored Dots</a
932 ><span class="playgrounds"
933 ><form
934 action="http://jsfiddle.net/api/post/library/pure/"
935 method="post"
936 target="_blank"
937 >
938 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
939 &#xA0;</button
940 ><input
941 type="hidden"
942 name="js"
943 value='var data = null;
944var graph = null;
945
946function onclick(point) {
947 console.log(point);
948}
949
950// Called when the Visualization API is loaded.
951function drawVisualization() {
952 // create the data table.
953 data = new vis.DataSet();
954
955 // create some shortcuts to math functions
956 var sqrt = Math.sqrt;
957 var pow = Math.pow;
958 var random = Math.random;
959
960 // create the animation data
961 var imax = 100;
962 for (var i = 0; i &lt; imax; i++) {
963 var x = pow(random(), 2);
964 var y = pow(random(), 2);
965 var z = pow(random(), 2);
966 var style =
967 i % 2 == 0 ? sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) : "#00ffff";
968
969 data.add({ x: x, y: y, z: z, style: style });
970 }
971
972 // specify options
973 var options = {
974 width: "600px",
975 height: "600px",
976 style: "dot-color",
977 showPerspective: true,
978 showGrid: true,
979 keepAspectRatio: true,
980 verticalRatio: 1.0,
981 legendLabel: "distance",
982 onclick: onclick,
983 cameraPosition: {
984 horizontal: -0.35,
985 vertical: 0.22,
986 distance: 1.8
987 }
988 };
989
990 // create our graph
991 var container = document.getElementById("mygraph");
992 graph = new vis.Graph3d(container, data, options);
993}
994
995window.addEventListener("load", () =&gt; {
996 drawVisualization();
997});
998'
999 /><input
1000 type="hidden"
1001 name="css"
1002 value="body {
1003 font: 10pt arial;
1004}
1005"
1006 /><input
1007 type="hidden"
1008 name="html"
1009 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1010
1011&lt;div id="info"&gt;&lt;/div&gt;
1012'
1013 /><input
1014 type="hidden"
1015 name="resources"
1016 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
1017 /><input type="hidden" name="wrap" value="b" /><input
1018 type="hidden"
1019 name="title"
1020 value="Graph 3D | Cloud with Colored Dots"
1021 />
1022 </form>
1023
1024 <form
1025 action="https://codepen.io/pen/define"
1026 method="post"
1027 target="_blank"
1028 >
1029 <button class="icon codepen" alt="CodePen" title="CodePen">
1030 &#xA0;</button
1031 ><input
1032 type="hidden"
1033 name="data"
1034 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction onclick(point) {\n console.log(point);\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create some shortcuts to math functions\n var sqrt = Math.sqrt;\n var pow = Math.pow;\n var random = Math.random;\n\n // create the animation data\n var imax = 100;\n for (var i = 0; i &lt; imax; i++) {\n var x = pow(random(), 2);\n var y = pow(random(), 2);\n var z = pow(random(), 2);\n var style =\n i % 2 == 0 ? sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) : \"#00ffff\";\n\n data.add({ x: x, y: y, z: z, style: style });\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"dot-color\",\n showPerspective: true,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0,\n legendLabel: \"distance\",\n onclick: onclick,\n cameraPosition: {\n horizontal: -0.35,\n vertical: 0.22,\n distance: 1.8\n }\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Cloud with Colored Dots"}'
1035 /><input
1036 type="hidden"
1037 name="js"
1038 value='var data = null;
1039var graph = null;
1040
1041function onclick(point) {
1042 console.log(point);
1043}
1044
1045// Called when the Visualization API is loaded.
1046function drawVisualization() {
1047 // create the data table.
1048 data = new vis.DataSet();
1049
1050 // create some shortcuts to math functions
1051 var sqrt = Math.sqrt;
1052 var pow = Math.pow;
1053 var random = Math.random;
1054
1055 // create the animation data
1056 var imax = 100;
1057 for (var i = 0; i &lt; imax; i++) {
1058 var x = pow(random(), 2);
1059 var y = pow(random(), 2);
1060 var z = pow(random(), 2);
1061 var style =
1062 i % 2 == 0 ? sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) : "#00ffff";
1063
1064 data.add({ x: x, y: y, z: z, style: style });
1065 }
1066
1067 // specify options
1068 var options = {
1069 width: "600px",
1070 height: "600px",
1071 style: "dot-color",
1072 showPerspective: true,
1073 showGrid: true,
1074 keepAspectRatio: true,
1075 verticalRatio: 1.0,
1076 legendLabel: "distance",
1077 onclick: onclick,
1078 cameraPosition: {
1079 horizontal: -0.35,
1080 vertical: 0.22,
1081 distance: 1.8
1082 }
1083 };
1084
1085 // create our graph
1086 var container = document.getElementById("mygraph");
1087 graph = new vis.Graph3d(container, data, options);
1088}
1089
1090window.addEventListener("load", () =&gt; {
1091 drawVisualization();
1092});
1093'
1094 /><input
1095 type="hidden"
1096 name="css"
1097 value="body {
1098 font: 10pt arial;
1099}
1100"
1101 /><input
1102 type="hidden"
1103 name="html"
1104 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1105
1106&lt;div id="info"&gt;&lt;/div&gt;
1107'
1108 /></form
1109 ></span>
1110 </div>
1111 <a href="graph3d/07_dot_cloud_colors.html"
1112 ><div class="example-image">
1113 <img
1114 src="thumbnails/25be5ead5cd783a8a644a4af642714aab8e429a7a0bb08222f637c37f52336d5.png"
1115 alt="Cloud with Colored Dots"
1116 /></div></a></span
1117 ><span class="example-link"
1118 ><div>
1119 <a href="graph3d/08_dot_cloud_size.html">Cloud with Sized Dots</a
1120 ><span class="playgrounds"
1121 ><form
1122 action="http://jsfiddle.net/api/post/library/pure/"
1123 method="post"
1124 target="_blank"
1125 >
1126 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
1127 &#xA0;</button
1128 ><input
1129 type="hidden"
1130 name="js"
1131 value='var data = null;
1132var graph = null;
1133
1134// Called when the Visualization API is loaded.
1135function drawVisualization() {
1136 // create the data table.
1137 data = new vis.DataSet();
1138
1139 // create some shortcuts to math functions
1140 var sqrt = Math.sqrt;
1141 var pow = Math.pow;
1142 var random = Math.random;
1143
1144 // create the animation data
1145 var imax = 100;
1146 for (var i = 0; i &lt; imax; i++) {
1147 var x = pow(random(), 2);
1148 var y = pow(random(), 2);
1149 var z = pow(random(), 2);
1150
1151 var dist = sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));
1152 var range = sqrt(2) - dist;
1153
1154 data.add({ x: x, y: y, z: z, style: range });
1155 }
1156
1157 // specify options
1158 var options = {
1159 width: "600px",
1160 height: "600px",
1161 style: "dot-size",
1162 showPerspective: false,
1163 showGrid: true,
1164 keepAspectRatio: true,
1165 legendLabel: "value",
1166 verticalRatio: 1.0,
1167 cameraPosition: {
1168 horizontal: -0.54,
1169 vertical: 0.5,
1170 distance: 1.6
1171 },
1172 dotSizeMinFraction: 0.5,
1173 dotSizeMaxFraction: 2.5
1174 };
1175
1176 // create our graph
1177 var container = document.getElementById("mygraph");
1178 graph = new vis.Graph3d(container, data, options);
1179}
1180
1181window.addEventListener("load", () =&gt; {
1182 drawVisualization();
1183});
1184'
1185 /><input
1186 type="hidden"
1187 name="css"
1188 value="body {
1189 font: 10pt arial;
1190}
1191"
1192 /><input
1193 type="hidden"
1194 name="html"
1195 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1196
1197&lt;div id="info"&gt;&lt;/div&gt;
1198'
1199 /><input
1200 type="hidden"
1201 name="resources"
1202 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
1203 /><input type="hidden" name="wrap" value="b" /><input
1204 type="hidden"
1205 name="title"
1206 value="Graph 3D | Cloud with Sized Dots"
1207 />
1208 </form>
1209
1210 <form
1211 action="https://codepen.io/pen/define"
1212 method="post"
1213 target="_blank"
1214 >
1215 <button class="icon codepen" alt="CodePen" title="CodePen">
1216 &#xA0;</button
1217 ><input
1218 type="hidden"
1219 name="data"
1220 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create some shortcuts to math functions\n var sqrt = Math.sqrt;\n var pow = Math.pow;\n var random = Math.random;\n\n // create the animation data\n var imax = 100;\n for (var i = 0; i &lt; imax; i++) {\n var x = pow(random(), 2);\n var y = pow(random(), 2);\n var z = pow(random(), 2);\n\n var dist = sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));\n var range = sqrt(2) - dist;\n\n data.add({ x: x, y: y, z: z, style: range });\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"dot-size\",\n showPerspective: false,\n showGrid: true,\n keepAspectRatio: true,\n legendLabel: \"value\",\n verticalRatio: 1.0,\n cameraPosition: {\n horizontal: -0.54,\n vertical: 0.5,\n distance: 1.6\n },\n dotSizeMinFraction: 0.5,\n dotSizeMaxFraction: 2.5\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Cloud with Sized Dots"}'
1221 /><input
1222 type="hidden"
1223 name="js"
1224 value='var data = null;
1225var graph = null;
1226
1227// Called when the Visualization API is loaded.
1228function drawVisualization() {
1229 // create the data table.
1230 data = new vis.DataSet();
1231
1232 // create some shortcuts to math functions
1233 var sqrt = Math.sqrt;
1234 var pow = Math.pow;
1235 var random = Math.random;
1236
1237 // create the animation data
1238 var imax = 100;
1239 for (var i = 0; i &lt; imax; i++) {
1240 var x = pow(random(), 2);
1241 var y = pow(random(), 2);
1242 var z = pow(random(), 2);
1243
1244 var dist = sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));
1245 var range = sqrt(2) - dist;
1246
1247 data.add({ x: x, y: y, z: z, style: range });
1248 }
1249
1250 // specify options
1251 var options = {
1252 width: "600px",
1253 height: "600px",
1254 style: "dot-size",
1255 showPerspective: false,
1256 showGrid: true,
1257 keepAspectRatio: true,
1258 legendLabel: "value",
1259 verticalRatio: 1.0,
1260 cameraPosition: {
1261 horizontal: -0.54,
1262 vertical: 0.5,
1263 distance: 1.6
1264 },
1265 dotSizeMinFraction: 0.5,
1266 dotSizeMaxFraction: 2.5
1267 };
1268
1269 // create our graph
1270 var container = document.getElementById("mygraph");
1271 graph = new vis.Graph3d(container, data, options);
1272}
1273
1274window.addEventListener("load", () =&gt; {
1275 drawVisualization();
1276});
1277'
1278 /><input
1279 type="hidden"
1280 name="css"
1281 value="body {
1282 font: 10pt arial;
1283}
1284"
1285 /><input
1286 type="hidden"
1287 name="html"
1288 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1289
1290&lt;div id="info"&gt;&lt;/div&gt;
1291'
1292 /></form
1293 ></span>
1294 </div>
1295 <a href="graph3d/08_dot_cloud_size.html"
1296 ><div class="example-image">
1297 <img
1298 src="thumbnails/5a02efacddb0331827ddcf2ae12052f3720c21a7506374c724150cecef901e84.png"
1299 alt="Cloud with Sized Dots"
1300 /></div></a></span
1301 ><span class="example-link"
1302 ><div>
1303 <a href="graph3d/12_custom_labels.html">Custom Labels</a
1304 ><span class="playgrounds"
1305 ><form
1306 action="http://jsfiddle.net/api/post/library/pure/"
1307 method="post"
1308 target="_blank"
1309 >
1310 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
1311 &#xA0;</button
1312 ><input
1313 type="hidden"
1314 name="js"
1315 value='var data = null;
1316var graph = null;
1317
1318function custom(x, y) {
1319 return (-Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10) * 1000;
1320}
1321
1322// Called when the Visualization API is loaded.
1323function drawVisualization() {
1324 var style = document.getElementById("style").value;
1325 var withValue =
1326 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
1327
1328 // Create and populate a data table.
1329 data = new vis.DataSet();
1330
1331 // create some nice looking data with sin/cos
1332 var steps = 5; // number of datapoints will be steps*steps
1333 var axisMax = 10;
1334 var axisStep = axisMax / steps;
1335 for (var x = 0; x &lt;= axisMax; x += axisStep) {
1336 for (var y = 0; y &lt;= axisMax; y += axisStep) {
1337 var z = custom(x, y);
1338 if (withValue) {
1339 var value = y - x;
1340 data.add({ x: x, y: y, z: z, style: value });
1341 } else {
1342 data.add({ x: x, y: y, z: z });
1343 }
1344 }
1345 }
1346
1347 // specify options
1348 var options = {
1349 width: "600px",
1350 height: "600px",
1351 style: style,
1352 showPerspective: true,
1353 showGrid: true,
1354 showShadow: false,
1355
1356 // Option tooltip can be true, false, or a function returning a string with HTML contents
1357 //tooltip: true,
1358 tooltip: function(point) {
1359 // parameter point contains properties x, y, z
1360 return "value: &lt;b&gt;" + point.z + "&lt;/b&gt;";
1361 },
1362
1363 xValueLabel: function(value) {
1364 return vis
1365 .moment()
1366 .add(value, "days")
1367 .format("DD MMM");
1368 },
1369
1370 yValueLabel: function(value) {
1371 return value * 10 + "%";
1372 },
1373
1374 zValueLabel: function(value) {
1375 return value / 1000 + "K";
1376 },
1377
1378 keepAspectRatio: true,
1379 verticalRatio: 0.5
1380 };
1381
1382 var camera = graph ? graph.getCameraPosition() : null;
1383
1384 // create our graph
1385 var container = document.getElementById("mygraph");
1386 graph = new vis.Graph3d(container, data, options);
1387
1388 if (camera) graph.setCameraPosition(camera); // restore camera position
1389
1390 document.getElementById("style").onchange = drawVisualization;
1391}
1392
1393window.addEventListener("load", () =&gt; {
1394 drawVisualization();
1395});
1396'
1397 /><input
1398 type="hidden"
1399 name="css"
1400 value="body {
1401 font: 10pt arial;
1402}
1403"
1404 /><input
1405 type="hidden"
1406 name="html"
1407 value='&lt;p&gt;
1408 &lt;label for="style"&gt;
1409 Style:
1410 &lt;select id="style"&gt;
1411 &lt;option value="bar"&gt;bar&lt;/option&gt;
1412 &lt;option value="bar-color"&gt;bar-color&lt;/option&gt;
1413 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
1414
1415 &lt;option value="dot"&gt;dot&lt;/option&gt;
1416 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
1417 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
1418 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
1419
1420 &lt;option value="grid"&gt;grid&lt;/option&gt;
1421 &lt;option value="line"&gt;line&lt;/option&gt;
1422 &lt;option value="surface"&gt;surface&lt;/option&gt;
1423 &lt;/select&gt;
1424 &lt;/label&gt;
1425&lt;/p&gt;
1426
1427&lt;div id="mygraph"&gt;&lt;/div&gt;
1428
1429&lt;div id="info"&gt;&lt;/div&gt;
1430'
1431 /><input
1432 type="hidden"
1433 name="resources"
1434 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
1435 /><input type="hidden" name="wrap" value="b" /><input
1436 type="hidden"
1437 name="title"
1438 value="Graph 3D | Custom Labels"
1439 />
1440 </form>
1441
1442 <form
1443 action="https://codepen.io/pen/define"
1444 method="post"
1445 target="_blank"
1446 >
1447 <button class="icon codepen" alt="CodePen" title="CodePen">
1448 &#xA0;</button
1449 ><input
1450 type="hidden"
1451 name="data"
1452 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;p&gt;\n &lt;label for=\"style\"&gt;\n Style:\n &lt;select id=\"style\"&gt;\n &lt;option value=\"bar\"&gt;bar&lt;/option&gt;\n &lt;option value=\"bar-color\"&gt;bar-color&lt;/option&gt;\n &lt;option value=\"bar-size\"&gt;bar-size&lt;/option&gt;\n\n &lt;option value=\"dot\"&gt;dot&lt;/option&gt;\n &lt;option value=\"dot-line\"&gt;dot-line&lt;/option&gt;\n &lt;option value=\"dot-color\"&gt;dot-color&lt;/option&gt;\n &lt;option value=\"dot-size\"&gt;dot-size&lt;/option&gt;\n\n &lt;option value=\"grid\"&gt;grid&lt;/option&gt;\n &lt;option value=\"line\"&gt;line&lt;/option&gt;\n &lt;option value=\"surface\"&gt;surface&lt;/option&gt;\n &lt;/select&gt;\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return (-Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10) * 1000;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n var style = document.getElementById(\"style\").value;\n var withValue =\n [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\n\n // Create and populate a data table.\n data = new vis.DataSet();\n\n // create some nice looking data with sin/cos\n var steps = 5; // number of datapoints will be steps*steps\n var axisMax = 10;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt;= axisMax; x += axisStep) {\n for (var y = 0; y &lt;= axisMax; y += axisStep) {\n var z = custom(x, y);\n if (withValue) {\n var value = y - x;\n data.add({ x: x, y: y, z: z, style: value });\n } else {\n data.add({ x: x, y: y, z: z });\n }\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: style,\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n\n // Option tooltip can be true, false, or a function returning a string with HTML contents\n //tooltip: true,\n tooltip: function(point) {\n // parameter point contains properties x, y, z\n return \"value: &lt;b&gt;\" + point.z + \"&lt;/b&gt;\";\n },\n\n xValueLabel: function(value) {\n return vis\n .moment()\n .add(value, \"days\")\n .format(\"DD MMM\");\n },\n\n yValueLabel: function(value) {\n return value * 10 + \"%\";\n },\n\n zValueLabel: function(value) {\n return value / 1000 + \"K\";\n },\n\n keepAspectRatio: true,\n verticalRatio: 0.5\n };\n\n var camera = graph ? graph.getCameraPosition() : null;\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n\n if (camera) graph.setCameraPosition(camera); // restore camera position\n\n document.getElementById(\"style\").onchange = drawVisualization;\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Custom Labels"}'
1453 /><input
1454 type="hidden"
1455 name="js"
1456 value='var data = null;
1457var graph = null;
1458
1459function custom(x, y) {
1460 return (-Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10) * 1000;
1461}
1462
1463// Called when the Visualization API is loaded.
1464function drawVisualization() {
1465 var style = document.getElementById("style").value;
1466 var withValue =
1467 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
1468
1469 // Create and populate a data table.
1470 data = new vis.DataSet();
1471
1472 // create some nice looking data with sin/cos
1473 var steps = 5; // number of datapoints will be steps*steps
1474 var axisMax = 10;
1475 var axisStep = axisMax / steps;
1476 for (var x = 0; x &lt;= axisMax; x += axisStep) {
1477 for (var y = 0; y &lt;= axisMax; y += axisStep) {
1478 var z = custom(x, y);
1479 if (withValue) {
1480 var value = y - x;
1481 data.add({ x: x, y: y, z: z, style: value });
1482 } else {
1483 data.add({ x: x, y: y, z: z });
1484 }
1485 }
1486 }
1487
1488 // specify options
1489 var options = {
1490 width: "600px",
1491 height: "600px",
1492 style: style,
1493 showPerspective: true,
1494 showGrid: true,
1495 showShadow: false,
1496
1497 // Option tooltip can be true, false, or a function returning a string with HTML contents
1498 //tooltip: true,
1499 tooltip: function(point) {
1500 // parameter point contains properties x, y, z
1501 return "value: &lt;b&gt;" + point.z + "&lt;/b&gt;";
1502 },
1503
1504 xValueLabel: function(value) {
1505 return vis
1506 .moment()
1507 .add(value, "days")
1508 .format("DD MMM");
1509 },
1510
1511 yValueLabel: function(value) {
1512 return value * 10 + "%";
1513 },
1514
1515 zValueLabel: function(value) {
1516 return value / 1000 + "K";
1517 },
1518
1519 keepAspectRatio: true,
1520 verticalRatio: 0.5
1521 };
1522
1523 var camera = graph ? graph.getCameraPosition() : null;
1524
1525 // create our graph
1526 var container = document.getElementById("mygraph");
1527 graph = new vis.Graph3d(container, data, options);
1528
1529 if (camera) graph.setCameraPosition(camera); // restore camera position
1530
1531 document.getElementById("style").onchange = drawVisualization;
1532}
1533
1534window.addEventListener("load", () =&gt; {
1535 drawVisualization();
1536});
1537'
1538 /><input
1539 type="hidden"
1540 name="css"
1541 value="body {
1542 font: 10pt arial;
1543}
1544"
1545 /><input
1546 type="hidden"
1547 name="html"
1548 value='&lt;p&gt;
1549 &lt;label for="style"&gt;
1550 Style:
1551 &lt;select id="style"&gt;
1552 &lt;option value="bar"&gt;bar&lt;/option&gt;
1553 &lt;option value="bar-color"&gt;bar-color&lt;/option&gt;
1554 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
1555
1556 &lt;option value="dot"&gt;dot&lt;/option&gt;
1557 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
1558 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
1559 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
1560
1561 &lt;option value="grid"&gt;grid&lt;/option&gt;
1562 &lt;option value="line"&gt;line&lt;/option&gt;
1563 &lt;option value="surface"&gt;surface&lt;/option&gt;
1564 &lt;/select&gt;
1565 &lt;/label&gt;
1566&lt;/p&gt;
1567
1568&lt;div id="mygraph"&gt;&lt;/div&gt;
1569
1570&lt;div id="info"&gt;&lt;/div&gt;
1571'
1572 /></form
1573 ></span>
1574 </div>
1575 <a href="graph3d/12_custom_labels.html"
1576 ><div class="example-image">
1577 <img
1578 src="thumbnails/f7c986763a1b0d76c35e782613d4c2255682de3477eac7ade789091dc243bc17.png"
1579 alt="Custom Labels"
1580 /></div></a></span
1581 ><span class="example-link"
1582 ><div>
1583 <a href="graph3d/13_disable_zoom.html">Disable Zoom</a
1584 ><span class="playgrounds"
1585 ><form
1586 action="http://jsfiddle.net/api/post/library/pure/"
1587 method="post"
1588 target="_blank"
1589 >
1590 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
1591 &#xA0;</button
1592 ><input
1593 type="hidden"
1594 name="js"
1595 value='var data = null;
1596var graph = null;
1597
1598function custom(x, y) {
1599 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
1600}
1601
1602// Called when the Visualization API is loaded.
1603function drawVisualization() {
1604 // Create and populate a data table.
1605 data = new vis.DataSet();
1606 // create some nice looking data with sin/cos
1607 var counter = 0;
1608 var steps = 50; // number of datapoints will be steps*steps
1609 var axisMax = 314;
1610 var axisStep = axisMax / steps;
1611 for (var x = 0; x &lt; axisMax; x += axisStep) {
1612 for (var y = 0; y &lt; axisMax; y += axisStep) {
1613 var value = custom(x, y);
1614 data.add({ id: counter++, x: x, y: y, z: value, style: value });
1615 }
1616 }
1617
1618 // specify options
1619 var options = {
1620 width: "600px",
1621 height: "600px",
1622 style: "surface",
1623 showPerspective: true,
1624 showGrid: true,
1625 showShadow: false,
1626 keepAspectRatio: true,
1627 verticalRatio: 0.5,
1628 zoomable: false
1629 };
1630
1631 // Instantiate our graph object.
1632 var container = document.getElementById("mygraph");
1633 graph = new vis.Graph3d(container, data, options);
1634}
1635
1636window.addEventListener("load", () =&gt; {
1637 drawVisualization();
1638});
1639'
1640 /><input
1641 type="hidden"
1642 name="css"
1643 value="body {
1644 font: 10pt arial;
1645}
1646"
1647 /><input
1648 type="hidden"
1649 name="html"
1650 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1651
1652&lt;div id="info"&gt;&lt;/div&gt;
1653'
1654 /><input
1655 type="hidden"
1656 name="resources"
1657 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
1658 /><input type="hidden" name="wrap" value="b" /><input
1659 type="hidden"
1660 name="title"
1661 value="Graph 3D | Disable Zoom"
1662 />
1663 </form>
1664
1665 <form
1666 action="https://codepen.io/pen/define"
1667 method="post"
1668 target="_blank"
1669 >
1670 <button class="icon codepen" alt="CodePen" title="CodePen">
1671 &#xA0;</button
1672 ><input
1673 type="hidden"
1674 name="data"
1675 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n // create some nice looking data with sin/cos\n var counter = 0;\n var steps = 50; // number of datapoints will be steps*steps\n var axisMax = 314;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y);\n data.add({ id: counter++, x: x, y: y, z: value, style: value });\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"surface\",\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n zoomable: false\n };\n\n // Instantiate our graph object.\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Disable Zoom"}'
1676 /><input
1677 type="hidden"
1678 name="js"
1679 value='var data = null;
1680var graph = null;
1681
1682function custom(x, y) {
1683 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
1684}
1685
1686// Called when the Visualization API is loaded.
1687function drawVisualization() {
1688 // Create and populate a data table.
1689 data = new vis.DataSet();
1690 // create some nice looking data with sin/cos
1691 var counter = 0;
1692 var steps = 50; // number of datapoints will be steps*steps
1693 var axisMax = 314;
1694 var axisStep = axisMax / steps;
1695 for (var x = 0; x &lt; axisMax; x += axisStep) {
1696 for (var y = 0; y &lt; axisMax; y += axisStep) {
1697 var value = custom(x, y);
1698 data.add({ id: counter++, x: x, y: y, z: value, style: value });
1699 }
1700 }
1701
1702 // specify options
1703 var options = {
1704 width: "600px",
1705 height: "600px",
1706 style: "surface",
1707 showPerspective: true,
1708 showGrid: true,
1709 showShadow: false,
1710 keepAspectRatio: true,
1711 verticalRatio: 0.5,
1712 zoomable: false
1713 };
1714
1715 // Instantiate our graph object.
1716 var container = document.getElementById("mygraph");
1717 graph = new vis.Graph3d(container, data, options);
1718}
1719
1720window.addEventListener("load", () =&gt; {
1721 drawVisualization();
1722});
1723'
1724 /><input
1725 type="hidden"
1726 name="css"
1727 value="body {
1728 font: 10pt arial;
1729}
1730"
1731 /><input
1732 type="hidden"
1733 name="html"
1734 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1735
1736&lt;div id="info"&gt;&lt;/div&gt;
1737'
1738 /></form
1739 ></span>
1740 </div>
1741 <a href="graph3d/13_disable_zoom.html"
1742 ><div class="example-image">
1743 <img
1744 src="thumbnails/ca22cb74e9f0c43b4a07bac1b0389e3e16082cfd3c6589d87bd7492c2107bcb6.png"
1745 alt="Disable Zoom"
1746 /></div></a></span
1747 ><span class="example-link"
1748 ><div>
1749 <a href="graph3d/03_filter_data.html">Filter Data</a
1750 ><span class="playgrounds"
1751 ><form
1752 action="http://jsfiddle.net/api/post/library/pure/"
1753 method="post"
1754 target="_blank"
1755 >
1756 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
1757 &#xA0;</button
1758 ><input
1759 type="hidden"
1760 name="js"
1761 value='var data = null;
1762var graph = null;
1763
1764function custom(x, y) {
1765 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
1766}
1767
1768// Called when the Visualization API is loaded.
1769function drawVisualization() {
1770 // Create and populate a data table.
1771 data = [];
1772 // create some nice looking data with sin/cos
1773 var steps = 50; // number of datapoints will be steps*steps
1774 var axisMax = 314;
1775 var axisStep = axisMax / steps;
1776 for (var x = 0; x &lt; axisMax; x += axisStep) {
1777 for (var y = 0; y &lt; axisMax; y += axisStep) {
1778 var value = custom(x, y);
1779 var valueRange = value &gt; 67 ? "67-100" : value &lt; 33 ? "0-33" : "33-67";
1780 data.push({ x: x, y: y, z: value, filter: valueRange, style: value });
1781 }
1782 }
1783
1784 // specify options
1785 var options = {
1786 width: "600px",
1787 height: "600px",
1788 style: "surface",
1789 showPerspective: false,
1790 showGrid: true,
1791 showShadow: false,
1792 keepAspectRatio: true,
1793 verticalRatio: 0.5,
1794 filterLabel: "values"
1795 };
1796
1797 // Create our graph
1798 var container = document.getElementById("mygraph");
1799 graph = new vis.Graph3d(container, data, options);
1800}
1801
1802window.addEventListener("load", () =&gt; {
1803 drawVisualization();
1804});
1805'
1806 /><input
1807 type="hidden"
1808 name="css"
1809 value="body {
1810 font: 10pt arial;
1811}
1812"
1813 /><input
1814 type="hidden"
1815 name="html"
1816 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1817
1818&lt;div id="info"&gt;&lt;/div&gt;
1819'
1820 /><input
1821 type="hidden"
1822 name="resources"
1823 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
1824 /><input type="hidden" name="wrap" value="b" /><input
1825 type="hidden"
1826 name="title"
1827 value="Graph 3D | Filter Data"
1828 />
1829 </form>
1830
1831 <form
1832 action="https://codepen.io/pen/define"
1833 method="post"
1834 target="_blank"
1835 >
1836 <button class="icon codepen" alt="CodePen" title="CodePen">
1837 &#xA0;</button
1838 ><input
1839 type="hidden"
1840 name="data"
1841 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = [];\n // create some nice looking data with sin/cos\n var steps = 50; // number of datapoints will be steps*steps\n var axisMax = 314;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y);\n var valueRange = value &gt; 67 ? \"67-100\" : value &lt; 33 ? \"0-33\" : \"33-67\";\n data.push({ x: x, y: y, z: value, filter: valueRange, style: value });\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"surface\",\n showPerspective: false,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n filterLabel: \"values\"\n };\n\n // Create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Filter Data"}'
1842 /><input
1843 type="hidden"
1844 name="js"
1845 value='var data = null;
1846var graph = null;
1847
1848function custom(x, y) {
1849 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
1850}
1851
1852// Called when the Visualization API is loaded.
1853function drawVisualization() {
1854 // Create and populate a data table.
1855 data = [];
1856 // create some nice looking data with sin/cos
1857 var steps = 50; // number of datapoints will be steps*steps
1858 var axisMax = 314;
1859 var axisStep = axisMax / steps;
1860 for (var x = 0; x &lt; axisMax; x += axisStep) {
1861 for (var y = 0; y &lt; axisMax; y += axisStep) {
1862 var value = custom(x, y);
1863 var valueRange = value &gt; 67 ? "67-100" : value &lt; 33 ? "0-33" : "33-67";
1864 data.push({ x: x, y: y, z: value, filter: valueRange, style: value });
1865 }
1866 }
1867
1868 // specify options
1869 var options = {
1870 width: "600px",
1871 height: "600px",
1872 style: "surface",
1873 showPerspective: false,
1874 showGrid: true,
1875 showShadow: false,
1876 keepAspectRatio: true,
1877 verticalRatio: 0.5,
1878 filterLabel: "values"
1879 };
1880
1881 // Create our graph
1882 var container = document.getElementById("mygraph");
1883 graph = new vis.Graph3d(container, data, options);
1884}
1885
1886window.addEventListener("load", () =&gt; {
1887 drawVisualization();
1888});
1889'
1890 /><input
1891 type="hidden"
1892 name="css"
1893 value="body {
1894 font: 10pt arial;
1895}
1896"
1897 /><input
1898 type="hidden"
1899 name="html"
1900 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1901
1902&lt;div id="info"&gt;&lt;/div&gt;
1903'
1904 /></form
1905 ></span>
1906 </div>
1907 <a href="graph3d/03_filter_data.html"
1908 ><div class="example-image">
1909 <img
1910 src="thumbnails/2fa5fd611006cb869a8a54e40a30bb3258eb46541b3530aaf0757dcc15513a18.png"
1911 alt="Filter Data"
1912 /></div></a></span
1913 ><span class="example-link"
1914 ><div>
1915 <a href="graph3d/05_line.html">Line</a
1916 ><span class="playgrounds"
1917 ><form
1918 action="http://jsfiddle.net/api/post/library/pure/"
1919 method="post"
1920 target="_blank"
1921 >
1922 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
1923 &#xA0;</button
1924 ><input
1925 type="hidden"
1926 name="js"
1927 value='var data = null;
1928var graph = null;
1929
1930// Called when the Visualization API is loaded.
1931function drawVisualization() {
1932 // Create and populate a data table.
1933 data = new vis.DataSet();
1934
1935 // create some nice looking data with sin/cos
1936 var steps = 500;
1937 var axisMax = 314;
1938 var tmax = 4 * 2 * Math.PI;
1939 var axisStep = axisMax / steps;
1940 for (var t = 0; t &lt; tmax; t += tmax / steps) {
1941 var r = 1;
1942 var x = r * Math.sin(t);
1943 var y = r * Math.cos(t);
1944 var z = t / tmax;
1945 data.add({ x: x, y: y, z: z });
1946 }
1947
1948 // specify options
1949 var options = {
1950 width: "600px",
1951 height: "600px",
1952 style: "line",
1953 showPerspective: false,
1954 showGrid: true,
1955 keepAspectRatio: true,
1956 verticalRatio: 1.0
1957 };
1958
1959 // create our graph
1960 var container = document.getElementById("mygraph");
1961 graph = new vis.Graph3d(container, data, options);
1962
1963 graph.setCameraPosition(0.4, undefined, undefined);
1964}
1965
1966window.addEventListener("load", () =&gt; {
1967 drawVisualization();
1968});
1969'
1970 /><input
1971 type="hidden"
1972 name="css"
1973 value="body {
1974 font: 10pt arial;
1975}
1976"
1977 /><input
1978 type="hidden"
1979 name="html"
1980 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
1981
1982&lt;div id="info"&gt;&lt;/div&gt;
1983'
1984 /><input
1985 type="hidden"
1986 name="resources"
1987 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
1988 /><input type="hidden" name="wrap" value="b" /><input
1989 type="hidden"
1990 name="title"
1991 value="Graph 3D | Line"
1992 />
1993 </form>
1994
1995 <form
1996 action="https://codepen.io/pen/define"
1997 method="post"
1998 target="_blank"
1999 >
2000 <button class="icon codepen" alt="CodePen" title="CodePen">
2001 &#xA0;</button
2002 ><input
2003 type="hidden"
2004 name="data"
2005 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n\n // create some nice looking data with sin/cos\n var steps = 500;\n var axisMax = 314;\n var tmax = 4 * 2 * Math.PI;\n var axisStep = axisMax / steps;\n for (var t = 0; t &lt; tmax; t += tmax / steps) {\n var r = 1;\n var x = r * Math.sin(t);\n var y = r * Math.cos(t);\n var z = t / tmax;\n data.add({ x: x, y: y, z: z });\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"line\",\n showPerspective: false,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n\n graph.setCameraPosition(0.4, undefined, undefined);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Line"}'
2006 /><input
2007 type="hidden"
2008 name="js"
2009 value='var data = null;
2010var graph = null;
2011
2012// Called when the Visualization API is loaded.
2013function drawVisualization() {
2014 // Create and populate a data table.
2015 data = new vis.DataSet();
2016
2017 // create some nice looking data with sin/cos
2018 var steps = 500;
2019 var axisMax = 314;
2020 var tmax = 4 * 2 * Math.PI;
2021 var axisStep = axisMax / steps;
2022 for (var t = 0; t &lt; tmax; t += tmax / steps) {
2023 var r = 1;
2024 var x = r * Math.sin(t);
2025 var y = r * Math.cos(t);
2026 var z = t / tmax;
2027 data.add({ x: x, y: y, z: z });
2028 }
2029
2030 // specify options
2031 var options = {
2032 width: "600px",
2033 height: "600px",
2034 style: "line",
2035 showPerspective: false,
2036 showGrid: true,
2037 keepAspectRatio: true,
2038 verticalRatio: 1.0
2039 };
2040
2041 // create our graph
2042 var container = document.getElementById("mygraph");
2043 graph = new vis.Graph3d(container, data, options);
2044
2045 graph.setCameraPosition(0.4, undefined, undefined);
2046}
2047
2048window.addEventListener("load", () =&gt; {
2049 drawVisualization();
2050});
2051'
2052 /><input
2053 type="hidden"
2054 name="css"
2055 value="body {
2056 font: 10pt arial;
2057}
2058"
2059 /><input
2060 type="hidden"
2061 name="html"
2062 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
2063
2064&lt;div id="info"&gt;&lt;/div&gt;
2065'
2066 /></form
2067 ></span>
2068 </div>
2069 <a href="graph3d/05_line.html"
2070 ><div class="example-image">
2071 <img
2072 src="thumbnails/f5e35d3448f335732af70475c293466677d5806da60c96df9173da7312dcfcff.png"
2073 alt="Line"
2074 /></div></a></span
2075 ><span class="example-link"
2076 ><div>
2077 <a href="graph3d/09_mobile.html">Mobile</a
2078 ><span class="playgrounds"
2079 ><form
2080 action="http://jsfiddle.net/api/post/library/pure/"
2081 method="post"
2082 target="_blank"
2083 >
2084 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
2085 &#xA0;</button
2086 ><input
2087 type="hidden"
2088 name="js"
2089 value='var data = null;
2090var graph = null;
2091
2092function custom(x, y) {
2093 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
2094}
2095
2096// Called when the Visualization API is loaded.
2097function drawVisualization() {
2098 // Create and populate a data table.
2099 data = new vis.DataSet();
2100
2101 // create some nice looking data with sin/cos
2102 var steps = 10; // number of datapoints will be steps*steps
2103 var axisMax = 314;
2104 var axisStep = axisMax / steps;
2105 for (var x = 0; x &lt; axisMax; x += axisStep) {
2106 for (var y = 0; y &lt; axisMax; y += axisStep) {
2107 var value = custom(x, y);
2108 data.add([{ x: x, y: y, z: value }]);
2109 }
2110 }
2111
2112 // specify options
2113 var options = {
2114 width: "100%",
2115 height: "100%",
2116 style: "surface",
2117 showPerspective: true,
2118 showGrid: true,
2119 showShadow: false,
2120 keepAspectRatio: true,
2121 verticalRatio: 0.5,
2122 backgroundColor: {
2123 strokeWidth: 0
2124 }
2125 };
2126
2127 // create our graph
2128 var container = document.getElementById("mygraph");
2129 graph = new vis.Graph3d(container, data, options);
2130}
2131
2132window.addEventListener("resize", () =&gt; {
2133 graph.redraw();
2134});
2135window.addEventListener("load", () =&gt; {
2136 drawVisualization();
2137});
2138'
2139 /><input
2140 type="hidden"
2141 name="css"
2142 value="html,
2143body {
2144 font: 10pt arial;
2145 padding: 0;
2146 margin: 0;
2147 width: 100%;
2148 height: 100%;
2149}
2150
2151#mygraph {
2152 position: absolute;
2153 width: 100%;
2154 height: 100%;
2155}
2156"
2157 /><input
2158 type="hidden"
2159 name="html"
2160 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
2161'
2162 /><input
2163 type="hidden"
2164 name="resources"
2165 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
2166 /><input type="hidden" name="wrap" value="b" /><input
2167 type="hidden"
2168 name="title"
2169 value="Graph 3D | Mobile"
2170 />
2171 </form>
2172
2173 <form
2174 action="https://codepen.io/pen/define"
2175 method="post"
2176 target="_blank"
2177 >
2178 <button class="icon codepen" alt="CodePen" title="CodePen">
2179 &#xA0;</button
2180 ><input
2181 type="hidden"
2182 name="data"
2183 value='{"css":"html,\nbody {\n font: 10pt arial;\n padding: 0;\n margin: 0;\n width: 100%;\n height: 100%;\n}\n\n#mygraph {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n\n // create some nice looking data with sin/cos\n var steps = 10; // number of datapoints will be steps*steps\n var axisMax = 314;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y);\n data.add([{ x: x, y: y, z: value }]);\n }\n }\n\n // specify options\n var options = {\n width: \"100%\",\n height: \"100%\",\n style: \"surface\",\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n backgroundColor: {\n strokeWidth: 0\n }\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"resize\", () =&gt; {\n graph.redraw();\n});\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Mobile"}'
2184 /><input
2185 type="hidden"
2186 name="js"
2187 value='var data = null;
2188var graph = null;
2189
2190function custom(x, y) {
2191 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
2192}
2193
2194// Called when the Visualization API is loaded.
2195function drawVisualization() {
2196 // Create and populate a data table.
2197 data = new vis.DataSet();
2198
2199 // create some nice looking data with sin/cos
2200 var steps = 10; // number of datapoints will be steps*steps
2201 var axisMax = 314;
2202 var axisStep = axisMax / steps;
2203 for (var x = 0; x &lt; axisMax; x += axisStep) {
2204 for (var y = 0; y &lt; axisMax; y += axisStep) {
2205 var value = custom(x, y);
2206 data.add([{ x: x, y: y, z: value }]);
2207 }
2208 }
2209
2210 // specify options
2211 var options = {
2212 width: "100%",
2213 height: "100%",
2214 style: "surface",
2215 showPerspective: true,
2216 showGrid: true,
2217 showShadow: false,
2218 keepAspectRatio: true,
2219 verticalRatio: 0.5,
2220 backgroundColor: {
2221 strokeWidth: 0
2222 }
2223 };
2224
2225 // create our graph
2226 var container = document.getElementById("mygraph");
2227 graph = new vis.Graph3d(container, data, options);
2228}
2229
2230window.addEventListener("resize", () =&gt; {
2231 graph.redraw();
2232});
2233window.addEventListener("load", () =&gt; {
2234 drawVisualization();
2235});
2236'
2237 /><input
2238 type="hidden"
2239 name="css"
2240 value="html,
2241body {
2242 font: 10pt arial;
2243 padding: 0;
2244 margin: 0;
2245 width: 100%;
2246 height: 100%;
2247}
2248
2249#mygraph {
2250 position: absolute;
2251 width: 100%;
2252 height: 100%;
2253}
2254"
2255 /><input
2256 type="hidden"
2257 name="html"
2258 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
2259'
2260 /></form
2261 ></span>
2262 </div>
2263 <a href="graph3d/09_mobile.html"
2264 ><div class="example-image">
2265 <img
2266 src="thumbnails/4fb6e1185e7f4ae7392babb7ce8c11b5b6baaeb839ef9f9a655f309dde4b234a.png"
2267 alt="Mobile"
2268 /></div></a></span
2269 ><span class="example-link"
2270 ><div>
2271 <a href="graph3d/playground/index.html">Playground</a
2272 ><span class="playgrounds"
2273 ><form
2274 action="http://jsfiddle.net/api/post/library/pure/"
2275 method="post"
2276 target="_blank"
2277 >
2278 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
2279 &#xA0;</button
2280 ><input
2281 type="hidden"
2282 name="js"
2283 value='// Called when the Visualization API is loaded.
2284function drawVisualization() {
2285 // TODO
2286}
2287
2288window.addEventListener("load", () =&gt; {
2289 load();
2290});
2291'
2292 /><input type="hidden" name="css" value /><input
2293 type="hidden"
2294 name="html"
2295 value='&lt;h1&gt;Graph 3D - Playground&lt;/h1&gt;
2296
2297&lt;table style="width:100%;"&gt;
2298 &lt;colgroup&gt;
2299 &lt;col width="50%" /&gt;
2300 &lt;col width="50%" /&gt;
2301 &lt;/colgroup&gt;
2302 &lt;tbody&gt;
2303 &lt;tr&gt;
2304 &lt;td&gt;
2305 &lt;h2&gt;Data&lt;/h2&gt;
2306 &lt;p&gt;
2307 Graph 3D expects a data table with first three to five columns: colums
2308 &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;z&lt;/code&gt; (optional),
2309 &lt;code&gt;style&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt; (optional).
2310 &lt;/p&gt;
2311
2312 &lt;table&gt;
2313 &lt;tbody&gt;
2314 &lt;tr&gt;
2315 &lt;td style="white-space: nowrap"&gt;
2316 &lt;input
2317 type="radio"
2318 name="datatype"
2319 id="datatypeCsv"
2320 onclick="selectDataType();"
2321 checked
2322 value="csv"
2323 /&gt;Csv
2324 &lt;/td&gt;
2325 &lt;td&gt;
2326 &lt;div id="csv"&gt;
2327 &lt;textarea id="csvTextarea"&gt;&lt;/textarea&gt;
2328 &lt;p&gt;
2329 &lt;a
2330 href="javascript: loadCsvExample();"
2331 title="Load an example"
2332 &gt;Simple example&lt;/a
2333 &gt;
2334 &lt;a
2335 href="javascript: loadCsvLineExample();"
2336 title="Load an example"
2337 &gt;Line example&lt;/a
2338 &gt;
2339 &lt;a
2340 href="javascript: loadCsvAnimationExample();"
2341 title="Load an example"
2342 &gt;Animation example&lt;/a
2343 &gt;
2344 &lt;a
2345 href="javascript: loadCsvMovingDotsExample();"
2346 title="Load an example"
2347 &gt;Moving dots example&lt;/a
2348 &gt;
2349 &lt;a
2350 href="javascript: loadCsvColoredDotsExample();"
2351 title="Load an example"
2352 &gt;Colored dots example&lt;/a
2353 &gt;
2354 &lt;a
2355 href="javascript: loadCsvSizedDotsExample();"
2356 title="Load an example"
2357 &gt;Sized dots example&lt;/a
2358 &gt;
2359 &lt;/p&gt;
2360 &lt;/div&gt;
2361 &lt;/td&gt;
2362 &lt;/tr&gt;
2363 &lt;!-- TODO: add JSON examples --&gt;
2364 &lt;/tbody&gt;
2365 &lt;/table&gt;
2366
2367 &lt;br /&gt;
2368 &lt;/td&gt;
2369 &lt;td rowspan="2"&gt;
2370 &lt;h2&gt;Graph&lt;/h2&gt;
2371 &lt;p&gt;
2372 &lt;input type="button" value="Draw graph" onclick="draw();" id="draw" /&gt;
2373 &lt;/p&gt;
2374
2375 &lt;div id="mygraph"&gt;&lt;/div&gt;
2376 &lt;/td&gt;
2377 &lt;/tr&gt;
2378 &lt;tr&gt;
2379 &lt;td&gt;
2380 &lt;h2&gt;Options&lt;/h2&gt;
2381
2382 &lt;table&gt;
2383 &lt;tbody&gt;
2384 &lt;tr&gt;
2385 &lt;th&gt;Option&lt;/th&gt;
2386 &lt;th&gt;Value&lt;/th&gt;
2387 &lt;/tr&gt;
2388
2389 &lt;tr&gt;
2390 &lt;td&gt;width&lt;/td&gt;
2391 &lt;td&gt;
2392 &lt;input type="text" id="width" value="100%" /&gt;
2393 &lt;span class="info"
2394 &gt;for example &amp;quot;500px&amp;quot; or &amp;quot;100%&amp;quot;&lt;/span
2395 &gt;
2396 &lt;/td&gt;
2397 &lt;/tr&gt;
2398 &lt;tr&gt;
2399 &lt;td&gt;height&lt;/td&gt;
2400 &lt;td&gt;
2401 &lt;input type="text" id="height" value="100%" /&gt;
2402 &lt;span class="info"
2403 &gt;for example &amp;quot;500px&amp;quot; or &amp;quot;100%&amp;quot;&lt;/span
2404 &gt;
2405 &lt;/td&gt;
2406 &lt;/tr&gt;
2407 &lt;tr&gt;
2408 &lt;td&gt;style&lt;/td&gt;
2409 &lt;td&gt;
2410 &lt;select id="style"&gt;
2411 &lt;option value="bar"&gt;bar &lt;/option
2412 &gt;&lt;option value="bar-color"&gt;bar-color &lt;/option
2413 &gt;&lt;option value="bar-size"&gt;bar-size &lt;/option
2414 &gt;&lt;option value="dot"&gt;dot &lt;/option
2415 &gt;&lt;option value="dot-color"&gt;dot-color &lt;/option
2416 &gt;&lt;option value="dot-size"&gt;dot-size &lt;/option
2417 &gt;&lt;option value="dot-line"&gt;dot-line &lt;/option
2418 &gt;&lt;option value="line"&gt;line &lt;/option
2419 &gt;&lt;option value="grid"&gt;grid &lt;/option
2420 &gt;&lt;option value="surface" selected&gt;surface &lt;/option&gt;&lt;/select
2421 &gt;
2422 &lt;/td&gt;
2423 &lt;/tr&gt;
2424
2425 &lt;tr&gt;
2426 &lt;td&gt;showAnimationControls&lt;/td&gt;
2427 &lt;td&gt;
2428 &lt;input type="checkbox" id="showAnimationControls" checked /&gt;
2429 &lt;/td&gt;
2430 &lt;/tr&gt;
2431 &lt;tr&gt;
2432 &lt;td&gt;showGrid&lt;/td&gt;
2433 &lt;td&gt;&lt;input type="checkbox" id="showGrid" checked /&gt;&lt;/td&gt;
2434 &lt;/tr&gt;
2435 &lt;tr&gt;
2436 &lt;td&gt;showXAxis&lt;/td&gt;
2437 &lt;td&gt;&lt;input type="checkbox" id="showXAxis" checked /&gt;&lt;/td&gt;
2438 &lt;/tr&gt;
2439 &lt;tr&gt;
2440 &lt;td&gt;showYAxis&lt;/td&gt;
2441 &lt;td&gt;&lt;input type="checkbox" id="showYAxis" checked /&gt;&lt;/td&gt;
2442 &lt;/tr&gt;
2443 &lt;tr&gt;
2444 &lt;td&gt;showZAxis&lt;/td&gt;
2445 &lt;td&gt;&lt;input type="checkbox" id="showZAxis" checked /&gt;&lt;/td&gt;
2446 &lt;/tr&gt;
2447
2448 &lt;tr&gt;
2449 &lt;td&gt;showPerspective&lt;/td&gt;
2450 &lt;td&gt;&lt;input type="checkbox" id="showPerspective" checked /&gt;&lt;/td&gt;
2451 &lt;/tr&gt;
2452 &lt;tr&gt;
2453 &lt;td&gt;showLegend&lt;/td&gt;
2454 &lt;td&gt;&lt;input type="checkbox" id="showLegend" checked /&gt;&lt;/td&gt;
2455 &lt;/tr&gt;
2456 &lt;tr&gt;
2457 &lt;td&gt;showShadow&lt;/td&gt;
2458 &lt;td&gt;&lt;input type="checkbox" id="showShadow" /&gt;&lt;/td&gt;
2459 &lt;/tr&gt;
2460
2461 &lt;tr&gt;
2462 &lt;td&gt;keepAspectRatio&lt;/td&gt;
2463 &lt;td&gt;&lt;input type="checkbox" id="keepAspectRatio" checked /&gt;&lt;/td&gt;
2464 &lt;/tr&gt;
2465 &lt;tr&gt;
2466 &lt;td&gt;verticalRatio&lt;/td&gt;
2467 &lt;td&gt;
2468 &lt;input type="text" id="verticalRatio" value="0.5" /&gt;
2469 &lt;span class="info"&gt;a value between 0.1 and 1.0&lt;/span&gt;
2470 &lt;/td&gt;
2471 &lt;/tr&gt;
2472
2473 &lt;tr&gt;
2474 &lt;td&gt;animationInterval&lt;/td&gt;
2475 &lt;td&gt;
2476 &lt;input type="text" id="animationInterval" value="1000" /&gt;
2477 &lt;span class="info"&gt;in milliseconds&lt;/span&gt;
2478 &lt;/td&gt;
2479 &lt;/tr&gt;
2480 &lt;tr&gt;
2481 &lt;td&gt;animationPreload&lt;/td&gt;
2482 &lt;td&gt;&lt;input type="checkbox" id="animationPreload" /&gt;&lt;/td&gt;
2483 &lt;/tr&gt;
2484 &lt;tr&gt;
2485 &lt;td&gt;animationAutoStart&lt;/td&gt;
2486 &lt;td&gt;&lt;input type="checkbox" id="animationAutoStart" /&gt;&lt;/td&gt;
2487 &lt;/tr&gt;
2488
2489 &lt;tr&gt;
2490 &lt;td&gt;xCenter&lt;/td&gt;
2491 &lt;td&gt;&lt;input type="text" id="xCenter" value="55%" /&gt;&lt;/td&gt;
2492 &lt;/tr&gt;
2493 &lt;tr&gt;
2494 &lt;td&gt;yCenter&lt;/td&gt;
2495 &lt;td&gt;&lt;input type="text" id="yCenter" value="45%" /&gt;&lt;/td&gt;
2496 &lt;/tr&gt;
2497
2498 &lt;tr&gt;
2499 &lt;td&gt;xMin&lt;/td&gt;
2500 &lt;td&gt;&lt;input type="text" id="xMin" /&gt;&lt;/td&gt;
2501 &lt;/tr&gt;
2502 &lt;tr&gt;
2503 &lt;td&gt;xMax&lt;/td&gt;
2504 &lt;td&gt;&lt;input type="text" id="xMax" /&gt;&lt;/td&gt;
2505 &lt;/tr&gt;
2506 &lt;tr&gt;
2507 &lt;td&gt;xStep&lt;/td&gt;
2508 &lt;td&gt;&lt;input type="text" id="xStep" /&gt;&lt;/td&gt;
2509 &lt;/tr&gt;
2510
2511 &lt;tr&gt;
2512 &lt;td&gt;yMin&lt;/td&gt;
2513 &lt;td&gt;&lt;input type="text" id="yMin" /&gt;&lt;/td&gt;
2514 &lt;/tr&gt;
2515 &lt;tr&gt;
2516 &lt;td&gt;yMax&lt;/td&gt;
2517 &lt;td&gt;&lt;input type="text" id="yMax" /&gt;&lt;/td&gt;
2518 &lt;/tr&gt;
2519 &lt;tr&gt;
2520 &lt;td&gt;yStep&lt;/td&gt;
2521 &lt;td&gt;&lt;input type="text" id="yStep" /&gt;&lt;/td&gt;
2522 &lt;/tr&gt;
2523
2524 &lt;tr&gt;
2525 &lt;td&gt;zMin&lt;/td&gt;
2526 &lt;td&gt;&lt;input type="text" id="zMin" /&gt;&lt;/td&gt;
2527 &lt;/tr&gt;
2528 &lt;tr&gt;
2529 &lt;td&gt;zMax&lt;/td&gt;
2530 &lt;td&gt;&lt;input type="text" id="zMax" /&gt;&lt;/td&gt;
2531 &lt;/tr&gt;
2532 &lt;tr&gt;
2533 &lt;td&gt;zStep&lt;/td&gt;
2534 &lt;td&gt;&lt;input type="text" id="zStep" /&gt;&lt;/td&gt;
2535 &lt;/tr&gt;
2536
2537 &lt;tr&gt;
2538 &lt;td&gt;valueMin&lt;/td&gt;
2539 &lt;td&gt;&lt;input type="text" id="valueMin" /&gt;&lt;/td&gt;
2540 &lt;/tr&gt;
2541 &lt;tr&gt;
2542 &lt;td&gt;valueMax&lt;/td&gt;
2543 &lt;td&gt;&lt;input type="text" id="valueMax" /&gt;&lt;/td&gt;
2544 &lt;/tr&gt;
2545
2546 &lt;tr&gt;
2547 &lt;td&gt;xBarWidth&lt;/td&gt;
2548 &lt;td&gt;&lt;input type="text" id="xBarWidth" /&gt;&lt;/td&gt;
2549 &lt;/tr&gt;
2550 &lt;tr&gt;
2551 &lt;td&gt;yBarWidth&lt;/td&gt;
2552 &lt;td&gt;&lt;input type="text" id="yBarWidth" /&gt;&lt;/td&gt;
2553 &lt;/tr&gt;
2554
2555 &lt;tr&gt;
2556 &lt;td&gt;xLabel&lt;/td&gt;
2557 &lt;td&gt;&lt;input type="text" id="xLabel" value="x" /&gt;&lt;/td&gt;
2558 &lt;/tr&gt;
2559 &lt;tr&gt;
2560 &lt;td&gt;yLabel&lt;/td&gt;
2561 &lt;td&gt;&lt;input type="text" id="yLabel" value="y" /&gt;&lt;/td&gt;
2562 &lt;/tr&gt;
2563 &lt;tr&gt;
2564 &lt;td&gt;zLabel&lt;/td&gt;
2565 &lt;td&gt;&lt;input type="text" id="zLabel" value="z" /&gt;&lt;/td&gt;
2566 &lt;/tr&gt;
2567 &lt;tr&gt;
2568 &lt;td&gt;filterLabel&lt;/td&gt;
2569 &lt;td&gt;&lt;input type="text" id="filterLabel" value="time" /&gt;&lt;/td&gt;
2570 &lt;/tr&gt;
2571 &lt;tr&gt;
2572 &lt;td&gt;legendLabel&lt;/td&gt;
2573 &lt;td&gt;&lt;input type="text" id="legendLabel" value="value" /&gt;&lt;/td&gt;
2574 &lt;/tr&gt;
2575 &lt;/tbody&gt;
2576 &lt;/table&gt;
2577 &lt;/td&gt;
2578 &lt;/tr&gt;
2579 &lt;/tbody&gt;
2580&lt;/table&gt;
2581'
2582 /><input
2583 type="hidden"
2584 name="resources"
2585 value="https://visjs.github.io/vis-graph3d/examples/graph3d/playground/playground.css,https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js,https://visjs.github.io/vis-graph3d/examples/graph3d/playground/playground.js,https://visjs.github.io/vis-graph3d/examples/graph3d/playground/csv2array.js"
2586 /><input type="hidden" name="wrap" value="b" /><input
2587 type="hidden"
2588 name="title"
2589 value="Graph 3D | Playground"
2590 />
2591 </form>
2592
2593 <form
2594 action="https://codepen.io/pen/define"
2595 method="post"
2596 target="_blank"
2597 >
2598 <button class="icon codepen" alt="CodePen" title="CodePen">
2599 &#xA0;</button
2600 ><input
2601 type="hidden"
2602 name="data"
2603 value='{"css":"","css_external":"https://visjs.github.io/vis-graph3d/examples/graph3d/playground/playground.css","html":"&lt;h1&gt;Graph 3D - Playground&lt;/h1&gt;\n\n&lt;table style=\"width:100%;\"&gt;\n &lt;colgroup&gt;\n &lt;col width=\"50%\" /&gt;\n &lt;col width=\"50%\" /&gt;\n &lt;/colgroup&gt;\n &lt;tbody&gt;\n &lt;tr&gt;\n &lt;td&gt;\n &lt;h2&gt;Data&lt;/h2&gt;\n &lt;p&gt;\n Graph 3D expects a data table with first three to five columns: colums\n &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;z&lt;/code&gt; (optional),\n &lt;code&gt;style&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt; (optional).\n &lt;/p&gt;\n\n &lt;table&gt;\n &lt;tbody&gt;\n &lt;tr&gt;\n &lt;td style=\"white-space: nowrap\"&gt;\n &lt;input\n type=\"radio\"\n name=\"datatype\"\n id=\"datatypeCsv\"\n onclick=\"selectDataType();\"\n checked\n value=\"csv\"\n /&gt;Csv\n &lt;/td&gt;\n &lt;td&gt;\n &lt;div id=\"csv\"&gt;\n &lt;textarea id=\"csvTextarea\"&gt;&lt;/textarea&gt;\n &lt;p&gt;\n &lt;a\n href=\"javascript: loadCsvExample();\"\n title=\"Load an example\"\n &gt;Simple example&lt;/a\n &gt;\n &lt;a\n href=\"javascript: loadCsvLineExample();\"\n title=\"Load an example\"\n &gt;Line example&lt;/a\n &gt;\n &lt;a\n href=\"javascript: loadCsvAnimationExample();\"\n title=\"Load an example\"\n &gt;Animation example&lt;/a\n &gt;\n &lt;a\n href=\"javascript: loadCsvMovingDotsExample();\"\n title=\"Load an example\"\n &gt;Moving dots example&lt;/a\n &gt;\n &lt;a\n href=\"javascript: loadCsvColoredDotsExample();\"\n title=\"Load an example\"\n &gt;Colored dots example&lt;/a\n &gt;\n &lt;a\n href=\"javascript: loadCsvSizedDotsExample();\"\n title=\"Load an example\"\n &gt;Sized dots example&lt;/a\n &gt;\n &lt;/p&gt;\n &lt;/div&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;!-- TODO: add JSON examples --&gt;\n &lt;/tbody&gt;\n &lt;/table&gt;\n\n &lt;br /&gt;\n &lt;/td&gt;\n &lt;td rowspan=\"2\"&gt;\n &lt;h2&gt;Graph&lt;/h2&gt;\n &lt;p&gt;\n &lt;input type=\"button\" value=\"Draw graph\" onclick=\"draw();\" id=\"draw\" /&gt;\n &lt;/p&gt;\n\n &lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;\n &lt;h2&gt;Options&lt;/h2&gt;\n\n &lt;table&gt;\n &lt;tbody&gt;\n &lt;tr&gt;\n &lt;th&gt;Option&lt;/th&gt;\n &lt;th&gt;Value&lt;/th&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;width&lt;/td&gt;\n &lt;td&gt;\n &lt;input type=\"text\" id=\"width\" value=\"100%\" /&gt;\n &lt;span class=\"info\"\n &gt;for example &amp;quot;500px&amp;quot; or &amp;quot;100%&amp;quot;&lt;/span\n &gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;height&lt;/td&gt;\n &lt;td&gt;\n &lt;input type=\"text\" id=\"height\" value=\"100%\" /&gt;\n &lt;span class=\"info\"\n &gt;for example &amp;quot;500px&amp;quot; or &amp;quot;100%&amp;quot;&lt;/span\n &gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;style&lt;/td&gt;\n &lt;td&gt;\n &lt;select id=\"style\"&gt;\n &lt;option value=\"bar\"&gt;bar &lt;/option\n &gt;&lt;option value=\"bar-color\"&gt;bar-color &lt;/option\n &gt;&lt;option value=\"bar-size\"&gt;bar-size &lt;/option\n &gt;&lt;option value=\"dot\"&gt;dot &lt;/option\n &gt;&lt;option value=\"dot-color\"&gt;dot-color &lt;/option\n &gt;&lt;option value=\"dot-size\"&gt;dot-size &lt;/option\n &gt;&lt;option value=\"dot-line\"&gt;dot-line &lt;/option\n &gt;&lt;option value=\"line\"&gt;line &lt;/option\n &gt;&lt;option value=\"grid\"&gt;grid &lt;/option\n &gt;&lt;option value=\"surface\" selected&gt;surface &lt;/option&gt;&lt;/select\n &gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;showAnimationControls&lt;/td&gt;\n &lt;td&gt;\n &lt;input type=\"checkbox\" id=\"showAnimationControls\" checked /&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;showGrid&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showGrid\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;showXAxis&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showXAxis\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;showYAxis&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showYAxis\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;showZAxis&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showZAxis\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;showPerspective&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showPerspective\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;showLegend&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showLegend\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;showShadow&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"showShadow\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;keepAspectRatio&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"keepAspectRatio\" checked /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;verticalRatio&lt;/td&gt;\n &lt;td&gt;\n &lt;input type=\"text\" id=\"verticalRatio\" value=\"0.5\" /&gt;\n &lt;span class=\"info\"&gt;a value between 0.1 and 1.0&lt;/span&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;animationInterval&lt;/td&gt;\n &lt;td&gt;\n &lt;input type=\"text\" id=\"animationInterval\" value=\"1000\" /&gt;\n &lt;span class=\"info\"&gt;in milliseconds&lt;/span&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;animationPreload&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"animationPreload\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;animationAutoStart&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"checkbox\" id=\"animationAutoStart\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;xCenter&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"xCenter\" value=\"55%\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;yCenter&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"yCenter\" value=\"45%\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;xMin&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"xMin\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;xMax&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"xMax\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;xStep&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"xStep\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;yMin&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"yMin\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;yMax&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"yMax\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;yStep&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"yStep\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;zMin&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"zMin\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;zMax&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"zMax\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;zStep&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"zStep\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;valueMin&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"valueMin\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;valueMax&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"valueMax\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;xBarWidth&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"xBarWidth\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;yBarWidth&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"yBarWidth\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td&gt;xLabel&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"xLabel\" value=\"x\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;yLabel&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"yLabel\" value=\"y\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;zLabel&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"zLabel\" value=\"z\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;filterLabel&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"filterLabel\" value=\"time\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;tr&gt;\n &lt;td&gt;legendLabel&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"text\" id=\"legendLabel\" value=\"value\" /&gt;&lt;/td&gt;\n &lt;/tr&gt;\n &lt;/tbody&gt;\n &lt;/table&gt;\n &lt;/td&gt;\n &lt;/tr&gt;\n &lt;/tbody&gt;\n&lt;/table&gt;\n","js":"// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // TODO\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n load();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js;https://visjs.github.io/vis-graph3d/examples/graph3d/playground/playground.js;https://visjs.github.io/vis-graph3d/examples/graph3d/playground/csv2array.js","title":"Graph 3D | Playground"}'
2604 /><input
2605 type="hidden"
2606 name="js"
2607 value='// Called when the Visualization API is loaded.
2608function drawVisualization() {
2609 // TODO
2610}
2611
2612window.addEventListener("load", () =&gt; {
2613 load();
2614});
2615'
2616 /><input type="hidden" name="css" value /><input
2617 type="hidden"
2618 name="html"
2619 value='&lt;h1&gt;Graph 3D - Playground&lt;/h1&gt;
2620
2621&lt;table style="width:100%;"&gt;
2622 &lt;colgroup&gt;
2623 &lt;col width="50%" /&gt;
2624 &lt;col width="50%" /&gt;
2625 &lt;/colgroup&gt;
2626 &lt;tbody&gt;
2627 &lt;tr&gt;
2628 &lt;td&gt;
2629 &lt;h2&gt;Data&lt;/h2&gt;
2630 &lt;p&gt;
2631 Graph 3D expects a data table with first three to five columns: colums
2632 &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;z&lt;/code&gt; (optional),
2633 &lt;code&gt;style&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt; (optional).
2634 &lt;/p&gt;
2635
2636 &lt;table&gt;
2637 &lt;tbody&gt;
2638 &lt;tr&gt;
2639 &lt;td style="white-space: nowrap"&gt;
2640 &lt;input
2641 type="radio"
2642 name="datatype"
2643 id="datatypeCsv"
2644 onclick="selectDataType();"
2645 checked
2646 value="csv"
2647 /&gt;Csv
2648 &lt;/td&gt;
2649 &lt;td&gt;
2650 &lt;div id="csv"&gt;
2651 &lt;textarea id="csvTextarea"&gt;&lt;/textarea&gt;
2652 &lt;p&gt;
2653 &lt;a
2654 href="javascript: loadCsvExample();"
2655 title="Load an example"
2656 &gt;Simple example&lt;/a
2657 &gt;
2658 &lt;a
2659 href="javascript: loadCsvLineExample();"
2660 title="Load an example"
2661 &gt;Line example&lt;/a
2662 &gt;
2663 &lt;a
2664 href="javascript: loadCsvAnimationExample();"
2665 title="Load an example"
2666 &gt;Animation example&lt;/a
2667 &gt;
2668 &lt;a
2669 href="javascript: loadCsvMovingDotsExample();"
2670 title="Load an example"
2671 &gt;Moving dots example&lt;/a
2672 &gt;
2673 &lt;a
2674 href="javascript: loadCsvColoredDotsExample();"
2675 title="Load an example"
2676 &gt;Colored dots example&lt;/a
2677 &gt;
2678 &lt;a
2679 href="javascript: loadCsvSizedDotsExample();"
2680 title="Load an example"
2681 &gt;Sized dots example&lt;/a
2682 &gt;
2683 &lt;/p&gt;
2684 &lt;/div&gt;
2685 &lt;/td&gt;
2686 &lt;/tr&gt;
2687 &lt;!-- TODO: add JSON examples --&gt;
2688 &lt;/tbody&gt;
2689 &lt;/table&gt;
2690
2691 &lt;br /&gt;
2692 &lt;/td&gt;
2693 &lt;td rowspan="2"&gt;
2694 &lt;h2&gt;Graph&lt;/h2&gt;
2695 &lt;p&gt;
2696 &lt;input type="button" value="Draw graph" onclick="draw();" id="draw" /&gt;
2697 &lt;/p&gt;
2698
2699 &lt;div id="mygraph"&gt;&lt;/div&gt;
2700 &lt;/td&gt;
2701 &lt;/tr&gt;
2702 &lt;tr&gt;
2703 &lt;td&gt;
2704 &lt;h2&gt;Options&lt;/h2&gt;
2705
2706 &lt;table&gt;
2707 &lt;tbody&gt;
2708 &lt;tr&gt;
2709 &lt;th&gt;Option&lt;/th&gt;
2710 &lt;th&gt;Value&lt;/th&gt;
2711 &lt;/tr&gt;
2712
2713 &lt;tr&gt;
2714 &lt;td&gt;width&lt;/td&gt;
2715 &lt;td&gt;
2716 &lt;input type="text" id="width" value="100%" /&gt;
2717 &lt;span class="info"
2718 &gt;for example &amp;quot;500px&amp;quot; or &amp;quot;100%&amp;quot;&lt;/span
2719 &gt;
2720 &lt;/td&gt;
2721 &lt;/tr&gt;
2722 &lt;tr&gt;
2723 &lt;td&gt;height&lt;/td&gt;
2724 &lt;td&gt;
2725 &lt;input type="text" id="height" value="100%" /&gt;
2726 &lt;span class="info"
2727 &gt;for example &amp;quot;500px&amp;quot; or &amp;quot;100%&amp;quot;&lt;/span
2728 &gt;
2729 &lt;/td&gt;
2730 &lt;/tr&gt;
2731 &lt;tr&gt;
2732 &lt;td&gt;style&lt;/td&gt;
2733 &lt;td&gt;
2734 &lt;select id="style"&gt;
2735 &lt;option value="bar"&gt;bar &lt;/option
2736 &gt;&lt;option value="bar-color"&gt;bar-color &lt;/option
2737 &gt;&lt;option value="bar-size"&gt;bar-size &lt;/option
2738 &gt;&lt;option value="dot"&gt;dot &lt;/option
2739 &gt;&lt;option value="dot-color"&gt;dot-color &lt;/option
2740 &gt;&lt;option value="dot-size"&gt;dot-size &lt;/option
2741 &gt;&lt;option value="dot-line"&gt;dot-line &lt;/option
2742 &gt;&lt;option value="line"&gt;line &lt;/option
2743 &gt;&lt;option value="grid"&gt;grid &lt;/option
2744 &gt;&lt;option value="surface" selected&gt;surface &lt;/option&gt;&lt;/select
2745 &gt;
2746 &lt;/td&gt;
2747 &lt;/tr&gt;
2748
2749 &lt;tr&gt;
2750 &lt;td&gt;showAnimationControls&lt;/td&gt;
2751 &lt;td&gt;
2752 &lt;input type="checkbox" id="showAnimationControls" checked /&gt;
2753 &lt;/td&gt;
2754 &lt;/tr&gt;
2755 &lt;tr&gt;
2756 &lt;td&gt;showGrid&lt;/td&gt;
2757 &lt;td&gt;&lt;input type="checkbox" id="showGrid" checked /&gt;&lt;/td&gt;
2758 &lt;/tr&gt;
2759 &lt;tr&gt;
2760 &lt;td&gt;showXAxis&lt;/td&gt;
2761 &lt;td&gt;&lt;input type="checkbox" id="showXAxis" checked /&gt;&lt;/td&gt;
2762 &lt;/tr&gt;
2763 &lt;tr&gt;
2764 &lt;td&gt;showYAxis&lt;/td&gt;
2765 &lt;td&gt;&lt;input type="checkbox" id="showYAxis" checked /&gt;&lt;/td&gt;
2766 &lt;/tr&gt;
2767 &lt;tr&gt;
2768 &lt;td&gt;showZAxis&lt;/td&gt;
2769 &lt;td&gt;&lt;input type="checkbox" id="showZAxis" checked /&gt;&lt;/td&gt;
2770 &lt;/tr&gt;
2771
2772 &lt;tr&gt;
2773 &lt;td&gt;showPerspective&lt;/td&gt;
2774 &lt;td&gt;&lt;input type="checkbox" id="showPerspective" checked /&gt;&lt;/td&gt;
2775 &lt;/tr&gt;
2776 &lt;tr&gt;
2777 &lt;td&gt;showLegend&lt;/td&gt;
2778 &lt;td&gt;&lt;input type="checkbox" id="showLegend" checked /&gt;&lt;/td&gt;
2779 &lt;/tr&gt;
2780 &lt;tr&gt;
2781 &lt;td&gt;showShadow&lt;/td&gt;
2782 &lt;td&gt;&lt;input type="checkbox" id="showShadow" /&gt;&lt;/td&gt;
2783 &lt;/tr&gt;
2784
2785 &lt;tr&gt;
2786 &lt;td&gt;keepAspectRatio&lt;/td&gt;
2787 &lt;td&gt;&lt;input type="checkbox" id="keepAspectRatio" checked /&gt;&lt;/td&gt;
2788 &lt;/tr&gt;
2789 &lt;tr&gt;
2790 &lt;td&gt;verticalRatio&lt;/td&gt;
2791 &lt;td&gt;
2792 &lt;input type="text" id="verticalRatio" value="0.5" /&gt;
2793 &lt;span class="info"&gt;a value between 0.1 and 1.0&lt;/span&gt;
2794 &lt;/td&gt;
2795 &lt;/tr&gt;
2796
2797 &lt;tr&gt;
2798 &lt;td&gt;animationInterval&lt;/td&gt;
2799 &lt;td&gt;
2800 &lt;input type="text" id="animationInterval" value="1000" /&gt;
2801 &lt;span class="info"&gt;in milliseconds&lt;/span&gt;
2802 &lt;/td&gt;
2803 &lt;/tr&gt;
2804 &lt;tr&gt;
2805 &lt;td&gt;animationPreload&lt;/td&gt;
2806 &lt;td&gt;&lt;input type="checkbox" id="animationPreload" /&gt;&lt;/td&gt;
2807 &lt;/tr&gt;
2808 &lt;tr&gt;
2809 &lt;td&gt;animationAutoStart&lt;/td&gt;
2810 &lt;td&gt;&lt;input type="checkbox" id="animationAutoStart" /&gt;&lt;/td&gt;
2811 &lt;/tr&gt;
2812
2813 &lt;tr&gt;
2814 &lt;td&gt;xCenter&lt;/td&gt;
2815 &lt;td&gt;&lt;input type="text" id="xCenter" value="55%" /&gt;&lt;/td&gt;
2816 &lt;/tr&gt;
2817 &lt;tr&gt;
2818 &lt;td&gt;yCenter&lt;/td&gt;
2819 &lt;td&gt;&lt;input type="text" id="yCenter" value="45%" /&gt;&lt;/td&gt;
2820 &lt;/tr&gt;
2821
2822 &lt;tr&gt;
2823 &lt;td&gt;xMin&lt;/td&gt;
2824 &lt;td&gt;&lt;input type="text" id="xMin" /&gt;&lt;/td&gt;
2825 &lt;/tr&gt;
2826 &lt;tr&gt;
2827 &lt;td&gt;xMax&lt;/td&gt;
2828 &lt;td&gt;&lt;input type="text" id="xMax" /&gt;&lt;/td&gt;
2829 &lt;/tr&gt;
2830 &lt;tr&gt;
2831 &lt;td&gt;xStep&lt;/td&gt;
2832 &lt;td&gt;&lt;input type="text" id="xStep" /&gt;&lt;/td&gt;
2833 &lt;/tr&gt;
2834
2835 &lt;tr&gt;
2836 &lt;td&gt;yMin&lt;/td&gt;
2837 &lt;td&gt;&lt;input type="text" id="yMin" /&gt;&lt;/td&gt;
2838 &lt;/tr&gt;
2839 &lt;tr&gt;
2840 &lt;td&gt;yMax&lt;/td&gt;
2841 &lt;td&gt;&lt;input type="text" id="yMax" /&gt;&lt;/td&gt;
2842 &lt;/tr&gt;
2843 &lt;tr&gt;
2844 &lt;td&gt;yStep&lt;/td&gt;
2845 &lt;td&gt;&lt;input type="text" id="yStep" /&gt;&lt;/td&gt;
2846 &lt;/tr&gt;
2847
2848 &lt;tr&gt;
2849 &lt;td&gt;zMin&lt;/td&gt;
2850 &lt;td&gt;&lt;input type="text" id="zMin" /&gt;&lt;/td&gt;
2851 &lt;/tr&gt;
2852 &lt;tr&gt;
2853 &lt;td&gt;zMax&lt;/td&gt;
2854 &lt;td&gt;&lt;input type="text" id="zMax" /&gt;&lt;/td&gt;
2855 &lt;/tr&gt;
2856 &lt;tr&gt;
2857 &lt;td&gt;zStep&lt;/td&gt;
2858 &lt;td&gt;&lt;input type="text" id="zStep" /&gt;&lt;/td&gt;
2859 &lt;/tr&gt;
2860
2861 &lt;tr&gt;
2862 &lt;td&gt;valueMin&lt;/td&gt;
2863 &lt;td&gt;&lt;input type="text" id="valueMin" /&gt;&lt;/td&gt;
2864 &lt;/tr&gt;
2865 &lt;tr&gt;
2866 &lt;td&gt;valueMax&lt;/td&gt;
2867 &lt;td&gt;&lt;input type="text" id="valueMax" /&gt;&lt;/td&gt;
2868 &lt;/tr&gt;
2869
2870 &lt;tr&gt;
2871 &lt;td&gt;xBarWidth&lt;/td&gt;
2872 &lt;td&gt;&lt;input type="text" id="xBarWidth" /&gt;&lt;/td&gt;
2873 &lt;/tr&gt;
2874 &lt;tr&gt;
2875 &lt;td&gt;yBarWidth&lt;/td&gt;
2876 &lt;td&gt;&lt;input type="text" id="yBarWidth" /&gt;&lt;/td&gt;
2877 &lt;/tr&gt;
2878
2879 &lt;tr&gt;
2880 &lt;td&gt;xLabel&lt;/td&gt;
2881 &lt;td&gt;&lt;input type="text" id="xLabel" value="x" /&gt;&lt;/td&gt;
2882 &lt;/tr&gt;
2883 &lt;tr&gt;
2884 &lt;td&gt;yLabel&lt;/td&gt;
2885 &lt;td&gt;&lt;input type="text" id="yLabel" value="y" /&gt;&lt;/td&gt;
2886 &lt;/tr&gt;
2887 &lt;tr&gt;
2888 &lt;td&gt;zLabel&lt;/td&gt;
2889 &lt;td&gt;&lt;input type="text" id="zLabel" value="z" /&gt;&lt;/td&gt;
2890 &lt;/tr&gt;
2891 &lt;tr&gt;
2892 &lt;td&gt;filterLabel&lt;/td&gt;
2893 &lt;td&gt;&lt;input type="text" id="filterLabel" value="time" /&gt;&lt;/td&gt;
2894 &lt;/tr&gt;
2895 &lt;tr&gt;
2896 &lt;td&gt;legendLabel&lt;/td&gt;
2897 &lt;td&gt;&lt;input type="text" id="legendLabel" value="value" /&gt;&lt;/td&gt;
2898 &lt;/tr&gt;
2899 &lt;/tbody&gt;
2900 &lt;/table&gt;
2901 &lt;/td&gt;
2902 &lt;/tr&gt;
2903 &lt;/tbody&gt;
2904&lt;/table&gt;
2905'
2906 /></form
2907 ></span>
2908 </div>
2909 <a href="graph3d/playground/index.html"
2910 ><div class="example-image">
2911 <img
2912 src="thumbnails/abd84ceb6894a84b569ea940d4831358492f11253c022f11e43b1014a7992ddf.png"
2913 alt="Playground"
2914 /></div></a></span
2915 ><span class="example-link"
2916 ><div>
2917 <a href="graph3d/10_styling.html">Styling</a
2918 ><span class="playgrounds"
2919 ><form
2920 action="http://jsfiddle.net/api/post/library/pure/"
2921 method="post"
2922 target="_blank"
2923 >
2924 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
2925 &#xA0;</button
2926 ><input
2927 type="hidden"
2928 name="js"
2929 value='var data = null;
2930var graph = null;
2931
2932function custom(x, y) {
2933 return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;
2934}
2935
2936// Called when the Visualization API is loaded.
2937function drawVisualization() {
2938 var style = document.getElementById("style").value;
2939 var showPerspective = document.getElementById("perspective").checked;
2940 var xBarWidth =
2941 parseFloat(document.getElementById("xBarWidth").value) || undefined;
2942 var yBarWidth =
2943 parseFloat(document.getElementById("yBarWidth").value) || undefined;
2944 var withValue =
2945 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
2946
2947 // Create and populate a data table.
2948 data = [];
2949
2950 // create some nice looking data with sin/cos
2951 var steps = 5; // number of datapoints will be steps*steps
2952 var axisMax = 10;
2953 var axisStep = axisMax / steps;
2954 for (var x = 0; x &lt;= axisMax; x += axisStep) {
2955 for (var y = 0; y &lt;= axisMax; y += axisStep) {
2956 var z = custom(x, y);
2957 if (withValue) {
2958 var value = y - x;
2959 data.push({ x: x, y: y, z: z, style: value });
2960 } else {
2961 data.push({ x: x, y: y, z: z });
2962 }
2963 }
2964 }
2965
2966 // specify options
2967 var options = {
2968 width: "600px",
2969 height: "600px",
2970 style: style,
2971 xBarWidth: xBarWidth,
2972 yBarWidth: yBarWidth,
2973 showPerspective: showPerspective,
2974 showGrid: true,
2975 showShadow: false,
2976 keepAspectRatio: true,
2977 verticalRatio: 0.5
2978 };
2979
2980 var camera = graph ? graph.getCameraPosition() : null;
2981
2982 // create our graph
2983 var container = document.getElementById("mygraph");
2984 graph = new vis.Graph3d(container, data, options);
2985
2986 if (camera) graph.setCameraPosition(camera); // restore camera position
2987
2988 document.getElementById("style").onchange = drawVisualization;
2989 document.getElementById("perspective").onchange = drawVisualization;
2990 document.getElementById("xBarWidth").onchange = drawVisualization;
2991 document.getElementById("yBarWidth").onchange = drawVisualization;
2992}
2993
2994window.addEventListener("load", () =&gt; {
2995 drawVisualization();
2996});
2997'
2998 /><input
2999 type="hidden"
3000 name="css"
3001 value="body {
3002 font: 10pt arial;
3003}
3004"
3005 /><input
3006 type="hidden"
3007 name="html"
3008 value='&lt;p&gt;
3009 &lt;label for="style"&gt;
3010 Style:
3011 &lt;select id="style"&gt;
3012 &lt;option value="bar"&gt;bar&lt;/option&gt;
3013 &lt;option value="bar-color"&gt;bar-color&lt;/option&gt;
3014 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
3015
3016 &lt;option value="dot"&gt;dot&lt;/option&gt;
3017 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
3018 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
3019 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
3020
3021 &lt;option value="grid"&gt;grid&lt;/option&gt;
3022 &lt;option value="line"&gt;line&lt;/option&gt;
3023 &lt;option value="surface"&gt;surface&lt;/option&gt;
3024 &lt;/select&gt;
3025 &lt;/label&gt;
3026&lt;/p&gt;
3027
3028&lt;p&gt;
3029 &lt;label for="perspective"&gt;
3030 &lt;input type="checkbox" id="perspective" checked /&gt; Show perspective
3031 &lt;/label&gt;
3032&lt;/p&gt;
3033
3034&lt;p&gt;
3035 &lt;label for="xBarWidth"&gt;
3036 Bar width X:
3037 &lt;input type="text" id="xBarWidth" value style="width:50px;" /&gt; (only
3038 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3039 &lt;/label&gt;
3040&lt;/p&gt;
3041&lt;p&gt;
3042 &lt;label for="yBarWidth"&gt;
3043 Bar width Y:
3044 &lt;input type="text" id="yBarWidth" value style="width:50px;" /&gt; (only
3045 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3046 &lt;/label&gt;
3047&lt;/p&gt;
3048
3049&lt;div id="mygraph"&gt;&lt;/div&gt;
3050
3051&lt;div id="info"&gt;&lt;/div&gt;
3052'
3053 /><input
3054 type="hidden"
3055 name="resources"
3056 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
3057 /><input type="hidden" name="wrap" value="b" /><input
3058 type="hidden"
3059 name="title"
3060 value="Graph 3D | Styling"
3061 />
3062 </form>
3063
3064 <form
3065 action="https://codepen.io/pen/define"
3066 method="post"
3067 target="_blank"
3068 >
3069 <button class="icon codepen" alt="CodePen" title="CodePen">
3070 &#xA0;</button
3071 ><input
3072 type="hidden"
3073 name="data"
3074 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;p&gt;\n &lt;label for=\"style\"&gt;\n Style:\n &lt;select id=\"style\"&gt;\n &lt;option value=\"bar\"&gt;bar&lt;/option&gt;\n &lt;option value=\"bar-color\"&gt;bar-color&lt;/option&gt;\n &lt;option value=\"bar-size\"&gt;bar-size&lt;/option&gt;\n\n &lt;option value=\"dot\"&gt;dot&lt;/option&gt;\n &lt;option value=\"dot-line\"&gt;dot-line&lt;/option&gt;\n &lt;option value=\"dot-color\"&gt;dot-color&lt;/option&gt;\n &lt;option value=\"dot-size\"&gt;dot-size&lt;/option&gt;\n\n &lt;option value=\"grid\"&gt;grid&lt;/option&gt;\n &lt;option value=\"line\"&gt;line&lt;/option&gt;\n &lt;option value=\"surface\"&gt;surface&lt;/option&gt;\n &lt;/select&gt;\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;p&gt;\n &lt;label for=\"perspective\"&gt;\n &lt;input type=\"checkbox\" id=\"perspective\" checked /&gt; Show perspective\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;p&gt;\n &lt;label for=\"xBarWidth\"&gt;\n Bar width X:\n &lt;input type=\"text\" id=\"xBarWidth\" value style=\"width:50px;\" /&gt; (only\n applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)\n &lt;/label&gt;\n&lt;/p&gt;\n&lt;p&gt;\n &lt;label for=\"yBarWidth\"&gt;\n Bar width Y:\n &lt;input type=\"text\" id=\"yBarWidth\" value style=\"width:50px;\" /&gt; (only\n applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n var style = document.getElementById(\"style\").value;\n var showPerspective = document.getElementById(\"perspective\").checked;\n var xBarWidth =\n parseFloat(document.getElementById(\"xBarWidth\").value) || undefined;\n var yBarWidth =\n parseFloat(document.getElementById(\"yBarWidth\").value) || undefined;\n var withValue =\n [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\n\n // Create and populate a data table.\n data = [];\n\n // create some nice looking data with sin/cos\n var steps = 5; // number of datapoints will be steps*steps\n var axisMax = 10;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt;= axisMax; x += axisStep) {\n for (var y = 0; y &lt;= axisMax; y += axisStep) {\n var z = custom(x, y);\n if (withValue) {\n var value = y - x;\n data.push({ x: x, y: y, z: z, style: value });\n } else {\n data.push({ x: x, y: y, z: z });\n }\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: style,\n xBarWidth: xBarWidth,\n yBarWidth: yBarWidth,\n showPerspective: showPerspective,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5\n };\n\n var camera = graph ? graph.getCameraPosition() : null;\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n\n if (camera) graph.setCameraPosition(camera); // restore camera position\n\n document.getElementById(\"style\").onchange = drawVisualization;\n document.getElementById(\"perspective\").onchange = drawVisualization;\n document.getElementById(\"xBarWidth\").onchange = drawVisualization;\n document.getElementById(\"yBarWidth\").onchange = drawVisualization;\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Styling"}'
3075 /><input
3076 type="hidden"
3077 name="js"
3078 value='var data = null;
3079var graph = null;
3080
3081function custom(x, y) {
3082 return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;
3083}
3084
3085// Called when the Visualization API is loaded.
3086function drawVisualization() {
3087 var style = document.getElementById("style").value;
3088 var showPerspective = document.getElementById("perspective").checked;
3089 var xBarWidth =
3090 parseFloat(document.getElementById("xBarWidth").value) || undefined;
3091 var yBarWidth =
3092 parseFloat(document.getElementById("yBarWidth").value) || undefined;
3093 var withValue =
3094 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
3095
3096 // Create and populate a data table.
3097 data = [];
3098
3099 // create some nice looking data with sin/cos
3100 var steps = 5; // number of datapoints will be steps*steps
3101 var axisMax = 10;
3102 var axisStep = axisMax / steps;
3103 for (var x = 0; x &lt;= axisMax; x += axisStep) {
3104 for (var y = 0; y &lt;= axisMax; y += axisStep) {
3105 var z = custom(x, y);
3106 if (withValue) {
3107 var value = y - x;
3108 data.push({ x: x, y: y, z: z, style: value });
3109 } else {
3110 data.push({ x: x, y: y, z: z });
3111 }
3112 }
3113 }
3114
3115 // specify options
3116 var options = {
3117 width: "600px",
3118 height: "600px",
3119 style: style,
3120 xBarWidth: xBarWidth,
3121 yBarWidth: yBarWidth,
3122 showPerspective: showPerspective,
3123 showGrid: true,
3124 showShadow: false,
3125 keepAspectRatio: true,
3126 verticalRatio: 0.5
3127 };
3128
3129 var camera = graph ? graph.getCameraPosition() : null;
3130
3131 // create our graph
3132 var container = document.getElementById("mygraph");
3133 graph = new vis.Graph3d(container, data, options);
3134
3135 if (camera) graph.setCameraPosition(camera); // restore camera position
3136
3137 document.getElementById("style").onchange = drawVisualization;
3138 document.getElementById("perspective").onchange = drawVisualization;
3139 document.getElementById("xBarWidth").onchange = drawVisualization;
3140 document.getElementById("yBarWidth").onchange = drawVisualization;
3141}
3142
3143window.addEventListener("load", () =&gt; {
3144 drawVisualization();
3145});
3146'
3147 /><input
3148 type="hidden"
3149 name="css"
3150 value="body {
3151 font: 10pt arial;
3152}
3153"
3154 /><input
3155 type="hidden"
3156 name="html"
3157 value='&lt;p&gt;
3158 &lt;label for="style"&gt;
3159 Style:
3160 &lt;select id="style"&gt;
3161 &lt;option value="bar"&gt;bar&lt;/option&gt;
3162 &lt;option value="bar-color"&gt;bar-color&lt;/option&gt;
3163 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
3164
3165 &lt;option value="dot"&gt;dot&lt;/option&gt;
3166 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
3167 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
3168 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
3169
3170 &lt;option value="grid"&gt;grid&lt;/option&gt;
3171 &lt;option value="line"&gt;line&lt;/option&gt;
3172 &lt;option value="surface"&gt;surface&lt;/option&gt;
3173 &lt;/select&gt;
3174 &lt;/label&gt;
3175&lt;/p&gt;
3176
3177&lt;p&gt;
3178 &lt;label for="perspective"&gt;
3179 &lt;input type="checkbox" id="perspective" checked /&gt; Show perspective
3180 &lt;/label&gt;
3181&lt;/p&gt;
3182
3183&lt;p&gt;
3184 &lt;label for="xBarWidth"&gt;
3185 Bar width X:
3186 &lt;input type="text" id="xBarWidth" value style="width:50px;" /&gt; (only
3187 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3188 &lt;/label&gt;
3189&lt;/p&gt;
3190&lt;p&gt;
3191 &lt;label for="yBarWidth"&gt;
3192 Bar width Y:
3193 &lt;input type="text" id="yBarWidth" value style="width:50px;" /&gt; (only
3194 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3195 &lt;/label&gt;
3196&lt;/p&gt;
3197
3198&lt;div id="mygraph"&gt;&lt;/div&gt;
3199
3200&lt;div id="info"&gt;&lt;/div&gt;
3201'
3202 /></form
3203 ></span>
3204 </div>
3205 <a href="graph3d/10_styling.html"
3206 ><div class="example-image">
3207 <img
3208 src="thumbnails/5692720dbea5649cf26f16fdee0735e311e3f2eaa6af7c9404b3a1fdb906fbe3.png"
3209 alt="Styling"
3210 /></div></a></span
3211 ><span class="example-link"
3212 ><div>
3213 <a href="graph3d/15_styling_per_point.html">Styling per Point</a
3214 ><span class="playgrounds"
3215 ><form
3216 action="http://jsfiddle.net/api/post/library/pure/"
3217 method="post"
3218 target="_blank"
3219 >
3220 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
3221 &#xA0;</button
3222 ><input
3223 type="hidden"
3224 name="js"
3225 value='var data = null;
3226var graph = null;
3227
3228function custom(x, y) {
3229 return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;
3230}
3231
3232// Called when the Visualization API is loaded.
3233function drawVisualization() {
3234 var style = document.getElementById("style").value;
3235 var showPerspective = document.getElementById("perspective").checked;
3236 var xBarWidth =
3237 parseFloat(document.getElementById("xBarWidth").value) || undefined;
3238 var yBarWidth =
3239 parseFloat(document.getElementById("yBarWidth").value) || undefined;
3240 var withValue =
3241 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
3242
3243 // Create and populate a data table.
3244 data = [];
3245 colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];
3246
3247 // create some nice looking data with sin/cos
3248 var steps = 7; // number of datapoints will be steps*steps
3249 var axisMax = 12;
3250 var axisStep = axisMax / steps;
3251 for (var x = 0; x &lt;= axisMax; x += axisStep) {
3252 for (var y = 0; y &lt;= axisMax; y += axisStep) {
3253 var z = custom(x, y);
3254 if (withValue) {
3255 data.push({
3256 x: x,
3257 y: y,
3258 z: z,
3259 style: {
3260 fill: colors[x / axisStep],
3261 stroke: "#999"
3262 }
3263 });
3264 } else {
3265 data.push({ x: x, y: y, z: z });
3266 }
3267 }
3268 }
3269
3270 // specify options
3271 var options = {
3272 width: "600px",
3273 height: "600px",
3274 style: style,
3275 xBarWidth: xBarWidth,
3276 yBarWidth: yBarWidth,
3277 showPerspective: showPerspective,
3278 showGrid: true,
3279 showShadow: false,
3280 keepAspectRatio: true,
3281 verticalRatio: 0.5
3282 };
3283
3284 var camera = graph ? graph.getCameraPosition() : null;
3285
3286 // create our graph
3287 var container = document.getElementById("mygraph");
3288 graph = new vis.Graph3d(container, data, options);
3289
3290 if (camera) graph.setCameraPosition(camera); // restore camera position
3291
3292 document.getElementById("style").onchange = drawVisualization;
3293 document.getElementById("perspective").onchange = drawVisualization;
3294 document.getElementById("xBarWidth").onchange = drawVisualization;
3295 document.getElementById("yBarWidth").onchange = drawVisualization;
3296}
3297
3298window.addEventListener("load", () =&gt; {
3299 drawVisualization();
3300});
3301'
3302 /><input
3303 type="hidden"
3304 name="css"
3305 value="body {
3306 font: 10pt arial;
3307}
3308"
3309 /><input
3310 type="hidden"
3311 name="html"
3312 value='&lt;p&gt;
3313 &lt;label for="style"&gt;
3314 Style:
3315 &lt;select id="style"&gt;
3316 &lt;option value="bar"&gt;bar&lt;/option&gt;
3317 &lt;option value="bar-color" selected&gt;bar-color&lt;/option&gt;
3318 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
3319
3320 &lt;option value="dot"&gt;dot&lt;/option&gt;
3321 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
3322 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
3323 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
3324
3325 &lt;option value="grid"&gt;grid&lt;/option&gt;
3326 &lt;option value="line"&gt;line&lt;/option&gt;
3327 &lt;option value="surface"&gt;surface&lt;/option&gt;
3328 &lt;/select&gt;
3329 &lt;/label&gt;
3330&lt;/p&gt;
3331
3332&lt;p&gt;
3333 &lt;label for="perspective"&gt;
3334 &lt;input type="checkbox" id="perspective" checked /&gt; Show perspective
3335 &lt;/label&gt;
3336&lt;/p&gt;
3337
3338&lt;p&gt;
3339 &lt;label for="xBarWidth"&gt;
3340 Bar width X:
3341 &lt;input type="text" id="xBarWidth" value style="width:50px;" /&gt; (only
3342 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3343 &lt;/label&gt;
3344&lt;/p&gt;
3345&lt;p&gt;
3346 &lt;label for="yBarWidth"&gt;
3347 Bar width Y:
3348 &lt;input type="text" id="yBarWidth" value style="width:50px;" /&gt; (only
3349 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3350 &lt;/label&gt;
3351&lt;/p&gt;
3352
3353&lt;div id="mygraph"&gt;&lt;/div&gt;
3354
3355&lt;div id="info"&gt;&lt;/div&gt;
3356'
3357 /><input
3358 type="hidden"
3359 name="resources"
3360 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
3361 /><input type="hidden" name="wrap" value="b" /><input
3362 type="hidden"
3363 name="title"
3364 value="Graph 3D | Styling per Point"
3365 />
3366 </form>
3367
3368 <form
3369 action="https://codepen.io/pen/define"
3370 method="post"
3371 target="_blank"
3372 >
3373 <button class="icon codepen" alt="CodePen" title="CodePen">
3374 &#xA0;</button
3375 ><input
3376 type="hidden"
3377 name="data"
3378 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;p&gt;\n &lt;label for=\"style\"&gt;\n Style:\n &lt;select id=\"style\"&gt;\n &lt;option value=\"bar\"&gt;bar&lt;/option&gt;\n &lt;option value=\"bar-color\" selected&gt;bar-color&lt;/option&gt;\n &lt;option value=\"bar-size\"&gt;bar-size&lt;/option&gt;\n\n &lt;option value=\"dot\"&gt;dot&lt;/option&gt;\n &lt;option value=\"dot-line\"&gt;dot-line&lt;/option&gt;\n &lt;option value=\"dot-color\"&gt;dot-color&lt;/option&gt;\n &lt;option value=\"dot-size\"&gt;dot-size&lt;/option&gt;\n\n &lt;option value=\"grid\"&gt;grid&lt;/option&gt;\n &lt;option value=\"line\"&gt;line&lt;/option&gt;\n &lt;option value=\"surface\"&gt;surface&lt;/option&gt;\n &lt;/select&gt;\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;p&gt;\n &lt;label for=\"perspective\"&gt;\n &lt;input type=\"checkbox\" id=\"perspective\" checked /&gt; Show perspective\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;p&gt;\n &lt;label for=\"xBarWidth\"&gt;\n Bar width X:\n &lt;input type=\"text\" id=\"xBarWidth\" value style=\"width:50px;\" /&gt; (only\n applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)\n &lt;/label&gt;\n&lt;/p&gt;\n&lt;p&gt;\n &lt;label for=\"yBarWidth\"&gt;\n Bar width Y:\n &lt;input type=\"text\" id=\"yBarWidth\" value style=\"width:50px;\" /&gt; (only\n applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n var style = document.getElementById(\"style\").value;\n var showPerspective = document.getElementById(\"perspective\").checked;\n var xBarWidth =\n parseFloat(document.getElementById(\"xBarWidth\").value) || undefined;\n var yBarWidth =\n parseFloat(document.getElementById(\"yBarWidth\").value) || undefined;\n var withValue =\n [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\n\n // Create and populate a data table.\n data = [];\n colors = [\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"];\n\n // create some nice looking data with sin/cos\n var steps = 7; // number of datapoints will be steps*steps\n var axisMax = 12;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt;= axisMax; x += axisStep) {\n for (var y = 0; y &lt;= axisMax; y += axisStep) {\n var z = custom(x, y);\n if (withValue) {\n data.push({\n x: x,\n y: y,\n z: z,\n style: {\n fill: colors[x / axisStep],\n stroke: \"#999\"\n }\n });\n } else {\n data.push({ x: x, y: y, z: z });\n }\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: style,\n xBarWidth: xBarWidth,\n yBarWidth: yBarWidth,\n showPerspective: showPerspective,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5\n };\n\n var camera = graph ? graph.getCameraPosition() : null;\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n\n if (camera) graph.setCameraPosition(camera); // restore camera position\n\n document.getElementById(\"style\").onchange = drawVisualization;\n document.getElementById(\"perspective\").onchange = drawVisualization;\n document.getElementById(\"xBarWidth\").onchange = drawVisualization;\n document.getElementById(\"yBarWidth\").onchange = drawVisualization;\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Styling per Point"}'
3379 /><input
3380 type="hidden"
3381 name="js"
3382 value='var data = null;
3383var graph = null;
3384
3385function custom(x, y) {
3386 return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;
3387}
3388
3389// Called when the Visualization API is loaded.
3390function drawVisualization() {
3391 var style = document.getElementById("style").value;
3392 var showPerspective = document.getElementById("perspective").checked;
3393 var xBarWidth =
3394 parseFloat(document.getElementById("xBarWidth").value) || undefined;
3395 var yBarWidth =
3396 parseFloat(document.getElementById("yBarWidth").value) || undefined;
3397 var withValue =
3398 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
3399
3400 // Create and populate a data table.
3401 data = [];
3402 colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];
3403
3404 // create some nice looking data with sin/cos
3405 var steps = 7; // number of datapoints will be steps*steps
3406 var axisMax = 12;
3407 var axisStep = axisMax / steps;
3408 for (var x = 0; x &lt;= axisMax; x += axisStep) {
3409 for (var y = 0; y &lt;= axisMax; y += axisStep) {
3410 var z = custom(x, y);
3411 if (withValue) {
3412 data.push({
3413 x: x,
3414 y: y,
3415 z: z,
3416 style: {
3417 fill: colors[x / axisStep],
3418 stroke: "#999"
3419 }
3420 });
3421 } else {
3422 data.push({ x: x, y: y, z: z });
3423 }
3424 }
3425 }
3426
3427 // specify options
3428 var options = {
3429 width: "600px",
3430 height: "600px",
3431 style: style,
3432 xBarWidth: xBarWidth,
3433 yBarWidth: yBarWidth,
3434 showPerspective: showPerspective,
3435 showGrid: true,
3436 showShadow: false,
3437 keepAspectRatio: true,
3438 verticalRatio: 0.5
3439 };
3440
3441 var camera = graph ? graph.getCameraPosition() : null;
3442
3443 // create our graph
3444 var container = document.getElementById("mygraph");
3445 graph = new vis.Graph3d(container, data, options);
3446
3447 if (camera) graph.setCameraPosition(camera); // restore camera position
3448
3449 document.getElementById("style").onchange = drawVisualization;
3450 document.getElementById("perspective").onchange = drawVisualization;
3451 document.getElementById("xBarWidth").onchange = drawVisualization;
3452 document.getElementById("yBarWidth").onchange = drawVisualization;
3453}
3454
3455window.addEventListener("load", () =&gt; {
3456 drawVisualization();
3457});
3458'
3459 /><input
3460 type="hidden"
3461 name="css"
3462 value="body {
3463 font: 10pt arial;
3464}
3465"
3466 /><input
3467 type="hidden"
3468 name="html"
3469 value='&lt;p&gt;
3470 &lt;label for="style"&gt;
3471 Style:
3472 &lt;select id="style"&gt;
3473 &lt;option value="bar"&gt;bar&lt;/option&gt;
3474 &lt;option value="bar-color" selected&gt;bar-color&lt;/option&gt;
3475 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
3476
3477 &lt;option value="dot"&gt;dot&lt;/option&gt;
3478 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
3479 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
3480 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
3481
3482 &lt;option value="grid"&gt;grid&lt;/option&gt;
3483 &lt;option value="line"&gt;line&lt;/option&gt;
3484 &lt;option value="surface"&gt;surface&lt;/option&gt;
3485 &lt;/select&gt;
3486 &lt;/label&gt;
3487&lt;/p&gt;
3488
3489&lt;p&gt;
3490 &lt;label for="perspective"&gt;
3491 &lt;input type="checkbox" id="perspective" checked /&gt; Show perspective
3492 &lt;/label&gt;
3493&lt;/p&gt;
3494
3495&lt;p&gt;
3496 &lt;label for="xBarWidth"&gt;
3497 Bar width X:
3498 &lt;input type="text" id="xBarWidth" value style="width:50px;" /&gt; (only
3499 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3500 &lt;/label&gt;
3501&lt;/p&gt;
3502&lt;p&gt;
3503 &lt;label for="yBarWidth"&gt;
3504 Bar width Y:
3505 &lt;input type="text" id="yBarWidth" value style="width:50px;" /&gt; (only
3506 applicable for styles &amp;quot;bar&amp;quot; and &amp;quot;bar-color&amp;quot;)
3507 &lt;/label&gt;
3508&lt;/p&gt;
3509
3510&lt;div id="mygraph"&gt;&lt;/div&gt;
3511
3512&lt;div id="info"&gt;&lt;/div&gt;
3513'
3514 /></form
3515 ></span>
3516 </div>
3517 <a href="graph3d/15_styling_per_point.html"
3518 ><div class="example-image">
3519 <img
3520 src="thumbnails/c83e4c80b92f79205c976318a5d1f7be8b08dd8f68c242177458bbacc2f3465c.png"
3521 alt="Styling per Point"
3522 /></div></a></span
3523 ><span class="example-link"
3524 ><div>
3525 <a href="graph3d/11_tooltips.html">Tooltips</a
3526 ><span class="playgrounds"
3527 ><form
3528 action="http://jsfiddle.net/api/post/library/pure/"
3529 method="post"
3530 target="_blank"
3531 >
3532 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
3533 &#xA0;</button
3534 ><input
3535 type="hidden"
3536 name="js"
3537 value='var data = null;
3538var graph = null;
3539
3540function custom(x, y) {
3541 return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;
3542}
3543
3544// Called when the Visualization API is loaded.
3545function drawVisualization() {
3546 var style = document.getElementById("style").value;
3547 var withValue =
3548 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
3549
3550 // Create and populate a data table.
3551 data = new vis.DataSet();
3552 var extra_content = [
3553 "Arbitrary information",
3554 "You can access data from the point source object",
3555 "Tooltip example content"
3556 ];
3557
3558 // create some nice looking data with sin/cos
3559 var steps = 5; // number of datapoints will be steps*steps
3560 var axisMax = 10;
3561 var axisStep = axisMax / steps;
3562 for (var x = 0; x &lt;= axisMax; x += axisStep) {
3563 for (var y = 0; y &lt;= axisMax; y += axisStep) {
3564 var z = custom(x, y);
3565 if (withValue) {
3566 var value = y - x;
3567 data.add({
3568 x: x,
3569 y: y,
3570 z: z,
3571 style: value,
3572 extra: extra_content[(x * y) % extra_content.length]
3573 });
3574 } else {
3575 data.add({
3576 x: x,
3577 y: y,
3578 z: z,
3579 extra: extra_content[(x * y) % extra_content.length]
3580 });
3581 }
3582 }
3583 }
3584
3585 // specify options
3586 var options = {
3587 width: "600px",
3588 height: "600px",
3589 style: style,
3590 showPerspective: true,
3591 showLegend: true,
3592 showGrid: true,
3593 showShadow: false,
3594
3595 // Option tooltip can be true, false, or a function returning a string with HTML contents
3596 tooltip: function(point) {
3597 // parameter point contains properties x, y, z, and data
3598 // data is the original object passed to the point constructor
3599 return "value: &lt;b&gt;" + point.z + "&lt;/b&gt;&lt;br&gt;" + point.data.extra;
3600 },
3601
3602 // Tooltip default styling can be overridden
3603 tooltipStyle: {
3604 content: {
3605 background: "rgba(255, 255, 255, 0.7)",
3606 padding: "10px",
3607 borderRadius: "10px"
3608 },
3609 line: {
3610 borderLeft: "1px dotted rgba(0, 0, 0, 0.5)"
3611 },
3612 dot: {
3613 border: "5px solid rgba(0, 0, 0, 0.5)"
3614 }
3615 },
3616
3617 keepAspectRatio: true,
3618 verticalRatio: 0.5
3619 };
3620
3621 var camera = graph ? graph.getCameraPosition() : null;
3622
3623 // create our graph
3624 var container = document.getElementById("mygraph");
3625 graph = new vis.Graph3d(container, data, options);
3626
3627 if (camera) graph.setCameraPosition(camera); // restore camera position
3628
3629 document.getElementById("style").onchange = drawVisualization;
3630}
3631
3632window.addEventListener("load", () =&gt; {
3633 drawVisualization();
3634});
3635'
3636 /><input
3637 type="hidden"
3638 name="css"
3639 value="body {
3640 font: 10pt arial;
3641}
3642div#info {
3643 width: 600px;
3644 text-align: center;
3645 margin-top: 2em;
3646 font-size: 1.2em;
3647}
3648"
3649 /><input
3650 type="hidden"
3651 name="html"
3652 value='&lt;p&gt;
3653 &lt;label for="style"&gt;
3654 Style:
3655 &lt;select id="style"&gt;
3656 &lt;option value="bar"&gt;bar&lt;/option&gt;
3657 &lt;option value="bar-color"&gt;bar-color&lt;/option&gt;
3658 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
3659
3660 &lt;option value="dot"&gt;dot&lt;/option&gt;
3661 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
3662 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
3663 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
3664
3665 &lt;option value="grid"&gt;grid&lt;/option&gt;
3666 &lt;option value="line"&gt;line&lt;/option&gt;
3667 &lt;option value="surface"&gt;surface&lt;/option&gt;
3668 &lt;/select&gt;
3669 &lt;/label&gt;
3670&lt;/p&gt;
3671
3672&lt;div id="mygraph"&gt;&lt;/div&gt;
3673
3674&lt;div id="info"&gt;Hover the mouse cursor over the graph to see tooltips.&lt;/div&gt;
3675'
3676 /><input
3677 type="hidden"
3678 name="resources"
3679 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
3680 /><input type="hidden" name="wrap" value="b" /><input
3681 type="hidden"
3682 name="title"
3683 value="Graph 3D | Tooltips"
3684 />
3685 </form>
3686
3687 <form
3688 action="https://codepen.io/pen/define"
3689 method="post"
3690 target="_blank"
3691 >
3692 <button class="icon codepen" alt="CodePen" title="CodePen">
3693 &#xA0;</button
3694 ><input
3695 type="hidden"
3696 name="data"
3697 value='{"css":"body {\n font: 10pt arial;\n}\ndiv#info {\n width: 600px;\n text-align: center;\n margin-top: 2em;\n font-size: 1.2em;\n}\n","css_external":"","html":"&lt;p&gt;\n &lt;label for=\"style\"&gt;\n Style:\n &lt;select id=\"style\"&gt;\n &lt;option value=\"bar\"&gt;bar&lt;/option&gt;\n &lt;option value=\"bar-color\"&gt;bar-color&lt;/option&gt;\n &lt;option value=\"bar-size\"&gt;bar-size&lt;/option&gt;\n\n &lt;option value=\"dot\"&gt;dot&lt;/option&gt;\n &lt;option value=\"dot-line\"&gt;dot-line&lt;/option&gt;\n &lt;option value=\"dot-color\"&gt;dot-color&lt;/option&gt;\n &lt;option value=\"dot-size\"&gt;dot-size&lt;/option&gt;\n\n &lt;option value=\"grid\"&gt;grid&lt;/option&gt;\n &lt;option value=\"line\"&gt;line&lt;/option&gt;\n &lt;option value=\"surface\"&gt;surface&lt;/option&gt;\n &lt;/select&gt;\n &lt;/label&gt;\n&lt;/p&gt;\n\n&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;Hover the mouse cursor over the graph to see tooltips.&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n var style = document.getElementById(\"style\").value;\n var withValue =\n [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\n\n // Create and populate a data table.\n data = new vis.DataSet();\n var extra_content = [\n \"Arbitrary information\",\n \"You can access data from the point source object\",\n \"Tooltip example content\"\n ];\n\n // create some nice looking data with sin/cos\n var steps = 5; // number of datapoints will be steps*steps\n var axisMax = 10;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt;= axisMax; x += axisStep) {\n for (var y = 0; y &lt;= axisMax; y += axisStep) {\n var z = custom(x, y);\n if (withValue) {\n var value = y - x;\n data.add({\n x: x,\n y: y,\n z: z,\n style: value,\n extra: extra_content[(x * y) % extra_content.length]\n });\n } else {\n data.add({\n x: x,\n y: y,\n z: z,\n extra: extra_content[(x * y) % extra_content.length]\n });\n }\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: style,\n showPerspective: true,\n showLegend: true,\n showGrid: true,\n showShadow: false,\n\n // Option tooltip can be true, false, or a function returning a string with HTML contents\n tooltip: function(point) {\n // parameter point contains properties x, y, z, and data\n // data is the original object passed to the point constructor\n return \"value: &lt;b&gt;\" + point.z + \"&lt;/b&gt;&lt;br&gt;\" + point.data.extra;\n },\n\n // Tooltip default styling can be overridden\n tooltipStyle: {\n content: {\n background: \"rgba(255, 255, 255, 0.7)\",\n padding: \"10px\",\n borderRadius: \"10px\"\n },\n line: {\n borderLeft: \"1px dotted rgba(0, 0, 0, 0.5)\"\n },\n dot: {\n border: \"5px solid rgba(0, 0, 0, 0.5)\"\n }\n },\n\n keepAspectRatio: true,\n verticalRatio: 0.5\n };\n\n var camera = graph ? graph.getCameraPosition() : null;\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n\n if (camera) graph.setCameraPosition(camera); // restore camera position\n\n document.getElementById(\"style\").onchange = drawVisualization;\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Tooltips"}'
3698 /><input
3699 type="hidden"
3700 name="js"
3701 value='var data = null;
3702var graph = null;
3703
3704function custom(x, y) {
3705 return -Math.sin(x / Math.PI) * Math.cos(y / Math.PI) * 10 + 10;
3706}
3707
3708// Called when the Visualization API is loaded.
3709function drawVisualization() {
3710 var style = document.getElementById("style").value;
3711 var withValue =
3712 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
3713
3714 // Create and populate a data table.
3715 data = new vis.DataSet();
3716 var extra_content = [
3717 "Arbitrary information",
3718 "You can access data from the point source object",
3719 "Tooltip example content"
3720 ];
3721
3722 // create some nice looking data with sin/cos
3723 var steps = 5; // number of datapoints will be steps*steps
3724 var axisMax = 10;
3725 var axisStep = axisMax / steps;
3726 for (var x = 0; x &lt;= axisMax; x += axisStep) {
3727 for (var y = 0; y &lt;= axisMax; y += axisStep) {
3728 var z = custom(x, y);
3729 if (withValue) {
3730 var value = y - x;
3731 data.add({
3732 x: x,
3733 y: y,
3734 z: z,
3735 style: value,
3736 extra: extra_content[(x * y) % extra_content.length]
3737 });
3738 } else {
3739 data.add({
3740 x: x,
3741 y: y,
3742 z: z,
3743 extra: extra_content[(x * y) % extra_content.length]
3744 });
3745 }
3746 }
3747 }
3748
3749 // specify options
3750 var options = {
3751 width: "600px",
3752 height: "600px",
3753 style: style,
3754 showPerspective: true,
3755 showLegend: true,
3756 showGrid: true,
3757 showShadow: false,
3758
3759 // Option tooltip can be true, false, or a function returning a string with HTML contents
3760 tooltip: function(point) {
3761 // parameter point contains properties x, y, z, and data
3762 // data is the original object passed to the point constructor
3763 return "value: &lt;b&gt;" + point.z + "&lt;/b&gt;&lt;br&gt;" + point.data.extra;
3764 },
3765
3766 // Tooltip default styling can be overridden
3767 tooltipStyle: {
3768 content: {
3769 background: "rgba(255, 255, 255, 0.7)",
3770 padding: "10px",
3771 borderRadius: "10px"
3772 },
3773 line: {
3774 borderLeft: "1px dotted rgba(0, 0, 0, 0.5)"
3775 },
3776 dot: {
3777 border: "5px solid rgba(0, 0, 0, 0.5)"
3778 }
3779 },
3780
3781 keepAspectRatio: true,
3782 verticalRatio: 0.5
3783 };
3784
3785 var camera = graph ? graph.getCameraPosition() : null;
3786
3787 // create our graph
3788 var container = document.getElementById("mygraph");
3789 graph = new vis.Graph3d(container, data, options);
3790
3791 if (camera) graph.setCameraPosition(camera); // restore camera position
3792
3793 document.getElementById("style").onchange = drawVisualization;
3794}
3795
3796window.addEventListener("load", () =&gt; {
3797 drawVisualization();
3798});
3799'
3800 /><input
3801 type="hidden"
3802 name="css"
3803 value="body {
3804 font: 10pt arial;
3805}
3806div#info {
3807 width: 600px;
3808 text-align: center;
3809 margin-top: 2em;
3810 font-size: 1.2em;
3811}
3812"
3813 /><input
3814 type="hidden"
3815 name="html"
3816 value='&lt;p&gt;
3817 &lt;label for="style"&gt;
3818 Style:
3819 &lt;select id="style"&gt;
3820 &lt;option value="bar"&gt;bar&lt;/option&gt;
3821 &lt;option value="bar-color"&gt;bar-color&lt;/option&gt;
3822 &lt;option value="bar-size"&gt;bar-size&lt;/option&gt;
3823
3824 &lt;option value="dot"&gt;dot&lt;/option&gt;
3825 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
3826 &lt;option value="dot-color"&gt;dot-color&lt;/option&gt;
3827 &lt;option value="dot-size"&gt;dot-size&lt;/option&gt;
3828
3829 &lt;option value="grid"&gt;grid&lt;/option&gt;
3830 &lt;option value="line"&gt;line&lt;/option&gt;
3831 &lt;option value="surface"&gt;surface&lt;/option&gt;
3832 &lt;/select&gt;
3833 &lt;/label&gt;
3834&lt;/p&gt;
3835
3836&lt;div id="mygraph"&gt;&lt;/div&gt;
3837
3838&lt;div id="info"&gt;Hover the mouse cursor over the graph to see tooltips.&lt;/div&gt;
3839'
3840 /></form
3841 ></span>
3842 </div>
3843 <a href="graph3d/11_tooltips.html"
3844 ><div class="example-image">
3845 <img
3846 src="thumbnails/c053a6307bb0b5efafd118ab07192cd5d3bf6c6b6bbc742d10d8eda2d7bb04e7.png"
3847 alt="Tooltips"
3848 /></div></a></span
3849 ><span class="example-link"
3850 ><div>
3851 <a href="graph3d/rotateAxisLabels/rotateAxisLabels.html"
3852 >WORLD INDEXES BY COUNTRY 2018 MID-YEAR</a
3853 ><span class="playgrounds"
3854 ><form
3855 action="http://jsfiddle.net/api/post/library/pure/"
3856 method="post"
3857 target="_blank"
3858 >
3859 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
3860 &#xA0;</button
3861 ><input
3862 type="hidden"
3863 name="js"
3864 value='var graph = null;
3865
3866function drawVisualization() {
3867 var style = document.getElementById("style").value;
3868 var withValue =
3869 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
3870
3871 // Create and populate a data table.
3872 var data = new vis.DataSet();
3873 var extra_content = [];
3874 data.add({
3875 id: "c57621e7d6cfb81",
3876 x: 0,
3877 y: -1,
3878 z: 0,
3879 extra: extra_content[0]
3880 });
3881 var axis_x = {};
3882 var axis_y = {};
3883 var file1 = "world_index_data_small.json?nocache=" + Math.random();
3884 var _width = "1000px";
3885 var _height = "1000px";
3886
3887 var request = new XMLHttpRequest();
3888 request.open("GET", file1, true);
3889
3890 function axisLoad(axis_obj, callback) {
3891 Object.keys(axis_obj).forEach(function(field, i) {
3892 callback(axis_obj[field], i);
3893 });
3894 }
3895
3896 request.onload = function() {
3897 if (request.status &gt;= 200 &amp;&amp; request.status &lt; 400) {
3898 var result = JSON.parse(request.responseText);
3899 axisLoad(result.graph3d, function(object, i) {
3900 data.add(object);
3901 });
3902 axisLoad(result.axis_x, function(object, i) {
3903 axis_x[i] = object;
3904 });
3905 axisLoad(result.axis_y, function(object, i) {
3906 axis_y[i] = object;
3907 });
3908 data.remove("c57621e7d6cfb81");
3909 } else {
3910 console.log("ERR: request.onload");
3911 }
3912 };
3913 request.onerror = function() {
3914 console.log("ERR: Connection request");
3915 };
3916 request.send();
3917
3918 var options = {
3919 width: _width,
3920 height: _height,
3921 style: style,
3922 showPerspective: false,
3923 showLegend: true,
3924 showGrid: true,
3925 showShadow: true,
3926 xLabel: "COUNTRY",
3927 yLabel: "INDEX",
3928 zLabel: "PERCENT",
3929 legendLabel: "value",
3930 rotateAxisLabels: true,
3931 axisColor: "#41413C",
3932 axisFontType: "courier",
3933 axisFontSize: 30,
3934 gridColor: "#5590CC",
3935 backgroundColor: "white",
3936 dataColor: {
3937 fill: "green",
3938 stroke: "green",
3939 strokeWidth: 2
3940 },
3941 cameraPosition: {
3942 horizontal: 0,
3943 vertical: 2,
3944 distance: 2.3
3945 },
3946 tooltip: function(point) {
3947 return (
3948 "value: &lt;b&gt;" +
3949 point.z +
3950 "%&lt;/b&gt;&lt;br&gt;" +
3951 axis_x[point.x] +
3952 "&lt;/b&gt;&lt;br&gt;" +
3953 axis_y[point.y]
3954 );
3955 },
3956 tooltipDelay: 0,
3957 tooltipStyle: {
3958 content: {
3959 background: "rgba(255, 255, 255, 0.7)",
3960 padding: "10px",
3961 borderRadius: "10px"
3962 },
3963 line: {
3964 borderLeft: "1px dotted rgba(0, 0, 0, 0.5)"
3965 },
3966 dot: {
3967 border: "5px solid rgba(0, 0, 0, 0.5)"
3968 }
3969 },
3970 keepAspectRatio: false,
3971 verticalRatio: 0.5,
3972 xBarWidth: 1,
3973 yBarWidth: 1,
3974 xStep: 1,
3975 yStep: 1,
3976 xCenter: "50%",
3977 yCenter: "25%",
3978 xValueLabel: function(value) {
3979 return "" + axis_x[value.toString()];
3980 },
3981 yValueLabel: function(value) {
3982 return "" + axis_y[value.toString()];
3983 },
3984 zValueLabel: function(value) {
3985 return value + "%";
3986 }
3987 };
3988 var camera = graph ? graph.getCameraPosition() : null;
3989 var container = document.getElementById("mygraph");
3990 graph = new vis.Graph3d(container, data, options);
3991 if (camera) graph.setCameraPosition(camera);
3992 document.getElementById("style").onchange = drawVisualization;
3993}
3994
3995window.addEventListener("load", () =&gt; {
3996 drawVisualization();
3997});
3998'
3999 /><input
4000 type="hidden"
4001 name="css"
4002 value="body {
4003 font: 10pt arial;
4004}
4005div#info {
4006 width: 500px;
4007 text-align: center;
4008 margin-top: 2em;
4009 font-size: 1.2em;
4010}
4011span#graphHead,
4012span#updateTime,
4013span#startTime,
4014span#endTime {
4015 font: 10pt arial;
4016 font-weight: bold;
4017 text-align: center;
4018}
4019"
4020 /><input
4021 type="hidden"
4022 name="html"
4023 value='&lt;p&gt;
4024 &lt;label for="style"&gt;
4025 Style:
4026 &lt;select id="style"&gt;
4027 &lt;option value="bar"&gt;bar&lt;/option&gt;
4028 &lt;option value="dot"&gt;dot&lt;/option&gt;
4029 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
4030 &lt;/select&gt;
4031 &lt;/label&gt;
4032&lt;/p&gt;
4033&lt;div style="text-align: center; width: 1024px;"&gt;
4034 &lt;span id="graphHead"&gt;WORLD INDEXES BY COUNTRY 2018 MID-YEAR&lt;/span&gt;&lt;br /&gt;
4035 &lt;span id="updateTime"&gt;&lt;/span&gt;&lt;br /&gt;
4036 &lt;span id="startTime"&gt;&lt;/span&gt;&lt;br /&gt;
4037 &lt;span id="endTime"&gt;&lt;/span&gt;&lt;br /&gt;
4038 &lt;div id="mygraph" height="470px"&gt;&lt;/div&gt;
4039 &lt;div id="info"&gt;Hover the mouse cursor over the graph to see tooltips.&lt;/div&gt;
4040&lt;/div&gt;
4041'
4042 /><input
4043 type="hidden"
4044 name="resources"
4045 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
4046 /><input type="hidden" name="wrap" value="b" /><input
4047 type="hidden"
4048 name="title"
4049 value="Graph 3D | WORLD INDEXES BY COUNTRY 2018 MID-YEAR"
4050 />
4051 </form>
4052
4053 <form
4054 action="https://codepen.io/pen/define"
4055 method="post"
4056 target="_blank"
4057 >
4058 <button class="icon codepen" alt="CodePen" title="CodePen">
4059 &#xA0;</button
4060 ><input
4061 type="hidden"
4062 name="data"
4063 value='{"css":"body {\n font: 10pt arial;\n}\ndiv#info {\n width: 500px;\n text-align: center;\n margin-top: 2em;\n font-size: 1.2em;\n}\nspan#graphHead,\nspan#updateTime,\nspan#startTime,\nspan#endTime {\n font: 10pt arial;\n font-weight: bold;\n text-align: center;\n}\n","css_external":"","html":"&lt;p&gt;\n &lt;label for=\"style\"&gt;\n Style:\n &lt;select id=\"style\"&gt;\n &lt;option value=\"bar\"&gt;bar&lt;/option&gt;\n &lt;option value=\"dot\"&gt;dot&lt;/option&gt;\n &lt;option value=\"dot-line\"&gt;dot-line&lt;/option&gt;\n &lt;/select&gt;\n &lt;/label&gt;\n&lt;/p&gt;\n&lt;div style=\"text-align: center; width: 1024px;\"&gt;\n &lt;span id=\"graphHead\"&gt;WORLD INDEXES BY COUNTRY 2018 MID-YEAR&lt;/span&gt;&lt;br /&gt;\n &lt;span id=\"updateTime\"&gt;&lt;/span&gt;&lt;br /&gt;\n &lt;span id=\"startTime\"&gt;&lt;/span&gt;&lt;br /&gt;\n &lt;span id=\"endTime\"&gt;&lt;/span&gt;&lt;br /&gt;\n &lt;div id=\"mygraph\" height=\"470px\"&gt;&lt;/div&gt;\n &lt;div id=\"info\"&gt;Hover the mouse cursor over the graph to see tooltips.&lt;/div&gt;\n&lt;/div&gt;\n","js":"var graph = null;\n\nfunction drawVisualization() {\n var style = document.getElementById(\"style\").value;\n var withValue =\n [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\n\n // Create and populate a data table.\n var data = new vis.DataSet();\n var extra_content = [];\n data.add({\n id: \"c57621e7d6cfb81\",\n x: 0,\n y: -1,\n z: 0,\n extra: extra_content[0]\n });\n var axis_x = {};\n var axis_y = {};\n var file1 = \"world_index_data_small.json?nocache=\" + Math.random();\n var _width = \"1000px\";\n var _height = \"1000px\";\n\n var request = new XMLHttpRequest();\n request.open(\"GET\", file1, true);\n\n function axisLoad(axis_obj, callback) {\n Object.keys(axis_obj).forEach(function(field, i) {\n callback(axis_obj[field], i);\n });\n }\n\n request.onload = function() {\n if (request.status &gt;= 200 &amp;&amp; request.status &lt; 400) {\n var result = JSON.parse(request.responseText);\n axisLoad(result.graph3d, function(object, i) {\n data.add(object);\n });\n axisLoad(result.axis_x, function(object, i) {\n axis_x[i] = object;\n });\n axisLoad(result.axis_y, function(object, i) {\n axis_y[i] = object;\n });\n data.remove(\"c57621e7d6cfb81\");\n } else {\n console.log(\"ERR: request.onload\");\n }\n };\n request.onerror = function() {\n console.log(\"ERR: Connection request\");\n };\n request.send();\n\n var options = {\n width: _width,\n height: _height,\n style: style,\n showPerspective: false,\n showLegend: true,\n showGrid: true,\n showShadow: true,\n xLabel: \"COUNTRY\",\n yLabel: \"INDEX\",\n zLabel: \"PERCENT\",\n legendLabel: \"value\",\n rotateAxisLabels: true,\n axisColor: \"#41413C\",\n axisFontType: \"courier\",\n axisFontSize: 30,\n gridColor: \"#5590CC\",\n backgroundColor: \"white\",\n dataColor: {\n fill: \"green\",\n stroke: \"green\",\n strokeWidth: 2\n },\n cameraPosition: {\n horizontal: 0,\n vertical: 2,\n distance: 2.3\n },\n tooltip: function(point) {\n return (\n \"value: &lt;b&gt;\" +\n point.z +\n \"%&lt;/b&gt;&lt;br&gt;\" +\n axis_x[point.x] +\n \"&lt;/b&gt;&lt;br&gt;\" +\n axis_y[point.y]\n );\n },\n tooltipDelay: 0,\n tooltipStyle: {\n content: {\n background: \"rgba(255, 255, 255, 0.7)\",\n padding: \"10px\",\n borderRadius: \"10px\"\n },\n line: {\n borderLeft: \"1px dotted rgba(0, 0, 0, 0.5)\"\n },\n dot: {\n border: \"5px solid rgba(0, 0, 0, 0.5)\"\n }\n },\n keepAspectRatio: false,\n verticalRatio: 0.5,\n xBarWidth: 1,\n yBarWidth: 1,\n xStep: 1,\n yStep: 1,\n xCenter: \"50%\",\n yCenter: \"25%\",\n xValueLabel: function(value) {\n return \"\" + axis_x[value.toString()];\n },\n yValueLabel: function(value) {\n return \"\" + axis_y[value.toString()];\n },\n zValueLabel: function(value) {\n return value + \"%\";\n }\n };\n var camera = graph ? graph.getCameraPosition() : null;\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n if (camera) graph.setCameraPosition(camera);\n document.getElementById(\"style\").onchange = drawVisualization;\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | WORLD INDEXES BY COUNTRY 2018 MID-YEAR"}'
4064 /><input
4065 type="hidden"
4066 name="js"
4067 value='var graph = null;
4068
4069function drawVisualization() {
4070 var style = document.getElementById("style").value;
4071 var withValue =
4072 ["bar-color", "bar-size", "dot-size", "dot-color"].indexOf(style) != -1;
4073
4074 // Create and populate a data table.
4075 var data = new vis.DataSet();
4076 var extra_content = [];
4077 data.add({
4078 id: "c57621e7d6cfb81",
4079 x: 0,
4080 y: -1,
4081 z: 0,
4082 extra: extra_content[0]
4083 });
4084 var axis_x = {};
4085 var axis_y = {};
4086 var file1 = "world_index_data_small.json?nocache=" + Math.random();
4087 var _width = "1000px";
4088 var _height = "1000px";
4089
4090 var request = new XMLHttpRequest();
4091 request.open("GET", file1, true);
4092
4093 function axisLoad(axis_obj, callback) {
4094 Object.keys(axis_obj).forEach(function(field, i) {
4095 callback(axis_obj[field], i);
4096 });
4097 }
4098
4099 request.onload = function() {
4100 if (request.status &gt;= 200 &amp;&amp; request.status &lt; 400) {
4101 var result = JSON.parse(request.responseText);
4102 axisLoad(result.graph3d, function(object, i) {
4103 data.add(object);
4104 });
4105 axisLoad(result.axis_x, function(object, i) {
4106 axis_x[i] = object;
4107 });
4108 axisLoad(result.axis_y, function(object, i) {
4109 axis_y[i] = object;
4110 });
4111 data.remove("c57621e7d6cfb81");
4112 } else {
4113 console.log("ERR: request.onload");
4114 }
4115 };
4116 request.onerror = function() {
4117 console.log("ERR: Connection request");
4118 };
4119 request.send();
4120
4121 var options = {
4122 width: _width,
4123 height: _height,
4124 style: style,
4125 showPerspective: false,
4126 showLegend: true,
4127 showGrid: true,
4128 showShadow: true,
4129 xLabel: "COUNTRY",
4130 yLabel: "INDEX",
4131 zLabel: "PERCENT",
4132 legendLabel: "value",
4133 rotateAxisLabels: true,
4134 axisColor: "#41413C",
4135 axisFontType: "courier",
4136 axisFontSize: 30,
4137 gridColor: "#5590CC",
4138 backgroundColor: "white",
4139 dataColor: {
4140 fill: "green",
4141 stroke: "green",
4142 strokeWidth: 2
4143 },
4144 cameraPosition: {
4145 horizontal: 0,
4146 vertical: 2,
4147 distance: 2.3
4148 },
4149 tooltip: function(point) {
4150 return (
4151 "value: &lt;b&gt;" +
4152 point.z +
4153 "%&lt;/b&gt;&lt;br&gt;" +
4154 axis_x[point.x] +
4155 "&lt;/b&gt;&lt;br&gt;" +
4156 axis_y[point.y]
4157 );
4158 },
4159 tooltipDelay: 0,
4160 tooltipStyle: {
4161 content: {
4162 background: "rgba(255, 255, 255, 0.7)",
4163 padding: "10px",
4164 borderRadius: "10px"
4165 },
4166 line: {
4167 borderLeft: "1px dotted rgba(0, 0, 0, 0.5)"
4168 },
4169 dot: {
4170 border: "5px solid rgba(0, 0, 0, 0.5)"
4171 }
4172 },
4173 keepAspectRatio: false,
4174 verticalRatio: 0.5,
4175 xBarWidth: 1,
4176 yBarWidth: 1,
4177 xStep: 1,
4178 yStep: 1,
4179 xCenter: "50%",
4180 yCenter: "25%",
4181 xValueLabel: function(value) {
4182 return "" + axis_x[value.toString()];
4183 },
4184 yValueLabel: function(value) {
4185 return "" + axis_y[value.toString()];
4186 },
4187 zValueLabel: function(value) {
4188 return value + "%";
4189 }
4190 };
4191 var camera = graph ? graph.getCameraPosition() : null;
4192 var container = document.getElementById("mygraph");
4193 graph = new vis.Graph3d(container, data, options);
4194 if (camera) graph.setCameraPosition(camera);
4195 document.getElementById("style").onchange = drawVisualization;
4196}
4197
4198window.addEventListener("load", () =&gt; {
4199 drawVisualization();
4200});
4201'
4202 /><input
4203 type="hidden"
4204 name="css"
4205 value="body {
4206 font: 10pt arial;
4207}
4208div#info {
4209 width: 500px;
4210 text-align: center;
4211 margin-top: 2em;
4212 font-size: 1.2em;
4213}
4214span#graphHead,
4215span#updateTime,
4216span#startTime,
4217span#endTime {
4218 font: 10pt arial;
4219 font-weight: bold;
4220 text-align: center;
4221}
4222"
4223 /><input
4224 type="hidden"
4225 name="html"
4226 value='&lt;p&gt;
4227 &lt;label for="style"&gt;
4228 Style:
4229 &lt;select id="style"&gt;
4230 &lt;option value="bar"&gt;bar&lt;/option&gt;
4231 &lt;option value="dot"&gt;dot&lt;/option&gt;
4232 &lt;option value="dot-line"&gt;dot-line&lt;/option&gt;
4233 &lt;/select&gt;
4234 &lt;/label&gt;
4235&lt;/p&gt;
4236&lt;div style="text-align: center; width: 1024px;"&gt;
4237 &lt;span id="graphHead"&gt;WORLD INDEXES BY COUNTRY 2018 MID-YEAR&lt;/span&gt;&lt;br /&gt;
4238 &lt;span id="updateTime"&gt;&lt;/span&gt;&lt;br /&gt;
4239 &lt;span id="startTime"&gt;&lt;/span&gt;&lt;br /&gt;
4240 &lt;span id="endTime"&gt;&lt;/span&gt;&lt;br /&gt;
4241 &lt;div id="mygraph" height="470px"&gt;&lt;/div&gt;
4242 &lt;div id="info"&gt;Hover the mouse cursor over the graph to see tooltips.&lt;/div&gt;
4243&lt;/div&gt;
4244'
4245 /></form
4246 ></span>
4247 </div>
4248 <a href="graph3d/rotateAxisLabels/rotateAxisLabels.html"
4249 ><div class="example-image">
4250 <img
4251 src="thumbnails/0b719c793c5a7360ba565c3d9448a308fe2f150e90aee742099ab867df5c2e23.png"
4252 alt="WORLD INDEXES BY COUNTRY 2018 MID-YEAR"
4253 /></div></a></span
4254 ><span class="example-link"
4255 ><div>
4256 <a href="graph3d/14_zoom_ctrl_scroll.html">Zoom CTRL Scroll</a
4257 ><span class="playgrounds"
4258 ><form
4259 action="http://jsfiddle.net/api/post/library/pure/"
4260 method="post"
4261 target="_blank"
4262 >
4263 <button class="icon jsfiddle" alt="JSFiddle" title="JSFiddle">
4264 &#xA0;</button
4265 ><input
4266 type="hidden"
4267 name="js"
4268 value='var data = null;
4269var graph = null;
4270
4271function custom(x, y) {
4272 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
4273}
4274
4275// Called when the Visualization API is loaded.
4276function drawVisualization() {
4277 // Create and populate a data table.
4278 data = new vis.DataSet();
4279 // create some nice looking data with sin/cos
4280 var counter = 0;
4281 var steps = 50; // number of datapoints will be steps*steps
4282 var axisMax = 314;
4283 var axisStep = axisMax / steps;
4284 for (var x = 0; x &lt; axisMax; x += axisStep) {
4285 for (var y = 0; y &lt; axisMax; y += axisStep) {
4286 var value = custom(x, y);
4287 data.add({ id: counter++, x: x, y: y, z: value, style: value });
4288 }
4289 }
4290
4291 // specify options
4292 var options = {
4293 width: "600px",
4294 height: "600px",
4295 style: "surface",
4296 showPerspective: true,
4297 showGrid: true,
4298 showShadow: false,
4299 keepAspectRatio: true,
4300 verticalRatio: 0.5,
4301 ctrlToZoom: true
4302 };
4303
4304 // Instantiate our graph object.
4305 var container = document.getElementById("mygraph");
4306 graph = new vis.Graph3d(container, data, options);
4307}
4308
4309window.addEventListener("load", () =&gt; {
4310 drawVisualization();
4311});
4312'
4313 /><input
4314 type="hidden"
4315 name="css"
4316 value="body {
4317 font: 10pt arial;
4318}
4319"
4320 /><input
4321 type="hidden"
4322 name="html"
4323 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
4324
4325&lt;div id="info"&gt;&lt;/div&gt;
4326'
4327 /><input
4328 type="hidden"
4329 name="resources"
4330 value="https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js"
4331 /><input type="hidden" name="wrap" value="b" /><input
4332 type="hidden"
4333 name="title"
4334 value="Graph 3D | Zoom CTRL Scroll"
4335 />
4336 </form>
4337
4338 <form
4339 action="https://codepen.io/pen/define"
4340 method="post"
4341 target="_blank"
4342 >
4343 <button class="icon codepen" alt="CodePen" title="CodePen">
4344 &#xA0;</button
4345 ><input
4346 type="hidden"
4347 name="data"
4348 value='{"css":"body {\n font: 10pt arial;\n}\n","css_external":"","html":"&lt;div id=\"mygraph\"&gt;&lt;/div&gt;\n\n&lt;div id=\"info\"&gt;&lt;/div&gt;\n","js":"var data = null;\nvar graph = null;\n\nfunction custom(x, y) {\n return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;\n}\n\n// Called when the Visualization API is loaded.\nfunction drawVisualization() {\n // Create and populate a data table.\n data = new vis.DataSet();\n // create some nice looking data with sin/cos\n var counter = 0;\n var steps = 50; // number of datapoints will be steps*steps\n var axisMax = 314;\n var axisStep = axisMax / steps;\n for (var x = 0; x &lt; axisMax; x += axisStep) {\n for (var y = 0; y &lt; axisMax; y += axisStep) {\n var value = custom(x, y);\n data.add({ id: counter++, x: x, y: y, z: value, style: value });\n }\n }\n\n // specify options\n var options = {\n width: \"600px\",\n height: \"600px\",\n style: \"surface\",\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n ctrlToZoom: true\n };\n\n // Instantiate our graph object.\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n}\n\nwindow.addEventListener(\"load\", () =&gt; {\n drawVisualization();\n});\n","js_external":"https://visjs.github.io/vis-graph3d/dist/vis-graph3d.min.js","title":"Graph 3D | Zoom CTRL Scroll"}'
4349 /><input
4350 type="hidden"
4351 name="js"
4352 value='var data = null;
4353var graph = null;
4354
4355function custom(x, y) {
4356 return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
4357}
4358
4359// Called when the Visualization API is loaded.
4360function drawVisualization() {
4361 // Create and populate a data table.
4362 data = new vis.DataSet();
4363 // create some nice looking data with sin/cos
4364 var counter = 0;
4365 var steps = 50; // number of datapoints will be steps*steps
4366 var axisMax = 314;
4367 var axisStep = axisMax / steps;
4368 for (var x = 0; x &lt; axisMax; x += axisStep) {
4369 for (var y = 0; y &lt; axisMax; y += axisStep) {
4370 var value = custom(x, y);
4371 data.add({ id: counter++, x: x, y: y, z: value, style: value });
4372 }
4373 }
4374
4375 // specify options
4376 var options = {
4377 width: "600px",
4378 height: "600px",
4379 style: "surface",
4380 showPerspective: true,
4381 showGrid: true,
4382 showShadow: false,
4383 keepAspectRatio: true,
4384 verticalRatio: 0.5,
4385 ctrlToZoom: true
4386 };
4387
4388 // Instantiate our graph object.
4389 var container = document.getElementById("mygraph");
4390 graph = new vis.Graph3d(container, data, options);
4391}
4392
4393window.addEventListener("load", () =&gt; {
4394 drawVisualization();
4395});
4396'
4397 /><input
4398 type="hidden"
4399 name="css"
4400 value="body {
4401 font: 10pt arial;
4402}
4403"
4404 /><input
4405 type="hidden"
4406 name="html"
4407 value='&lt;div id="mygraph"&gt;&lt;/div&gt;
4408
4409&lt;div id="info"&gt;&lt;/div&gt;
4410'
4411 /></form
4412 ></span>
4413 </div>
4414 <a href="graph3d/14_zoom_ctrl_scroll.html"
4415 ><div class="example-image">
4416 <img
4417 src="thumbnails/9d3da0f15b9ed2d99a43702eab6e272430988bf6f5b634baeed4a4232208502a.png"
4418 alt="Zoom CTRL Scroll"
4419 /></div></a
4420 ></span>
4421 </div>
4422 </div>
4423 </div>
4424 </body>
4425</html>