NavigatedViewer.js 733 B

12345678910111213141516171819202122232425262728293031
  1. import inherits from 'inherits';
  2. import Viewer from './Viewer';
  3. import KeyboardMoveModule from 'diagram-js/lib/navigation/keyboard-move';
  4. import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
  5. import ZoomScrollModule from 'diagram-js/lib/navigation/zoomscroll';
  6. /**
  7. * A viewer that includes mouse navigation facilities
  8. *
  9. * @param {Object} options
  10. */
  11. export default function NavigatedViewer(options) {
  12. Viewer.call(this, options);
  13. }
  14. inherits(NavigatedViewer, Viewer);
  15. NavigatedViewer.prototype._navigationModules = [
  16. KeyboardMoveModule,
  17. MoveCanvasModule,
  18. ZoomScrollModule
  19. ];
  20. NavigatedViewer.prototype._modules = [].concat(
  21. Viewer.prototype._modules,
  22. NavigatedViewer.prototype._navigationModules
  23. );