vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
8.1 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Graph3d Examples</title>
  8. <!-- Bootstrap -->
  9. <link href="css/bootstrap.min.css" rel="stylesheet">
  10. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  11. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  12. <!--[if lt IE 9]>
  13. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  14. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  15. <![endif]-->
  16. <link href="./css/prettify.css" rel="stylesheet" type="text/css" />
  17. <script type="text/javascript" src="./js/prettify/prettify.js"></script>
  18. <script src="./dist/vis.js"></script>
  19. <link href="./dist/vis.css" rel="stylesheet" type="text/css" />
  20. <style>
  21. body {
  22. padding:10px;
  23. }
  24. pre {
  25. width:450px;
  26. height:552px;
  27. overflow:auto;
  28. }
  29. #visualization {
  30. display:block;
  31. margin-left:470px;
  32. margin-top:-562px;
  33. width:500px;
  34. height:552px;
  35. border: 1px solid #dddddd;
  36. border-radius:4px;
  37. background-color:#fcfcfc;
  38. }
  39. div.textHTMLContent {
  40. margin-top:10px;
  41. margin-bottom:10px;
  42. display:block;
  43. width:800px;
  44. }
  45. img {
  46. border:1px solid #032740;
  47. width:250px;
  48. height:250px;
  49. margin-top:10px;
  50. }
  51. div.exampleTitle {
  52. width:250px;
  53. height:30px;
  54. background-color:#032740;
  55. color:#ffffff;
  56. text-align:center;
  57. vertical-align:middle;
  58. line-height: 30px;
  59. }
  60. </style>
  61. <script language="JavaScript">
  62. function loadVis() {
  63. // Create and populate a data table.
  64. var data = new vis.DataSet();
  65. // create some nice looking data with sin/cos
  66. var counter = 0;
  67. var steps = 50; // number of datapoints will be steps*steps
  68. var axisMax = 314;
  69. var axisStep = axisMax / steps;
  70. for (var x = 0; x < axisMax; x+=axisStep) {
  71. for (var y = 0; y < axisMax; y+=axisStep) {
  72. var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
  73. data.add({id:counter++,x:x,y:y,z:value,style:value});
  74. }
  75. }
  76. // specify options
  77. var options = {
  78. width: '500px',
  79. height: '552px',
  80. style: 'surface',
  81. showPerspective: true,
  82. showGrid: true,
  83. showShadow: false,
  84. keepAspectRatio: true,
  85. verticalRatio: 0.5
  86. };
  87. // Instantiate our graph object.
  88. var container = document.getElementById('visualization');
  89. var graph3d = new vis.Graph3d(container, data, options);
  90. }
  91. </script>
  92. </head>
  93. <body onload="prettyPrint(); loadVis();">
  94. <h1>Graph3d Examples</h1><a class="btn btn-default" href="#allExamples" role="button">View all examples »</a> <a class="btn btn-primary" href="./docs/graph3d.html" role="button">View docs »</a>
  95. <div class="textHTMLContent">This small code example shows the easiest way to get a Graph2d up and running. This code has been taken from example 1. The working example is shown next to it. Click it to start the interaction.</div>
  96. <pre class="prettyprint lang-html">
  97. &lt;div id="visualization"&gt;&lt;/div&gt;
  98. &lt;script type="text/javascript"&gt;
  99. // Create and populate a data table.
  100. var data = new vis.DataSet();
  101. // create some nice looking data with sin/cos
  102. var counter = 0;
  103. var steps = 50; // number of datapoints will be steps*steps
  104. var axisMax = 314;
  105. var axisStep = axisMax / steps;
  106. for (var x = 0; x < axisMax; x+=axisStep) {
  107. for (var y = 0; y < axisMax; y+=axisStep) {
  108. var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
  109. data.add({id:counter++,x:x,y:y,z:value,style:value});
  110. }
  111. }
  112. // specify options
  113. var options = {
  114. width: '500px',
  115. height: '552px',
  116. style: 'surface',
  117. showPerspective: true,
  118. showGrid: true,
  119. showShadow: false,
  120. keepAspectRatio: true,
  121. verticalRatio: 0.5
  122. };
  123. // Instantiate our graph object.
  124. var container = document.getElementById('visualization');
  125. var graph3d = new vis.Graph3d(container, data, options);
  126. &lt;/script&gt;
  127. </pre>
  128. <div id="visualization"></div>
  129. <h2 id="allExamples">All examples</h2>
  130. <div class="container-fluid">
  131. <div class="col-lg-3 col-md-3 col-sm-6">
  132. <a href="examples/graph3d/example01_basis.html">
  133. <img src="./images/gallery/graph3d/example01_basis.png">
  134. <div class="exampleTitle">basis</div>
  135. </a>
  136. </div>
  137. <div class="col-lg-3 col-md-3 col-sm-6">
  138. <a href="examples/graph3d/example02_camera.html">
  139. <img src="./images/gallery/graph3d/example02_camera.png">
  140. <div class="exampleTitle">camera</div>
  141. </a>
  142. </div>
  143. <div class="col-lg-3 col-md-3 col-sm-6">
  144. <a href="examples/graph3d/example03_filter.html">
  145. <img src="./images/gallery/graph3d/example03_filter.png">
  146. <div class="exampleTitle">filter</div>
  147. </a>
  148. </div>
  149. <div class="col-lg-3 col-md-3 col-sm-6">
  150. <a href="examples/graph3d/example04_animate.html">
  151. <img src="./images/gallery/graph3d/example04_animate.png">
  152. <div class="exampleTitle">animate</div>
  153. </a>
  154. </div>
  155. <div class="col-lg-3 col-md-3 col-sm-6">
  156. <a href="examples/graph3d/example05_line.html">
  157. <img src="./images/gallery/graph3d/example05_line.png">
  158. <div class="exampleTitle">line</div>
  159. </a>
  160. </div>
  161. <div class="col-lg-3 col-md-3 col-sm-6">
  162. <a href="examples/graph3d/example06_moving_dots.html">
  163. <img src="./images/gallery/graph3d/example06_moving_dots.png">
  164. <div class="exampleTitle">moving dots</div>
  165. </a>
  166. </div>
  167. <div class="col-lg-3 col-md-3 col-sm-6">
  168. <a href="examples/graph3d/example07_dot_cloud_colors.html">
  169. <img src="./images/gallery/graph3d/example07_dot_cloud_colors.png">
  170. <div class="exampleTitle">dot cloud colors</div>
  171. </a>
  172. </div>
  173. <div class="col-lg-3 col-md-3 col-sm-6">
  174. <a href="examples/graph3d/example08_dot_cloud_size.html">
  175. <img src="./images/gallery/graph3d/example08_dot_cloud_size.png">
  176. <div class="exampleTitle">dot cloud size</div>
  177. </a>
  178. </div>
  179. <div class="col-lg-3 col-md-3 col-sm-6">
  180. <a href="examples/graph3d/example09_mobile.html">
  181. <img src="./images/gallery/graph3d/example09_mobile.png">
  182. <div class="exampleTitle">mobile</div>
  183. </a>
  184. </div>
  185. <div class="col-lg-3 col-md-3 col-sm-6">
  186. <a href="examples/graph3d/example10_styles.html">
  187. <img src="./images/gallery/graph3d/example10_styles.png">
  188. <div class="exampleTitle">styles</div>
  189. </a>
  190. </div>
  191. <div class="col-lg-3 col-md-3 col-sm-6">
  192. <a href="examples/graph3d/example11_tooltips.html">
  193. <img src="./images/gallery/graph3d/example11_tooltips.png">
  194. <div class="exampleTitle">tooltips</div>
  195. </a>
  196. </div>
  197. <div class="col-lg-3 col-md-3 col-sm-6">
  198. <a href="examples/graph3d/playground/index.html">
  199. <img src="./images/gallery/graph3d/playground.png">
  200. <div class="exampleTitle">playground</div>
  201. </a>
  202. </div>
  203. </div>
  204. <br />
  205. <br />
  206. <br />
  207. <br />
  208. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  209. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  210. <!-- Include all compiled plugins (below), or include individual files as needed -->
  211. <script src="js/bootstrap.min.js"></script>
  212. </body>
  213. </html>