1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
![]() |
{"version":3,"file":"g2-plugin-brush.js","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 9ace5933f725c00cc374","webpack:///./index.js","webpack:///./src/index.js","webpack:///./src/util.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Brush\"] = factory();\n\telse\n\t\troot[\"Brush\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9ace5933f725c00cc374","/**\n * [exports description]\n * @type {Object}\n */\nvar Brush = require('./src/index');\nmodule.exports = Brush;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * [exports description]\n * @type {Object}\n */\nvar Util = require('./util');\n\nvar Brush = function () {\n function Brush(chart, type) {\n _classCallCheck(this, Brush);\n\n this.startPoint = null;\n this.isBrushing = false;\n this.brushShape = null;\n this.container = null;\n this.polygonPath = null;\n this.polygonPoints = null;\n\n this.type = type || 'XY';\n this.chart = chart;\n // TODO\n this.canvas = chart.get('canvas');\n this.plotRange = chart.get('plotRange');\n this.frontPlot = chart.get('frontPlot');\n\n this.bindEvent();\n }\n\n Brush.prototype.bindEvent = function bindEvent() {\n var me = this;\n var chart = me.chart,\n frontPlot = me.frontPlot,\n type = me.type;\n\n\n chart.on('mousedown', function (ev) {\n var x = ev.x,\n y = ev.y;\n\n var container = me.container;\n me.startPoint = {\n x: x,\n y: y\n };\n me.isBrushing = true; // 开始<E5BC80>
|