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.

225 lines
9.5 KiB

9 years ago
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-61231638-1', 'auto');ga('send', 'pageview');</script>
  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. <link rel="icon" HREF="favicon.ico">
  9. <!-- Bootstrap -->
  10. <link href="./css/bootstrap.css" rel="stylesheet">
  11. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  12. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  13. <!--[if lt IE 9]>
  14. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  15. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./css/prettify.css" rel="stylesheet" type="text/css" />
  18. <script type="text/javascript" src="./js/prettify/prettify.js"></script>
  19. <script src="./dist/vis.js"></script>
  20. <link href="./dist/vis.css" rel="stylesheet" type="text/css" />
  21. <link href="./css/examples.css" rel="stylesheet" type="text/css" />
  22. <style>
  23. </style>
  24. <script language="JavaScript">
  25. function loadVis() {
  26. // Create and populate a data table.
  27. var data = new vis.DataSet();
  28. // create some nice looking data with sin/cos
  29. var counter = 0;
  30. var steps = 50; // number of datapoints will be steps*steps
  31. var axisMax = 314;
  32. var axisStep = axisMax / steps;
  33. for (var x = 0; x < axisMax; x+=axisStep) {
  34. for (var y = 0; y < axisMax; y+=axisStep) {
  35. var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
  36. data.add({id:counter++,x:x,y:y,z:value,style:value});
  37. }
  38. }
  39. // specify options
  40. var options = {
  41. width: '500px',
  42. height: '552px',
  43. style: 'surface',
  44. showPerspective: true,
  45. showGrid: true,
  46. showShadow: false,
  47. keepAspectRatio: true,
  48. verticalRatio: 0.5
  49. };
  50. // Instantiate our graph object.
  51. var container = document.getElementById('visualization');
  52. var graph3d = new vis.Graph3d(container, data, options);
  53. }
  54. </script>
  55. </head>
  56. <body onload="prettyPrint(); loadVis();">
  57. <div class="navbar-wrapper">
  58. <div class="container">
  59. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  60. <div class="container">
  61. <div class="navbar-header">
  62. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  63. <span class="sr-only">Toggle navigation</span>
  64. <span class="icon-bar"></span>
  65. <span class="icon-bar"></span>
  66. <span class="icon-bar"></span>
  67. </button>
  68. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  69. </div>
  70. <div id="navbar" class="navbar-collapse collapse">
  71. <ul class="nav navbar-nav">
  72. <li class="active"><a href="./index.html#modules">Modules</a></li>
  73. <li><a href="./index.html#download_install">Download</a></li>
  74. <li><a href="./showcase/index.html">Showcase</a></li>
  75. <li><a href="./index.html#contribute">Contribute</a></li>
  76. <li><a href="./index.html#licenses">License</a></li>
  77. </ul>
  78. </div>
  79. </div>
  80. </nav>
  81. </div>
  82. </div>
  83. <div class="contentWrapper">
  84. <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/" role="button">View docs »</a>
  85. <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>
  86. <pre class="prettyprint lang-html">
  87. &lt;div id="visualization"&gt;&lt;/div&gt;
  88. &lt;script type="text/javascript"&gt;
  89. // Create and populate a data table.
  90. var data = new vis.DataSet();
  91. // create some nice looking data with sin/cos
  92. var counter = 0;
  93. var steps = 50; // number of datapoints will be steps*steps
  94. var axisMax = 314;
  95. var axisStep = axisMax / steps;
  96. for (var x = 0; x < axisMax; x+=axisStep) {
  97. for (var y = 0; y < axisMax; y+=axisStep) {
  98. var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
  99. data.add({id:counter++,x:x,y:y,z:value,style:value});
  100. }
  101. }
  102. // specify options
  103. var options = {
  104. width: '500px',
  105. height: '552px',
  106. style: 'surface',
  107. showPerspective: true,
  108. showGrid: true,
  109. showShadow: false,
  110. keepAspectRatio: true,
  111. verticalRatio: 0.5
  112. };
  113. // Instantiate our graph object.
  114. var container = document.getElementById('visualization');
  115. var graph3d = new vis.Graph3d(container, data, options);
  116. &lt;/script&gt;
  117. </pre>
  118. <div id="visualization"></div>
  119. <h2 id="allExamples">All examples</h2>
  120. <div class="container-fluid">
  121. <div class="col-lg-2 col-md-3 col-sm-6">
  122. <a href="examples/graph3d/01_basics.html">
  123. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/1.png">
  124. <div class="exampleTitle">basis</div>
  125. </a>
  126. </div>
  127. <div class="col-lg-2 col-md-3 col-sm-6">
  128. <a href="examples/graph3d/02_camera.html">
  129. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/2.png">
  130. <div class="exampleTitle">camera</div>
  131. </a>
  132. </div>
  133. <div class="col-lg-2 col-md-3 col-sm-6">
  134. <a href="examples/graph3d/03_filter_data.html">
  135. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/3.png">
  136. <div class="exampleTitle">filter</div>
  137. </a>
  138. </div>
  139. <div class="col-lg-2 col-md-3 col-sm-6">
  140. <a href="examples/graph3d/04_animation.html">
  141. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/4.png">
  142. <div class="exampleTitle">animate</div>
  143. </a>
  144. </div>
  145. <div class="col-lg-2 col-md-3 col-sm-6">
  146. <a href="examples/graph3d/05_line.html">
  147. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/5.png">
  148. <div class="exampleTitle">line</div>
  149. </a>
  150. </div>
  151. <div class="col-lg-2 col-md-3 col-sm-6">
  152. <a href="examples/graph3d/06_moving_dots.html">
  153. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/6.png">
  154. <div class="exampleTitle">moving dots</div>
  155. </a>
  156. </div>
  157. <div class="col-lg-2 col-md-3 col-sm-6">
  158. <a href="examples/graph3d/07_dot_cloud_colors.html">
  159. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/7.png">
  160. <div class="exampleTitle">dot cloud colors</div>
  161. </a>
  162. </div>
  163. <div class="col-lg-2 col-md-3 col-sm-6">
  164. <a href="examples/graph3d/08_dot_cloud_size.html">
  165. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/8.png">
  166. <div class="exampleTitle">dot cloud size</div>
  167. </a>
  168. </div>
  169. <div class="col-lg-2 col-md-3 col-sm-6">
  170. <a href="examples/graph3d/09_mobile.html">
  171. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/9.png">
  172. <div class="exampleTitle">mobile</div>
  173. </a>
  174. </div>
  175. <div class="col-lg-2 col-md-3 col-sm-6">
  176. <a href="examples/graph3d/10_styling.html">
  177. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/10.png">
  178. <div class="exampleTitle">styles</div>
  179. </a>
  180. </div>
  181. <div class="col-lg-2 col-md-3 col-sm-6">
  182. <a href="examples/graph3d/11_tooltips.html">
  183. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/11.png">
  184. <div class="exampleTitle">tooltips</div>
  185. </a>
  186. </div>
  187. <div class="col-lg-2 col-md-3 col-sm-6">
  188. <a href="examples/graph3d/12_custom_labels.html">
  189. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/12.png">
  190. <div class="exampleTitle">custom labels</div>
  191. </a>
  192. </div>
  193. <div class="col-lg-2 col-md-3 col-sm-6">
  194. <a href="examples/graph3d/playground/index.html">
  195. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/playground.png">
  196. <div class="exampleTitle">playground</div>
  197. </a>
  198. </div>
  199. </div>
  200. <br />
  201. <br />
  202. <br />
  203. <br />
  204. </div>
  205. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  206. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  207. <!-- Include all compiled plugins (below), or include individual files as needed -->
  208. <script src="js/bootstrap.min.js"></script>
  209. </body>
  210. </html>