pathdiagram.app.js 726 B

12345678910111213141516171819202122
  1. define(function (require, exports, module) {
  2. var Class = require('core/class');
  3. var Paper = require('graphic/paper');
  4. var Draggable = require('../public/draggable');
  5. var PathDiagram = require('../pathdiagram/pathdiagram');
  6. Class.extendClass(Paper, Draggable);
  7. var paper = new Paper(document.body).drag();
  8. paper.on('dragstart', function() {
  9. this.setStyle('cursor', '-webkit-grabbing');
  10. }).on('dragend', function() {
  11. this.setStyle('cursor', '-webkit-grab');
  12. }).trigger('dragend');
  13. paper.setViewBox(-600.5, -400.5, 1200, 800);
  14. var keyword = /q=(.+)/.exec(window.location.href);
  15. keyword = keyword && keyword[1];
  16. paper.addShape(new PathDiagram(keyword));
  17. });