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.

289 lines
11 KiB

10 years ago
  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>Graph2d Examples</title>
  8. <link rel="icon" HREF="favicon.ico">
  9. <!-- Bootstrap -->
  10. <link href="css/bootstrap.min.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. <style>
  22. body {
  23. font-family: Lustria,Georgia,Times,"Times New Roman",serif !important;
  24. background: url('./images/crossword.png') /* Background pattern from subtlepatterns.com */
  25. }
  26. div.contentWrapper {
  27. padding:10px;
  28. }
  29. div.container {
  30. max-width:970px;
  31. }
  32. div.navbar-wrapper {
  33. background-color:#07508E;
  34. border-bottom: 3px solid #ffffff;
  35. }
  36. pre {
  37. width:450px;
  38. height:552px;
  39. overflow:auto;
  40. }
  41. #visualization {
  42. display:block;
  43. margin-left:470px;
  44. margin-top:-562px;
  45. width:500px;
  46. height:552px;
  47. border: 1px solid #dddddd;
  48. border-radius:4px;
  49. background-color:#fcfcfc;
  50. }
  51. div.textHTMLContent {
  52. margin-top:10px;
  53. margin-bottom:10px;
  54. display:block;
  55. width:800px;
  56. }
  57. img {
  58. border:1px solid #dddddd;
  59. width:250px;
  60. height:250px;
  61. border-radius:10px;
  62. margin-top:10px;
  63. }
  64. div.exampleTitle {
  65. position:relative;
  66. top:-7px;
  67. width:100%;
  68. max-width:250px;
  69. height:30px;
  70. border: 1px solid #dddddd;
  71. background-color: #526b84;
  72. color:#ffffff;
  73. text-align:center;
  74. vertical-align:middle;
  75. line-height: 30px;
  76. border-bottom-left-radius:5px;
  77. border-bottom-right-radius:5px;
  78. }
  79. </style>
  80. <script language="JavaScript">
  81. function loadVis() {
  82. var container = document.getElementById('visualization');
  83. var items = [
  84. {x: '2014-06-11', y: 10},
  85. {x: '2014-06-12', y: 25},
  86. {x: '2014-06-13', y: 30},
  87. {x: '2014-06-14', y: 10},
  88. {x: '2014-06-15', y: 15},
  89. {x: '2014-06-16', y: 30}
  90. ];
  91. var dataset = new vis.DataSet(items);
  92. var options = {
  93. start: '2014-06-10',
  94. end: '2014-06-18',
  95. height:'552px',
  96. clickToUse:true
  97. };
  98. var graph2d = new vis.Graph2d(container, dataset, options);
  99. }
  100. </script>
  101. </head>
  102. <body onload="prettyPrint(); loadVis();">
  103. <div class="navbar-wrapper">
  104. <div class="container">
  105. <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  106. <div class="container">
  107. <div class="navbar-header">
  108. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  109. <span class="sr-only">Toggle navigation</span>
  110. <span class="icon-bar"></span>
  111. <span class="icon-bar"></span>
  112. <span class="icon-bar"></span>
  113. </button>
  114. <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
  115. </div>
  116. <div id="navbar" class="navbar-collapse collapse">
  117. <ul class="nav navbar-nav">
  118. <li class="active"><a href="./index.html#modules">Modules</a></li>
  119. <li><a href="./docs/index.html" target="_blank">Documentation <img class="icon" src="./images/external-link-icons/external-link-icon-white.png"></a></li>
  120. <li><a href="./blog.html">Blog</a></li>
  121. <li><a href="./index.html#download_install">Download</a></li>
  122. <li><a href="./index.html#showcase">Showcase</a></li>
  123. <li><a href="./index.html#contribute">Contribute</a></li>
  124. <li><a href="./index.html#featureRequests">Feature requests</a></li>
  125. <li><a href="./index.html#licenses">License</a></li>
  126. </ul>
  127. </div>
  128. </div>
  129. </nav>
  130. </div>
  131. </div>
  132. <div class="contentWrapper">
  133. <h1>Graph2d Examples</h1><a class="btn btn-default" href="#allExamples" role="button">View all examples »</a> <a class="btn btn-primary" href="./docs/graph2d.html" role="button">View docs »</a>
  134. <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>
  135. <pre class="prettyprint lang-html">
  136. &lt;div id="visualization"&gt;&lt;/div&gt;
  137. &lt;script type="text/javascript"&gt;
  138. var container = document.getElementById('visualization');
  139. var items = [
  140. {x: '2014-06-11', y: 10},
  141. {x: '2014-06-12', y: 25},
  142. {x: '2014-06-13', y: 30},
  143. {x: '2014-06-14', y: 10},
  144. {x: '2014-06-15', y: 15},
  145. {x: '2014-06-16', y: 30}
  146. ];
  147. var dataset = new vis.DataSet(items);
  148. var options = {
  149. start: '2014-06-10',
  150. end: '2014-06-18'
  151. };
  152. var graph2d = new vis.Graph2d(container, dataset, options);
  153. &lt;/script&gt;
  154. </pre>
  155. <div id="visualization"></div>
  156. <h2 id="allExamples">All examples</h2>
  157. <div class="container-fluid">
  158. <div class="col-lg-2 col-md-3 col-sm-6">
  159. <a href="examples/graph2d/01_basic.html">
  160. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/1.png">
  161. <div class="exampleTitle">basic</div>
  162. </a>
  163. </div>
  164. <div class="col-lg-2 col-md-3 col-sm-6">
  165. <a href="examples/graph2d/02_bars.html">
  166. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/2.png">
  167. <div class="exampleTitle">bars</div>
  168. </a>
  169. </div>
  170. <div class="col-lg-2 col-md-3 col-sm-6">
  171. <a href="examples/graph2d/03_groups.html">
  172. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/3.png">
  173. <div class="exampleTitle">groups</div>
  174. </a>
  175. </div>
  176. <div class="col-lg-2 col-md-3 col-sm-6">
  177. <a href="examples/graph2d/04_rightAxis.html">
  178. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/4.png">
  179. <div class="exampleTitle">right axis</div>
  180. </a>
  181. </div>
  182. <div class="col-lg-2 col-md-3 col-sm-6">
  183. <a href="examples/graph2d/05_bothAxis.html">
  184. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/5.png">
  185. <div class="exampleTitle">both axis</div>
  186. </a>
  187. </div>
  188. <div class="col-lg-2 col-md-3 col-sm-6">
  189. <a href="examples/graph2d/06_interpolation.html">
  190. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/6.png">
  191. <div class="exampleTitle">interpolation</div>
  192. </a>
  193. </div>
  194. <div class="col-lg-2 col-md-3 col-sm-6">
  195. <a href="examples/graph2d/07_scrollingAndSorting.html">
  196. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/7.png">
  197. <div class="exampleTitle">scrolling and sorting</div>
  198. </a>
  199. </div>
  200. <div class="col-lg-2 col-md-3 col-sm-6">
  201. <a href="examples/graph2d/08_performance.html">
  202. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/8.png">
  203. <div class="exampleTitle">performance</div>
  204. </a>
  205. </div>
  206. <div class="col-lg-2 col-md-3 col-sm-6">
  207. <a href="examples/graph2d/09_external_legend.html">
  208. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/9.png">
  209. <div class="exampleTitle">external legend</div>
  210. </a>
  211. </div>
  212. <div class="col-lg-2 col-md-3 col-sm-6">
  213. <a href="examples/graph2d/10_barsSideBySide.html">
  214. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/10.png">
  215. <div class="exampleTitle">bars side by side</div>
  216. </a>
  217. </div>
  218. <div class="col-lg-2 col-md-3 col-sm-6">
  219. <a href="examples/graph2d/11_barsSideBySideGroups.html">
  220. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/11.png">
  221. <div class="exampleTitle">bars side by side groups</div>
  222. </a>
  223. </div>
  224. <div class="col-lg-2 col-md-3 col-sm-6">
  225. <a href="examples/graph2d/12_customRange.html">
  226. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/12.png">
  227. <div class="exampleTitle">custom range</div>
  228. </a>
  229. </div>
  230. <div class="col-lg-2 col-md-3 col-sm-6">
  231. <a href="examples/graph2d/13_localization.html">
  232. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/13.png">
  233. <div class="exampleTitle">localization</div>
  234. </a>
  235. </div>
  236. <div class="col-lg-2 col-md-3 col-sm-6">
  237. <a href="examples/graph2d/14_toggleGroups.html">
  238. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/14.png">
  239. <div class="exampleTitle">toggle groups</div>
  240. </a>
  241. </div>
  242. <div class="col-lg-2 col-md-3 col-sm-6">
  243. <a href="examples/graph2d/15_streaming_data.html">
  244. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/15.png">
  245. <div class="exampleTitle">streaming data</div>
  246. </a>
  247. </div>
  248. <div class="col-lg-2 col-md-3 col-sm-6">
  249. <a href="examples/graph2d/16_bothAxis_titles.html">
  250. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/16.png">
  251. <div class="exampleTitle">axis titles</div>
  252. </a>
  253. </div>
  254. <div class="col-lg-2 col-md-3 col-sm-6">
  255. <a href="examples/graph2d/17_dynamicStyling.html">
  256. <img class="example img-responsive" src="./images/exampleScreenshots/graph2d/17.png">
  257. <div class="exampleTitle">dynamic styling</div>
  258. </a>
  259. </div>
  260. </div>
  261. <br />
  262. <br />
  263. <br />
  264. <br />
  265. </div>
  266. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  267. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  268. <!-- Include all compiled plugins (below), or include individual files as needed -->
  269. <script src="js/bootstrap.min.js"></script>
  270. </body>
  271. </html>