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EAAM,IAAMgY,EACZhY,EAAM,IAAMgY,EACZvW,EAAOwL,OACT,CAEAnK,EAAQgP,gBAAkBA,EAC1BhP,EAAQkP,iBAAmBA,C","sources":["webpack://app/./node_modules/echarts/lib/component/helper/BrushController.js","webpack://app/./node_modules/echarts/lib/component/helper/BrushTargetManager.js","webpack://app/./node_modules/echarts/lib/component/helper/MapDraw.js","webpack://app/./node_modules/echarts/lib/component/helper/RoamController.js","webpack://app/./node_modules/echarts/lib/component/helper/brushHelper.js","webpack://app/./node_modules/echarts/lib/component/helper/cursorHelper.js","webpack://app/./node_modules/echarts/lib/component/helper/interactionMutex.js","webpack://app/./node_modules/echarts/lib/component/helper/listComponent.js","webpack://app/./node_modules/echarts/lib/component/helper/roamHelper.js"],"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\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Eventful = require(\"zrender/lib/mixin/Eventful\");\n\nvar graphic = require(\"../../util/graphic\");\n\nvar interactionMutex = require(\"./interactionMutex\");\n\nvar DataDiffer = require(\"../../data/DataDiffer\");\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*/\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar map = zrUtil.map;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathPow = Math.pow;\nvar COVER_Z = 10000;\nvar UNSELECT_THRESHOLD = 6;\nvar MIN_RESIZE_LINE_WIDTH = 6;\nvar MUTEX_RESOURCE_KEY = 'globalPan';\nvar DIRECTION_MAP = {\n w: [0, 0],\n e: [0, 1],\n n: [1, 0],\n s: [1, 1]\n};\nvar CURSOR_MAP = {\n w: 'ew',\n e: 'ew',\n n: 'ns',\n s: 'ns',\n ne: 'nesw',\n sw: 'nesw',\n nw: 'nwse',\n se: 'nwse'\n};\nvar DEFAULT_BRUSH_OPT = {\n brushStyle: {\n lineWidth: 2,\n stroke: 'rgba(0,0,0,0.3)',\n fill: 'rgba(0,0,0,0.1)'\n },\n transformable: true,\n brushMode: 'single',\n removeOnClick: false\n};\nvar baseUID = 0;\n/**\n * @alias module:echarts/component/helper/BrushController\n * @constructor\n * @mixin {module:zrender/mixin/Eventful}\n * @event module:echarts/component/helper/BrushController#brush\n * params:\n * areas: Array.<Array>, coord relates to container group,\n * If no container specified, to global.\n * opt {\n * isEnd: boolean,\n * removeOnClick: boolean\n * }\n *\n * @param {module:zrender/zrender~ZRender} zr\n */\n\nfunction BrushController(zr) {\n Eventful.call(this);\n /**\n * @type {module:zrender/zrender~ZRender}\n * @private\n */\n\n this._zr = zr;\n /**\n * @type {module:zrender/container/Group}\n * @readOnly\n */\n\n this.group = new graphic.Group();\n /**\n * Only for drawing (after enabledBrush).\n * 'line', 'rect', 'polygon' or false\n * If passing false/null/undefined, disable brush.\n * If passing 'auto', determined by panel.defaultBrushType\n * @private\n * @type {string}\n */\n\n this._brushType;\n /**\n * Only for drawing (after enabledBrush).\n *\n * @private\n * @type {Object}\n */\n\n this._brushOption;\n /**\n * @private\n * @type {Object}\n */\n\n this._panels;\n /**\n * @private\n * @type {Array.<nubmer>}\n */\n\n this._track = [];\n /**\n * @private\n * @type {boolean}\n */\n\n this._dragging;\n /**\n * @private\n * @type {Array}\n */\n\n this._covers = [];\n /**\n * @private\n * @type {moudule:zrender/container/Group}\n */\n\n this._creatingCover;\n /**\n * `true` means global panel\n * @private\n * @type {module:zrender/container/Group|boolean}\n */\n\n this._creatingPanel;\n /**\n * @private\n * @type {boolean}\n */\n\n this._enableGlobalPan;\n /**\n * @private\n * @type {boolean}\n */\n\n /**\n * @private\n * @type {string}\n */\n this._uid = 'brushController_' + baseUID++;\n /**\n * @private\n * @type {Object}\n */\n\n this._handlers = {};\n each(pointerHandlers, function (handler, eventName) {\n this._handlers[eventName] = zrUtil.bind(handler, this);\n }, this);\n}\n\nBrushController.prototype = {\n constructor: BrushController,\n\n /**\n * If set to null/undefined/false, select disabled.\n * @param {Object} brushOption\n * @param {string|boolean} brushOption.brushType 'line', 'rect', 'polygon' or false\n * If passing false/null/undefined, disable brush.\n * If passing 'auto', determined by panel.defaultBrushType.\n * ('auto' can not be used in global panel)\n * @param {number} [brushOption.brushMode='single'] 'single' or 'multiple'\n * @param {boolean} [brushOption.transformable=true]\n * @param {boolean} [brushOption.removeOnClick=false]\n * @param {Object} [brushOption.brushStyle]\n * @param {number} [brushOption.brushStyle.width]\n * @param {number} [brushOption.brushStyle.lineWidth]\n * @param {string} [brushOption.brushStyle.stroke]\n * @param {string} [brushOption.brushStyle.fill]\n * @param {number} [brushOption.z]\n */\n enableBrush: function (brushOption) {\n this._brushType && doDisableBrush(this);\n brushOption.brushType && doEnableBrush(this, brushOption);\n return this;\n },\n\n /**\n * @param {Array.<Object>} panelOpts If not pass, it is global brush.\n * Each items: {\n * panelId, // mandatory.\n * clipPath, // mandatory. function.\n * isTargetByCursor, // mandatory. function.\n * defaultBrushType, // optional, only used when brushType is 'auto'.\n * getLinearBrushOtherExtent, // optional. function.\n * }\n */\n setPanels: function (panelOpts) {\n if (panelOpts && panelOpts.length) {\n var panels = this._panels = {};\n zrUtil.each(panelOpts, function (panelOpts) {\n panels[panelOpts.panelId] = zrUtil.clone(panelOpts);\n });\n } else {\n this._panels = null;\n }\n\n return this;\n },\n\n /**\n * @param {Object} [opt]\n * @return {boolean} [opt.enableGlobalPan=false]\n */\n mount: function (opt) {\n opt = opt || {};\n this._enableGlobalPan = opt.enableGlobalPan;\n var thisGroup = this.group;\n\n this._zr.add(thisGroup);\n\n thisGroup.attr({\n position: opt.position || [0, 0],\n rotation: opt.rotation || 0,\n scale: opt.scale || [1, 1]\n });\n this._transform = thisGroup.getLocalTransform();\n return this;\n },\n eachCover: function (cb, context) {\n each(this._covers, cb, context);\n },\n\n /**\n * Update covers.\n * @param {Array.<Object>} brushOptionList Like:\n * [\n * {id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable},\n * {id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]},\n * ...\n * ]\n * `brushType` is required in each cover info. (can not be 'auto')\n * `id` is not mandatory.\n * `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default.\n * If brushOptionList is null/undefined, all covers removed.\n */\n updateCovers: function (brushOptionList) {\n brushOptionList = zrUtil.map(brushOptionList, function (brushOption) {\n return zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);\n });\n var tmpIdPrefix = '\\0-brush-index-';\n var oldCovers = this._covers;\n var newCovers = this._covers = [];\n var controller = this;\n var creatingCover = this._creatingCover;\n new DataDiffer(oldCovers, brushOptionList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();\n return this;\n\n function getKey(brushOption, index) {\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType;\n }\n\n function oldGetKey(cover, index) {\n return getKey(cover.__brushOption, index);\n }\n\n function addOrUpdate(newIndex, oldIndex) {\n var newBrushOption = brushOptionList[newIndex]; // Consider setOption in event listener of brushSelect,\n // where updating cover when creating should be forbiden.\n\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\n newCovers[newIndex] = oldCovers[oldIndex];\n } else {\n var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushOption, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushOption));\n updateCoverAfterCreation(controller, cover);\n }\n }\n\n function remove(oldIndex) {\n if (oldCovers[oldIndex] !== creatingCover) {\n controller.group.remove(oldCovers[oldIndex]);\n }\n }\n },\n unmount: function () {\n this.enableBrush(false); // container may 'removeAll' outside.\n\n clearCovers(this);\n\n this._zr.remove(this.group);\n\n return this;\n },\n dispose: function () {\n this.unmount();\n this.off();\n }\n};\nzrUtil.mixin(BrushController, Eventful);\n\nfunction doEnableBrush(controller, brushOption) {\n var zr = controller._zr; // Consider roam, which takes globalPan too.\n\n if (!controller._enableGlobalPan) {\n interactionMutex.take(zr, MUTEX_RESOURCE_KEY, controller._uid);\n }\n\n mountHandlers(zr, controller._handlers);\n controller._brushType = brushOption.brushType;\n controller._brushOption = zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);\n}\n\nfunction doDisableBrush(controller) {\n var zr = controller._zr;\n interactionMutex.release(zr, MUTEX_RESOURCE_KEY, controller._uid);\n unmountHandlers(zr, controller._handlers);\n controller._brushType = controller._brushOption = null;\n}\n\nfunction mountHandlers(zr, handlers) {\n each(handlers, function (handler, eventName) {\n zr.on(eventName, handler);\n });\n}\n\nfunction unmountHandlers(zr, handlers) {\n each(handlers, function (handler, eventName) {\n zr.off(eventName, handler);\n });\n}\n\nfunction createCover(controller, brushOption) {\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\n cover.__brushOption = brushOption;\n updateZ(cover, brushOption);\n controller.group.add(cover);\n return cover;\n}\n\nfunction endCreating(controller, creatingCover) {\n var coverRenderer = getCoverRenderer(creatingCover);\n\n if (coverRenderer.endCreating) {\n coverRenderer.endCreating(controller, creatingCover);\n updateZ(creatingCover, creatingCover.__brushOption);\n }\n\n return creatingCover;\n}\n\nfunction updateCoverShape(controller, cover) {\n var brushOption = cover.__brushOption;\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\n}\n\nfunction updateZ(cover, brushOption) {\n var z = brushOption.z;\n z == null && (z = COVER_Z);\n cover.traverse(function (el) {\n el.z = z;\n el.z2 = z; // Consider in given container.\n });\n}\n\nfunction updateCoverAfterCreation(controller, cover) {\n getCoverRenderer(cover).updateCommon(controller, cover);\n updateCoverShape(controller, cover);\n}\n\nfunction getCoverRenderer(cover) {\n return coverRenderers[cover.__brushOption.brushType];\n} // return target panel or `true` (means global panel)\n\n\nfunction getPanelByPoint(controller, e, localCursorPoint) {\n var panels = controller._panels;\n\n if (!panels) {\n return true; // Global panel\n }\n\n var panel;\n var transform = controller._transform;\n each(panels, function (pn) {\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\n });\n return panel;\n} // Return a panel or true\n\n\nfunction getPanelByCover(controller, cover) {\n var panels = controller._panels;\n\n if (!panels) {\n return true; // Global panel\n }\n\n var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info,\n // which is then treated as global panel.\n\n return panelId != null ? panels[panelId] : true;\n}\n\nfunction clearCovers(controller) {\n var covers = controller._covers;\n var originalLength = covers.length;\n each(covers, function (cover) {\n controller.group.remove(cover);\n }, controller);\n covers.length = 0;\n return !!originalLength;\n}\n\nfunction trigger(controller, opt) {\n var areas = map(controller._covers, function (cover) {\n var brushOption = cover.__brushOption;\n var range = zrUtil.clone(brushOption.range);\n return {\n brushType: brushOption.brushType,\n panelId: brushOption.panelId,\n range: range\n };\n });\n controller.trigger('brush', areas, {\n isEnd: !!opt.isEnd,\n removeOnClick: !!opt.removeOnClick\n });\n}\n\nfunction shouldShowCover(controller) {\n var track = controller._track;\n\n if (!track.length) {\n return false;\n }\n\n var p2 = track[track.length - 1];\n var p1 = track[0];\n var dx = p2[0] - p1[0];\n var dy = p2[1] - p1[1];\n var dist = mathPow(dx * dx + dy * dy, 0.5);\n return dist > UNSELECT_THRESHOLD;\n}\n\nfunction getTrackEnds(track) {\n var tail = track.length - 1;\n tail < 0 && (tail = 0);\n return [track[0], track[tail]];\n}\n\nfunction createBaseRectCover(doDrift, controller, brushOption, edgeNames) {\n var cover = new graphic.Group();\n cover.add(new graphic.Rect({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true,\n draggable: true,\n cursor: 'move',\n drift: curry(doDrift, controller, cover, 'nswe'),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n each(edgeNames, function (name) {\n cover.add(new graphic.Rect({\n name: name,\n style: {\n opacity: 0\n },\n draggable: true,\n silent: true,\n invisible: true,\n drift: curry(doDrift, controller, cover, name),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n });\n return cover;\n}\n\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\n var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\n var x = localRange[0][0];\n var y = localRange[1][0];\n var xa = x - lineWidth / 2;\n var ya = y - lineWidth / 2;\n var x2 = localRange[0][1];\n var y2 = localRange[1][1];\n var x2a = x2 - handleSize + lineWidth / 2;\n var y2a = y2 - handleSize + lineWidth / 2;\n var width = x2 - x;\n var height = y2 - y;\n var widtha = width + lineWidth;\n var heighta = height + lineWidth;\n updateRectShape(controller, cover, 'main', x, y, width, height);\n\n if (brushOption.transformable) {\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\n }\n}\n\nfunction updateCommon(controller, cover) {\n var brushOption = cover.__brushOption;\n var transformable = brushOption.transformable;\n var mainEl = cover.childAt(0);\n mainEl.useStyle(makeStyle(brushOption));\n mainEl.attr({\n silent: !transformable,\n cursor: transformable ? 'move' : 'default'\n });\n each(['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'], function (name) {\n var el = cover.childOfName(name);\n var globalDir = getGlobalDirection(controller, name);\n el && el.attr({\n silent: !transformable,\n invisible: !transformable,\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\n });\n });\n}\n\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\n var el = cover.childOfName(name);\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\n}\n\nfunction makeStyle(brushOption) {\n return zrUtil.defaults({\n strokeNoScale: true\n }, brushOption.brushStyle);\n}\n\nfunction formatRectRange(x, y, x2, y2) {\n var min = [mathMin(x, x2), mathMin(y, y2)];\n var max = [mathMax(x, x2), mathMax(y, y2)];\n return [[min[0], max[0]], // x range\n [min[1], max[1]] // y range\n ];\n}\n\nfunction getTransform(controller) {\n return graphic.getTransform(controller.group);\n}\n\nfunction getGlobalDirection(controller, localDirection) {\n if (localDirection.length > 1) {\n localDirection = localDirection.split('');\n var globalDir = [getGlobalDirection(controller, localDirection[0]), getGlobalDirection(controller, localDirection[1])];\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\n return globalDir.join('');\n } else {\n var map = {\n w: 'left',\n e: 'right',\n n: 'top',\n s: 'bottom'\n };\n var inverseMap = {\n left: 'w',\n right: 'e',\n top: 'n',\n bottom: 's'\n };\n var globalDir = graphic.transformDirection(map[localDirection], getTransform(controller));\n return inverseMap[globalDir];\n }\n}\n\nfunction driftRect(toRectRange, fromRectRange, controller, cover, name, dx, dy, e) {\n var brushOption = cover.__brushOption;\n var rectRange = toRectRange(brushOption.range);\n var localDelta = toLocalDelta(controller, dx, dy);\n each(name.split(''), function (namePart) {\n var ind = DIRECTION_MAP[namePart];\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\n });\n brushOption.range = fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction driftPolygon(controller, cover, dx, dy, e) {\n var range = cover.__brushOption.range;\n var localDelta = toLocalDelta(controller, dx, dy);\n each(range, function (point) {\n point[0] += localDelta[0];\n point[1] += localDelta[1];\n });\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction toLocalDelta(controller, dx, dy) {\n var thisGroup = controller.group;\n var localD = thisGroup.transformCoordToLocal(dx, dy);\n var localZero = thisGroup.transformCoordToLocal(0, 0);\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\n}\n\nfunction clipByPanel(controller, cover, data) {\n var panel = getPanelByCover(controller, cover);\n return panel && panel !== true ? panel.clipPath(data, controller._transform) : zrUtil.clone(data);\n}\n\nfunction pointsToRect(points) {\n var xmin = mathMin(points[0][0], points[1][0]);\n var ymin = mathMin(points[0][1], points[1][1]);\n var xmax = mathMax(points[0][0], points[1][0]);\n var ymax = mathMax(points[0][1], points[1][1]);\n return {\n x: xmin,\n y: ymin,\n width: xmax - xmin,\n height: ymax - ymin\n };\n}\n\nfunction resetCursor(controller, e, localCursorPoint) {\n if ( // Check active\n !controller._brushType // resetCursor should be always called when mouse is in zr area,\n // but not called when mouse is out of zr area to avoid bad influence\n // if `mousemove`, `mouseup` are triggered from `document` event.\n || isOutsideZrArea(controller, e)) {\n return;\n }\n\n var zr = controller._zr;\n var covers = controller._covers;\n var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers.\n\n if (!controller._dragging) {\n for (var i = 0; i < covers.length; i++) {\n var brushOption = covers[i].__brushOption;\n\n if (currPanel && (currPanel === true || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\n // Use cursor style set on cover.\n return;\n }\n }\n }\n\n currPanel && zr.setCursorStyle('crosshair');\n}\n\nfunction preventDefault(e) {\n var rawE = e.event;\n rawE.preventDefault && rawE.preventDefault();\n}\n\nfunction mainShapeContain(cover, x, y) {\n return cover.childOfName('main').contain(x, y);\n}\n\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\n var creatingCover = controller._creatingCover;\n var panel = controller._creatingPanel;\n var thisBrushOption = controller._brushOption;\n var eventParams;\n\n controller._track.push(localCursorPoint.slice());\n\n if (shouldShowCover(controller) || creatingCover) {\n if (panel && !creatingCover) {\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\n var brushOption = zrUtil.clone(thisBrushOption);\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\n brushOption.panelId = panel === true ? null : panel.panelId;\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\n\n controller._covers.push(creatingCover);\n }\n\n if (creatingCover) {\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\n var coverBrushOption = creatingCover.__brushOption;\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\n\n if (isEnd) {\n endCreating(controller, creatingCover);\n coverRenderer.updateCommon(controller, creatingCover);\n }\n\n updateCoverShape(controller, creatingCover);\n eventParams = {\n isEnd: isEnd\n };\n }\n } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) {\n // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\n // But a single click do not clear covers, because user may have casual\n // clicks (for example, click on other component and do not expect covers\n // disappear).\n // Only some cover removed, trigger action, but not every click trigger action.\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\n eventParams = {\n isEnd: isEnd,\n removeOnClick: true\n };\n }\n }\n\n return eventParams;\n}\n\nfunction determineBrushType(brushType, panel) {\n if (brushType === 'auto') {\n return panel.defaultBrushType;\n }\n\n return brushType;\n}\n\nvar pointerHandlers = {\n mousedown: function (e) {\n if (this._dragging) {\n // In case some browser do not support globalOut,\n // and release mose out side the browser.\n handleDragEnd(this, e);\n } else if (!e.target || !e.target.draggable) {\n preventDefault(e);\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\n this._creatingCover = null;\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\n\n if (panel) {\n this._dragging = true;\n this._track = [localCursorPoint.slice()];\n }\n }\n },\n mousemove: function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\n resetCursor(this, e, localCursorPoint);\n\n if (this._dragging) {\n preventDefault(e);\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\n eventParams && trigger(this, eventParams);\n }\n },\n mouseup: function (e) {\n handleDragEnd(this, e);\n }\n};\n\nfunction handleDragEnd(controller, e) {\n if (controller._dragging) {\n preventDefault(e);\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\n controller._dragging = false;\n controller._track = [];\n controller._creatingCover = null; // trigger event shoule be at final, after procedure will be nested.\n\n eventParams && trigger(controller, eventParams);\n }\n}\n\nfunction isOutsideZrArea(controller, x, y) {\n var zr = controller._zr;\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\n}\n/**\n * key: brushType\n * @type {Object}\n */\n\n\nvar coverRenderers = {\n lineX: getLineRenderer(0),\n lineY: getLineRenderer(1),\n rect: {\n createCover: function (controller, brushOption) {\n return createBaseRectCover(curry(driftRect, function (range) {\n return range;\n }, function (range) {\n return range;\n }), controller, brushOption, ['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw']);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n updateBaseRect(controller, cover, localRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n },\n polygon: {\n createCover: function (controller, brushOption) {\n var cover = new graphic.Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the\n // border of the shape when drawing, which is a better experience for user.\n\n cover.add(new graphic.Polyline({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true\n }));\n return cover;\n },\n getCreatingRange: function (localTrack) {\n return localTrack;\n },\n endCreating: function (controller, cover) {\n cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape.\n\n cover.add(new graphic.Polygon({\n name: 'main',\n draggable: true,\n drift: curry(driftPolygon, controller, cover),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n cover.childAt(0).setShape({\n points: clipByPanel(controller, cover, localRange)\n });\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n }\n};\n\nfunction getLineRenderer(xyIndex) {\n return {\n createCover: function (controller, brushOption) {\n return createBaseRectCover(curry(driftRect, function (range) {\n var rectRange = [range, [0, 100]];\n xyIndex && rectRange.reverse();\n return rectRange;\n }, function (rectRange) {\n return rectRange[xyIndex];\n }), controller, brushOption, [['w', 'e'], ['n', 's']][xyIndex]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\n var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\n return [min, max];\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n var otherExtent; // If brushWidth not specified, fit the panel.\n\n var panel = getPanelByCover(controller, cover);\n\n if (panel !== true && panel.getLinearBrushOtherExtent) {\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex, controller._transform);\n } else {\n var zr = controller._zr;\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\n }\n\n var rectRange = [localRange, otherExtent];\n xyIndex && rectRange.reverse();\n updateBaseRect(controller, cover, rectRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n };\n}\n\nvar _default = BrushController;\nmodule.exports = _default;","\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\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar graphic = require(\"../../util/graphic\");\n\nvar modelUtil = require(\"../../util/model\");\n\nvar brushHelper = require(\"./brushHelper\");\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*/\nvar each = zrUtil.each;\nvar indexOf = zrUtil.indexOf;\nvar curry = zrUtil.curry;\nvar COORD_CONVERTS = ['dataToPoint', 'pointToData']; // FIXME\n// how to genarialize to more coordinate systems.\n\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\n/**\n * [option in constructor]:\n * {\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * }\n *\n *\n * [targetInfo]:\n *\n * There can be multiple axes in a single targetInfo. Consider the case\n * of `grid` component, a targetInfo represents a grid which contains one or more\n * cartesian and one or more axes. And consider the case of parallel system,\n * which has multiple axes in a coordinate system.\n * Can be {\n * panelId: ...,\n * coordSys: <a representitive cartesian in grid (first cartesian by default)>,\n * coordSyses: all cartesians.\n * gridModel: <grid component>\n * xAxes: correspond to coordSyses on index\n * yAxes: correspond to coordSyses on index\n * }\n * or {\n * panelId: ...,\n * coordSys: <geo coord sys>\n * coordSyses: [<geo coord sys>]\n * geoModel: <geo component>\n * }\n *\n *\n * [panelOpt]:\n *\n * Make from targetInfo. Input to BrushController.\n * {\n * panelId: ...,\n * rect: ...\n * }\n *\n *\n * [area]:\n *\n * Generated by BrushController or user input.\n * {\n * panelId: Used to locate coordInfo directly. If user inpput, no panelId.\n * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y').\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * range: pixel range.\n * coordRange: representitive coord range (the first one of coordRanges).\n * coordRanges: <Array> coord ranges, used in multiple cartesian in one grid.\n * }\n */\n\n/**\n * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.<number>}. like: {xAxisIndex: [3, 4]}\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} [opt]\n * @param {Array.<string>} [opt.include] include coordinate system types.\n */\n\nfunction BrushTargetManager(option, ecModel, opt) {\n /**\n * @private\n * @type {Array.<Object>}\n */\n var targetInfoList = this._targetInfoList = [];\n var info = {};\n var foundCpts = parseFinder(ecModel, option);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, targetInfoList, info);\n }\n });\n}\n\nvar proto = BrushTargetManager.prototype;\n\nproto.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges\n\n if (!area.coordRange) {\n area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n};\n\nproto.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (targetInfo && targetInfo !== true) {\n zrUtil.each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n};\n\nproto.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n area.range = area.range || []; // convert coordRange to global range and set panelId.\n\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n};\n\nproto.makePanelOpts = function (api, getDefaultBrushType) {\n return zrUtil.map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType && getDefaultBrushType(targetInfo),\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n};\n\nproto.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n};\n/**\n * If return Object, a coord found.\n * If reutrn true, global found.\n * Otherwise nothing found.\n *\n * @param {Object} area\n * @param {Array} targetInfoList\n * @return {Object|boolean}\n */\n\n\nproto.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var i = 0; i < targetInfoMatchers.length; i++) {\n if (targetInfoMatchers[i](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n\n return true;\n};\n\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\n\nfunction parseFinder(ecModel, option) {\n return modelUtil.parseFinder(ecModel, option, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\n\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels; // Remove duplicated.\n\n var gridModelMap = zrUtil.createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilder.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilder.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n}, // geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilder = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.grid.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform\n\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange) {\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = zrUtil.map(rangeOrCoordRange, function (item) {\n var p = coordSys[COORD_CONVERTS[to]](item);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\n\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(zrUtil.map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\n\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];\n },\n polygon: function (values, refer, scales) {\n return zrUtil.map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\n\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n} // We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n\n\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\n\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\n\nvar _default = BrushTargetManager;\nmodule.exports = _default;","\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\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar RoamController = require(\"./RoamController\");\n\nvar roamHelper = require(\"../../component/helper/roamHelper\");\n\nvar _cursorHelper = require(\"../../component/helper/cursorHelper\");\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphic = require(\"../../util/graphic\");\n\nvar geoSourceManager = require(\"../../coord/geo/geoSourceManager\");\n\nvar _component = require(\"../../util/component\");\n\nvar getUID = _component.getUID;\n\nvar Transformable = require(\"zrender/lib/mixin/Transformable\");\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*/\nfunction getFixedItemStyle(model) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n\n return itemStyle;\n}\n\nfunction updateMapSelectHandler(mapDraw, mapOrGeoModel, regionsGroup, api, fromView) {\n regionsGroup.off('click');\n regionsGroup.off('mousedown');\n\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n\n mapDraw._mouseDownFlag = false;\n var el = e.target;\n\n while (!el.__regions) {\n el = el.parent;\n }\n\n if (!el) {\n return;\n }\n\n var action = {\n type: (mapOrGeoModel.mainType === 'geo' ? 'geo' : 'map') + 'ToggleSelect',\n batch: zrUtil.map(el.__regions, function (region) {\n return {\n name: region.name,\n from: fromView.uid\n };\n })\n };\n action[mapOrGeoModel.mainType + 'Id'] = mapOrGeoModel.id;\n api.dispatchAction(action);\n updateMapSelected(mapOrGeoModel, regionsGroup);\n });\n }\n}\n\nfunction updateMapSelected(mapOrGeoModel, regionsGroup) {\n // FIXME\n regionsGroup.eachChild(function (otherRegionEl) {\n zrUtil.each(otherRegionEl.__regions, function (region) {\n otherRegionEl.trigger(mapOrGeoModel.isSelected(region.name) ? 'emphasis' : 'normal');\n });\n });\n}\n/**\n * @alias module:echarts/component/helper/MapDraw\n * @param {module:echarts/ExtensionAPI} api\n * @param {boolean} updateGroup\n */\n\n\nfunction MapDraw(api, updateGroup) {\n var group = new graphic.Group();\n /**\n * @type {string}\n * @private\n */\n\n this.uid = getUID('ec_map_draw');\n /**\n * @type {module:echarts/component/helper/RoamController}\n * @private\n */\n\n this._controller = new RoamController(api.getZr());\n /**\n * @type {Object} {target, zoom, zoomLimit}\n * @private\n */\n\n this._controllerHost = {\n target: updateGroup ? group : null\n };\n /**\n * @type {module:zrender/container/Group}\n * @readOnly\n */\n\n this.group = group;\n /**\n * @type {boolean}\n * @private\n */\n\n this._updateGroup = updateGroup;\n /**\n * This flag is used to make sure that only one among\n * `pan`, `zoom`, `click` can occurs, otherwise 'selected'\n * action may be triggered when `pan`, which is unexpected.\n * @type {booelan}\n */\n\n this._mouseDownFlag;\n /**\n * @type {string}\n */\n\n this._mapName;\n /**\n * @type {boolean}\n */\n\n this._initialized;\n /**\n * @type {module:zrender/container/Group}\n */\n\n group.add(this._regionsGroup = new graphic.Group());\n /**\n * @type {module:zrender/container/Group}\n */\n\n group.add(this._backgroundGroup = new graphic.Group());\n}\n\nMapDraw.prototype = {\n constructor: MapDraw,\n draw: function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n\n this._updateBackground(geo);\n\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var transformInfo = geo.getTransformInfo(); // No animation when first draw or in action\n\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\n var targetScale;\n\n if (isFirstDraw) {\n group.transform = transformInfo.roamTransform;\n group.decomposeTransform();\n group.dirty();\n } else {\n var target = new Transformable();\n target.transform = transformInfo.roamTransform;\n target.decomposeTransform();\n var props = {\n scale: target.scale,\n position: target.position\n };\n targetScale = target.scale;\n graphic.updateProps(group, props, mapOrGeoModel);\n }\n\n var scale = transformInfo.rawScale;\n var position = transformInfo.rawPosition;\n regionsGroup.removeAll();\n var itemStyleAccessPath = ['itemStyle'];\n var hoverItemStyleAccessPath = ['emphasis', 'itemStyle'];\n var labelAccessPath = ['label'];\n var hoverLabelAccessPath = ['emphasis', 'label'];\n var nameMap = zrUtil.createHashMap();\n zrUtil.each(geo.regions, function (region) {\n // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n var regionGroup = nameMap.get(region.name) || nameMap.set(region.name, new graphic.Group());\n var compoundPath = new graphic.CompoundPath({\n segmentIgnoreThreshold: 1,\n shape: {\n paths: []\n }\n });\n regionGroup.add(compoundPath);\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\n var itemStyleModel = regionModel.getModel(itemStyleAccessPath);\n var hoverItemStyleModel = regionModel.getModel(hoverItemStyleAccessPath);\n var itemStyle = getFixedItemStyle(itemStyleModel);\n var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel);\n var labelModel = regionModel.getModel(labelAccessPath);\n var hoverLabelModel = regionModel.getModel(hoverLabelAccessPath);\n var dataIdx; // Use the itemStyle in data if has data\n\n if (data) {\n dataIdx = data.indexOfName(region.name); // Only visual color of each item will be used. It can be encoded by dataRange\n // But visual color of series is used in symbol drawing\n //\n // Visual color for each series is for the symbol draw\n\n var visualColor = data.getItemVisual(dataIdx, 'color', true);\n\n if (visualColor) {\n itemStyle.fill = visualColor;\n }\n }\n\n var transformPoint = function (point) {\n return [point[0] * scale[0] + position[0], point[1] * scale[1] + position[1]];\n };\n\n zrUtil.each(region.geometries, function (geometry) {\n if (geometry.type !== 'polygon') {\n return;\n }\n\n var points = [];\n\n for (var i = 0; i < geometry.exterior.length; ++i) {\n points.push(transformPoint(geometry.exterior[i]));\n }\n\n compoundPath.shape.paths.push(new graphic.Polygon({\n segmentIgnoreThreshold: 1,\n shape: {\n points: points\n }\n }));\n\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) {\n var interior = geometry.interiors[i];\n var points = [];\n\n for (var j = 0; j < interior.length; ++j) {\n points.push(transformPoint(interior[j]));\n }\n\n compoundPath.shape.paths.push(new graphic.Polygon({\n segmentIgnoreThreshold: 1,\n shape: {\n points: points\n }\n }));\n }\n });\n compoundPath.setStyle(itemStyle);\n compoundPath.style.strokeNoScale = true;\n compoundPath.culling = true; // Label\n\n var showLabel = labelModel.get('show');\n var hoverShowLabel = hoverLabelModel.get('show');\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 4. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout\n\n if (isGeo || isDataNaN && (showLabel || hoverShowLabel) || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : region.name;\n var labelFetcher; // Consider dataIdx not found.\n\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n\n var textEl = new graphic.Text({\n position: transformPoint(region.center.slice()),\n // FIXME\n // label rotation is not support yet in geo or regions of series-map\n // that has no data. The rotation will be effected by this `scale`.\n // So needed to change to RectText?\n scale: [1 / group.scale[0], 1 / group.scale[1]],\n z2: 10,\n silent: true\n });\n graphic.setLabelStyle(textEl.style, textEl.hoverStyle = {}, labelModel, hoverLabelModel, {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: region.name,\n useInsideStyle: false\n }, {\n textAlign: 'center',\n textVerticalAlign: 'middle'\n });\n\n if (!isFirstDraw) {\n // Text animation\n var textScale = [1 / targetScale[0], 1 / targetScale[1]];\n graphic.updateProps(textEl, {\n scale: textScale\n }, mapOrGeoModel);\n }\n\n regionGroup.add(textEl);\n } // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the rigionGroup\n\n\n if (data) {\n data.setItemGraphicEl(dataIdx, regionGroup);\n } else {\n var regionModel = mapOrGeoModel.getRegionModel(region.name); // Package custom mouse event for geo component\n\n compoundPath.eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: region.name,\n region: regionModel && regionModel.option || {}\n };\n }\n\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\n groupRegions.push(region);\n regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\n graphic.setHoverStyle(regionGroup, hoverItemStyle);\n regionsGroup.add(regionGroup);\n });\n\n this._updateController(mapOrGeoModel, ecModel, api);\n\n updateMapSelectHandler(this, mapOrGeoModel, regionsGroup, api, fromView);\n updateMapSelected(mapOrGeoModel, regionsGroup);\n },\n remove: function () {\n this._regionsGroup.removeAll();\n\n this._backgroundGroup.removeAll();\n\n this._controller.dispose();\n\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\n this._mapName = null;\n this._controllerHost = {};\n },\n _updateBackground: function (geo) {\n var mapName = geo.map;\n\n if (this._mapName !== mapName) {\n zrUtil.each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\n this._backgroundGroup.add(root);\n }, this);\n }\n\n this._mapName = mapName;\n },\n _updateController: function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null\n\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n }));\n\n if (this._updateGroup) {\n var scale = this.group.scale;\n\n this._regionsGroup.traverse(function (el) {\n if (el.type === 'text') {\n el.attr('scale', [1 / scale[0], 1 / scale[1]]);\n }\n });\n }\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.getViewRectAfterRoam().contain(x, y) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n }\n};\nvar _default = MapDraw;\nmodule.exports = _default;","\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\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Eventful = require(\"zrender/lib/mixin/Eventful\");\n\nvar eventTool = require(\"zrender/lib/core/event\");\n\nvar interactionMutex = require(\"./interactionMutex\");\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*/\n\n/**\n * @alias module:echarts/component/helper/RoamController\n * @constructor\n * @mixin {module:zrender/mixin/Eventful}\n *\n * @param {module:zrender/zrender~ZRender} zr\n */\nfunction RoamController(zr) {\n /**\n * @type {Function}\n */\n this.pointerChecker;\n /**\n * @type {module:zrender}\n */\n\n this._zr = zr;\n /**\n * @type {Object}\n */\n\n this._opt = {}; // Avoid two roamController bind the same handler\n\n var bind = zrUtil.bind;\n var mousedownHandler = bind(mousedown, this);\n var mousemoveHandler = bind(mousemove, this);\n var mouseupHandler = bind(mouseup, this);\n var mousewheelHandler = bind(mousewheel, this);\n var pinchHandler = bind(pinch, this);\n Eventful.call(this);\n /**\n * @param {Function} pointerChecker\n * input: x, y\n * output: boolean\n */\n\n this.setPointerChecker = function (pointerChecker) {\n this.pointerChecker = pointerChecker;\n };\n /**\n * Notice: only enable needed types. For example, if 'zoom'\n * is not needed, 'zoom' should not be enabled, otherwise\n * default mousewheel behaviour (scroll page) will be disabled.\n *\n * @param {boolean|string} [controlType=true] Specify the control type,\n * which can be null/undefined or true/false\n * or 'pan/move' or 'zoom'/'scale'\n * @param {Object} [opt]\n * @param {Object} [opt.zoomOnMouseWheel=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.moveOnMouseMove=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.moveOnMouseWheel=false] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.preventDefaultMouseMove=true] When pan.\n */\n\n\n this.enable = function (controlType, opt) {\n // Disable previous first\n this.disable();\n this._opt = zrUtil.defaults(zrUtil.clone(opt) || {}, {\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n // By default, wheel do not trigger move.\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n\n if (controlType == null) {\n controlType = true;\n }\n\n if (controlType === true || controlType === 'move' || controlType === 'pan') {\n zr.on('mousedown', mousedownHandler);\n zr.on('mousemove', mousemoveHandler);\n zr.on('mouseup', mouseupHandler);\n }\n\n if (controlType === true || controlType === 'scale' || controlType === 'zoom') {\n zr.on('mousewheel', mousewheelHandler);\n zr.on('pinch', pinchHandler);\n }\n };\n\n this.disable = function () {\n zr.off('mousedown', mousedownHandler);\n zr.off('mousemove', mousemoveHandler);\n zr.off('mouseup', mouseupHandler);\n zr.off('mousewheel', mousewheelHandler);\n zr.off('pinch', pinchHandler);\n };\n\n this.dispose = this.disable;\n\n this.isDragging = function () {\n return this._dragging;\n };\n\n this.isPinching = function () {\n return this._pinching;\n };\n}\n\nzrUtil.mixin(RoamController, Eventful);\n\nfunction mousedown(e) {\n if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e) || e.target && e.target.draggable) {\n return;\n }\n\n var x = e.offsetX;\n var y = e.offsetY; // Only check on mosedown, but not mousemove.\n // Mouse can be out of target when mouse moving.\n\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\n this._x = x;\n this._y = y;\n this._dragging = true;\n }\n}\n\nfunction mousemove(e) {\n if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var x = e.offsetX;\n var y = e.offsetY;\n var oldX = this._x;\n var oldY = this._y;\n var dx = x - oldX;\n var dy = y - oldY;\n this._x = x;\n this._y = y;\n this._opt.preventDefaultMouseMove && eventTool.stop(e.event);\n trigger(this, 'pan', 'moveOnMouseMove', e, {\n dx: dx,\n dy: dy,\n oldX: oldX,\n oldY: oldY,\n newX: x,\n newY: y\n });\n}\n\nfunction mouseup(e) {\n if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n this._dragging = false;\n }\n}\n\nfunction mousewheel(e) {\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\n var wheelDelta = e.wheelDelta;\n var absWheelDeltaDelta = Math.abs(wheelDelta);\n var originX = e.offsetX;\n var originY = e.offsetY; // wheelDelta maybe -0 in chrome mac.\n\n if (wheelDelta === 0 || !shouldZoom && !shouldMove) {\n return;\n } // If both `shouldZoom` and `shouldMove` is true, trigger\n // their event both, and the final behavior is determined\n // by event listener themselves.\n\n\n if (shouldZoom) {\n // Convenience:\n // Mac and VM Windows on Mac: scroll up: zoom out.\n // Windows: scroll up: zoom in.\n // FIXME: Should do more test in different environment.\n // wheelDelta is too complicated in difference nvironment\n // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n // although it has been normallized by zrender.\n // wheelDelta of mouse wheel is bigger than touch pad.\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\n var scale = wheelDelta > 0 ? factor : 1 / factor;\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\n scale: scale,\n originX: originX,\n originY: originY\n });\n }\n\n if (shouldMove) {\n // FIXME: Should do more test in different environment.\n var absDelta = Math.abs(wheelDelta); // wheelDelta of mouse wheel is bigger than touch pad.\n\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\n scrollDelta: scrollDelta,\n originX: originX,\n originY: originY\n });\n }\n}\n\nfunction pinch(e) {\n if (interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\n checkPointerAndTrigger(this, 'zoom', null, e, {\n scale: scale,\n originX: e.pinchX,\n originY: e.pinchY\n });\n}\n\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\n // When mouse is out of roamController rect,\n // default befavoius should not be be disabled, otherwise\n // page sliding is disabled, contrary to expectation.\n eventTool.stop(e.event);\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\n }\n}\n\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n // Also provide behavior checker for event listener, for some case that\n // multiple components share one listener.\n contollerEvent.isAvailableBehavior = zrUtil.bind(isAvailableBehavior, null, behaviorToCheck, e);\n controller.trigger(eventName, contollerEvent);\n} // settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n\n\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\n var setting = settings[behaviorToCheck];\n return !behaviorToCheck || setting && (!zrUtil.isString(setting) || e.event[setting + 'Key']);\n}\n\nvar _default = RoamController;\nmodule.exports = _default;","\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\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar _cursorHelper = require(\"./cursorHelper\");\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphicUtil = require(\"../../util/graphic\");\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*/\nfunction makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints, transform) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\n\nfunction makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\n\nfunction makeRectIsTargetByCursor(rect, api, targetModel) {\n rect = normalizeRect(rect);\n return function (e, localCursorPoint, transform) {\n return rect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n} // Consider width/height is negative.\n\n\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\n}\n\nexports.makeRectPanelClipPath = makeRectPanelClipPath;\nexports.makeLinearBrushOtherExtent = makeLinearBrushOtherExtent;\nexports.makeRectIsTargetByCursor = makeRectIsTargetByCursor;","\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* 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*/\nvar IRRELEVANT_EXCLUDES = {\n 'axisPointer': 1,\n 'tooltip': 1,\n 'brush': 1\n};\n/**\n * Avoid that: mouse click on a elements that is over geo or graph,\n * but roam is triggered.\n */\n\nfunction onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES[model.mainType] && coordSys && coordSys.model !== targetCoordSysModel;\n}\n\nexports.onIrrelevantElement = onIrrelevantElement;","\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\nvar echarts = require(\"../../echarts\");\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*/\nvar ATTR = '\\0_ec_interaction_mutex';\n\nfunction take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\n\nfunction release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\n\nfunction isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\n\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */\n\n\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, function () {});\nexports.take = take;\nexports.release = release;\nexports.isTaken = isTaken;","\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\nvar _layout = require(\"../../util/layout\");\n\nvar getLayoutRect = _layout.getLayoutRect;\nvar layoutBox = _layout.box;\nvar positionElement = _layout.positionElement;\n\nvar formatUtil = require(\"../../util/format\");\n\nvar graphic = require(\"../../util/graphic\");\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*/\n\n/**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */\nfunction layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\n\nfunction makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n }); // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n\n return rect;\n}\n\nexports.layout = layout;\nexports.makeBackground = makeBackground;","\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* 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 * For geo and graph.\n *\n * @param {Object} controllerHost\n * @param {module:zrender/Element} controllerHost.target\n */\nfunction updateViewOnPan(controllerHost, dx, dy) {\n var target = controllerHost.target;\n var pos = target.position;\n pos[0] += dx;\n pos[1] += dy;\n target.dirty();\n}\n/**\n * For geo and graph.\n *\n * @param {Object} controllerHost\n * @param {module:zrender/Element} controllerHost.target\n * @param {number} controllerHost.zoom\n * @param {number} controllerHost.zoomLimit like: {min: 1, max: 2}\n */\n\n\nfunction updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n var target = controllerHost.target;\n var zoomLimit = controllerHost.zoomLimit;\n var pos = target.position;\n var scale = target.scale;\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n\n var zoomScale = newZoom / controllerHost.zoom;\n controllerHost.zoom = newZoom; // Keep the mouse center when scaling\n\n pos[0] -= (zoomX - pos[0]) * (zoomScale - 1);\n pos[1] -= (zoomY - pos[1]) * (zoomScale - 1);\n scale[0] *= zoomScale;\n scale[1] *= zoomScale;\n target.dirty();\n}\n\nexports.updateViewOnPan = updateViewOnPan;\nexports.updateViewOnZoom = updateViewOnZoom;"],"names":["_config","zrUtil","__DEV__","Eventful","graphic","interactionMutex","DataDiffer","curry","each","map","mathMin","Math","min","mathMax","max","mathPow","pow","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","w","e","n","s","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","brushStyle","lineWidth","stroke","fill","transformable","brushMode","removeOnClick","baseUID","BrushController","zr","call","this","_zr","group","Group","_brushType","_brushOption","_panels","_track","_dragging","_covers","_creatingCover","_creatingPanel","_enableGlobalPan","_uid","_handlers","pointerHandlers","handler","eventName","bind","doEnableBrush","controller","brushOption","take","mountHandlers","brushType","merge","clone","doDisableBrush","release","unmountHandlers","handlers","on","off","createCover","cover","coverRenderers","__brushOption","updateZ","add","endCreating","creatingCover","coverRenderer","getCoverRenderer","updateCoverShape","range","z","traverse","el","z2","updateCoverAfterCreation","updateCommon","getPanelByPoint","localCursorPoint","panel","panels","transform","_transform","pn","isTargetByCursor","getPanelByCover","panelId","clearCovers","covers","originalLength","length","remove","trigger","opt","areas","isEnd","shouldShowCover","track","p2","p1","dx","dy","dist","getTrackEnds","tail","createBaseRectCover","doDrift","edgeNames","Rect","name","style","makeStyle","silent","draggable","cursor","drift","ondragend","opacity","invisible","updateBaseRect","localRange","handleSize","x","y","xa","ya","x2","y2","x2a","y2a","width","height","widtha","heighta","updateRectShape","mainEl","childAt","useStyle","attr","childOfName","globalDir","getGlobalDirection","h","setShape","pointsToRect","clipByPanel","defaults","strokeNoScale","formatRectRange","getTransform","localDirection","split","reverse","join","inverseMap","left","right","top","bottom","transformDirection","driftRect","toRectRange","fromRectRange","rectRange","localDelta","toLocalDelta","namePart","ind","driftPolygon","point","thisGroup","localD","transformCoordToLocal","localZero","data","clipPath","points","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","i","contain","setCursorStyle","preventDefault","rawE","event","mainShapeContain","updateCoverByMouse","eventParams","thisBrushOption","push","slice","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","prototype","constructor","enableBrush","setPanels","panelOpts","mount","enableGlobalPan","position","rotation","scale","getLocalTransform","eachCover","cb","context","updateCovers","brushOptionList","tmpIdPrefix","oldCovers","newCovers","oldGetKey","getKey","addOrUpdate","update","execute","index","id","newIndex","oldIndex","newBrushOption","unmount","dispose","mixin","mousedown","handleDragEnd","target","offsetX","offsetY","mousemove","mouseup","getWidth","getHeight","lineX","getLineRenderer","lineY","rect","localTrack","ends","polygon","Polyline","Polygon","xyIndex","otherExtent","getLinearBrushOtherExtent","_default","module","exports","modelUtil","brushHelper","indexOf","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","option","ecModel","targetInfoList","_targetInfoList","info","foundCpts","parseFinder","targetInfoBuilders","builder","type","include","proto","formatMinMax","minMax","includeMainTypes","setOutputRanges","matchOutputRanges","area","coordRange","coordSys","coordRanges","result","coordConvert","__rangeOffset","offset","diffProcessor","values","xyMinMax","targetInfo","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","api","getDefaultBrushType","getPanelRect","makeRectPanelClipPath","makeRectIsTargetByCursor","coordSysModel","makeLinearBrushOtherExtent","controlSeries","seriesModel","coordinateSystem","areaPanelId","targetInfoMatchers","grid","xAxisModels","yAxisModels","gridModels","gridModelMap","createHashMap","xAxesHas","yAxesHas","axisModel","gridModel","axis","model","set","cartesians","getCartesians","cartesian","getAxis","panelRectBuilder","xAxisDeclared","yAxisDeclared","geo","geoModels","geoModel","xAxisModel","yAxisModel","getRect","getBoundingRect","applyTransform","axisConvert","to","rangeOrCoordRange","xminymin","xmaxymax","Infinity","item","p","axisNameIndex","coordToData","toLocalCoord","toGlobalCoord","dataToCoord","NaN","axisDiffProcessor","refer","scales","idx","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","getSize","sizeOrigin","isNaN","RoamController","roamHelper","_cursorHelper","onIrrelevantElement","geoSourceManager","_component","getUID","Transformable","getFixedItemStyle","itemStyle","getItemStyle","areaColor","get","updateMapSelectHandler","mapDraw","mapOrGeoModel","regionsGroup","fromView","_mouseDownFlag","__regions","parent","action","mainType","batch","region","from","uid","dispatchAction","updateMapSelected","eachChild","otherRegionEl","isSelected","MapDraw","updateGroup","_controller","getZr","_controllerHost","_updateGroup","_mapName","_initialized","_regionsGroup","_backgroundGroup","draw","payload","isGeo","getData","eachComponent","subType","mapSeries","getHostGeoModel","_updateBackground","targetScale","transformInfo","getTransformInfo","isFirstDraw","roamTransform","decomposeTransform","dirty","props","updateProps","rawScale","rawPosition","removeAll","itemStyleAccessPath","hoverItemStyleAccessPath","labelAccessPath","hoverLabelAccessPath","nameMap","regions","regionGroup","compoundPath","CompoundPath","segmentIgnoreThreshold","shape","paths","dataIdx","regionModel","getRegionModel","itemStyleModel","getModel","hoverItemStyleModel","hoverItemStyle","labelModel","hoverLabelModel","indexOfName","visualColor","getItemVisual","transformPoint","geometries","geometry","exterior","interiors","interior","j","setStyle","culling","showLabel","hoverShowLabel","isDataNaN","mapDimension","itemLayout","getItemLayout","labelFetcher","query","textEl","Text","center","setLabelStyle","hoverStyle","labelDataIndex","defaultText","useInsideStyle","textAlign","textVerticalAlign","textScale","setItemGraphicEl","eventData","componentType","componentIndex","geoIndex","groupRegions","highDownSilentOnTouch","setHoverStyle","_updateController","removeGraphic","mapName","makeGraphic","root","controllerHost","zoomLimit","zoom","getZoom","enable","makeActionBase","updateViewOnPan","extend","updateViewOnZoom","originX","originY","setPointerChecker","getViewRectAfterRoam","eventTool","pointerChecker","_opt","mousedownHandler","mousemoveHandler","mouseupHandler","mousewheelHandler","mousewheel","pinchHandler","pinch","controlType","disable","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","isPinching","_pinching","isMiddleOrRightButtonOnMouseUpDown","_x","_y","isAvailableBehavior","gestureEvent","isTaken","oldX","oldY","stop","newX","newY","shouldZoom","shouldMove","wheelDelta","absWheelDeltaDelta","abs","factor","checkPointerAndTrigger","absDelta","scrollDelta","pinchScale","pinchX","pinchY","behaviorToCheck","contollerEvent","settings","setting","isString","BoundingRect","graphicUtil","normalizeRect","localPoints","clipPointsByRect","specifiedXYIndex","brushWidth","base","targetModel","create","IRRELEVANT_EXCLUDES","targetCoordSysModel","getComponentByElement","topTarget","echarts","ATTR","resourceKey","userKey","store","getStore","uKey","registerAction","_layout","getLayoutRect","layoutBox","box","positionElement","formatUtil","layout","componentModel","boxLayoutParams","getBoxLayoutParams","padding","viewportSize","makeBackground","normalizeCssArray","r","pos","zoomDelta","zoomX","zoomY","newZoom","zoomMin","zoomMax","zoomScale"],"sourceRoot":""}
|