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.

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