@ -76,6 +76,22 @@ Where `container` is an HTML element, `data` is an Array with data or a DataSet,
and `options` is an optional object with configuration options for the
component.
### Bundles
The folder `dist` contains bundled versions of vis.js for direct use in the browser. In general, to use vis, load the files `vis.js` and `vis.css`.
vis.js offers various bundled files: default or light version, and minified or non-minified. The source code of vis.js consists of commonjs modules, which makes it possible to create custom bundles using tools like [Browserify](http://browserify.org/) or [Webpack](http://webpack.github.io/). This can be bundling just one visualization like the Timeline, or bundling vis.js as part of your own browserified web application.
Bundle | Files | Description
------ | ----- | -----------
default | vis.js, vis.css | The default bundle, fully standalone. Code is not minified, use this version for development.
default minified | vis.min.js, vis.min.css | The default bundle, fully standalone. Code is minified, use this version for production.
light | vis-light.js, vis.css | The light bundle. External libraries [moment.js](http://momentjs.com/) and [hammer.js](http://hammerjs.github.io/) are excluded and need to be loaded before loading vis. Code is not minified, use this version for development.
light minified | vis-light.min.js, vis.min.css | The light bundle. External libraries [moment.js](http://momentjs.com/) and [hammer.js](http://hammerjs.github.io/) are excluded and need to be loaded before loading vis. Codee is minified, use this version for production.
The light bundle of vis.js (<code>vis-light.js</code> or <code>vis-light.min.js</code>) don't have the external dependencies of moment.js and hammer.js bundled. You have to load these yourself before loading vis-light.js. This is useful in the case that your application is using moment.js and/or hammer.js itself too, in order not to load these libraries twice. Note that it is possible too to create your own vis.js bundle: the source code consists of common.js modules which is browserifiable.
</p>
<divid="visualization"></div>
<scripttype="text/javascript">
// DOM element where the Timeline will be attached
var container = document.getElementById('visualization');