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.

196 lines
5.2 KiB

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