* Use mock canvas object replacing `canvas`
Fixes#3515.
A mock canvas object is added to the unit tests, which makes usage of module `canvas` voluntary.
The issue with `canvas` is that it requires an external dependency to `cairo`. This complicates setting up a develop environment for `vis.js`
- Removed `canvas` from `package.json`
- Added section to README.md with instructions on how to install `canvas` instead.
* Removed debugger statements
* Updates for review
* Fixes for review
Module `canvas` is only required if you need to run `vis.js` on `node.js` and require actual output. It is not required for regular usage in a browser.
Currently, the unit tests use a mock object for canvas which has limited but adequate functionality. If `canvas` is installed, that will be used silently in place of the mock object.
The issue with `canvas` is that it has an external dependency to `cairo`. This needs to be installed outside of the regular install as done by `npm`. Please consult [`node-canvas` github page](https://github.com/Automattic/node-canvas/wiki#desktop) for the correct installation procecure your platform
## Load
## Load
To use a component, include the javascript and css files of vis in your web page:
To use a component, include the javascript and css files of vis in your web page:
@ -322,6 +332,9 @@ module: {
There is also an [demo-project](https://github.com/mojoaxel/vis-webpack-demo) showing the integration of vis.js using webpack.
There is also an [demo-project](https://github.com/mojoaxel/vis-webpack-demo) showing the integration of vis.js using webpack.
## Test
## Test
To test the library, install the project dependencies once:
To test the library, install the project dependencies once: