1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"ast":null,"code":"/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { each, bind, extend } from 'zrender/lib/core/util.js';\nimport { createOrUpdate, clear } from '../../util/throttle.js';\nvar CLICK_THRESHOLD = 5; // > 4\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n return _this;\n }\n\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n }, this);\n }\n\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n };\n\n ParallelView.prototype.dispose = function (ecModel, api) {\n clear(this, '_throttledDispatchExpand');\n each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n };\n /**\n * @internal\n * @param {Object} [opt] If null, cancel the last action triggering for debounce.\n */\n\n\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\n this._dispatchExpand(opt);\n };\n /**\n * @internal\n */\n\n\n ParallelView.prototype._dispatchExpand = function (opt) {\n opt && this._api.dispatchAction(extend({\n type: 'parallelAxisExpand'\n }, opt));\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ComponentView);\n\nvar handlers = {\n mousedown: function mousedown(e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function mouseup(e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function mousemove(e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : {\n duration: 0 // Disable animation.\n\n }\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\nexport default ParallelView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/component/parallel/ParallelView.js"],"names":["__extends","ComponentView","each","bind","extend","createOrUpdate","clear","CLICK_THRESHOLD","ParallelView","_super","_this","apply","arguments","type","prototype","render","parallelModel","ecModel","api","_model","_api","_handlers","handlers","handler","eventName","getZr","on","get","dispose","off","_throttledDispatchExpand","opt","_dispatchExpand","dispatchAction","mousedown","e","checkTrigger","_mouseDownPoint","offsetX","offsetY","mouseup","mouseDownPoint","point","dist","Math","pow","result","coordinateSystem","getSlidedAxisExpandWindow","behavior","axisExpandWindow","mousemove","model","debounceNextCall","animation","duration","view","triggerOn"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,OAA1B;AACA,OAAOC,aAAP,MAA0B,yBAA1B;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,MAArB,QAAmC,0BAAnC;AACA,SAASC,cAAT,EAAyBC,KAAzB,QAAsC,wBAAtC;AACA,IAAIC,eAAe,GAAG,CAAtB,C,CAAyB;;AAEzB,IAAIC,YAAY;AAChB;AACA,UAAUC,MAAV,EAAkB;AAChBT,EAAAA,SAAS,CAACQ,YAAD,EAAeC,MAAf,CAAT;;AAEA,WAASD,YAAT,GAAwB;AACtB,QAAIE,KAAK,GAAGD,MAAM,KAA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AU,gBAAV,KAA+ByB,KAAK,CAACzB,GAAN,CAAU,qBAAV,MAAqC8B,SAA3E;AACD;;AAED,eAAejD,YAAf","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { each, bind, extend } from 'zrender/lib/core/util.js';\nimport { createOrUpdate, clear } from '../../util/throttle.js';\nvar CLICK_THRESHOLD = 5; // > 4\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n return _this;\n }\n\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n }, this);\n }\n\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n };\n\n ParallelView.prototype.dispose = function (ecModel, api) {\n clear(this, '_throttledDispatchExpand');\n each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n };\n /**\n * @internal\n * @param {Object} [opt] If null, cancel the last action triggering for debounce.\n */\n\n\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\n this._dispatchExpand(opt);\n };\n /**\n * @internal\n */\n\n\n ParallelView.prototype._dispatchExpand = function (opt) {\n opt && this._api.dispatchAction(extend({\n type: 'parallelAxisExpand'\n }, opt));\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ComponentView);\n\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : {\n duration: 0 // Disable animation.\n\n }\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\nexport default ParallelView;"]},"metadata":{},"sourceType":"module"} |