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.

14 lines
458 B

  1. // Only load hammer.js when in a browser environment
  2. // (loading hammer.js in a node.js environment gives errors)
  3. if (typeof window !== 'undefined') {
  4. var propagating = require('propagating-hammerjs');
  5. var Hammer = window['Hammer'] || require('hammerjs');
  6. module.exports = propagating(Hammer, {
  7. preventDefault: true
  8. });
  9. }
  10. else {
  11. module.exports = function () {
  12. throw Error('hammer.js is only available in a browser, not in node.js.');
  13. }
  14. }