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.

195 lines
5.1 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. <h2 id="Install">Install</h2>
  48. <h3>npm</h3>
  49. <pre class="prettyprint">
  50. npm install vis
  51. </pre>
  52. <h3>bower</h3>
  53. <pre class="prettyprint">
  54. bower install vis
  55. </pre>
  56. <h3>download</h3>
  57. Download the library from the website:
  58. <a href="http://visjs.org" target="_blank">http://visjs.org</a>.
  59. <h2 id="Load">Load</h2>
  60. <p>
  61. To use a component, include the javascript file of vis in your web page:
  62. </p>
  63. <pre class="prettyprint lang-html">&lt;!DOCTYPE HTML&gt;
  64. &lt;html&gt;
  65. &lt;head&gt;
  66. &lt;script src="components/vis/vis.js"&gt;&lt;/script&gt;
  67. &lt;/head&gt;
  68. &lt;body&gt;
  69. &lt;script type="text/javascript"&gt;
  70. // ... load a visualization
  71. &lt;/script&gt;
  72. &lt;/body&gt;
  73. &lt;/html&gt;
  74. </pre>
  75. <p>
  76. or load vis.js using require.js:
  77. </p>
  78. <pre class="prettyprint lang-js">
  79. require.config({
  80. paths: {
  81. vis: 'path/to/vis',
  82. }
  83. });
  84. require(['vis'], function (math) {
  85. // ... load a visualization
  86. });
  87. </pre>
  88. <p>
  89. A timeline can be instantiated as follows. Other components can be
  90. created in a similar way.
  91. </p>
  92. <pre class="prettyprint lang-js">
  93. var timeline = new vis.Timeline(container, data, options);
  94. </pre>
  95. <p>
  96. Where <code>container</code> is an HTML element, <code>data</code> is
  97. an Array with data or a DataSet, and <code>options</code> is an optional
  98. object with configuration options for the component.
  99. </p>
  100. <h2 id="Use">Use</h2>
  101. <p>
  102. A basic example on using a Timeline is shown below. More examples can be
  103. found in the <a href="https://github.com/almende/vis/tree/master/examples"
  104. target="_blank">examples directory</a> of the project.
  105. </p>
  106. <pre class="prettyprint lang-html">
  107. &lt;!DOCTYPE HTML&gt;
  108. &lt;html&gt;
  109. &lt;head&gt;
  110. &lt;title&gt;Timeline basic demo&lt;/title&gt;
  111. &lt;script src="components/vis/vis.js"&gt;&lt;/script&gt;
  112. &lt;style type="text/css"&gt;
  113. body, html {
  114. font-family: sans-serif;
  115. }
  116. &lt;/style&gt;
  117. &lt;/head&gt;
  118. &lt;body&gt;
  119. &lt;div id="visualization"&gt;&lt;/div&gt;
  120. &lt;script type="text/javascript"&gt;
  121. var container = document.getElementById('visualization');
  122. var data = [
  123. {id: 1, content: 'item 1', start: '2013-04-20'},
  124. {id: 2, content: 'item 2', start: '2013-04-14'},
  125. {id: 3, content: 'item 3', start: '2013-04-18'},
  126. {id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'},
  127. {id: 5, content: 'item 5', start: '2013-04-25'},
  128. {id: 6, content: 'item 6', start: '2013-04-27'}
  129. ];
  130. var options = {};
  131. var timeline = new vis.Timeline(container, data, options);
  132. &lt;/script&gt;
  133. &lt;/body&gt;
  134. &lt;/html&gt;
  135. </pre>
  136. <h2 id="license">License</h2>
  137. <p>
  138. Copyright (C) 2010-2013 Almende B.V.
  139. </p>
  140. <p>
  141. Licensed under the Apache License, Version 2.0 (the "License");
  142. you may not use this file except in compliance with the License.
  143. You may obtain a copy of the License at
  144. </p>
  145. <p>
  146. <a href="http://www.apache.org/licenses/LICENSE-2.0"
  147. target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a>
  148. </p>
  149. <p>
  150. Unless required by applicable law or agreed to in writing, software
  151. distributed under the License is distributed on an "AS IS" BASIS,
  152. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  153. See the License for the specific language governing permissions and
  154. limitations under the License.
  155. </p>
  156. </div>
  157. </body>
  158. </html>