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.

117 lines
3.1 KiB

11 years ago
11 years ago
11 years ago
11 years ago
  1. vis.js
  2. ==================
  3. Vis.js is a dynamic, browser based visualization library.
  4. The library is designed to be easy to use, to handle large amounts
  5. of dynamic data, and to enable manipulation of the data.
  6. The library consists of Timeline, LineChart, LineChart3d, Graph, and Treegrid.
  7. Vis.js Library is part of [CHAP](http://chap.almende.com),
  8. the Common Hybrid Agent Platform, developed by [Almende B.V](http://almende.com).
  9. ## Install
  10. Install via bower:
  11. bower install vis
  12. Or download the library from the github project:
  13. [https://github.com/almende/vis.git](https://github.com/almende/vis.git).
  14. ## Load
  15. To use a component, include the javascript file of vis in your webpage.
  16. ```html
  17. <script src="components/vis/vis.js"></script>
  18. ```
  19. A timeline can be instantiated as:
  20. ```js
  21. var timeline = new Timeline(container, data, options);
  22. ```
  23. Where `container` is an HTML element, `data` is an Array with data or a DataSet,
  24. and `options` is an optional object with configuration options for the
  25. component.
  26. ## Example
  27. A basic example on loading a Timeline is shown below. More examples can be
  28. found in the [examples directory](https://github.com/almende/vis/tree/master/examples)
  29. of the project.
  30. ```html
  31. <!DOCTYPE HTML>
  32. <html>
  33. <head>
  34. <title>Timeline basic demo</title>
  35. <script src="components/vis/vis.js"></script>
  36. <style type="text/css">
  37. body, html {
  38. font-family: sans-serif;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div id="visualization"></div>
  44. <script type="text/javascript">
  45. var container = document.getElementById('visualization');
  46. var data = [
  47. {id: 1, content: 'item 1', start: '2013-04-20'},
  48. {id: 2, content: 'item 2', start: '2013-04-14'},
  49. {id: 3, content: 'item 3', start: '2013-04-18'},
  50. {id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'},
  51. {id: 5, content: 'item 5', start: '2013-04-25'},
  52. {id: 6, content: 'item 6', start: '2013-04-27'}
  53. ];
  54. var options = {};
  55. var timeline = new Timeline(container, data, options);
  56. </script>
  57. </body>
  58. </html>
  59. ```
  60. ## Build
  61. To build the library from source, clone the project from github
  62. git clone git://github.com/almende/vis.git
  63. The project uses [jake](https://github.com/mde/jake) as build tool.
  64. To be able to run jake from the command line, jake must be installed globally:
  65. sudo npm install -g jake
  66. Then, the project can be build by executing jake in the root of the project:
  67. cd vis
  68. jake
  69. This will build the library for each of the components. The built libraries can
  70. be found in the directory `bin`, and includes examples.
  71. ## License
  72. Copyright (C) 2010-2013 Almende B.V.
  73. Licensed under the Apache License, Version 2.0 (the "License");
  74. you may not use this file except in compliance with the License.
  75. You may obtain a copy of the License at
  76. http://www.apache.org/licenses/LICENSE-2.0
  77. Unless required by applicable law or agreed to in writing, software
  78. distributed under the License is distributed on an "AS IS" BASIS,
  79. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  80. See the License for the specific language governing permissions and
  81. limitations under the License.