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.

208 lines
5.3 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>vis.js | documentation</title>
  5. <link href="css/prettify.css" type="text/css" rel="stylesheet" />
  6. <link href='css/style.css' type='text/css' rel='stylesheet'>
  7. <script type="text/javascript" src="lib/prettify/prettify.js"></script>
  8. </head>
  9. <body onload="prettyPrint();">
  10. <div id="container">
  11. <h1>vis.js documentation</h1>
  12. <p>
  13. Vis.js is a dynamic, browser based visualization library.
  14. The library is designed to be easy to use, handle large amounts
  15. of dynamic data, and enable manipulation of the data.
  16. </p>
  17. <p>
  18. The library is developed by
  19. <a href="http://almende.com" target="_blank">Almende B.V.</a>.
  20. Vis.js runs fine on Chrome, Firefox, Opera, Safari, IE9+, and most mobile
  21. browsers (with full touch support).
  22. </p>
  23. <h2 id="Components">Components</h2>
  24. <p>
  25. Vis.js contains of the following components:
  26. </p>
  27. <div style="text-align: center; float: right; padding-left: 30px;">
  28. <a href="img/vis_overview.png" target="_blank">
  29. <img src="img/vis_overview.png" style="width: 350px; "/><br>
  30. (click for a larger view)
  31. </a>
  32. </div>
  33. <ul>
  34. <li>
  35. <a href="dataset.html"><b>DataSet</b></a>.
  36. A flexible key/value based data set.
  37. Add, update, and remove items. Subscribe on changes in the data set.
  38. A DataSet can filter and order items, and convert fields of items.
  39. </li>
  40. <li>
  41. <a href="dataview.html"><b>DataView</b></a>.
  42. A filtered and/or formatted view on a DataSet.
  43. </li>
  44. <li>
  45. <a href="graph.html"><b>Graph</b></a>.
  46. Display a graph or network with nodes and edges.
  47. </li>
  48. <li>
  49. <a href="graph3d.html"><b>Graph3d</b></a>.
  50. Display data in a three dimensional graph.
  51. </li>
  52. <li>
  53. <a href="timeline.html"><b>Timeline</b></a>.
  54. Display different types of data on a timeline.
  55. </li>
  56. </ul>
  57. <h2 id="Install">Install</h2>
  58. <h3>npm</h3>
  59. <pre class="prettyprint">
  60. npm install vis
  61. </pre>
  62. <h3>bower</h3>
  63. <pre class="prettyprint">
  64. bower install vis
  65. </pre>
  66. <h3>download</h3>
  67. Download the library from the website:
  68. <a href="http://visjs.org" target="_blank">http://visjs.org</a>.
  69. <h2 id="Load">Load</h2>
  70. <p>
  71. To load vis.js, include the javascript and css files of vis in your web page:
  72. </p>
  73. <pre class="prettyprint lang-html">&lt;!DOCTYPE HTML&gt;
  74. &lt;html&gt;
  75. &lt;head&gt;
  76. &lt;script src="components/vis/vis.js"&gt;&lt;/script&gt;
  77. &lt;link href="components/vis/vis.css" rel="stylesheet" type="text/css" /&gt;
  78. &lt;/head&gt;
  79. &lt;body&gt;
  80. &lt;script type="text/javascript"&gt;
  81. // ... load a visualization
  82. &lt;/script&gt;
  83. &lt;/body&gt;
  84. &lt;/html&gt;
  85. </pre>
  86. <p>
  87. or load vis.js using require.js:
  88. </p>
  89. <pre class="prettyprint lang-js">
  90. require.config({
  91. paths: {
  92. vis: 'path/to/vis',
  93. }
  94. });
  95. require(['vis'], function (math) {
  96. // ... load a visualization
  97. });
  98. </pre>
  99. <p>
  100. A timeline can be instantiated as follows. Other components can be
  101. created in a similar way.
  102. </p>
  103. <pre class="prettyprint lang-js">
  104. var timeline = new vis.Timeline(container, data, options);
  105. </pre>
  106. <p>
  107. Where <code>container</code> is an HTML element, <code>data</code> is
  108. an Array with data or a DataSet, and <code>options</code> is an optional
  109. object with configuration options for the component.
  110. </p>
  111. <h2 id="Use">Use</h2>
  112. <p>
  113. A basic example on using a Timeline is shown below. More examples can be
  114. found in the <a href="https://github.com/almende/vis/tree/master/examples"
  115. target="_blank">examples directory</a> of the project.
  116. </p>
  117. <pre class="prettyprint lang-html">
  118. &lt;!DOCTYPE HTML&gt;
  119. &lt;html&gt;
  120. &lt;head&gt;
  121. &lt;title&gt;Timeline basic demo&lt;/title&gt;
  122. &lt;script src="components/vis/vis.js"&gt;&lt;/script&gt;
  123. &lt;link href="components/vis/vis.css" rel="stylesheet" type="text/css" /&gt;
  124. &lt;style type="text/css"&gt;
  125. body, html {
  126. font-family: sans-serif;
  127. }
  128. &lt;/style&gt;
  129. &lt;/head&gt;
  130. &lt;body&gt;
  131. &lt;div id="visualization"&gt;&lt;/div&gt;
  132. &lt;script type="text/javascript"&gt;
  133. var container = document.getElementById('visualization');
  134. var data = [
  135. {id: 1, content: 'item 1', start: '2013-04-20'},
  136. {id: 2, content: 'item 2', start: '2013-04-14'},
  137. {id: 3, content: 'item 3', start: '2013-04-18'},
  138. {id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'},
  139. {id: 5, content: 'item 5', start: '2013-04-25'},
  140. {id: 6, content: 'item 6', start: '2013-04-27'}
  141. ];
  142. var options = {};
  143. var timeline = new vis.Timeline(container, data, options);
  144. &lt;/script&gt;
  145. &lt;/body&gt;
  146. &lt;/html&gt;
  147. </pre>
  148. <h2 id="license">License</h2>
  149. <p>
  150. Copyright (C) 2010-2014 Almende B.V.
  151. </p>
  152. <p>
  153. Licensed under the Apache License, Version 2.0 (the "License");
  154. you may not use this file except in compliance with the License.
  155. You may obtain a copy of the License at
  156. </p>
  157. <p>
  158. <a href="http://www.apache.org/licenses/LICENSE-2.0"
  159. target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a>
  160. </p>
  161. <p>
  162. Unless required by applicable law or agreed to in writing, software
  163. distributed under the License is distributed on an "AS IS" BASIS,
  164. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  165. See the License for the specific language governing permissions and
  166. limitations under the License.
  167. </p>
  168. </div>
  169. </body>
  170. </html>