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.

226 lines
9.6 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="./blog.html">Blog</a></li>
  74. <li><a href="./index.html#download_install">Download</a></li>
  75. <li><a href="./showcase/index.html">Showcase</a></li>
  76. <li><a href="./index.html#contribute">Contribute</a></li>
  77. <li><a href="./index.html#licenses">License</a></li>
  78. </ul>
  79. </div>
  80. </div>
  81. </nav>
  82. </div>
  83. </div>
  84. <div class="contentWrapper">
  85. <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>
  86. <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>
  87. <pre class="prettyprint lang-html">
  88. &lt;div id="visualization"&gt;&lt;/div&gt;
  89. &lt;script type="text/javascript"&gt;
  90. // Create and populate a data table.
  91. var data = new vis.DataSet();
  92. // create some nice looking data with sin/cos
  93. var counter = 0;
  94. var steps = 50; // number of datapoints will be steps*steps
  95. var axisMax = 314;
  96. var axisStep = axisMax / steps;
  97. for (var x = 0; x < axisMax; x+=axisStep) {
  98. for (var y = 0; y < axisMax; y+=axisStep) {
  99. var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
  100. data.add({id:counter++,x:x,y:y,z:value,style:value});
  101. }
  102. }
  103. // specify options
  104. var options = {
  105. width: '500px',
  106. height: '552px',
  107. style: 'surface',
  108. showPerspective: true,
  109. showGrid: true,
  110. showShadow: false,
  111. keepAspectRatio: true,
  112. verticalRatio: 0.5
  113. };
  114. // Instantiate our graph object.
  115. var container = document.getElementById('visualization');
  116. var graph3d = new vis.Graph3d(container, data, options);
  117. &lt;/script&gt;
  118. </pre>
  119. <div id="visualization"></div>
  120. <h2 id="allExamples">All examples</h2>
  121. <div class="container-fluid">
  122. <div class="col-lg-2 col-md-3 col-sm-6">
  123. <a href="examples/graph3d/01_basics.html">
  124. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/1.png">
  125. <div class="exampleTitle">basis</div>
  126. </a>
  127. </div>
  128. <div class="col-lg-2 col-md-3 col-sm-6">
  129. <a href="examples/graph3d/02_camera.html">
  130. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/2.png">
  131. <div class="exampleTitle">camera</div>
  132. </a>
  133. </div>
  134. <div class="col-lg-2 col-md-3 col-sm-6">
  135. <a href="examples/graph3d/03_filter_data.html">
  136. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/3.png">
  137. <div class="exampleTitle">filter</div>
  138. </a>
  139. </div>
  140. <div class="col-lg-2 col-md-3 col-sm-6">
  141. <a href="examples/graph3d/04_animation.html">
  142. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/4.png">
  143. <div class="exampleTitle">animate</div>
  144. </a>
  145. </div>
  146. <div class="col-lg-2 col-md-3 col-sm-6">
  147. <a href="examples/graph3d/05_line.html">
  148. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/5.png">
  149. <div class="exampleTitle">line</div>
  150. </a>
  151. </div>
  152. <div class="col-lg-2 col-md-3 col-sm-6">
  153. <a href="examples/graph3d/06_moving_dots.html">
  154. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/6.png">
  155. <div class="exampleTitle">moving dots</div>
  156. </a>
  157. </div>
  158. <div class="col-lg-2 col-md-3 col-sm-6">
  159. <a href="examples/graph3d/07_dot_cloud_colors.html">
  160. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/7.png">
  161. <div class="exampleTitle">dot cloud colors</div>
  162. </a>
  163. </div>
  164. <div class="col-lg-2 col-md-3 col-sm-6">
  165. <a href="examples/graph3d/08_dot_cloud_size.html">
  166. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/8.png">
  167. <div class="exampleTitle">dot cloud size</div>
  168. </a>
  169. </div>
  170. <div class="col-lg-2 col-md-3 col-sm-6">
  171. <a href="examples/graph3d/09_mobile.html">
  172. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/9.png">
  173. <div class="exampleTitle">mobile</div>
  174. </a>
  175. </div>
  176. <div class="col-lg-2 col-md-3 col-sm-6">
  177. <a href="examples/graph3d/10_styling.html">
  178. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/10.png">
  179. <div class="exampleTitle">styles</div>
  180. </a>
  181. </div>
  182. <div class="col-lg-2 col-md-3 col-sm-6">
  183. <a href="examples/graph3d/11_tooltips.html">
  184. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/11.png">
  185. <div class="exampleTitle">tooltips</div>
  186. </a>
  187. </div>
  188. <div class="col-lg-2 col-md-3 col-sm-6">
  189. <a href="examples/graph3d/12_custom_labels.html">
  190. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/12.png">
  191. <div class="exampleTitle">custom labels</div>
  192. </a>
  193. </div>
  194. <div class="col-lg-2 col-md-3 col-sm-6">
  195. <a href="examples/graph3d/playground/index.html">
  196. <img class="example img-responsive" src="./images/exampleScreenshots/graph3d/playground.png">
  197. <div class="exampleTitle">playground</div>
  198. </a>
  199. </div>
  200. </div>
  201. <br />
  202. <br />
  203. <br />
  204. <br />
  205. </div>
  206. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  207. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  208. <!-- Include all compiled plugins (below), or include individual files as needed -->
  209. <script src="js/bootstrap.min.js"></script>
  210. </body>
  211. </html>