qauMaWeb/node_modules/.cache/babel-loader/3776028aa632f6915e1a52c0efe...

1 line
41 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 * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\n * Base axis pointer class in 2D.\n */\n\nvar BaseAxisPointer =\n/** @class */\nfunction () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\n * In px, arbitrary value. Do not set too small,\n * no animation is ok for most cases.\n */\n\n this.animationThreshold = 15;\n }\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api; // Optimize: `render` will be called repeatedly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n\n group && group.show();\n handle && handle.show(); // Otherwise status is 'show'\n\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type.\n\n var graphicKey = elOption.graphicKey;\n\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n\n updateMandatoryProps(group, axisPointerModel, true);\n\n this._renderHandle(value);\n };\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap.\n\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n } // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n\n\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent(); // Approximate band width\n\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n\n return false;\n }\n\n return animation === true;\n };\n /**\n * add {pointer, label, graphicKey} to elOption\n * @protected\n */\n\n\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Should be implemenented by sub-class.\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @private\n */\n\n\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n\n var axisPointerModel = this._axisPointerModel;\n\n var zr = this._api.getZr();\n\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n\n var isInit;\n\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function onmousemove(e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n\n updateMandatoryProps(handle, axisPointerModel, false); // update style\n\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position\n\n var handleSize = handleModel.get('size');\n\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n\n this._moveHandleToValue(value, isInit);\n };\n\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n this._dragging = true; // Persistent for throttle.\n\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n\n this._doDispatchAxisPointer();\n };\n /**\n * Throttled method.\n */\n\n\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n\n\n this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n\n\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\n * @private\n */\n\n\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n\n throttleUtil.clear(this, '_doDispatchAxisPointer');\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary.\n };\n\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n\n return BaseAxisPointer;\n}();\n\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\n\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\n\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\n\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\n\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\n\nexport default BaseAxisPointer;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js"],"names":["zrUtil","graphic","axisPointerModelHelper","eventTool","throttleUtil","makeInner","inner","clone","bind","BaseAxisPointer","_dragging","animationThreshold","prototype","render","axisModel","axisPointerModel","api","forceRender","value","get","status","_axisModel","_axisPointerModel","_api","_lastValue","_lastStatus","group","_group","handle","_handle","hide","show","elOption","makeElOption","graphicKey","_lastGraphicKey","clear","moveAnimation","_moveAnimation","determineAnimation","Group","createPointerEl","createLabelEl","getZr","add","doUpdateProps","curry","updateProps","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","remove","dispose","animation","axis","isCategoryAxis","type","useSnap","getBandWidth","seriesDataCount","getAxisInfo","axisExtent","getExtent","Math","abs","pointerOption","pointer","pointerEl","label","labelEl","Text","updateLabelShowHide","setStyle","style","shape","x","y","updateHandleTransform","zr","handleModel","getModel","isInit","createIcon","cursor","draggable","onmousemove","e","stop","event","onmousedown","_onHandleDragMove","drift","ondragend","_onHandleDragEnd","getItemStyle","handleSize","isArray","scaleX","scaleY","createOrUpdate","_moveHandleToValue","getHandleTransProps","getHandleTransform","dx","dy","trans","_payloadInfo","stopAnimation","attr","lastProp","_doDispatchAxisPointer","payloadInfo","dispatchAction","cursorPoint","tooltipOption","axesInfo","axisDim","dim","axisIndex","componentIndex","doClear","buildLabel","xy","wh","xDimIndex","width","height","animationModel","el","props","propsEqual","lastProps","newProps","isObject","equals_1","each","item","key","rotation","silent","z","zlevel","traverse"],"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,OAAO,KAAKA,MAAZ,MAAwB,0BAAxB;AACA,OAAO,KAAKC,OAAZ,MAAyB,uBAAzB;AACA,OAAO,KAAKC,sBAAZ,MAAwC,kBAAxC;AACA,OAAO,KAAKC,SAAZ,MAA2B,2BAA3B;AACA,OAAO,KAAKC,YAAZ,MAA8B,wBAA9B;AACA,SAASC,SAAT,QAA0B,qBAA1B;AACA,IAAIC,KAAK,GAAGD,SAAS,EAArB;AACA,IAAIE,KAAK,GAAGP,MAAM,CAACO,KAAnB;AACA,IAAIC,IAAI,GAAGR,MAAM,CAACQ,IAAlB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ACM,GAAD,CAAV,EAAiBD,IAAjB,CAAjC;AACD,KAFD;AAGA,WAAO,CAAC,CAACF,QAAT;AACD,GAND,MAMO;AACL,WAAOH,SAAS,KAAKC,QAArB;AACD;AACF;;AAED,SAAS7D,mBAAT,CAA6BF,OAA7B,EAAsCvD,gBAAtC,EAAwD;AACtDuD,EAAAA,OAAO,CAACvD,gBAAgB,CAACI,GAAjB,CAAqB,CAAC,OAAD,EAAU,MAAV,CAArB,IAA0C,MAA1C,GAAmD,MAApD,CAAP;AACD;;AAED,SAASmF,mBAAT,CAA6BI,KAA7B,EAAoC;AAClC,SAAO;AACL9B,IAAAA,CAAC,EAAE8B,KAAK,CAAC9B,CAAN,IAAW,CADT;AAELC,IAAAA,CAAC,EAAE6B,KAAK,CAAC7B,CAAN,IAAW,CAFT;AAGL8D,IAAAA,QAAQ,EAAEjC,KAAK,CAACiC,QAAN,IAAkB;AAHvB,GAAP;AAKD;;AAED,SAASzF,oBAAT,CAA8BxB,KAA9B,EAAqCX,gBAArC,EAAuD6H,MAAvD,EAA+D;AAC7D,MAAIC,CAAC,GAAG9H,gBAAgB,CAACI,GAAjB,CAAqB,GAArB,CAAR;AACA,MAAI2H,MAAM,GAAG/H,gBAAgB,CAACI,GAAjB,CAAqB,QAArB,CAAb;AACAO,EAAAA,KAAK,IAAIA,KAAK,CAACqH,QAAN,CAAe,UAAUd,EAAV,EAAc;AACpC,QAAIA,EAAE,CAACxE,IAAH,KAAY,OAAhB,EAAyB;AACvBoF,MAAAA,CAAC,IAAI,IAAL,KAAcZ,EAAE,CAACY,CAAH,GAAOA,CAArB;AACAC,MAAAA,MAAM,IAAI,IAAV,KAAmBb,EAAE,CAACa,MAAH,GAAYA,MAA/B;AACAb,MAAAA,EAAE,CAACW,MAAH,GAAYA,MAAZ;AACD;AACF,GANQ,CAAT;AAOD;;AAED,eAAenI,eAAf","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 * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\n * Base axis pointer class in 2D.\n */\n\nvar BaseAxisPointer =\n/** @class */\nfunction () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\n * In px, arbitrary value. Do not set too small,\n * no animation is ok for most cases.\n */\n\n this.animationThreshold = 15;\n }\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api; // Optimize: `render` will be called repeatedly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n\n group && group.show();\n handle && handle.show(); // Otherwise status is 'show'\n\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type.\n\n var graphicKey = elOption.graphicKey;\n\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n\n updateMandatoryProps(group, axisPointerModel, true);\n\n this._renderHandle(value);\n };\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap.\n\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n } // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n\n\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent(); // Approximate band width\n\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n\n return false;\n }\n\n return animation === true;\n };\n /**\n * add {pointer, label, graphicKey} to elOption\n * @protected\n */\n\n\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Should be implemenented by sub-class.\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @private\n */\n\n\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n\n var axisPointerModel = this._axisPointerModel;\n\n var zr = this._api.getZr();\n\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n\n var isInit;\n\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n\n updateMandatoryProps(handle, axisPointerModel, false); // update style\n\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position\n\n var handleSize = handleModel.get('size');\n\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n\n this._moveHandleToValue(value, isInit);\n };\n\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n this._dragging = true; // Persistent for throttle.\n\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n\n this._doDispatchAxisPointer();\n };\n /**\n * Throttled method.\n */\n\n\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n\n\n this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n\n\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\n * @private\n */\n\n\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n\n throttleUtil.clear(this, '_doDispatchAxisPointer');\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary.\n };\n\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n\n return BaseAxisPointer;\n}();\n\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\n\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\n\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\n\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\n\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\n\nexport default BaseAxisPointer;"]},"metadata":{},"sourceType":"module"}