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.

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