{"version":3,"file":"echarts-DYPKSdrS.js","sources":["../../../node_modules/echarts/lib/config.js","../../../node_modules/zrender/lib/core/guid.js","../../../node_modules/zrender/lib/core/env.js","../../../node_modules/zrender/lib/core/util.js","../../../node_modules/zrender/lib/core/vector.js","../../../node_modules/zrender/lib/mixin/Draggable.js","../../../node_modules/zrender/lib/mixin/Eventful.js","../../../node_modules/zrender/lib/core/fourPointsTransform.js","../../../node_modules/zrender/lib/core/dom.js","../../../node_modules/zrender/lib/core/event.js","../../../node_modules/zrender/lib/core/GestureMgr.js","../../../node_modules/zrender/lib/Handler.js","../../../node_modules/zrender/lib/core/matrix.js","../../../node_modules/zrender/lib/mixin/Transformable.js","../../../node_modules/zrender/lib/animation/easing.js","../../../node_modules/zrender/lib/animation/Clip.js","../../../node_modules/zrender/lib/core/LRU.js","../../../node_modules/zrender/lib/tool/color.js","../../../node_modules/zrender/lib/animation/Animator.js","../../../node_modules/zrender/lib/config.js","../../../node_modules/zrender/lib/core/log.js","../../../node_modules/zrender/lib/mixin/Animatable.js","../../../node_modules/zrender/lib/Element.js","../../../node_modules/zrender/lib/core/BoundingRect.js","../../../node_modules/zrender/lib/container/Group.js","../../../node_modules/zrender/lib/core/timsort.js","../../../node_modules/zrender/lib/Storage.js","../../../node_modules/zrender/lib/graphic/helper/fixShadow.js","../../../node_modules/zrender/lib/graphic/constant.js","../../../node_modules/zrender/lib/graphic/Style.js","../../../node_modules/zrender/lib/graphic/Pattern.js","../../../node_modules/zrender/lib/Layer.js","../../../node_modules/zrender/lib/animation/requestAnimationFrame.js","../../../node_modules/zrender/lib/graphic/helper/image.js","../../../node_modules/zrender/lib/contain/text.js","../../../node_modules/zrender/lib/graphic/helper/roundRect.js","../../../node_modules/zrender/lib/graphic/helper/text.js","../../../node_modules/zrender/lib/graphic/mixin/RectText.js","../../../node_modules/zrender/lib/graphic/Displayable.js","../../../node_modules/zrender/lib/graphic/Image.js","../../../node_modules/zrender/lib/Painter.js","../../../node_modules/zrender/lib/animation/Animation.js","../../../node_modules/zrender/lib/dom/HandlerProxy.js","../../../node_modules/zrender/lib/zrender.js","../../../node_modules/echarts/lib/util/model.js","../../../node_modules/echarts/lib/util/clazz.js","../../../node_modules/echarts/lib/model/mixin/makeStyleMapper.js","../../../node_modules/echarts/lib/model/mixin/lineStyle.js","../../../node_modules/echarts/lib/model/mixin/areaStyle.js","../../../node_modules/zrender/lib/core/curve.js","../../../node_modules/zrender/lib/core/bbox.js","../../../node_modules/zrender/lib/core/PathProxy.js","../../../node_modules/zrender/lib/contain/line.js","../../../node_modules/zrender/lib/contain/cubic.js","../../../node_modules/zrender/lib/contain/quadratic.js","../../../node_modules/zrender/lib/contain/util.js","../../../node_modules/zrender/lib/contain/arc.js","../../../node_modules/zrender/lib/contain/windingLine.js","../../../node_modules/zrender/lib/contain/path.js","../../../node_modules/zrender/lib/graphic/Path.js","../../../node_modules/zrender/lib/tool/transformPath.js","../../../node_modules/zrender/lib/tool/path.js","../../../node_modules/zrender/lib/graphic/Text.js","../../../node_modules/zrender/lib/graphic/shape/Circle.js","../../../node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js","../../../node_modules/zrender/lib/graphic/shape/Sector.js","../../../node_modules/zrender/lib/graphic/shape/Ring.js","../../../node_modules/zrender/lib/graphic/helper/smoothSpline.js","../../../node_modules/zrender/lib/graphic/helper/smoothBezier.js","../../../node_modules/zrender/lib/graphic/helper/poly.js","../../../node_modules/zrender/lib/graphic/shape/Polygon.js","../../../node_modules/zrender/lib/graphic/shape/Polyline.js","../../../node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","../../../node_modules/zrender/lib/graphic/shape/Rect.js","../../../node_modules/zrender/lib/graphic/shape/Line.js","../../../node_modules/zrender/lib/graphic/shape/BezierCurve.js","../../../node_modules/zrender/lib/graphic/shape/Arc.js","../../../node_modules/zrender/lib/graphic/CompoundPath.js","../../../node_modules/zrender/lib/graphic/Gradient.js","../../../node_modules/zrender/lib/graphic/LinearGradient.js","../../../node_modules/zrender/lib/graphic/RadialGradient.js","../../../node_modules/zrender/lib/graphic/IncrementalDisplayable.js","../../../node_modules/echarts/lib/util/graphic.js","../../../node_modules/echarts/lib/model/mixin/textStyle.js","../../../node_modules/echarts/lib/model/mixin/itemStyle.js","../../../node_modules/echarts/lib/model/Model.js","../../../node_modules/echarts/lib/util/component.js","../../../node_modules/echarts/lib/util/number.js","../../../node_modules/echarts/lib/util/format.js","../../../node_modules/echarts/lib/util/layout.js","../../../node_modules/echarts/lib/model/mixin/boxLayout.js","../../../node_modules/echarts/lib/model/Component.js","../../../node_modules/echarts/lib/model/globalDefault.js","../../../node_modules/echarts/lib/model/mixin/colorPalette.js","../../../node_modules/echarts/lib/data/helper/sourceType.js","../../../node_modules/echarts/lib/data/Source.js","../../../node_modules/echarts/lib/data/helper/sourceHelper.js","../../../node_modules/echarts/lib/model/Global.js","../../../node_modules/echarts/lib/ExtensionAPI.js","../../../node_modules/echarts/lib/CoordinateSystem.js","../../../node_modules/echarts/lib/model/OptionManager.js","../../../node_modules/echarts/lib/preprocessor/helper/compatStyle.js","../../../node_modules/echarts/lib/preprocessor/backwardCompat.js","../../../node_modules/echarts/lib/processor/dataStack.js","../../../node_modules/echarts/lib/data/helper/dataProvider.js","../../../node_modules/echarts/lib/model/mixin/dataFormat.js","../../../node_modules/echarts/lib/stream/task.js","../../../node_modules/echarts/lib/model/Series.js","../../../node_modules/echarts/lib/view/Component.js","../../../node_modules/echarts/lib/chart/helper/createRenderPlanner.js","../../../node_modules/echarts/lib/view/Chart.js","../../../node_modules/echarts/lib/util/throttle.js","../../../node_modules/echarts/lib/visual/seriesColor.js","../../../node_modules/echarts/lib/lang.js","../../../node_modules/echarts/lib/visual/aria.js","../../../node_modules/echarts/lib/loading/default.js","../../../node_modules/echarts/lib/stream/Scheduler.js","../../../node_modules/echarts/lib/theme/light.js","../../../node_modules/echarts/lib/theme/dark.js","../../../node_modules/echarts/lib/component/dataset.js","../../../node_modules/zrender/lib/graphic/shape/Ellipse.js","../../../node_modules/zrender/lib/tool/parseSVG.js","../../../node_modules/echarts/lib/coord/geo/mapDataStorage.js","../../../node_modules/echarts/lib/data/DataDiffer.js","../../../node_modules/echarts/lib/data/helper/dimensionHelper.js","../../../node_modules/echarts/lib/data/DataDimensionInfo.js","../../../node_modules/echarts/lib/data/List.js","../../../node_modules/echarts/lib/data/helper/completeDimensions.js","../../../node_modules/echarts/lib/data/helper/createDimensions.js","../../../node_modules/echarts/lib/model/referHelper.js","../../../node_modules/echarts/lib/data/helper/dataStackHelper.js","../../../node_modules/echarts/lib/chart/helper/createListFromArray.js","../../../node_modules/echarts/lib/scale/Scale.js","../../../node_modules/echarts/lib/data/OrdinalMeta.js","../../../node_modules/echarts/lib/scale/Ordinal.js","../../../node_modules/echarts/lib/scale/helper.js","../../../node_modules/echarts/lib/scale/Interval.js","../../../node_modules/echarts/lib/layout/barGrid.js","../../../node_modules/echarts/lib/scale/Time.js","../../../node_modules/echarts/lib/scale/Log.js","../../../node_modules/echarts/lib/coord/axisHelper.js","../../../node_modules/echarts/lib/coord/axisModelCommonMixin.js","../../../node_modules/echarts/lib/util/symbol.js","../../../node_modules/echarts/lib/helper.js","../../../node_modules/zrender/lib/contain/polygon.js","../../../node_modules/echarts/lib/coord/geo/Region.js","../../../node_modules/echarts/lib/coord/geo/parseGeoJson.js","../../../node_modules/echarts/lib/coord/axisTickLabelBuilder.js","../../../node_modules/echarts/lib/coord/Axis.js","../../../node_modules/echarts/lib/export.js","../../../node_modules/echarts/lib/echarts.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\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// (1) The code `if (__DEV__) ...` can be removed by build tool.\n// (2) If intend to use `__DEV__`, this module should be imported. Use a global\n// variable `__DEV__` may cause that miss the declaration (see #6535), or the\n// declaration is behind of the using position (for example in `Model.extent`,\n// And tools like rollup can not analysis the dependency if not import).\nvar dev; // In browser\n\nif (typeof window !== 'undefined') {\n dev = window.__DEV__;\n} // In node\nelse if (typeof global !== 'undefined') {\n dev = global.__DEV__;\n }\n\nif (typeof dev === 'undefined') {\n dev = true;\n}\n\nvar __DEV__ = dev;\nexports.__DEV__ = __DEV__;","/**\n * zrender: 生成唯一id\n *\n * @author errorrik (errorrik@gmail.com)\n */\nvar idStart = 0x0907;\n\nfunction _default() {\n return idStart++;\n}\n\nmodule.exports = _default;","/**\n * echarts设备环境识别\n *\n * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。\n * @author firede[firede@firede.us]\n * @desc thanks zepto.\n */\n\n/* global wx */\nvar env = {};\n\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n // In Weixin Application\n env = {\n browser: {},\n os: {},\n node: false,\n wxa: true,\n // Weixin Application\n canvasSupported: true,\n svgSupported: false,\n touchEventsSupported: true,\n domSupported: false\n };\n} else if (typeof document === 'undefined' && typeof self !== 'undefined') {\n // In worker\n env = {\n browser: {},\n os: {},\n node: false,\n worker: true,\n canvasSupported: true,\n domSupported: false\n };\n} else if (typeof navigator === 'undefined') {\n // In node\n env = {\n browser: {},\n os: {},\n node: true,\n worker: false,\n // Assume canvas is supported\n canvasSupported: true,\n svgSupported: true,\n domSupported: false\n };\n} else {\n env = detect(navigator.userAgent);\n}\n\nvar _default = env; // Zepto.js\n// (c) 2010-2013 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\nfunction detect(ua) {\n var os = {};\n var browser = {}; // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n\n var firefox = ua.match(/Firefox\\/([\\d.]+)/); // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n\n var ie = ua.match(/MSIE\\s([\\d.]+)/) // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = /micromessenger/i.test(ua); // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n } // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n\n\n if (weChat) {\n browser.weChat = true;\n } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported: !!document.createElement('canvas').getContext,\n svgSupported: typeof SVGRect !== 'undefined',\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // .\n pointerEventsSupported: // (1) Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // For example, in iOS 13 Mobile Chromium 78, if the touching behavior starts page\n // scroll, the `pointermove` event can not be fired any more. That will break some\n // features like \"pan horizontally to move something and pan vertically to page scroll\".\n // The horizontal pan probably be interrupted by the casually triggered page scroll.\n // (2) Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n 'onpointerdown' in window && (browser.edge || browser.ie && browser.version >= 11),\n // passiveSupported: detectPassiveSupport()\n domSupported: typeof document !== 'undefined'\n };\n} // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n// function detectPassiveSupport() {\n// // Test via a getter in the options object to see if the passive property is accessed\n// var supportsPassive = false;\n// try {\n// var opts = Object.defineProperty({}, 'passive', {\n// get: function() {\n// supportsPassive = true;\n// }\n// });\n// window.addEventListener('testPassive', function() {}, opts);\n// } catch (e) {\n// }\n// return supportsPassive;\n// }\n\n\nmodule.exports = _default;","/**\n * @module zrender/core/util\n */\n// 用于处理merge时无法遍历Date等对象的问题\nvar BUILTIN_OBJECT = {\n '[object Function]': 1,\n '[object RegExp]': 1,\n '[object Date]': 1,\n '[object Error]': 1,\n '[object CanvasGradient]': 1,\n '[object CanvasPattern]': 1,\n // For node-canvas\n '[object Image]': 1,\n '[object Canvas]': 1\n};\nvar TYPED_ARRAY = {\n '[object Int8Array]': 1,\n '[object Uint8Array]': 1,\n '[object Uint8ClampedArray]': 1,\n '[object Int16Array]': 1,\n '[object Uint16Array]': 1,\n '[object Int32Array]': 1,\n '[object Uint32Array]': 1,\n '[object Float32Array]': 1,\n '[object Float64Array]': 1\n};\nvar objToString = Object.prototype.toString;\nvar arrayProto = Array.prototype;\nvar nativeForEach = arrayProto.forEach;\nvar nativeFilter = arrayProto.filter;\nvar nativeSlice = arrayProto.slice;\nvar nativeMap = arrayProto.map;\nvar nativeReduce = arrayProto.reduce; // Avoid assign to an exported variable, for transforming to cjs.\n\nvar methods = {};\n\nfunction $override(name, fn) {\n // Clear ctx instance for different environment\n if (name === 'createCanvas') {\n _ctx = null;\n }\n\n methods[name] = fn;\n}\n/**\n * Those data types can be cloned:\n * Plain object, Array, TypedArray, number, string, null, undefined.\n * Those data types will be assgined using the orginal data:\n * BUILTIN_OBJECT\n * Instance of user defined class will be cloned to a plain object, without\n * properties in prototype.\n * Other data types is not supported (not sure what will happen).\n *\n * Caution: do not support clone Date, for performance consideration.\n * (There might be a large number of date in `series.data`).\n * So date should not be modified in and out of echarts.\n *\n * @param {*} source\n * @return {*} new\n */\n\n\nfunction clone(source) {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n\n var result = source;\n var typeStr = objToString.call(source);\n\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [];\n\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n } else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n var Ctor = source.constructor;\n\n if (source.constructor.from) {\n result = Ctor.from(source);\n } else {\n result = new Ctor(source.length);\n\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {};\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n result[key] = clone(source[key]);\n }\n }\n }\n\n return result;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} target\n * @param {*} source\n * @param {boolean} [overwrite=false]\n */\n\n\nfunction merge(target, source, overwrite) {\n // We should escapse that source is string\n // and enter for ... in ...\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var targetProp = target[key];\n var sourceProp = source[key];\n\n if (isObject(sourceProp) && isObject(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) {\n // 如果需要递归覆盖,就递归调用merge\n merge(targetProp, sourceProp, overwrite);\n } else if (overwrite || !(key in target)) {\n // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况\n // NOTE,在 target[key] 不存在的时候也是直接覆盖\n target[key] = clone(source[key], true);\n }\n }\n }\n\n return target;\n}\n/**\n * @param {Array} targetAndSources The first item is target, and the rests are source.\n * @param {boolean} [overwrite=false]\n * @return {*} target\n */\n\n\nfunction mergeAll(targetAndSources, overwrite) {\n var result = targetAndSources[0];\n\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n\n return result;\n}\n/**\n * @param {*} target\n * @param {*} source\n * @memberOf module:zrender/core/util\n */\n\n\nfunction extend(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n\n return target;\n}\n/**\n * @param {*} target\n * @param {*} source\n * @param {boolean} [overlay=false]\n * @memberOf module:zrender/core/util\n */\n\n\nfunction defaults(target, source, overlay) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && (overlay ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nvar createCanvas = function () {\n return methods.createCanvas();\n};\n\nmethods.createCanvas = function () {\n return document.createElement('canvas');\n}; // FIXME\n\n\nvar _ctx;\n\nfunction getContext() {\n if (!_ctx) {\n // Use util.createCanvas instead of createCanvas\n // because createCanvas may be overwritten in different environment\n _ctx = createCanvas().getContext('2d');\n }\n\n return _ctx;\n}\n/**\n * 查询数组中元素的index\n * @memberOf module:zrender/core/util\n */\n\n\nfunction indexOf(array, value) {\n if (array) {\n if (array.indexOf) {\n return array.indexOf(value);\n }\n\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n\n return -1;\n}\n/**\n * 构造类继承关系\n *\n * @memberOf module:zrender/core/util\n * @param {Function} clazz 源类\n * @param {Function} baseClazz 基类\n */\n\n\nfunction inherits(clazz, baseClazz) {\n var clazzPrototype = clazz.prototype;\n\n function F() {}\n\n F.prototype = baseClazz.prototype;\n clazz.prototype = new F();\n\n for (var prop in clazzPrototype) {\n if (clazzPrototype.hasOwnProperty(prop)) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n }\n\n clazz.prototype.constructor = clazz;\n clazz.superClass = baseClazz;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Object|Function} target\n * @param {Object|Function} sorce\n * @param {boolean} overlay\n */\n\n\nfunction mixin(target, source, overlay) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n defaults(target, source, overlay);\n}\n/**\n * Consider typed array.\n * @param {Array|TypedArray} data\n */\n\n\nfunction isArrayLike(data) {\n if (!data) {\n return;\n }\n\n if (typeof data === 'string') {\n return false;\n }\n\n return typeof data.length === 'number';\n}\n/**\n * 数组或对象遍历\n * @memberOf module:zrender/core/util\n * @param {Object|Array} obj\n * @param {Function} cb\n * @param {*} [context]\n */\n\n\nfunction each(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.forEach && obj.forEach === nativeForEach) {\n obj.forEach(cb, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, len = obj.length; i < len; i++) {\n cb.call(context, obj[i], i, obj);\n }\n } else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n cb.call(context, obj[key], key, obj);\n }\n }\n }\n}\n/**\n * 数组映射\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {*} [context]\n * @return {Array}\n */\n\n\nfunction map(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.map && obj.map === nativeMap) {\n return obj.map(cb, context);\n } else {\n var result = [];\n\n for (var i = 0, len = obj.length; i < len; i++) {\n result.push(cb.call(context, obj[i], i, obj));\n }\n\n return result;\n }\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {Object} [memo]\n * @param {*} [context]\n * @return {Array}\n */\n\n\nfunction reduce(obj, cb, memo, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.reduce && obj.reduce === nativeReduce) {\n return obj.reduce(cb, memo, context);\n } else {\n for (var i = 0, len = obj.length; i < len; i++) {\n memo = cb.call(context, memo, obj[i], i, obj);\n }\n\n return memo;\n }\n}\n/**\n * 数组过滤\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {*} [context]\n * @return {Array}\n */\n\n\nfunction filter(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.filter && obj.filter === nativeFilter) {\n return obj.filter(cb, context);\n } else {\n var result = [];\n\n for (var i = 0, len = obj.length; i < len; i++) {\n if (cb.call(context, obj[i], i, obj)) {\n result.push(obj[i]);\n }\n }\n\n return result;\n }\n}\n/**\n * 数组项查找\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {*} [context]\n * @return {*}\n */\n\n\nfunction find(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n for (var i = 0, len = obj.length; i < len; i++) {\n if (cb.call(context, obj[i], i, obj)) {\n return obj[i];\n }\n }\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Function} func\n * @param {*} context\n * @return {Function}\n */\n\n\nfunction bind(func, context) {\n var args = nativeSlice.call(arguments, 2);\n return function () {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Function} func\n * @return {Function}\n */\n\n\nfunction curry(func) {\n var args = nativeSlice.call(arguments, 1);\n return function () {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isArray(value) {\n return objToString.call(value) === '[object Array]';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isString(value) {\n return objToString.call(value) === '[object String]';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return type === 'function' || !!value && type === 'object';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isBuiltInObject(value) {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isTypedArray(value) {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isDom(value) {\n return typeof value === 'object' && typeof value.nodeType === 'number' && typeof value.ownerDocument === 'object';\n}\n/**\n * Whether is exactly NaN. Notice isNaN('a') returns true.\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction eqNaN(value) {\n /* eslint-disable-next-line no-self-compare */\n return value !== value;\n}\n/**\n * If value1 is not null, then return value1, otherwise judget rest of values.\n * Low performance.\n * @memberOf module:zrender/core/util\n * @return {*} Final value\n */\n\n\nfunction retrieve(values) {\n for (var i = 0, len = arguments.length; i < len; i++) {\n if (arguments[i] != null) {\n return arguments[i];\n }\n }\n}\n\nfunction retrieve2(value0, value1) {\n return value0 != null ? value0 : value1;\n}\n\nfunction retrieve3(value0, value1, value2) {\n return value0 != null ? value0 : value1 != null ? value1 : value2;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Array} arr\n * @param {number} startIndex\n * @param {number} endIndex\n * @return {Array}\n */\n\n\nfunction slice() {\n return Function.call.apply(nativeSlice, arguments);\n}\n/**\n * Normalize css liked array configuration\n * e.g.\n * 3 => [3, 3, 3, 3]\n * [4, 2] => [4, 2, 4, 2]\n * [4, 3, 2] => [4, 3, 2, 3]\n * @param {number|Array.} val\n * @return {Array.}\n */\n\n\nfunction normalizeCssArray(val) {\n if (typeof val === 'number') {\n return [val, val, val, val];\n }\n\n var len = val.length;\n\n if (len === 2) {\n // vertical | horizontal\n return [val[0], val[1], val[0], val[1]];\n } else if (len === 3) {\n // top | horizontal | bottom\n return [val[0], val[1], val[2], val[1]];\n }\n\n return val;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {boolean} condition\n * @param {string} message\n */\n\n\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {string} str string to be trimed\n * @return {string} trimed string\n */\n\n\nfunction trim(str) {\n if (str == null) {\n return null;\n } else if (typeof str.trim === 'function') {\n return str.trim();\n } else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\n\nvar primitiveKey = '__ec_primitive__';\n/**\n * Set an object as primitive to be ignored traversing children in clone or merge\n */\n\nfunction setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}\n\nfunction isPrimitive(obj) {\n return obj[primitiveKey];\n}\n/**\n * @constructor\n * @param {Object} obj Only apply `ownProperty`.\n */\n\n\nfunction HashMap(obj) {\n var isArr = isArray(obj); // Key should not be set on this, otherwise\n // methods get/set/... may be overrided.\n\n this.data = {};\n var thisMap = this;\n obj instanceof HashMap ? obj.each(visit) : obj && each(obj, visit);\n\n function visit(value, key) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n}\n\nHashMap.prototype = {\n constructor: HashMap,\n // Do not provide `has` method to avoid defining what is `has`.\n // (We usually treat `null` and `undefined` as the same, different\n // from ES6 Map).\n get: function (key) {\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\n },\n set: function (key, value) {\n // Comparing with invocation chaining, `return value` is more commonly\n // used in this case: `var someVal = map.set('a', genVal());`\n return this.data[key] = value;\n },\n // Although util.each can be performed on this hashMap directly, user\n // should not use the exposed keys, who are prefixed.\n each: function (cb, context) {\n context !== void 0 && (cb = bind(cb, context));\n /* eslint-disable guard-for-in */\n\n for (var key in this.data) {\n this.data.hasOwnProperty(key) && cb(this.data[key], key);\n }\n /* eslint-enable guard-for-in */\n\n },\n // Do not use this method if performance sensitive.\n removeKey: function (key) {\n delete this.data[key];\n }\n};\n\nfunction createHashMap(obj) {\n return new HashMap(obj);\n}\n\nfunction concatArray(a, b) {\n var newArray = new a.constructor(a.length + b.length);\n\n for (var i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n\n var offset = a.length;\n\n for (i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n\n return newArray;\n}\n\nfunction noop() {}\n\nexports.$override = $override;\nexports.clone = clone;\nexports.merge = merge;\nexports.mergeAll = mergeAll;\nexports.extend = extend;\nexports.defaults = defaults;\nexports.createCanvas = createCanvas;\nexports.getContext = getContext;\nexports.indexOf = indexOf;\nexports.inherits = inherits;\nexports.mixin = mixin;\nexports.isArrayLike = isArrayLike;\nexports.each = each;\nexports.map = map;\nexports.reduce = reduce;\nexports.filter = filter;\nexports.find = find;\nexports.bind = bind;\nexports.curry = curry;\nexports.isArray = isArray;\nexports.isFunction = isFunction;\nexports.isString = isString;\nexports.isObject = isObject;\nexports.isBuiltInObject = isBuiltInObject;\nexports.isTypedArray = isTypedArray;\nexports.isDom = isDom;\nexports.eqNaN = eqNaN;\nexports.retrieve = retrieve;\nexports.retrieve2 = retrieve2;\nexports.retrieve3 = retrieve3;\nexports.slice = slice;\nexports.normalizeCssArray = normalizeCssArray;\nexports.assert = assert;\nexports.trim = trim;\nexports.setAsPrimitive = setAsPrimitive;\nexports.isPrimitive = isPrimitive;\nexports.createHashMap = createHashMap;\nexports.concatArray = concatArray;\nexports.noop = noop;","/* global Float32Array */\nvar ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;\n/**\n * 创建一个向量\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @return {Vector2}\n */\n\nfunction create(x, y) {\n var out = new ArrayCtor(2);\n\n if (x == null) {\n x = 0;\n }\n\n if (y == null) {\n y = 0;\n }\n\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * 复制向量数据\n * @param {Vector2} out\n * @param {Vector2} v\n * @return {Vector2}\n */\n\n\nfunction copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n/**\n * 克隆一个向量\n * @param {Vector2} v\n * @return {Vector2}\n */\n\n\nfunction clone(v) {\n var out = new ArrayCtor(2);\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n/**\n * 设置向量的两个项\n * @param {Vector2} out\n * @param {number} a\n * @param {number} b\n * @return {Vector2} 结果\n */\n\n\nfunction set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\n/**\n * 向量相加\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\n/**\n * 向量缩放后相加\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @param {number} a\n */\n\n\nfunction scaleAndAdd(out, v1, v2, a) {\n out[0] = v1[0] + v2[0] * a;\n out[1] = v1[1] + v2[1] * a;\n return out;\n}\n/**\n * 向量相减\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\n/**\n * 向量长度\n * @param {Vector2} v\n * @return {number}\n */\n\n\nfunction len(v) {\n return Math.sqrt(lenSquare(v));\n}\n\nvar length = len; // jshint ignore:line\n\n/**\n * 向量长度平方\n * @param {Vector2} v\n * @return {number}\n */\n\nfunction lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\n\nvar lengthSquare = lenSquare;\n/**\n * 向量乘法\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\nfunction mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\n/**\n * 向量除法\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\n/**\n * 向量点乘\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\n\nfunction dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\n/**\n * 向量缩放\n * @param {Vector2} out\n * @param {Vector2} v\n * @param {number} s\n */\n\n\nfunction scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\n/**\n * 向量归一化\n * @param {Vector2} out\n * @param {Vector2} v\n */\n\n\nfunction normalize(out, v) {\n var d = len(v);\n\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n } else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n\n return out;\n}\n/**\n * 计算向量间距离\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\n\nfunction distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\n\nvar dist = distance;\n/**\n * 向量距离平方\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\nfunction distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\n\nvar distSquare = distanceSquare;\n/**\n * 求负向量\n * @param {Vector2} out\n * @param {Vector2} v\n */\n\nfunction negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\n/**\n * 插值两个点\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @param {number} t\n */\n\n\nfunction lerp(out, v1, v2, t) {\n out[0] = v1[0] + t * (v2[0] - v1[0]);\n out[1] = v1[1] + t * (v2[1] - v1[1]);\n return out;\n}\n/**\n * 矩阵左乘向量\n * @param {Vector2} out\n * @param {Vector2} v\n * @param {Vector2} m\n */\n\n\nfunction applyTransform(out, v, m) {\n var x = v[0];\n var y = v[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * 求两个向量最小值\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction min(out, v1, v2) {\n out[0] = Math.min(v1[0], v2[0]);\n out[1] = Math.min(v1[1], v2[1]);\n return out;\n}\n/**\n * 求两个向量最大值\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction max(out, v1, v2) {\n out[0] = Math.max(v1[0], v2[0]);\n out[1] = Math.max(v1[1], v2[1]);\n return out;\n}\n\nexports.create = create;\nexports.copy = copy;\nexports.clone = clone;\nexports.set = set;\nexports.add = add;\nexports.scaleAndAdd = scaleAndAdd;\nexports.sub = sub;\nexports.len = len;\nexports.length = length;\nexports.lenSquare = lenSquare;\nexports.lengthSquare = lengthSquare;\nexports.mul = mul;\nexports.div = div;\nexports.dot = dot;\nexports.scale = scale;\nexports.normalize = normalize;\nexports.distance = distance;\nexports.dist = dist;\nexports.distanceSquare = distanceSquare;\nexports.distSquare = distSquare;\nexports.negate = negate;\nexports.lerp = lerp;\nexports.applyTransform = applyTransform;\nexports.min = min;\nexports.max = max;","// TODO Draggable for group\n// FIXME Draggable on element which has parent rotation or scale\nfunction Draggable() {\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this); // `mosuemove` and `mouseup` can be continue to fire when dragging.\n // See [Drag outside] in `Handler.js`. So we do not need to trigger\n // `_dragEnd` when globalout. That would brings better user experience.\n // this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n // this._x = 0;\n // this._y = 0;\n}\n\nDraggable.prototype = {\n constructor: Draggable,\n _dragStart: function (e) {\n var draggingTarget = e.target; // Find if there is draggable in the ancestor\n\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent;\n }\n\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n this.dispatchToElement(param(draggingTarget, e), 'dragstart', e.event);\n }\n },\n _drag: function (e) {\n var draggingTarget = this._draggingTarget;\n\n if (draggingTarget) {\n var x = e.offsetX;\n var y = e.offsetY;\n var dx = x - this._x;\n var dy = y - this._y;\n this._x = x;\n this._y = y;\n draggingTarget.drift(dx, dy, e);\n this.dispatchToElement(param(draggingTarget, e), 'drag', e.event);\n var dropTarget = this.findHover(x, y, draggingTarget).target;\n var lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.dispatchToElement(param(lastDropTarget, e), 'dragleave', e.event);\n }\n\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.dispatchToElement(param(dropTarget, e), 'dragenter', e.event);\n }\n }\n }\n },\n _dragEnd: function (e) {\n var draggingTarget = this._draggingTarget;\n\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n\n this.dispatchToElement(param(draggingTarget, e), 'dragend', e.event);\n\n if (this._dropTarget) {\n this.dispatchToElement(param(this._dropTarget, e), 'drop', e.event);\n }\n\n this._draggingTarget = null;\n this._dropTarget = null;\n }\n};\n\nfunction param(target, e) {\n return {\n target: target,\n topTarget: e && e.topTarget\n };\n}\n\nvar _default = Draggable;\nmodule.exports = _default;","/**\n * Event Mixin\n * @module zrender/mixin/Eventful\n * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * pissang (https://www.github.com/pissang)\n */\nvar arrySlice = Array.prototype.slice;\n/**\n * Event dispatcher.\n *\n * @alias module:zrender/mixin/Eventful\n * @constructor\n * @param {Object} [eventProcessor] The object eventProcessor is the scope when\n * `eventProcessor.xxx` called.\n * @param {Function} [eventProcessor.normalizeQuery]\n * param: {string|Object} Raw query.\n * return: {string|Object} Normalized query.\n * @param {Function} [eventProcessor.filter] Event will be dispatched only\n * if it returns `true`.\n * param: {string} eventType\n * param: {string|Object} query\n * return: {boolean}\n * @param {Function} [eventProcessor.afterTrigger] Called after all handlers called.\n * param: {string} eventType\n */\n\nvar Eventful = function (eventProcessor) {\n this._$handlers = {};\n this._$eventProcessor = eventProcessor;\n};\n\nEventful.prototype = {\n constructor: Eventful,\n\n /**\n * The handler can only be triggered once, then removed.\n *\n * @param {string} event The event name.\n * @param {string|Object} [query] Condition used on event filter.\n * @param {Function} handler The event handler.\n * @param {Object} context\n */\n one: function (event, query, handler, context) {\n return on(this, event, query, handler, context, true);\n },\n\n /**\n * Bind a handler.\n *\n * @param {string} event The event name.\n * @param {string|Object} [query] Condition used on event filter.\n * @param {Function} handler The event handler.\n * @param {Object} [context]\n */\n on: function (event, query, handler, context) {\n return on(this, event, query, handler, context, false);\n },\n\n /**\n * Whether any handler has bound.\n *\n * @param {string} event\n * @return {boolean}\n */\n isSilent: function (event) {\n var _h = this._$handlers;\n return !_h[event] || !_h[event].length;\n },\n\n /**\n * Unbind a event.\n *\n * @param {string} [event] The event name.\n * If no `event` input, \"off\" all listeners.\n * @param {Function} [handler] The event handler.\n * If no `handler` input, \"off\" all listeners of the `event`.\n */\n off: function (event, handler) {\n var _h = this._$handlers;\n\n if (!event) {\n this._$handlers = {};\n return this;\n }\n\n if (handler) {\n if (_h[event]) {\n var newList = [];\n\n for (var i = 0, l = _h[event].length; i < l; i++) {\n if (_h[event][i].h !== handler) {\n newList.push(_h[event][i]);\n }\n }\n\n _h[event] = newList;\n }\n\n if (_h[event] && _h[event].length === 0) {\n delete _h[event];\n }\n } else {\n delete _h[event];\n }\n\n return this;\n },\n\n /**\n * Dispatch a event.\n *\n * @param {string} type The event name.\n */\n trigger: function (type) {\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n\n if (argLen > 3) {\n args = arrySlice.call(args, 1);\n }\n\n var len = _h.length;\n\n for (var i = 0; i < len;) {\n var hItem = _h[i];\n\n if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {\n i++;\n continue;\n } // Optimize advise from backbone\n\n\n switch (argLen) {\n case 1:\n hItem.h.call(hItem.ctx);\n break;\n\n case 2:\n hItem.h.call(hItem.ctx, args[1]);\n break;\n\n case 3:\n hItem.h.call(hItem.ctx, args[1], args[2]);\n break;\n\n default:\n // have more than 2 given arguments\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n\n if (hItem.one) {\n _h.splice(i, 1);\n\n len--;\n } else {\n i++;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);\n return this;\n },\n\n /**\n * Dispatch a event with context, which is specified at the last parameter.\n *\n * @param {string} type The event name.\n */\n triggerWithContext: function (type) {\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n\n if (argLen > 4) {\n args = arrySlice.call(args, 1, args.length - 1);\n }\n\n var ctx = args[args.length - 1];\n var len = _h.length;\n\n for (var i = 0; i < len;) {\n var hItem = _h[i];\n\n if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {\n i++;\n continue;\n } // Optimize advise from backbone\n\n\n switch (argLen) {\n case 1:\n hItem.h.call(ctx);\n break;\n\n case 2:\n hItem.h.call(ctx, args[1]);\n break;\n\n case 3:\n hItem.h.call(ctx, args[1], args[2]);\n break;\n\n default:\n // have more than 2 given arguments\n hItem.h.apply(ctx, args);\n break;\n }\n\n if (hItem.one) {\n _h.splice(i, 1);\n\n len--;\n } else {\n i++;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);\n return this;\n }\n};\n\nfunction normalizeQuery(host, query) {\n var eventProcessor = host._$eventProcessor;\n\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n\n return query;\n}\n\nfunction on(eventful, event, query, handler, context, isOnce) {\n var _h = eventful._$handlers;\n\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n\n if (!handler || !event) {\n return eventful;\n }\n\n query = normalizeQuery(eventful, query);\n\n if (!_h[event]) {\n _h[event] = [];\n }\n\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return eventful;\n }\n }\n\n var wrap = {\n h: handler,\n one: isOnce,\n query: query,\n ctx: context || eventful,\n // FIXME\n // Do not publish this feature util it is proved that it makes sense.\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap);\n return eventful;\n} // ----------------------\n// The events in zrender\n// ----------------------\n\n/**\n * @event module:zrender/mixin/Eventful#onclick\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseover\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseout\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousemove\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousewheel\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousedown\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseup\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondrag\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragstart\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragend\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragenter\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragleave\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragover\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondrop\n * @type {Function}\n * @default null\n */\n\n\nvar _default = Eventful;\nmodule.exports = _default;","/**\n * The algoritm is learnt from\n * https://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/\n * And we made some optimization for matrix inversion.\n * Other similar approaches:\n * \"cv::getPerspectiveTransform\", \"Direct Linear Transformation\".\n */\nvar LN2 = Math.log(2);\n\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\n var cacheKey = rowMask + '-' + colMask;\n var fullRank = rows.length;\n\n if (detCache.hasOwnProperty(cacheKey)) {\n return detCache[cacheKey];\n }\n\n if (rank === 1) {\n // In this case the colMask must be like: `11101111`. We can find the place of `0`.\n var colStart = Math.round(Math.log((1 << fullRank) - 1 & ~colMask) / LN2);\n return rows[rowStart][colStart];\n }\n\n var subRowMask = rowMask | 1 << rowStart;\n var subRowStart = rowStart + 1;\n\n while (rowMask & 1 << subRowStart) {\n subRowStart++;\n }\n\n var sum = 0;\n\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\n var colTag = 1 << j;\n\n if (!(colTag & colMask)) {\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] // det(subMatrix(0, j))\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n colLocalIdx++;\n }\n }\n\n detCache[cacheKey] = sum;\n return sum;\n}\n/**\n * Usage:\n * ```js\n * var transformer = buildTransformer(\n * [10, 44, 100, 44, 100, 300, 10, 300],\n * [50, 54, 130, 14, 140, 330, 14, 220]\n * );\n * var out = [];\n * transformer && transformer([11, 33], out);\n * ```\n *\n * Notice: `buildTransformer` may take more than 10ms in some Android device.\n *\n * @param {Array.} src source four points, [x0, y0, x1, y1, x2, y2, x3, y3]\n * @param {Array.} dest destination four points, [x0, y0, x1, y1, x2, y2, x3, y3]\n * @return {Function} transformer If fail, return null/undefined.\n */\n\n\nfunction buildTransformer(src, dest) {\n var mA = [[src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]], [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]], [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]], [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]], [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]], [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]], [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]], [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]];\n var detCache = {};\n var det = determinant(mA, 8, 0, 0, 0, detCache);\n\n if (det === 0) {\n // can not make transformer when and only when\n // any three of the markers are collinear.\n return;\n } // `invert(mA) * dest`, that is, `adj(mA) / det * dest`.\n\n\n var vh = [];\n\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n vh[j] == null && (vh[j] = 0);\n vh[j] += ((i + j) % 2 ? -1 : 1) * // det(subMatrix(i, j))\n determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) / det * dest[i];\n }\n }\n\n return function (out, srcPointX, srcPointY) {\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n };\n}\n\nexports.buildTransformer = buildTransformer;","var env = require(\"./env\");\n\nvar _fourPointsTransform = require(\"./fourPointsTransform\");\n\nvar buildTransformer = _fourPointsTransform.buildTransformer;\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\nvar _calcOut = [];\n/**\n * Transform \"local coord\" from `elFrom` to `elTarget`.\n * \"local coord\": the coord based on the input `el`. The origin point is at\n * the position of \"left: 0; top: 0;\" in the `el`.\n *\n * Support when CSS transform is used.\n *\n * Having the `out` (that is, `[outX, outY]`), we can create an DOM element\n * and set the CSS style as \"left: outX; top: outY;\" and append it to `elTarge`\n * to locate the element.\n *\n * For example, this code below positions a child of `document.body` on the event\n * point, no matter whether `body` has `margin`/`paddin`/`transfrom`/... :\n * ```js\n * transformLocalCoord(out, container, document.body, event.offsetX, event.offsetY);\n * if (!eqNaN(out[0])) {\n * // Then locate the tip element on the event point.\n * var tipEl = document.createElement('div');\n * tipEl.style.cssText = 'position: absolute; left:' + out[0] + ';top:' + out[1] + ';';\n * document.body.appendChild(tipEl);\n * }\n * ```\n *\n * Notice: In some env this method is not supported. If called, `out` will be `[NaN, NaN]`.\n *\n * @param {Array.} out [inX: number, inY: number] The output..\n * If can not transform, `out` will not be modified but return `false`.\n * @param {HTMLElement} elFrom The `[inX, inY]` is based on elFrom.\n * @param {HTMLElement} elTarget The `out` is based on elTarget.\n * @param {number} inX\n * @param {number} inY\n * @return {boolean} Whether transform successfully.\n */\n\nfunction transformLocalCoord(out, elFrom, elTarget, inX, inY) {\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true) && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\n/**\n * Transform between a \"viewport coord\" and a \"local coord\".\n * \"viewport coord\": the coord based on the left-top corner of the viewport\n * of the browser.\n * \"local coord\": the coord based on the input `el`. The origin point is at\n * the position of \"left: 0; top: 0;\" in the `el`.\n *\n * Support the case when CSS transform is used on el.\n *\n * @param {Array.} out [inX: number, inY: number] The output. If `inverse: false`,\n * it represents \"local coord\", otherwise \"vireport coord\".\n * If can not transform, `out` will not be modified but return `false`.\n * @param {HTMLElement} el The \"local coord\" is based on the `el`, see comment above.\n * @param {number} inX If `inverse: false`,\n * it represents \"vireport coord\", otherwise \"local coord\".\n * @param {number} inY If `inverse: false`,\n * it represents \"vireport coord\", otherwise \"local coord\".\n * @param {boolean} [inverse=false]\n * `true`: from \"viewport coord\" to \"local coord\".\n * `false`: from \"local coord\" to \"viewport coord\".\n * @return {boolean} Whether transform successfully.\n */\n\n\nfunction transformCoordWithViewport(out, el, inX, inY, inverse) {\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\n var markers = prepareCoordMarkers(el, saved);\n var transformer = preparePointerTransformer(markers, saved, inverse);\n\n if (transformer) {\n transformer(out, inX, inY);\n return true;\n }\n }\n\n return false;\n}\n\nfunction prepareCoordMarkers(el, saved) {\n var markers = saved.markers;\n\n if (markers) {\n return markers;\n }\n\n markers = saved.markers = [];\n var propLR = ['left', 'right'];\n var propTB = ['top', 'bottom'];\n\n for (var i = 0; i < 4; i++) {\n var marker = document.createElement('div');\n var stl = marker.style;\n var idxLR = i % 2;\n var idxTB = (i >> 1) % 2;\n stl.cssText = ['position: absolute', 'visibility: hidden', 'padding: 0', 'margin: 0', 'border-width: 0', 'user-select: none', 'width:0', 'height:0', // 'width: 5px',\n // 'height: 5px',\n propLR[idxLR] + ':0', propTB[idxTB] + ':0', propLR[1 - idxLR] + ':auto', propTB[1 - idxTB] + ':auto', ''].join('!important;');\n el.appendChild(marker);\n markers.push(marker);\n }\n\n return markers;\n}\n\nfunction preparePointerTransformer(markers, saved, inverse) {\n var transformerName = inverse ? 'invTrans' : 'trans';\n var transformer = saved[transformerName];\n var oldSrcCoords = saved.srcCoords;\n var oldCoordTheSame = true;\n var srcCoords = [];\n var destCoords = [];\n\n for (var i = 0; i < 4; i++) {\n var rect = markers[i].getBoundingClientRect();\n var ii = 2 * i;\n var x = rect.left;\n var y = rect.top;\n srcCoords.push(x, y);\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n } // Cache to avoid time consuming of `buildTransformer`.\n\n\n return oldCoordTheSame && transformer ? transformer : (saved.srcCoords = srcCoords, saved[transformerName] = inverse ? buildTransformer(destCoords, srcCoords) : buildTransformer(srcCoords, destCoords));\n}\n\nfunction isCanvasEl(el) {\n return el.nodeName.toUpperCase() === 'CANVAS';\n}\n\nexports.transformLocalCoord = transformLocalCoord;\nexports.transformCoordWithViewport = transformCoordWithViewport;\nexports.isCanvasEl = isCanvasEl;","var Eventful = require(\"../mixin/Eventful\");\n\nexports.Dispatcher = Eventful;\n\nvar env = require(\"./env\");\n\nvar _dom = require(\"./dom\");\n\nvar isCanvasEl = _dom.isCanvasEl;\nvar transformCoordWithViewport = _dom.transformCoordWithViewport;\n\n/**\n * Utilities for mouse or touch events.\n */\nvar isDomLevel2 = typeof window !== 'undefined' && !!window.addEventListener;\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nvar _calcOut = [];\n/**\n * Get the `zrX` and `zrY`, which are relative to the top-left of\n * the input `el`.\n * CSS transform (2D & 3D) is supported.\n *\n * The strategy to fetch the coords:\n * + If `calculate` is not set as `true`, users of this method should\n * ensure that `el` is the same or the same size & location as `e.target`.\n * Otherwise the result coords are probably not expected. Because we\n * firstly try to get coords from e.offsetX/e.offsetY.\n * + If `calculate` is set as `true`, the input `el` can be any element\n * and we force to calculate the coords based on `el`.\n * + The input `el` should be positionable (not position:static).\n *\n * The force `calculate` can be used in case like:\n * When mousemove event triggered on ec tooltip, `e.target` is not `el`(zr painter.dom).\n *\n * @param {HTMLElement} el DOM element.\n * @param {Event} e Mouse event or touch event.\n * @param {Object} out Get `out.zrX` and `out.zrY` as the result.\n * @param {boolean} [calculate=false] Whether to force calculate\n * the coordinates but not use ones provided by browser.\n */\n\nfunction clientToLocal(el, e, out, calculate) {\n out = out || {}; // According to the W3C Working Draft, offsetX and offsetY should be relative\n // to the padding edge of the target element. The only browser using this convention\n // is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does\n // not support the properties.\n // (see http://www.jacklmoore.com/notes/mouse-position/)\n // In zr painter.dom, padding edge equals to border edge.\n\n if (calculate || !env.canvasSupported) {\n calculateZrXY(el, e, out);\n } // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned\n // ancestor element, so we should make sure el is positioned (e.g., not position:static).\n // BTW1, Webkit don't return the same results as FF in non-simple cases (like add\n // zoom-factor, overflow / opacity layers, transforms ...)\n // BTW2, (ev.offsetY || ev.pageY - $(ev.target).offset().top) is not correct in preserve-3d.\n // \n // BTW3, In ff, offsetX/offsetY is always 0.\n else if (env.browser.firefox && e.layerX != null && e.layerX !== e.offsetX) {\n out.zrX = e.layerX;\n out.zrY = e.layerY;\n } // For IE6+, chrome, safari, opera. (When will ff support offsetX?)\n else if (e.offsetX != null) {\n out.zrX = e.offsetX;\n out.zrY = e.offsetY;\n } // For some other device, e.g., IOS safari.\n else {\n calculateZrXY(el, e, out);\n }\n\n return out;\n}\n\nfunction calculateZrXY(el, e, out) {\n // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect.\n if (env.domSupported && el.getBoundingClientRect) {\n var ex = e.clientX;\n var ey = e.clientY;\n\n if (isCanvasEl(el)) {\n // Original approach, which do not support CSS transform.\n // marker can not be locationed in a canvas container\n // (getBoundingClientRect is always 0). We do not support\n // that input a pre-created canvas to zr while using css\n // transform in iOS.\n var box = el.getBoundingClientRect();\n out.zrX = ex - box.left;\n out.zrY = ey - box.top;\n return;\n } else {\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n out.zrX = _calcOut[0];\n out.zrY = _calcOut[1];\n return;\n }\n }\n }\n\n out.zrX = out.zrY = 0;\n}\n/**\n * Find native event compat for legency IE.\n * Should be called at the begining of a native event listener.\n *\n * @param {Event} [e] Mouse event or touch event or pointer event.\n * For lagency IE, we use `window.event` is used.\n * @return {Event} The native event.\n */\n\n\nfunction getNativeEvent(e) {\n return e || window.event;\n}\n/**\n * Normalize the coordinates of the input event.\n *\n * Get the `e.zrX` and `e.zrY`, which are relative to the top-left of\n * the input `el`.\n * Get `e.zrDelta` if using mouse wheel.\n * Get `e.which`, see the comment inside this function.\n *\n * Do not calculate repeatly if `zrX` and `zrY` already exist.\n *\n * Notice: see comments in `clientToLocal`. check the relationship\n * between the result coords and the parameters `el` and `calculate`.\n *\n * @param {HTMLElement} el DOM element.\n * @param {Event} [e] See `getNativeEvent`.\n * @param {boolean} [calculate=false] Whether to force calculate\n * the coordinates but not use ones provided by browser.\n * @return {UIEvent} The normalized native UIEvent.\n */\n\n\nfunction normalizeEvent(el, e, calculate) {\n e = getNativeEvent(e);\n\n if (e.zrX != null) {\n return e;\n }\n\n var eventType = e.type;\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\n\n if (!isTouch) {\n clientToLocal(el, e, e, calculate);\n e.zrDelta = e.wheelDelta ? e.wheelDelta / 120 : -(e.detail || 0) / 3;\n } else {\n var touch = eventType !== 'touchend' ? e.targetTouches[0] : e.changedTouches[0];\n touch && clientToLocal(el, touch, e, calculate);\n } // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0;\n // See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js\n // If e.which has been defined, it may be readonly,\n // see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which\n\n\n var button = e.button;\n\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n e.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0;\n } // [Caution]: `e.which` from browser is not always reliable. For example,\n // when press left button and `mousemove (pointermove)` in Edge, the `e.which`\n // is 65536 and the `e.button` is -1. But the `mouseup (pointerup)` and\n // `mousedown (pointerdown)` is the same as Chrome does.\n\n\n return e;\n}\n/**\n * @param {HTMLElement} el\n * @param {string} name\n * @param {Function} handler\n * @param {Object|boolean} opt If boolean, means `opt.capture`\n * @param {boolean} [opt.capture=false]\n * @param {boolean} [opt.passive=false]\n */\n\n\nfunction addEventListener(el, name, handler, opt) {\n if (isDomLevel2) {\n // Reproduct the console warning:\n // [Violation] Added non-passive event listener to a scroll-blocking event.\n // Consider marking event handler as 'passive' to make the page more responsive.\n // Just set console log level: verbose in chrome dev tool.\n // then the warning log will be printed when addEventListener called.\n // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n // We have not yet found a neat way to using passive. Because in zrender the dom event\n // listener delegate all of the upper events of element. Some of those events need\n // to prevent default. For example, the feature `preventDefaultMouseMove` of echarts.\n // Before passive can be adopted, these issues should be considered:\n // (1) Whether and how a zrender user specifies an event listener passive. And by default,\n // passive or not.\n // (2) How to tread that some zrender event listener is passive, and some is not. If\n // we use other way but not preventDefault of mousewheel and touchmove, browser\n // compatibility should be handled.\n // var opts = (env.passiveSupported && name === 'mousewheel')\n // ? {passive: true}\n // // By default, the third param of el.addEventListener is `capture: false`.\n // : void 0;\n // el.addEventListener(name, handler /* , opts */);\n el.addEventListener(name, handler, opt);\n } else {\n // For simplicity, do not implement `setCapture` for IE9-.\n el.attachEvent('on' + name, handler);\n }\n}\n/**\n * Parameter are the same as `addEventListener`.\n *\n * Notice that if a listener is registered twice, one with capture and one without,\n * remove each one separately. Removal of a capturing listener does not affect a\n * non-capturing version of the same listener, and vice versa.\n */\n\n\nfunction removeEventListener(el, name, handler, opt) {\n if (isDomLevel2) {\n el.removeEventListener(name, handler, opt);\n } else {\n el.detachEvent('on' + name, handler);\n }\n}\n/**\n * preventDefault and stopPropagation.\n * Notice: do not use this method in zrender. It can only be\n * used by upper applications if necessary.\n *\n * @param {Event} e A mouse or touch event.\n */\n\n\nvar stop = isDomLevel2 ? function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.cancelBubble = true;\n} : function (e) {\n e.returnValue = false;\n e.cancelBubble = true;\n};\n/**\n * This method only works for mouseup and mousedown. The functionality is restricted\n * for fault tolerance, See the `e.which` compatibility above.\n *\n * @param {MouseEvent} e\n * @return {boolean}\n */\n\nfunction isMiddleOrRightButtonOnMouseUpDown(e) {\n return e.which === 2 || e.which === 3;\n}\n/**\n * To be removed.\n * @deprecated\n */\n\n\nfunction notLeftMouse(e) {\n // If e.which is undefined, considered as left mouse event.\n return e.which > 1;\n} // For backward compatibility\n\n\nexports.clientToLocal = clientToLocal;\nexports.getNativeEvent = getNativeEvent;\nexports.normalizeEvent = normalizeEvent;\nexports.addEventListener = addEventListener;\nexports.removeEventListener = removeEventListener;\nexports.stop = stop;\nexports.isMiddleOrRightButtonOnMouseUpDown = isMiddleOrRightButtonOnMouseUpDown;\nexports.notLeftMouse = notLeftMouse;","var eventUtil = require(\"./event\");\n\n/**\n * Only implements needed gestures for mobile.\n */\nvar GestureMgr = function () {\n /**\n * @private\n * @type {Array.}\n */\n this._track = [];\n};\n\nGestureMgr.prototype = {\n constructor: GestureMgr,\n recognize: function (event, target, root) {\n this._doTrack(event, target, root);\n\n return this._recognize(event);\n },\n clear: function () {\n this._track.length = 0;\n return this;\n },\n _doTrack: function (event, target, root) {\n var touches = event.touches;\n\n if (!touches) {\n return;\n }\n\n var trackItem = {\n points: [],\n touches: [],\n target: target,\n event: event\n };\n\n for (var i = 0, len = touches.length; i < len; i++) {\n var touch = touches[i];\n var pos = eventUtil.clientToLocal(root, touch, {});\n trackItem.points.push([pos.zrX, pos.zrY]);\n trackItem.touches.push(touch);\n }\n\n this._track.push(trackItem);\n },\n _recognize: function (event) {\n for (var eventName in recognizers) {\n if (recognizers.hasOwnProperty(eventName)) {\n var gestureInfo = recognizers[eventName](this._track, event);\n\n if (gestureInfo) {\n return gestureInfo;\n }\n }\n }\n }\n};\n\nfunction dist(pointPair) {\n var dx = pointPair[1][0] - pointPair[0][0];\n var dy = pointPair[1][1] - pointPair[0][1];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\nfunction center(pointPair) {\n return [(pointPair[0][0] + pointPair[1][0]) / 2, (pointPair[0][1] + pointPair[1][1]) / 2];\n}\n\nvar recognizers = {\n pinch: function (track, event) {\n var trackLen = track.length;\n\n if (!trackLen) {\n return;\n }\n\n var pinchEnd = (track[trackLen - 1] || {}).points;\n var pinchPre = (track[trackLen - 2] || {}).points || pinchEnd;\n\n if (pinchPre && pinchPre.length > 1 && pinchEnd && pinchEnd.length > 1) {\n var pinchScale = dist(pinchEnd) / dist(pinchPre);\n !isFinite(pinchScale) && (pinchScale = 1);\n event.pinchScale = pinchScale;\n var pinchCenter = center(pinchEnd);\n event.pinchX = pinchCenter[0];\n event.pinchY = pinchCenter[1];\n return {\n type: 'pinch',\n target: track[0].target,\n event: event\n };\n }\n } // Only pinch currently.\n\n};\nvar _default = GestureMgr;\nmodule.exports = _default;","var util = require(\"./core/util\");\n\nvar vec2 = require(\"./core/vector\");\n\nvar Draggable = require(\"./mixin/Draggable\");\n\nvar Eventful = require(\"./mixin/Eventful\");\n\nvar eventTool = require(\"./core/event\");\n\nvar GestureMgr = require(\"./core/GestureMgr\");\n\n/**\n * [The interface between `Handler` and `HandlerProxy`]:\n *\n * The default `HandlerProxy` only support the common standard web environment\n * (e.g., standalone browser, headless browser, embed browser in mobild APP, ...).\n * But `HandlerProxy` can be replaced to support more non-standard environment\n * (e.g., mini app), or to support more feature that the default `HandlerProxy`\n * not provided (like echarts-gl did).\n * So the interface between `Handler` and `HandlerProxy` should be stable. Do not\n * make break changes util inevitable. The interface include the public methods\n * of `Handler` and the events listed in `handlerNames` below, by which `HandlerProxy`\n * drives `Handler`.\n */\n\n/**\n * [Drag outside]:\n *\n * That is, triggering `mousemove` and `mouseup` event when the pointer is out of the\n * zrender area when dragging. That is important for the improvement of the user experience\n * when dragging something near the boundary without being terminated unexpectedly.\n *\n * We originally consider to introduce new events like `pagemovemove` and `pagemouseup`\n * to resolve this issue. But some drawbacks of it is described in\n * https://github.com/ecomfe/zrender/pull/536#issuecomment-560286899\n *\n * Instead, we referenced the specifications:\n * https://www.w3.org/TR/touch-events/#the-touchmove-event\n * https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-mousemove\n * where the the mousemove/touchmove can be continue to fire if the user began a drag\n * operation and the pointer has left the boundary. (for the mouse event, browsers\n * only do it on `document` and when the pointer has left the boundary of the browser.)\n *\n * So the default `HandlerProxy` supports this feature similarly: if it is in the dragging\n * state (see `pointerCapture` in `HandlerProxy`), the `mousemove` and `mouseup` continue\n * to fire until release the pointer. That is implemented by listen to those event on\n * `document`.\n * If we implement some other `HandlerProxy` only for touch device, that would be easier.\n * The touch event support this feature by default.\n *\n * Note:\n * There might be some cases that the mouse event can not be\n * received on `document`. For example,\n * (A) `useCapture` is not supported and some user defined event listeners on the ancestor\n * of zr dom throw Error .\n * (B) `useCapture` is not supported Some user defined event listeners on the ancestor of\n * zr dom call `stopPropagation`.\n * In these cases, the `mousemove` event might be keep triggered event\n * if the mouse is released. We try to reduce the side-effect in those cases.\n * That is, do nothing (especially, `findHover`) in those cases. See `isOutsideBoundary`.\n *\n * Note:\n * If `HandlerProxy` listens to `document` with `useCapture`, `HandlerProxy` needs to\n * make sure `stopPropagation` and `preventDefault` doing nothing if and only if the event\n * target is not zrender dom. Becuase it is dangerous to enable users to call them in\n * `document` capture phase to prevent the propagation to any listener of the webpage.\n * But they are needed to work when the pointer inside the zrender dom.\n */\nvar SILENT = 'silent';\n\nfunction makeEventPacket(eveType, targetInfo, event) {\n return {\n type: eveType,\n event: event,\n // target can only be an element that is not silent.\n target: targetInfo.target,\n // topTarget can be a silent element.\n topTarget: targetInfo.topTarget,\n cancelBubble: false,\n offsetX: event.zrX,\n offsetY: event.zrY,\n gestureEvent: event.gestureEvent,\n pinchX: event.pinchX,\n pinchY: event.pinchY,\n pinchScale: event.pinchScale,\n wheelDelta: event.zrDelta,\n zrByTouch: event.zrByTouch,\n which: event.which,\n stop: stopEvent\n };\n}\n\nfunction stopEvent() {\n eventTool.stop(this.event);\n}\n\nfunction EmptyProxy() {}\n\nEmptyProxy.prototype.dispose = function () {};\n\nvar handlerNames = ['click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu'];\n/**\n * @alias module:zrender/Handler\n * @constructor\n * @extends module:zrender/mixin/Eventful\n * @param {module:zrender/Storage} storage Storage instance.\n * @param {module:zrender/Painter} painter Painter instance.\n * @param {module:zrender/dom/HandlerProxy} proxy HandlerProxy instance.\n * @param {HTMLElement} painterRoot painter.root (not painter.getViewportRoot()).\n */\n\nvar Handler = function (storage, painter, proxy, painterRoot) {\n Eventful.call(this);\n this.storage = storage;\n this.painter = painter;\n this.painterRoot = painterRoot;\n proxy = proxy || new EmptyProxy();\n /**\n * Proxy of event. can be Dom, WebGLSurface, etc.\n */\n\n this.proxy = null;\n /**\n * {target, topTarget, x, y}\n * @private\n * @type {Object}\n */\n\n this._hovered = {};\n /**\n * @private\n * @type {Date}\n */\n\n this._lastTouchMoment;\n /**\n * @private\n * @type {number}\n */\n\n this._lastX;\n /**\n * @private\n * @type {number}\n */\n\n this._lastY;\n /**\n * @private\n * @type {module:zrender/core/GestureMgr}\n */\n\n this._gestureMgr;\n Draggable.call(this);\n this.setHandlerProxy(proxy);\n};\n\nHandler.prototype = {\n constructor: Handler,\n setHandlerProxy: function (proxy) {\n if (this.proxy) {\n this.proxy.dispose();\n }\n\n if (proxy) {\n util.each(handlerNames, function (name) {\n proxy.on && proxy.on(name, this[name], this);\n }, this); // Attach handler\n\n proxy.handler = this;\n }\n\n this.proxy = proxy;\n },\n mousemove: function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var lastHovered = this._hovered;\n var lastHoveredTarget = lastHovered.target; // If lastHoveredTarget is removed from zr (detected by '__zr') by some API call\n // (like 'setOption' or 'dispatchAction') in event handlers, we should find\n // lastHovered again here. Otherwise 'mouseout' can not be triggered normally.\n // See #6198.\n\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n lastHoveredTarget = lastHovered.target;\n }\n\n var hovered = this._hovered = isOutside ? {\n x: x,\n y: y\n } : this.findHover(x, y);\n var hoveredTarget = hovered.target;\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default'); // Mouse out on previous hovered element\n\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(lastHovered, 'mouseout', event);\n } // Mouse moving on one element\n\n\n this.dispatchToElement(hovered, 'mousemove', event); // Mouse over on a new element\n\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(hovered, 'mouseover', event);\n }\n },\n mouseout: function (event) {\n var eventControl = event.zrEventControl;\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\n\n if (eventControl !== 'only_globalout') {\n this.dispatchToElement(this._hovered, 'mouseout', event);\n }\n\n if (eventControl !== 'no_globalout') {\n // FIXME: if the pointer moving from the extra doms to realy \"outside\",\n // the `globalout` should have been triggered. But currently not.\n !zrIsToLocalDOM && this.trigger('globalout', {\n type: 'globalout',\n event: event\n });\n }\n },\n\n /**\n * Resize\n */\n resize: function (event) {\n this._hovered = {};\n },\n\n /**\n * Dispatch event\n * @param {string} eventName\n * @param {event=} eventArgs\n */\n dispatch: function (eventName, eventArgs) {\n var handler = this[eventName];\n handler && handler.call(this, eventArgs);\n },\n\n /**\n * Dispose\n */\n dispose: function () {\n this.proxy.dispose();\n this.storage = this.proxy = this.painter = null;\n },\n\n /**\n * 设置默认的cursor style\n * @param {string} [cursorStyle='default'] 例如 crosshair\n */\n setCursorStyle: function (cursorStyle) {\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(cursorStyle);\n },\n\n /**\n * 事件分发代理\n *\n * @private\n * @param {Object} targetInfo {target, topTarget} 目标图形元素\n * @param {string} eventName 事件名称\n * @param {Object} event 事件对象\n */\n dispatchToElement: function (targetInfo, eventName, event) {\n targetInfo = targetInfo || {};\n var el = targetInfo.target;\n\n if (el && el.silent) {\n return;\n }\n\n var eventHandler = 'on' + eventName;\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\n\n while (el) {\n el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler].call(el, eventPacket));\n el.trigger(eventName, eventPacket);\n el = el.parent;\n\n if (eventPacket.cancelBubble) {\n break;\n }\n }\n\n if (!eventPacket.cancelBubble) {\n // 冒泡到顶级 zrender 对象\n this.trigger(eventName, eventPacket); // 分发事件到用户自定义层\n // 用户有可能在全局 click 事件中 dispose,所以需要判断下 painter 是否存在\n\n this.painter && this.painter.eachOtherLayer(function (layer) {\n if (typeof layer[eventHandler] === 'function') {\n layer[eventHandler].call(layer, eventPacket);\n }\n\n if (layer.trigger) {\n layer.trigger(eventName, eventPacket);\n }\n });\n }\n },\n\n /**\n * @private\n * @param {number} x\n * @param {number} y\n * @param {module:zrender/graphic/Displayable} exclude\n * @return {model:zrender/Element}\n * @method\n */\n findHover: function (x, y, exclude) {\n var list = this.storage.getDisplayList();\n var out = {\n x: x,\n y: y\n };\n\n for (var i = list.length - 1; i >= 0; i--) {\n var hoverCheckResult;\n\n if (list[i] !== exclude // getDisplayList may include ignored item in VML mode\n && !list[i].ignore && (hoverCheckResult = isHover(list[i], x, y))) {\n !out.topTarget && (out.topTarget = list[i]);\n\n if (hoverCheckResult !== SILENT) {\n out.target = list[i];\n break;\n }\n }\n }\n\n return out;\n },\n processGesture: function (event, stage) {\n if (!this._gestureMgr) {\n this._gestureMgr = new GestureMgr();\n }\n\n var gestureMgr = this._gestureMgr;\n stage === 'start' && gestureMgr.clear();\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\n stage === 'end' && gestureMgr.clear(); // Do not do any preventDefault here. Upper application do that if necessary.\n\n if (gestureInfo) {\n var type = gestureInfo.type;\n event.gestureEvent = type;\n this.dispatchToElement({\n target: gestureInfo.target\n }, type, gestureInfo.event);\n }\n }\n}; // Common handlers\n\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n Handler.prototype[name] = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var hovered;\n var hoveredTarget;\n\n if (name !== 'mouseup' || !isOutside) {\n // Find hover again to avoid click event is dispatched manually. Or click is triggered without mouseover\n hovered = this.findHover(x, y);\n hoveredTarget = hovered.target;\n }\n\n if (name === 'mousedown') {\n this._downEl = hoveredTarget;\n this._downPoint = [event.zrX, event.zrY]; // In case click triggered before mouseup\n\n this._upEl = hoveredTarget;\n } else if (name === 'mouseup') {\n this._upEl = hoveredTarget;\n } else if (name === 'click') {\n if (this._downEl !== this._upEl // Original click event is triggered on the whole canvas element,\n // including the case that `mousedown` - `mousemove` - `mouseup`,\n // which should be filtered, otherwise it will bring trouble to\n // pan and zoom.\n || !this._downPoint // Arbitrary value\n || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\n return;\n }\n\n this._downPoint = null;\n }\n\n this.dispatchToElement(hovered, name, event);\n };\n});\n\nfunction isHover(displayable, x, y) {\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n var el = displayable;\n var isSilent;\n\n while (el) {\n // If clipped by ancestor.\n // FIXME: If clipPath has neither stroke nor fill,\n // el.clipPath.contain(x, y) will always return false.\n if (el.clipPath && !el.clipPath.contain(x, y)) {\n return false;\n }\n\n if (el.silent) {\n isSilent = true;\n }\n\n el = el.parent;\n }\n\n return isSilent ? SILENT : true;\n }\n\n return false;\n}\n/**\n * See [Drag outside].\n */\n\n\nfunction isOutsideBoundary(handlerInstance, x, y) {\n var painter = handlerInstance.painter;\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\n\nutil.mixin(Handler, Eventful);\nutil.mixin(Handler, Draggable);\nvar _default = Handler;\nmodule.exports = _default;","/**\n * 3x2矩阵操作类\n * @exports zrender/tool/matrix\n */\n\n/* global Float32Array */\nvar ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;\n/**\n * Create a identity matrix.\n * @return {Float32Array|Array.}\n */\n\nfunction create() {\n var out = new ArrayCtor(6);\n identity(out);\n return out;\n}\n/**\n * 设置矩阵为单位矩阵\n * @param {Float32Array|Array.} out\n */\n\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * 复制矩阵\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} m\n */\n\n\nfunction copy(out, m) {\n out[0] = m[0];\n out[1] = m[1];\n out[2] = m[2];\n out[3] = m[3];\n out[4] = m[4];\n out[5] = m[5];\n return out;\n}\n/**\n * 矩阵相乘\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} m1\n * @param {Float32Array|Array.} m2\n */\n\n\nfunction mul(out, m1, m2) {\n // Consider matrix.mul(m, m2, m);\n // where out is the same as m2.\n // So use temp variable to escape error.\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = out3;\n out[4] = out4;\n out[5] = out5;\n return out;\n}\n/**\n * 平移变换\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n * @param {Float32Array|Array.} v\n */\n\n\nfunction translate(out, a, v) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4] + v[0];\n out[5] = a[5] + v[1];\n return out;\n}\n/**\n * 旋转变换\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n * @param {number} rad\n */\n\n\nfunction rotate(out, a, rad) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var st = Math.sin(rad);\n var ct = Math.cos(rad);\n out[0] = aa * ct + ab * st;\n out[1] = -aa * st + ab * ct;\n out[2] = ac * ct + ad * st;\n out[3] = -ac * st + ct * ad;\n out[4] = ct * atx + st * aty;\n out[5] = ct * aty - st * atx;\n return out;\n}\n/**\n * 缩放变换\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n * @param {Float32Array|Array.} v\n */\n\n\nfunction scale(out, a, v) {\n var vx = v[0];\n var vy = v[1];\n out[0] = a[0] * vx;\n out[1] = a[1] * vy;\n out[2] = a[2] * vx;\n out[3] = a[3] * vy;\n out[4] = a[4] * vx;\n out[5] = a[5] * vy;\n return out;\n}\n/**\n * 求逆矩阵\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n */\n\n\nfunction invert(out, a) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\n * Clone a new matrix.\n * @param {Float32Array|Array.} a\n */\n\n\nfunction clone(a) {\n var b = create();\n copy(b, a);\n return b;\n}\n\nexports.create = create;\nexports.identity = identity;\nexports.copy = copy;\nexports.mul = mul;\nexports.translate = translate;\nexports.rotate = rotate;\nexports.scale = scale;\nexports.invert = invert;\nexports.clone = clone;","var matrix = require(\"../core/matrix\");\n\nvar vector = require(\"../core/vector\");\n\n/**\n * 提供变换扩展\n * @module zrender/mixin/Transformable\n * @author pissang (https://www.github.com/pissang)\n */\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\n\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\n/**\n * @alias module:zrender/mixin/Transformable\n * @constructor\n */\n\n\nvar Transformable = function (opts) {\n opts = opts || {}; // If there are no given position, rotation, scale\n\n if (!opts.position) {\n /**\n * 平移\n * @type {Array.}\n * @default [0, 0]\n */\n this.position = [0, 0];\n }\n\n if (opts.rotation == null) {\n /**\n * 旋转\n * @type {Array.}\n * @default 0\n */\n this.rotation = 0;\n }\n\n if (!opts.scale) {\n /**\n * 缩放\n * @type {Array.}\n * @default [1, 1]\n */\n this.scale = [1, 1];\n }\n /**\n * 旋转和缩放的原点\n * @type {Array.}\n * @default null\n */\n\n\n this.origin = this.origin || null;\n};\n\nvar transformableProto = Transformable.prototype;\ntransformableProto.transform = null;\n/**\n * 判断是否需要有坐标变换\n * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵\n */\n\ntransformableProto.needLocalTransform = function () {\n return isNotAroundZero(this.rotation) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);\n};\n\nvar scaleTmp = [];\n\ntransformableProto.updateTransform = function () {\n var parent = this.parent;\n var parentHasTransform = parent && parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n\n if (!(needLocalTransform || parentHasTransform)) {\n m && mIdentity(m);\n return;\n }\n\n m = m || matrix.create();\n\n if (needLocalTransform) {\n this.getLocalTransform(m);\n } else {\n mIdentity(m);\n } // 应用父节点变换\n\n\n if (parentHasTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parent.transform, m);\n } else {\n matrix.copy(m, parent.transform);\n }\n } // 保存这个变换矩阵\n\n\n this.transform = m;\n var globalScaleRatio = this.globalScaleRatio;\n\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\n this.getGlobalScale(scaleTmp);\n var relX = scaleTmp[0] < 0 ? -1 : 1;\n var relY = scaleTmp[1] < 0 ? -1 : 1;\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n m[0] *= sx;\n m[1] *= sx;\n m[2] *= sy;\n m[3] *= sy;\n }\n\n this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n};\n\ntransformableProto.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n};\n/**\n * 将自己的transform应用到context上\n * @param {CanvasRenderingContext2D} ctx\n */\n\n\ntransformableProto.setTransform = function (ctx) {\n var m = this.transform;\n var dpr = ctx.dpr || 1;\n\n if (m) {\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n } else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n};\n\ntransformableProto.restoreTransform = function (ctx) {\n var dpr = ctx.dpr || 1;\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n};\n\nvar tmpTransform = [];\nvar originTransform = matrix.create();\n\ntransformableProto.setLocalTransform = function (m) {\n if (!m) {\n // TODO return or set identity?\n return;\n }\n\n var sx = m[0] * m[0] + m[1] * m[1];\n var sy = m[2] * m[2] + m[3] * m[3];\n var position = this.position;\n var scale = this.scale;\n\n if (isNotAroundZero(sx - 1)) {\n sx = Math.sqrt(sx);\n }\n\n if (isNotAroundZero(sy - 1)) {\n sy = Math.sqrt(sy);\n }\n\n if (m[0] < 0) {\n sx = -sx;\n }\n\n if (m[3] < 0) {\n sy = -sy;\n }\n\n position[0] = m[4];\n position[1] = m[5];\n scale[0] = sx;\n scale[1] = sy;\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\n};\n/**\n * 分解`transform`矩阵到`position`, `rotation`, `scale`\n */\n\n\ntransformableProto.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n\n var parent = this.parent;\n var m = this.transform;\n\n if (parent && parent.transform) {\n // Get local transform and decompose them to position, scale, rotation\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n\n var origin = this.origin;\n\n if (origin && (origin[0] || origin[1])) {\n originTransform[4] = origin[0];\n originTransform[5] = origin[1];\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= origin[0];\n tmpTransform[5] -= origin[1];\n m = tmpTransform;\n }\n\n this.setLocalTransform(m);\n};\n/**\n * Get global scale\n * @return {Array.}\n */\n\n\ntransformableProto.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\n }\n\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n\n if (m[0] < 0) {\n out[0] = -out[0];\n }\n\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n\n return out;\n};\n/**\n * 变换坐标位置到 shape 的局部坐标空间\n * @method\n * @param {number} x\n * @param {number} y\n * @return {Array.}\n */\n\n\ntransformableProto.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n\n return v2;\n};\n/**\n * 变换局部坐标位置到全局坐标空间\n * @method\n * @param {number} x\n * @param {number} y\n * @return {Array.}\n */\n\n\ntransformableProto.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n\n return v2;\n};\n/**\n * @static\n * @param {Object} target\n * @param {Array.} target.origin\n * @param {number} target.rotation\n * @param {Array.} target.position\n * @param {Array.} [m]\n */\n\n\nTransformable.getLocalTransform = function (target, m) {\n m = m || [];\n mIdentity(m);\n var origin = target.origin;\n var scale = target.scale || [1, 1];\n var rotation = target.rotation || 0;\n var position = target.position || [0, 0];\n\n if (origin) {\n // Translate to origin\n m[4] -= origin[0];\n m[5] -= origin[1];\n }\n\n matrix.scale(m, m, scale);\n\n if (rotation) {\n matrix.rotate(m, m, rotation);\n }\n\n if (origin) {\n // Translate back from origin\n m[4] += origin[0];\n m[5] += origin[1];\n }\n\n m[4] += position[0];\n m[5] += position[1];\n return m;\n};\n\nvar _default = Transformable;\nmodule.exports = _default;","/**\n * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js\n * @see http://sole.github.io/tween.js/examples/03_graphs.html\n * @exports zrender/animation/easing\n */\nvar easing = {\n /**\n * @param {number} k\n * @return {number}\n */\n linear: function (k) {\n return k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticIn: function (k) {\n return k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticOut: function (k) {\n return k * (2 - k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n\n return -0.5 * (--k * (k - 2) - 1);\n },\n // 三次方的缓动(t^3)\n\n /**\n * @param {number} k\n * @return {number}\n */\n cubicIn: function (k) {\n return k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n cubicOut: function (k) {\n return --k * k * k + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n cubicInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n // 四次方的缓动(t^4)\n\n /**\n * @param {number} k\n * @return {number}\n */\n quarticIn: function (k) {\n return k * k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quarticOut: function (k) {\n return 1 - --k * k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quarticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n // 五次方的缓动(t^5)\n\n /**\n * @param {number} k\n * @return {number}\n */\n quinticIn: function (k) {\n return k * k * k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quinticOut: function (k) {\n return --k * k * k * k * k + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quinticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n // 正弦曲线的缓动(sin(t))\n\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalIn: function (k) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalOut: function (k) {\n return Math.sin(k * Math.PI / 2);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalInOut: function (k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n // 指数曲线的缓动(2^t)\n\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialIn: function (k) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialOut: function (k) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n // 圆形曲线的缓动(sqrt(1-t^2))\n\n /**\n * @param {number} k\n * @return {number}\n */\n circularIn: function (k) {\n return 1 - Math.sqrt(1 - k * k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n circularOut: function (k) {\n return Math.sqrt(1 - --k * k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n circularInOut: function (k) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n // 创建类似于弹簧在停止前来回振荡的动画\n\n /**\n * @param {number} k\n * @return {number}\n */\n elasticIn: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n\n return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n elasticOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n\n return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n elasticInOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n\n return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动\n\n /**\n * @param {number} k\n * @return {number}\n */\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n // 创建弹跳效果\n\n /**\n * @param {number} k\n * @return {number}\n */\n bounceIn: function (k) {\n return 1 - easing.bounceOut(1 - k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n bounceOut: function (k) {\n if (k < 1 / 2.75) {\n return 7.5625 * k * k;\n } else if (k < 2 / 2.75) {\n return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;\n } else if (k < 2.5 / 2.75) {\n return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;\n } else {\n return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;\n }\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easing.bounceIn(k * 2) * 0.5;\n }\n\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\nvar _default = easing;\nmodule.exports = _default;","var easingFuncs = require(\"./easing\");\n\n/**\n * 动画主控制器\n * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件\n * @config life(1000) 动画时长\n * @config delay(0) 动画延迟时间\n * @config loop(true)\n * @config gap(0) 循环的间隔时间\n * @config onframe\n * @config easing(optional)\n * @config ondestroy(optional)\n * @config onrestart(optional)\n *\n * TODO pause\n */\nfunction Clip(options) {\n this._target = options.target; // 生命周期\n\n this._life = options.life || 1000; // 延时\n\n this._delay = options.delay || 0; // 开始时间\n // this._startTime = new Date().getTime() + this._delay;// 单位毫秒\n\n this._initialized = false; // 是否循环\n\n this.loop = options.loop == null ? false : options.loop;\n this.gap = options.gap || 0;\n this.easing = options.easing || 'Linear';\n this.onframe = options.onframe;\n this.ondestroy = options.ondestroy;\n this.onrestart = options.onrestart;\n this._pausedTime = 0;\n this._paused = false;\n}\n\nClip.prototype = {\n constructor: Clip,\n step: function (globalTime, deltaTime) {\n // Set startTime on first step, or _startTime may has milleseconds different between clips\n // PENDING\n if (!this._initialized) {\n this._startTime = globalTime + this._delay;\n this._initialized = true;\n }\n\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life; // 还没开始\n\n if (percent < 0) {\n return;\n }\n\n percent = Math.min(percent, 1);\n var easing = this.easing;\n var easingFunc = typeof easing === 'string' ? easingFuncs[easing] : easing;\n var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;\n this.fire('frame', schedule); // 结束\n\n if (percent === 1) {\n if (this.loop) {\n this.restart(globalTime); // 重新开始周期\n // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件\n\n return 'restart';\n } // 动画完成将这个控制器标识为待删除\n // 在Animation.update中进行批量删除\n\n\n this._needsRemove = true;\n return 'destroy';\n }\n\n return null;\n },\n restart: function (globalTime) {\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\n this._startTime = globalTime - remainder + this.gap;\n this._pausedTime = 0;\n this._needsRemove = false;\n },\n fire: function (eventType, arg) {\n eventType = 'on' + eventType;\n\n if (this[eventType]) {\n this[eventType](this._target, arg);\n }\n },\n pause: function () {\n this._paused = true;\n },\n resume: function () {\n this._paused = false;\n }\n};\nvar _default = Clip;\nmodule.exports = _default;","// Simple LRU cache use doubly linked list\n// @module zrender/core/LRU\n\n/**\n * Simple double linked list. Compared with array, it has O(1) remove operation.\n * @constructor\n */\nvar LinkedList = function () {\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n this.head = null;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.tail = null;\n this._len = 0;\n};\n\nvar linkedListProto = LinkedList.prototype;\n/**\n * Insert a new value at the tail\n * @param {} val\n * @return {module:zrender/core/LRU~Entry}\n */\n\nlinkedListProto.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n};\n/**\n * Insert an entry at the tail\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n } else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n\n this._len++;\n};\n/**\n * Remove entry.\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n\n if (prev) {\n prev.next = next;\n } else {\n // Is head\n this.head = next;\n }\n\n if (next) {\n next.prev = prev;\n } else {\n // Is tail\n this.tail = prev;\n }\n\n entry.next = entry.prev = null;\n this._len--;\n};\n/**\n * @return {number}\n */\n\n\nlinkedListProto.len = function () {\n return this._len;\n};\n/**\n * Clear list\n */\n\n\nlinkedListProto.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n};\n/**\n * @constructor\n * @param {} val\n */\n\n\nvar Entry = function (val) {\n /**\n * @type {}\n */\n this.value = val;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.next;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.prev;\n};\n/**\n * LRU Cache\n * @constructor\n * @alias module:zrender/core/LRU\n */\n\n\nvar LRU = function (maxSize) {\n this._list = new LinkedList();\n this._map = {};\n this._maxSize = maxSize || 10;\n this._lastRemovedEntry = null;\n};\n\nvar LRUProto = LRU.prototype;\n/**\n * @param {string} key\n * @param {} value\n * @return {} Removed value\n */\n\nLRUProto.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n\n if (map[key] == null) {\n var len = list.len(); // Reuse last removed entry\n\n var entry = this._lastRemovedEntry;\n\n if (len >= this._maxSize && len > 0) {\n // Remove the least recently used\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n\n if (entry) {\n entry.value = value;\n } else {\n entry = new Entry(value);\n }\n\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n\n return removed;\n};\n/**\n * @param {string} key\n * @return {}\n */\n\n\nLRUProto.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n\n if (entry != null) {\n // Put the latest used entry in the tail\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n\n return entry.value;\n }\n};\n/**\n * Clear the cache\n */\n\n\nLRUProto.clear = function () {\n this._list.clear();\n\n this._map = {};\n};\n\nvar _default = LRU;\nmodule.exports = _default;","var LRU = require(\"../core/LRU\");\n\nvar kCSSColorTable = {\n 'transparent': [0, 0, 0, 0],\n 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1],\n 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1],\n 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1],\n 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1],\n 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1],\n 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1],\n 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1],\n 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1],\n 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1],\n 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1],\n 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1],\n 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1],\n 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1],\n 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1],\n 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1],\n 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1],\n 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1],\n 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1],\n 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1],\n 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1],\n 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1],\n 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1],\n 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1],\n 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1],\n 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1],\n 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1],\n 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1],\n 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1],\n 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1],\n 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1],\n 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1],\n 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1],\n 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1],\n 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1],\n 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1],\n 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1],\n 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1],\n 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1],\n 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1],\n 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1],\n 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1],\n 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1],\n 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1],\n 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1],\n 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1],\n 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1],\n 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1],\n 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1],\n 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1],\n 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1],\n 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1],\n 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1],\n 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1],\n 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1],\n 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1],\n 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1],\n 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1],\n 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1],\n 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1],\n 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1],\n 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1],\n 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1],\n 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1],\n 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1],\n 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1],\n 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1],\n 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1],\n 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1],\n 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1],\n 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1],\n 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1],\n 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1],\n 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1],\n 'yellowgreen': [154, 205, 50, 1]\n};\n\nfunction clampCssByte(i) {\n // Clamp to integer 0 .. 255.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clampCssAngle(i) {\n // Clamp to integer 0 .. 360.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\n\nfunction clampCssFloat(f) {\n // Clamp to float 0.0 .. 1.0.\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parseCssInt(str) {\n // int or percentage.\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n\n return clampCssByte(parseInt(str, 10));\n}\n\nfunction parseCssFloat(str) {\n // float or percentage.\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n\n return clampCssFloat(parseFloat(str));\n}\n\nfunction cssHueToRgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n\n if (h * 2 < 1) {\n return m2;\n }\n\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n\n return m1;\n}\n\nfunction lerpNumber(a, b, p) {\n return a + (b - a) * p;\n}\n\nfunction setRgba(out, r, g, b, a) {\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n return out;\n}\n\nfunction copyRgba(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\n\nfunction putToCache(colorStr, rgbaArr) {\n // Reuse removed array\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());\n}\n/**\n * @param {string} colorStr\n * @param {Array.} out\n * @return {Array.}\n * @memberOf module:zrender/util/color\n */\n\n\nfunction parse(colorStr, rgbaArr) {\n if (!colorStr) {\n return;\n }\n\n rgbaArr = rgbaArr || [];\n var cached = colorCache.get(colorStr);\n\n if (cached) {\n return copyRgba(rgbaArr, cached);\n } // colorStr may be not string\n\n\n colorStr = colorStr + ''; // Remove all whitespace, not compliant, but should just be more accepting.\n\n var str = colorStr.replace(/ /g, '').toLowerCase(); // Color keywords (and transparent) lookup.\n\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n } // #abc and #abc123 syntax.\n\n\n if (str.charAt(0) === '#') {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return; // Covers NaN.\n }\n\n setRgba(rgbaArr, (iv & 0xf00) >> 4 | (iv & 0xf00) >> 8, iv & 0xf0 | (iv & 0xf0) >> 4, iv & 0xf | (iv & 0xf) << 4, 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return; // Covers NaN.\n }\n\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n\n return;\n }\n\n var op = str.indexOf('(');\n var ep = str.indexOf(')');\n\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\n var alpha = 1; // To allow case fallthrough.\n\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n alpha = parseCssFloat(params.pop());\n // jshint ignore:line\n // Fall through.\n\n case 'rgb':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n\n default:\n return;\n }\n }\n\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\n/**\n * @param {Array.} hsla\n * @param {Array.} rgba\n * @return {Array.} rgba\n */\n\n\nfunction hsla2rgba(hsla, rgba) {\n var h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n\n var s = parseCssFloat(hsla[1]);\n var l = parseCssFloat(hsla[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n rgba = rgba || [];\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\n\n if (hsla.length === 4) {\n rgba[3] = hsla[3];\n }\n\n return rgba;\n}\n/**\n * @param {Array.} rgba\n * @return {Array.} hsla\n */\n\n\nfunction rgba2hsla(rgba) {\n if (!rgba) {\n return;\n } // RGB from 0 to 255\n\n\n var R = rgba[0] / 255;\n var G = rgba[1] / 255;\n var B = rgba[2] / 255;\n var vMin = Math.min(R, G, B); // Min. value of RGB\n\n var vMax = Math.max(R, G, B); // Max. value of RGB\n\n var delta = vMax - vMin; // Delta RGB value\n\n var L = (vMax + vMin) / 2;\n var H;\n var S; // HSL results from 0 to 1\n\n if (delta === 0) {\n H = 0;\n S = 0;\n } else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n } else {\n S = delta / (2 - vMax - vMin);\n }\n\n var deltaR = ((vMax - R) / 6 + delta / 2) / delta;\n var deltaG = ((vMax - G) / 6 + delta / 2) / delta;\n var deltaB = ((vMax - B) / 6 + delta / 2) / delta;\n\n if (R === vMax) {\n H = deltaB - deltaG;\n } else if (G === vMax) {\n H = 1 / 3 + deltaR - deltaB;\n } else if (B === vMax) {\n H = 2 / 3 + deltaG - deltaR;\n }\n\n if (H < 0) {\n H += 1;\n }\n\n if (H > 1) {\n H -= 1;\n }\n }\n\n var hsla = [H * 360, S, L];\n\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n\n return hsla;\n}\n/**\n * @param {string} color\n * @param {number} level\n * @return {string}\n * @memberOf module:zrender/util/color\n */\n\n\nfunction lift(color, level) {\n var colorArr = parse(color);\n\n if (colorArr) {\n for (var i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n } else {\n colorArr[i] = (255 - colorArr[i]) * level + colorArr[i] | 0;\n }\n\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n } else if (color[i] < 0) {\n colorArr[i] = 0;\n }\n }\n\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\n/**\n * @param {string} color\n * @return {string}\n * @memberOf module:zrender/util/color\n */\n\n\nfunction toHex(color) {\n var colorArr = parse(color);\n\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + +colorArr[2]).toString(16).slice(1);\n }\n}\n/**\n * Map value to color. Faster than lerp methods because color is represented by rgba array.\n * @param {number} normalizedValue A float between 0 and 1.\n * @param {Array.>} colors List of rgba color array\n * @param {Array.} [out] Mapped gba color array\n * @return {Array.} will be null/undefined if input illegal.\n */\n\n\nfunction fastLerp(normalizedValue, colors, out) {\n if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n\n out = out || [];\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = colors[leftIndex];\n var rightColor = colors[rightIndex];\n var dv = value - leftIndex;\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\n return out;\n}\n/**\n * @deprecated\n */\n\n\nvar fastMapToColor = fastLerp;\n/**\n * @param {number} normalizedValue A float between 0 and 1.\n * @param {Array.} colors Color list.\n * @param {boolean=} fullOutput Default false.\n * @return {(string|Object)} Result color. If fullOutput,\n * return {color: ..., leftIndex: ..., rightIndex: ..., value: ...},\n * @memberOf module:zrender/util/color\n */\n\nfunction lerp(normalizedValue, colors, fullOutput) {\n if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = parse(colors[leftIndex]);\n var rightColor = parse(colors[rightIndex]);\n var dv = value - leftIndex;\n var color = stringify([clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)), clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)), clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)), clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))], 'rgba');\n return fullOutput ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n } : color;\n}\n/**\n * @deprecated\n */\n\n\nvar mapToColor = lerp;\n/**\n * @param {string} color\n * @param {number=} h 0 ~ 360, ignore when null.\n * @param {number=} s 0 ~ 1, ignore when null.\n * @param {number=} l 0 ~ 1, ignore when null.\n * @return {string} Color string in rgba format.\n * @memberOf module:zrender/util/color\n */\n\nfunction modifyHSL(color, h, s, l) {\n color = parse(color);\n\n if (color) {\n color = rgba2hsla(color);\n h != null && (color[0] = clampCssAngle(h));\n s != null && (color[1] = parseCssFloat(s));\n l != null && (color[2] = parseCssFloat(l));\n return stringify(hsla2rgba(color), 'rgba');\n }\n}\n/**\n * @param {string} color\n * @param {number=} alpha 0 ~ 1\n * @return {string} Color string in rgba format.\n * @memberOf module:zrender/util/color\n */\n\n\nfunction modifyAlpha(color, alpha) {\n color = parse(color);\n\n if (color && alpha != null) {\n color[3] = clampCssFloat(alpha);\n return stringify(color, 'rgba');\n }\n}\n/**\n * @param {Array.} arrColor like [12,33,44,0.4]\n * @param {string} type 'rgba', 'hsva', ...\n * @return {string} Result color. (If input illegal, return undefined).\n */\n\n\nfunction stringify(arrColor, type) {\n if (!arrColor || !arrColor.length) {\n return;\n }\n\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n\n return type + '(' + colorStr + ')';\n}\n\nexports.parse = parse;\nexports.lift = lift;\nexports.toHex = toHex;\nexports.fastLerp = fastLerp;\nexports.fastMapToColor = fastMapToColor;\nexports.lerp = lerp;\nexports.mapToColor = mapToColor;\nexports.modifyHSL = modifyHSL;\nexports.modifyAlpha = modifyAlpha;\nexports.stringify = stringify;","var Clip = require(\"./Clip\");\n\nvar color = require(\"../tool/color\");\n\nvar _util = require(\"../core/util\");\n\nvar isArrayLike = _util.isArrayLike;\n\n/**\n * @module echarts/animation/Animator\n */\nvar arraySlice = Array.prototype.slice;\n\nfunction defaultGetter(target, key) {\n return target[key];\n}\n\nfunction defaultSetter(target, key, value) {\n target[key] = value;\n}\n/**\n * @param {number} p0\n * @param {number} p1\n * @param {number} percent\n * @return {number}\n */\n\n\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\n * @param {string} p0\n * @param {string} p1\n * @param {number} percent\n * @return {string}\n */\n\n\nfunction interpolateString(p0, p1, percent) {\n return percent > 0.5 ? p1 : p0;\n}\n/**\n * @param {Array} p0\n * @param {Array} p1\n * @param {number} percent\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction interpolateArray(p0, p1, percent, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n } else {\n var len2 = len && p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n }\n} // arr0 is source array, arr1 is target array.\n// Do some preprocess to avoid error happened when interpolating from arr0 to arr1\n\n\nfunction fillArr(arr0, arr1, arrDim) {\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n\n if (arr0Len !== arr1Len) {\n // FIXME Not work for TypedArray\n var isPreviousLarger = arr0Len > arr1Len;\n\n if (isPreviousLarger) {\n // Cut the previous\n arr0.length = arr1Len;\n } else {\n // Fill the previous\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n } // Handling NaN value\n\n\n var len2 = arr0[0] && arr0[0].length;\n\n for (var i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i])) {\n arr0[i] = arr1[i];\n }\n } else {\n for (var j = 0; j < len2; j++) {\n if (isNaN(arr0[i][j])) {\n arr0[i][j] = arr1[i][j];\n }\n }\n }\n }\n}\n/**\n * @param {Array} arr0\n * @param {Array} arr1\n * @param {number} arrDim\n * @return {boolean}\n */\n\n\nfunction isArraySame(arr0, arr1, arrDim) {\n if (arr0 === arr1) {\n return true;\n }\n\n var len = arr0.length;\n\n if (len !== arr1.length) {\n return false;\n }\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n } else {\n var len2 = arr0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n if (arr0[i][j] !== arr1[i][j]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n/**\n * Catmull Rom interpolate array\n * @param {Array} p0\n * @param {Array} p1\n * @param {Array} p2\n * @param {Array} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\n }\n } else {\n var len2 = p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\n }\n }\n }\n}\n/**\n * Catmull Rom interpolate number\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @return {number}\n */\n\n\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n\nfunction cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n\n if (isArrayLike(value[0])) {\n var ret = [];\n\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n\n return ret;\n }\n\n return arraySlice.call(value);\n }\n\n return value;\n}\n\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]);\n rgba[1] = Math.floor(rgba[1]);\n rgba[2] = Math.floor(rgba[2]);\n return 'rgba(' + rgba.join(',') + ')';\n}\n\nfunction getArrayDim(keyframes) {\n var lastValue = keyframes[keyframes.length - 1].value;\n return isArrayLike(lastValue && lastValue[0]) ? 2 : 1;\n}\n\nfunction createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) {\n var getter = animator._getter;\n var setter = animator._setter;\n var useSpline = easing === 'spline';\n var trackLen = keyframes.length;\n\n if (!trackLen) {\n return;\n } // Guess data type\n\n\n var firstVal = keyframes[0].value;\n var isValueArray = isArrayLike(firstVal);\n var isValueColor = false;\n var isValueString = false; // For vertices morphing\n\n var arrDim = isValueArray ? getArrayDim(keyframes) : 0;\n var trackMaxTime; // Sort keyframe as ascending\n\n keyframes.sort(function (a, b) {\n return a.time - b.time;\n });\n trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe\n\n var kfPercents = []; // Value of each keyframe\n\n var kfValues = [];\n var prevValue = keyframes[0].value;\n var isAllValueEqual = true;\n\n for (var i = 0; i < trackLen; i++) {\n kfPercents.push(keyframes[i].time / trackMaxTime); // Assume value is a color when it is a string\n\n var value = keyframes[i].value; // Check if value is equal, deep check if value is array\n\n if (!(isValueArray && isArraySame(value, prevValue, arrDim) || !isValueArray && value === prevValue)) {\n isAllValueEqual = false;\n }\n\n prevValue = value; // Try converting a string to a color array\n\n if (typeof value === 'string') {\n var colorArray = color.parse(value);\n\n if (colorArray) {\n value = colorArray;\n isValueColor = true;\n } else {\n isValueString = true;\n }\n }\n\n kfValues.push(value);\n }\n\n if (!forceAnimate && isAllValueEqual) {\n return;\n }\n\n var lastValue = kfValues[trackLen - 1]; // Polyfill array and NaN value\n\n for (var i = 0; i < trackLen - 1; i++) {\n if (isValueArray) {\n fillArr(kfValues[i], lastValue, arrDim);\n } else {\n if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) {\n kfValues[i] = lastValue;\n }\n }\n }\n\n isValueArray && fillArr(getter(animator._target, propName), lastValue, arrDim); // Cache the key of last frame to speed up when\n // animation playback is sequency\n\n var lastFrame = 0;\n var lastFramePercent = 0;\n var start;\n var w;\n var p0;\n var p1;\n var p2;\n var p3;\n\n if (isValueColor) {\n var rgba = [0, 0, 0, 0];\n }\n\n var onframe = function (target, percent) {\n // Find the range keyframes\n // kf1-----kf2---------current--------kf3\n // find kf2 and kf3 and do interpolation\n var frame; // In the easing function like elasticOut, percent may less than 0\n\n if (percent < 0) {\n frame = 0;\n } else if (percent < lastFramePercent) {\n // Start from next key\n // PENDING start from lastFrame ?\n start = Math.min(lastFrame + 1, trackLen - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (kfPercents[frame] <= percent) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, trackLen - 2);\n } else {\n for (frame = lastFrame; frame < trackLen; frame++) {\n if (kfPercents[frame] > percent) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, trackLen - 2);\n }\n\n lastFrame = frame;\n lastFramePercent = percent;\n var range = kfPercents[frame + 1] - kfPercents[frame];\n\n if (range === 0) {\n return;\n } else {\n w = (percent - kfPercents[frame]) / range;\n }\n\n if (useSpline) {\n p1 = kfValues[frame];\n p0 = kfValues[frame === 0 ? frame : frame - 1];\n p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1];\n p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2];\n\n if (isValueArray) {\n catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n value = catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(p1, p2, w);\n } else {\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\n }\n\n setter(target, propName, value);\n }\n } else {\n if (isValueArray) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(kfValues[frame], kfValues[frame + 1], w);\n } else {\n value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w);\n }\n\n setter(target, propName, value);\n }\n }\n };\n\n var clip = new Clip({\n target: animator._target,\n life: trackMaxTime,\n loop: animator._loop,\n delay: animator._delay,\n onframe: onframe,\n ondestroy: oneTrackDone\n });\n\n if (easing && easing !== 'spline') {\n clip.easing = easing;\n }\n\n return clip;\n}\n/**\n * @alias module:zrender/animation/Animator\n * @constructor\n * @param {Object} target\n * @param {boolean} loop\n * @param {Function} getter\n * @param {Function} setter\n */\n\n\nvar Animator = function (target, loop, getter, setter) {\n this._tracks = {};\n this._target = target;\n this._loop = loop || false;\n this._getter = getter || defaultGetter;\n this._setter = setter || defaultSetter;\n this._clipCount = 0;\n this._delay = 0;\n this._doneList = [];\n this._onframeList = [];\n this._clipList = [];\n};\n\nAnimator.prototype = {\n /**\n * Set Animation keyframe\n * @param {number} time 关键帧时间,单位是ms\n * @param {Object} props 关键帧的属性值,key-value表示\n * @return {module:zrender/animation/Animator}\n */\n when: function (time\n /* ms */\n , props) {\n var tracks = this._tracks;\n\n for (var propName in props) {\n if (!props.hasOwnProperty(propName)) {\n continue;\n }\n\n if (!tracks[propName]) {\n tracks[propName] = []; // Invalid value\n\n var value = this._getter(this._target, propName);\n\n if (value == null) {\n // zrLog('Invalid property ' + propName);\n continue;\n } // If time is 0\n // Then props is given initialize value\n // Else\n // Initialize value from current prop value\n\n\n if (time !== 0) {\n tracks[propName].push({\n time: 0,\n value: cloneValue(value)\n });\n }\n }\n\n tracks[propName].push({\n time: time,\n value: props[propName]\n });\n }\n\n return this;\n },\n\n /**\n * 添加动画每一帧的回调函数\n * @param {Function} callback\n * @return {module:zrender/animation/Animator}\n */\n during: function (callback) {\n this._onframeList.push(callback);\n\n return this;\n },\n pause: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].pause();\n }\n\n this._paused = true;\n },\n resume: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].resume();\n }\n\n this._paused = false;\n },\n isPaused: function () {\n return !!this._paused;\n },\n _doneCallback: function () {\n // Clear all tracks\n this._tracks = {}; // Clear all clips\n\n this._clipList.length = 0;\n var doneList = this._doneList;\n var len = doneList.length;\n\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n },\n\n /**\n * Start the animation\n * @param {string|Function} [easing]\n * 动画缓动函数,详见{@link module:zrender/animation/easing}\n * @param {boolean} forceAnimate\n * @return {module:zrender/animation/Animator}\n */\n start: function (easing, forceAnimate) {\n var self = this;\n var clipCount = 0;\n\n var oneTrackDone = function () {\n clipCount--;\n\n if (!clipCount) {\n self._doneCallback();\n }\n };\n\n var lastClip;\n\n for (var propName in this._tracks) {\n if (!this._tracks.hasOwnProperty(propName)) {\n continue;\n }\n\n var clip = createTrackClip(this, easing, oneTrackDone, this._tracks[propName], propName, forceAnimate);\n\n if (clip) {\n this._clipList.push(clip);\n\n clipCount++; // If start after added to animation\n\n if (this.animation) {\n this.animation.addClip(clip);\n }\n\n lastClip = clip;\n }\n } // Add during callback on the last clip\n\n\n if (lastClip) {\n var oldOnFrame = lastClip.onframe;\n\n lastClip.onframe = function (target, percent) {\n oldOnFrame(target, percent);\n\n for (var i = 0; i < self._onframeList.length; i++) {\n self._onframeList[i](target, percent);\n }\n };\n } // This optimization will help the case that in the upper application\n // the view may be refreshed frequently, where animation will be\n // called repeatly but nothing changed.\n\n\n if (!clipCount) {\n this._doneCallback();\n }\n\n return this;\n },\n\n /**\n * Stop animation\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stop: function (forwardToLast) {\n var clipList = this._clipList;\n var animation = this.animation;\n\n for (var i = 0; i < clipList.length; i++) {\n var clip = clipList[i];\n\n if (forwardToLast) {\n // Move to last frame before stop\n clip.onframe(this._target, 1);\n }\n\n animation && animation.removeClip(clip);\n }\n\n clipList.length = 0;\n },\n\n /**\n * Set when animation delay starts\n * @param {number} time 单位ms\n * @return {module:zrender/animation/Animator}\n */\n delay: function (time) {\n this._delay = time;\n return this;\n },\n\n /**\n * Add callback for animation end\n * @param {Function} cb\n * @return {module:zrender/animation/Animator}\n */\n done: function (cb) {\n if (cb) {\n this._doneList.push(cb);\n }\n\n return this;\n },\n\n /**\n * @return {Array.}\n */\n getClips: function () {\n return this._clipList;\n }\n};\nvar _default = Animator;\nmodule.exports = _default;","var dpr = 1; // If in browser environment\n\nif (typeof window !== 'undefined') {\n dpr = Math.max(window.devicePixelRatio || 1, 1);\n}\n/**\n * config默认配置项\n * @exports zrender/config\n * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)\n */\n\n/**\n * Debug log mode:\n * 0: Do nothing, for release.\n * 1: console.error, for debug.\n */\n\n\nvar debugMode = 0; // retina 屏幕优化\n\nvar devicePixelRatio = dpr;\nexports.debugMode = debugMode;\nexports.devicePixelRatio = devicePixelRatio;","var _config = require(\"../config\");\n\nvar debugMode = _config.debugMode;\n\nvar logError = function () {};\n\nif (debugMode === 1) {\n logError = console.error;\n}\n\nvar _default = logError;\nmodule.exports = _default;","var Animator = require(\"../animation/Animator\");\n\nvar logError = require(\"../core/log\");\n\nvar _util = require(\"../core/util\");\n\nvar isString = _util.isString;\nvar isFunction = _util.isFunction;\nvar isObject = _util.isObject;\nvar isArrayLike = _util.isArrayLike;\nvar indexOf = _util.indexOf;\n\n/**\n * @alias module:zrender/mixin/Animatable\n * @constructor\n */\nvar Animatable = function () {\n /**\n * @type {Array.}\n * @readOnly\n */\n this.animators = [];\n};\n\nAnimatable.prototype = {\n constructor: Animatable,\n\n /**\n * 动画\n *\n * @param {string} path The path to fetch value from object, like 'a.b.c'.\n * @param {boolean} [loop] Whether to loop animation.\n * @return {module:zrender/animation/Animator}\n * @example:\n * el.animate('style', false)\n * .when(1000, {x: 10} )\n * .done(function(){ // Animation done })\n * .start()\n */\n animate: function (path, loop) {\n var target;\n var animatingShape = false;\n var el = this;\n var zr = this.__zr;\n\n if (path) {\n var pathSplitted = path.split('.');\n var prop = el; // If animating shape\n\n animatingShape = pathSplitted[0] === 'shape';\n\n for (var i = 0, l = pathSplitted.length; i < l; i++) {\n if (!prop) {\n continue;\n }\n\n prop = prop[pathSplitted[i]];\n }\n\n if (prop) {\n target = prop;\n }\n } else {\n target = el;\n }\n\n if (!target) {\n logError('Property \"' + path + '\" is not existed in element ' + el.id);\n return;\n }\n\n var animators = el.animators;\n var animator = new Animator(target, loop);\n animator.during(function (target) {\n el.dirty(animatingShape);\n }).done(function () {\n // FIXME Animator will not be removed if use `Animator#stop` to stop animation\n animators.splice(indexOf(animators, animator), 1);\n });\n animators.push(animator); // If animate after added to the zrender\n\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n\n return animator;\n },\n\n /**\n * 停止动画\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stopAnimation: function (forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n\n for (var i = 0; i < len; i++) {\n animators[i].stop(forwardToLast);\n }\n\n animators.length = 0;\n return this;\n },\n\n /**\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n * @param {Object} target\n * @param {number} [time=500] Time in ms\n * @param {string} [easing='linear']\n * @param {number} [delay=0]\n * @param {Function} [callback]\n * @param {Function} [forceAnimate] Prevent stop animation and callback\n * immediently when target values are the same as current values.\n *\n * @example\n * // Animate position\n * el.animateTo({\n * position: [10, 10]\n * }, function () { // done })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing\n * el.animateTo({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, 100, 100, 'cubicOut', function () { // done })\n */\n // TODO Return animation key\n animateTo: function (target, time, delay, easing, callback, forceAnimate) {\n animateTo(this, target, time, delay, easing, callback, forceAnimate);\n },\n\n /**\n * Animate from the target state to current state.\n * The params and the return value are the same as `this.animateTo`.\n */\n animateFrom: function (target, time, delay, easing, callback, forceAnimate) {\n animateTo(this, target, time, delay, easing, callback, forceAnimate, true);\n }\n};\n\nfunction animateTo(animatable, target, time, delay, easing, callback, forceAnimate, reverse) {\n // animateTo(target, time, easing, callback);\n if (isString(delay)) {\n callback = easing;\n easing = delay;\n delay = 0;\n } // animateTo(target, time, delay, callback);\n else if (isFunction(easing)) {\n callback = easing;\n easing = 'linear';\n delay = 0;\n } // animateTo(target, time, callback);\n else if (isFunction(delay)) {\n callback = delay;\n delay = 0;\n } // animateTo(target, callback)\n else if (isFunction(time)) {\n callback = time;\n time = 500;\n } // animateTo(target)\n else if (!time) {\n time = 500;\n } // Stop all previous animations\n\n\n animatable.stopAnimation();\n animateToShallow(animatable, '', animatable, target, time, delay, reverse); // Animators may be removed immediately after start\n // if there is nothing to animate\n\n var animators = animatable.animators.slice();\n var count = animators.length;\n\n function done() {\n count--;\n\n if (!count) {\n callback && callback();\n }\n } // No animators. This should be checked before animators[i].start(),\n // because 'done' may be executed immediately if no need to animate.\n\n\n if (!count) {\n callback && callback();\n } // Start after all animators created\n // Incase any animator is done immediately when all animation properties are not changed\n\n\n for (var i = 0; i < animators.length; i++) {\n animators[i].done(done).start(easing, forceAnimate);\n }\n}\n/**\n * @param {string} path=''\n * @param {Object} source=animatable\n * @param {Object} target\n * @param {number} [time=500]\n * @param {number} [delay=0]\n * @param {boolean} [reverse] If `true`, animate\n * from the `target` to current state.\n *\n * @example\n * // Animate position\n * el._animateToShallow({\n * position: [10, 10]\n * })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms\n * el._animateToShallow({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, 100, 100)\n */\n\n\nfunction animateToShallow(animatable, path, source, target, time, delay, reverse) {\n var objShallow = {};\n var propertyCount = 0;\n\n for (var name in target) {\n if (!target.hasOwnProperty(name)) {\n continue;\n }\n\n if (source[name] != null) {\n if (isObject(target[name]) && !isArrayLike(target[name])) {\n animateToShallow(animatable, path ? path + '.' + name : name, source[name], target[name], time, delay, reverse);\n } else {\n if (reverse) {\n objShallow[name] = source[name];\n setAttrByPath(animatable, path, name, target[name]);\n } else {\n objShallow[name] = target[name];\n }\n\n propertyCount++;\n }\n } else if (target[name] != null && !reverse) {\n setAttrByPath(animatable, path, name, target[name]);\n }\n }\n\n if (propertyCount > 0) {\n animatable.animate(path, false).when(time == null ? 500 : time, objShallow).delay(delay || 0);\n }\n}\n\nfunction setAttrByPath(el, path, name, value) {\n // Attr directly if not has property\n // FIXME, if some property not needed for element ?\n if (!path) {\n el.attr(name, value);\n } else {\n // Only support set shape or style\n var props = {};\n props[path] = {};\n props[path][name] = value;\n el.attr(props);\n }\n}\n\nvar _default = Animatable;\nmodule.exports = _default;","var guid = require(\"./core/guid\");\n\nvar Eventful = require(\"./mixin/Eventful\");\n\nvar Transformable = require(\"./mixin/Transformable\");\n\nvar Animatable = require(\"./mixin/Animatable\");\n\nvar zrUtil = require(\"./core/util\");\n\n/**\n * @alias module:zrender/Element\n * @constructor\n * @extends {module:zrender/mixin/Animatable}\n * @extends {module:zrender/mixin/Transformable}\n * @extends {module:zrender/mixin/Eventful}\n */\nvar Element = function (opts) {\n // jshint ignore:line\n Transformable.call(this, opts);\n Eventful.call(this, opts);\n Animatable.call(this, opts);\n /**\n * 画布元素ID\n * @type {string}\n */\n\n this.id = opts.id || guid();\n};\n\nElement.prototype = {\n /**\n * 元素类型\n * Element type\n * @type {string}\n */\n type: 'element',\n\n /**\n * 元素名字\n * Element name\n * @type {string}\n */\n name: '',\n\n /**\n * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值\n * ZRender instance will be assigned when element is associated with zrender\n * @name module:/zrender/Element#__zr\n * @type {module:zrender/ZRender}\n */\n __zr: null,\n\n /**\n * 图形是否忽略,为true时忽略图形的绘制以及事件触发\n * If ignore drawing and events of the element object\n * @name module:/zrender/Element#ignore\n * @type {boolean}\n * @default false\n */\n ignore: false,\n\n /**\n * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪\n * 该路径会继承被裁减对象的变换\n * @type {module:zrender/graphic/Path}\n * @see http://www.w3.org/TR/2dcontext/#clipping-region\n * @readOnly\n */\n clipPath: null,\n\n /**\n * 是否是 Group\n * @type {boolean}\n */\n isGroup: false,\n\n /**\n * Drift element\n * @param {number} dx dx on the global space\n * @param {number} dy dy on the global space\n */\n drift: function (dx, dy) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n\n case 'vertical':\n dx = 0;\n break;\n }\n\n var m = this.transform;\n\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.dirty(false);\n },\n\n /**\n * Hook before update\n */\n beforeUpdate: function () {},\n\n /**\n * Hook after update\n */\n afterUpdate: function () {},\n\n /**\n * Update each frame\n */\n update: function () {\n this.updateTransform();\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {},\n\n /**\n * @protected\n */\n attrKV: function (key, value) {\n if (key === 'position' || key === 'scale' || key === 'origin') {\n // Copy the array\n if (value) {\n var target = this[key];\n\n if (!target) {\n target = this[key] = [];\n }\n\n target[0] = value[0];\n target[1] = value[1];\n }\n } else {\n this[key] = value;\n }\n },\n\n /**\n * Hide the element\n */\n hide: function () {\n this.ignore = true;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * Show the element\n */\n show: function () {\n this.ignore = false;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * @param {string|Object} key\n * @param {*} value\n */\n attr: function (key, value) {\n if (typeof key === 'string') {\n this.attrKV(key, value);\n } else if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n this.attrKV(name, key[name]);\n }\n }\n }\n\n this.dirty(false);\n return this;\n },\n\n /**\n * @param {module:zrender/graphic/Path} clipPath\n */\n setClipPath: function (clipPath) {\n var zr = this.__zr;\n\n if (zr) {\n clipPath.addSelfToZr(zr);\n } // Remove previous clip path\n\n\n if (this.clipPath && this.clipPath !== clipPath) {\n this.removeClipPath();\n }\n\n this.clipPath = clipPath;\n clipPath.__zr = zr;\n clipPath.__clipTarget = this;\n this.dirty(false);\n },\n\n /**\n */\n removeClipPath: function () {\n var clipPath = this.clipPath;\n\n if (clipPath) {\n if (clipPath.__zr) {\n clipPath.removeSelfFromZr(clipPath.__zr);\n }\n\n clipPath.__zr = null;\n clipPath.__clipTarget = null;\n this.clipPath = null;\n this.dirty(false);\n }\n },\n\n /**\n * Add self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n addSelfToZr: function (zr) {\n this.__zr = zr; // 添加动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.addSelfToZr(zr);\n }\n },\n\n /**\n * Remove self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n removeSelfFromZr: function (zr) {\n this.__zr = null; // 移除动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.removeSelfFromZr(zr);\n }\n }\n};\nzrUtil.mixin(Element, Animatable);\nzrUtil.mixin(Element, Transformable);\nzrUtil.mixin(Element, Eventful);\nvar _default = Element;\nmodule.exports = _default;","var vec2 = require(\"./vector\");\n\nvar matrix = require(\"./matrix\");\n\n/**\n * @module echarts/core/BoundingRect\n */\nvar v2ApplyTransform = vec2.applyTransform;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n/**\n * @alias module:echarts/core/BoundingRect\n */\n\nfunction BoundingRect(x, y, width, height) {\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n /**\n * @type {number}\n */\n\n\n this.x = x;\n /**\n * @type {number}\n */\n\n this.y = y;\n /**\n * @type {number}\n */\n\n this.width = width;\n /**\n * @type {number}\n */\n\n this.height = height;\n}\n\nBoundingRect.prototype = {\n constructor: BoundingRect,\n\n /**\n * @param {module:echarts/core/BoundingRect} other\n */\n union: function (other) {\n var x = mathMin(other.x, this.x);\n var y = mathMin(other.y, this.y);\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n this.x = x;\n this.y = y;\n },\n\n /**\n * @param {Array.} m\n * @methods\n */\n applyTransform: function () {\n var lt = [];\n var rb = [];\n var lb = [];\n var rt = [];\n return function (m) {\n // In case usage like this\n // el.getBoundingRect().applyTransform(el.transform)\n // And element has no transform\n if (!m) {\n return;\n }\n\n lt[0] = lb[0] = this.x;\n lt[1] = rt[1] = this.y;\n rb[0] = rt[0] = this.x + this.width;\n rb[1] = lb[1] = this.y + this.height;\n v2ApplyTransform(lt, lt, m);\n v2ApplyTransform(rb, rb, m);\n v2ApplyTransform(lb, lb, m);\n v2ApplyTransform(rt, rt, m);\n this.x = mathMin(lt[0], rb[0], lb[0], rt[0]);\n this.y = mathMin(lt[1], rb[1], lb[1], rt[1]);\n var maxX = mathMax(lt[0], rb[0], lb[0], rt[0]);\n var maxY = mathMax(lt[1], rb[1], lb[1], rt[1]);\n this.width = maxX - this.x;\n this.height = maxY - this.y;\n };\n }(),\n\n /**\n * Calculate matrix of transforming from self to target rect\n * @param {module:zrender/core/BoundingRect} b\n * @return {Array.}\n */\n calculateTransform: function (b) {\n var a = this;\n var sx = b.width / a.width;\n var sy = b.height / a.height;\n var m = matrix.create(); // 矩阵右乘\n\n matrix.translate(m, m, [-a.x, -a.y]);\n matrix.scale(m, m, [sx, sy]);\n matrix.translate(m, m, [b.x, b.y]);\n return m;\n },\n\n /**\n * @param {(module:echarts/core/BoundingRect|Object)} b\n * @return {boolean}\n */\n intersect: function (b) {\n if (!b) {\n return false;\n }\n\n if (!(b instanceof BoundingRect)) {\n // Normalize negative width/height.\n b = BoundingRect.create(b);\n }\n\n var a = this;\n var ax0 = a.x;\n var ax1 = a.x + a.width;\n var ay0 = a.y;\n var ay1 = a.y + a.height;\n var bx0 = b.x;\n var bx1 = b.x + b.width;\n var by0 = b.y;\n var by1 = b.y + b.height;\n return !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n },\n contain: function (x, y) {\n var rect = this;\n return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;\n },\n\n /**\n * @return {module:echarts/core/BoundingRect}\n */\n clone: function () {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n },\n\n /**\n * Copy from another rect\n */\n copy: function (other) {\n this.x = other.x;\n this.y = other.y;\n this.width = other.width;\n this.height = other.height;\n },\n plain: function () {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n }\n};\n/**\n * @param {Object|module:zrender/core/BoundingRect} rect\n * @param {number} rect.x\n * @param {number} rect.y\n * @param {number} rect.width\n * @param {number} rect.height\n * @return {module:zrender/core/BoundingRect}\n */\n\nBoundingRect.create = function (rect) {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n};\n\nvar _default = BoundingRect;\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Element = require(\"../Element\");\n\nvar BoundingRect = require(\"../core/BoundingRect\");\n\n/**\n * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上\n * @module zrender/graphic/Group\n * @example\n * var Group = require('zrender/container/Group');\n * var Circle = require('zrender/graphic/shape/Circle');\n * var g = new Group();\n * g.position[0] = 100;\n * g.position[1] = 100;\n * g.add(new Circle({\n * style: {\n * x: 100,\n * y: 100,\n * r: 20,\n * }\n * }));\n * zr.add(g);\n */\n\n/**\n * @alias module:zrender/graphic/Group\n * @constructor\n * @extends module:zrender/mixin/Transformable\n * @extends module:zrender/mixin/Eventful\n */\nvar Group = function (opts) {\n opts = opts || {};\n Element.call(this, opts);\n\n for (var key in opts) {\n if (opts.hasOwnProperty(key)) {\n this[key] = opts[key];\n }\n }\n\n this._children = [];\n this.__storage = null;\n this.__dirty = true;\n};\n\nGroup.prototype = {\n constructor: Group,\n isGroup: true,\n\n /**\n * @type {string}\n */\n type: 'group',\n\n /**\n * 所有子孙元素是否响应鼠标事件\n * @name module:/zrender/container/Group#silent\n * @type {boolean}\n * @default false\n */\n silent: false,\n\n /**\n * @return {Array.}\n */\n children: function () {\n return this._children.slice();\n },\n\n /**\n * 获取指定 index 的儿子节点\n * @param {number} idx\n * @return {module:zrender/Element}\n */\n childAt: function (idx) {\n return this._children[idx];\n },\n\n /**\n * 获取指定名字的儿子节点\n * @param {string} name\n * @return {module:zrender/Element}\n */\n childOfName: function (name) {\n var children = this._children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n },\n\n /**\n * @return {number}\n */\n childCount: function () {\n return this._children.length;\n },\n\n /**\n * 添加子节点到最后\n * @param {module:zrender/Element} child\n */\n add: function (child) {\n if (child && child !== this && child.parent !== this) {\n this._children.push(child);\n\n this._doAdd(child);\n }\n\n return this;\n },\n\n /**\n * 添加子节点在 nextSibling 之前\n * @param {module:zrender/Element} child\n * @param {module:zrender/Element} nextSibling\n */\n addBefore: function (child, nextSibling) {\n if (child && child !== this && child.parent !== this && nextSibling && nextSibling.parent === this) {\n var children = this._children;\n var idx = children.indexOf(nextSibling);\n\n if (idx >= 0) {\n children.splice(idx, 0, child);\n\n this._doAdd(child);\n }\n }\n\n return this;\n },\n _doAdd: function (child) {\n if (child.parent) {\n child.parent.remove(child);\n }\n\n child.parent = this;\n var storage = this.__storage;\n var zr = this.__zr;\n\n if (storage && storage !== child.__storage) {\n storage.addToStorage(child);\n\n if (child instanceof Group) {\n child.addChildrenToStorage(storage);\n }\n }\n\n zr && zr.refresh();\n },\n\n /**\n * 移除子节点\n * @param {module:zrender/Element} child\n */\n remove: function (child) {\n var zr = this.__zr;\n var storage = this.__storage;\n var children = this._children;\n var idx = zrUtil.indexOf(children, child);\n\n if (idx < 0) {\n return this;\n }\n\n children.splice(idx, 1);\n child.parent = null;\n\n if (storage) {\n storage.delFromStorage(child);\n\n if (child instanceof Group) {\n child.delChildrenFromStorage(storage);\n }\n }\n\n zr && zr.refresh();\n return this;\n },\n\n /**\n * 移除所有子节点\n */\n removeAll: function () {\n var children = this._children;\n var storage = this.__storage;\n var child;\n var i;\n\n for (i = 0; i < children.length; i++) {\n child = children[i];\n\n if (storage) {\n storage.delFromStorage(child);\n\n if (child instanceof Group) {\n child.delChildrenFromStorage(storage);\n }\n }\n\n child.parent = null;\n }\n\n children.length = 0;\n return this;\n },\n\n /**\n * 遍历所有子节点\n * @param {Function} cb\n * @param {} context\n */\n eachChild: function (cb, context) {\n var children = this._children;\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n cb.call(context, child, i);\n }\n\n return this;\n },\n\n /**\n * 深度优先遍历所有子孙节点\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n cb.call(context, child);\n\n if (child.type === 'group') {\n child.traverse(cb, context);\n }\n }\n\n return this;\n },\n addChildrenToStorage: function (storage) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n storage.addToStorage(child);\n\n if (child instanceof Group) {\n child.addChildrenToStorage(storage);\n }\n }\n },\n delChildrenFromStorage: function (storage) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n storage.delFromStorage(child);\n\n if (child instanceof Group) {\n child.delChildrenFromStorage(storage);\n }\n }\n },\n dirty: function () {\n this.__dirty = true;\n this.__zr && this.__zr.refresh();\n return this;\n },\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function (includeChildren) {\n // TODO Caching\n var rect = null;\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = includeChildren || this._children;\n var tmpMat = [];\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n\n if (child.ignore || child.invisible) {\n continue;\n }\n\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat); // TODO\n // The boundingRect cacluated by transforming original\n // rect may be bigger than the actual bundingRect when rotation\n // is used. (Consider a circle rotated aginst its center, where\n // the actual boundingRect should be the same as that not be\n // rotated.) But we can not find better approach to calculate\n // actual boundingRect yet, considering performance.\n\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n } else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n\n return rect || tmpRect;\n }\n};\nzrUtil.inherits(Group, Element);\nvar _default = Group;\nmodule.exports = _default;","// https://github.com/mziccard/node-timsort\nvar DEFAULT_MIN_MERGE = 32;\nvar DEFAULT_MIN_GALLOPING = 7;\nvar DEFAULT_TMP_STORAGE_LENGTH = 256;\n\nfunction minRunLength(n) {\n var r = 0;\n\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n\n return n + r;\n}\n\nfunction makeAscendingRun(array, lo, hi, compare) {\n var runHi = lo + 1;\n\n if (runHi === hi) {\n return 1;\n }\n\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n\n reverseRun(array, lo, runHi);\n } else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n\n return runHi - lo;\n}\n\nfunction reverseRun(array, lo, hi) {\n hi--;\n\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n}\n\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\n if (start === lo) {\n start++;\n }\n\n for (; start < hi; start++) {\n var pivot = array[start];\n var left = lo;\n var right = start;\n var mid;\n\n while (left < right) {\n mid = left + right >>> 1;\n\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n\n var n = start - left;\n\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n\n case 2:\n array[left + 2] = array[left + 1];\n\n case 1:\n array[left + 1] = array[left];\n break;\n\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n\n }\n\n array[left] = pivot;\n }\n}\n\nfunction gallopLeft(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n lastOffset += hint;\n offset += hint;\n } else {\n maxOffset = hint + 1;\n\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n\n lastOffset++;\n\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n } else {\n offset = m;\n }\n }\n\n return offset;\n}\n\nfunction gallopRight(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n } else {\n maxOffset = length - hint;\n\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n lastOffset += hint;\n offset += hint;\n }\n\n lastOffset++;\n\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n } else {\n lastOffset = m + 1;\n }\n }\n\n return offset;\n}\n\nfunction TimSort(array, compare) {\n var minGallop = DEFAULT_MIN_GALLOPING;\n var length = 0;\n var tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;\n var stackLength = 0;\n var runStart;\n var runLength;\n var stackSize = 0;\n length = array.length;\n\n if (length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {\n tmpStorageLength = length >>> 1;\n }\n\n var tmp = [];\n stackLength = length < 120 ? 5 : length < 1542 ? 10 : length < 119151 ? 19 : 40;\n runStart = [];\n runLength = [];\n\n function pushRun(_runStart, _runLength) {\n runStart[stackSize] = _runStart;\n runLength[stackSize] = _runLength;\n stackSize += 1;\n }\n\n function mergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n\n if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) {\n if (runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n } else if (runLength[n] > runLength[n + 1]) {\n break;\n }\n\n mergeAt(n);\n }\n }\n\n function forceMergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n\n mergeAt(n);\n }\n }\n\n function mergeAt(i) {\n var start1 = runStart[i];\n var length1 = runLength[i];\n var start2 = runStart[i + 1];\n var length2 = runLength[i + 1];\n runLength[i] = length1 + length2;\n\n if (i === stackSize - 3) {\n runStart[i + 1] = runStart[i + 2];\n runLength[i + 1] = runLength[i + 2];\n }\n\n stackSize--;\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n\n if (length1 === 0) {\n return;\n }\n\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n\n if (length2 === 0) {\n return;\n }\n\n if (length1 <= length2) {\n mergeLow(start1, length1, start2, length2);\n } else {\n mergeHigh(start1, length1, start2, length2);\n }\n }\n\n function mergeLow(start1, length1, start2, length2) {\n var i = 0;\n\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n array[dest++] = array[cursor2++];\n\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n\n return;\n }\n\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n\n array[dest + length2] = tmp[cursor1];\n return;\n }\n\n var _minGallop = minGallop;\n var count1;\n var count2;\n var exit;\n\n while (1) {\n count1 = 0;\n count2 = 0;\n exit = false;\n\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n\n if (--length2 === 0) {\n exit = true;\n break;\n }\n } else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n\n if (exit) {\n break;\n }\n\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n\n array[dest++] = array[cursor2++];\n\n if (--length2 === 0) {\n exit = true;\n break;\n }\n\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n\n array[dest++] = tmp[cursor1++];\n\n if (--length1 === 1) {\n exit = true;\n break;\n }\n\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n\n if (exit) {\n break;\n }\n\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n\n _minGallop += 2;\n }\n\n minGallop = _minGallop;\n minGallop < 1 && (minGallop = 1);\n\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n\n array[dest + length2] = tmp[cursor1];\n } else if (length1 === 0) {\n throw new Error(); // throw new Error('mergeLow preconditions were not respected');\n } else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n }\n\n function mergeHigh(start1, length1, start2, length2) {\n var i = 0;\n\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n array[dest--] = array[cursor1--];\n\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n\n return;\n }\n\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n array[dest] = tmp[cursor2];\n return;\n }\n\n var _minGallop = minGallop;\n\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n\n if (--length1 === 0) {\n exit = true;\n break;\n }\n } else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n\n if (exit) {\n break;\n }\n\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n\n array[dest--] = tmp[cursor2--];\n\n if (--length2 === 1) {\n exit = true;\n break;\n }\n\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n\n array[dest--] = array[cursor1--];\n\n if (--length1 === 0) {\n exit = true;\n break;\n }\n\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n\n if (exit) {\n break;\n }\n\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n\n _minGallop += 2;\n }\n\n minGallop = _minGallop;\n\n if (minGallop < 1) {\n minGallop = 1;\n }\n\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n array[dest] = tmp[cursor2];\n } else if (length2 === 0) {\n throw new Error(); // throw new Error('mergeHigh preconditions were not respected');\n } else {\n customCursor = dest - (length2 - 1);\n\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n }\n\n this.mergeRuns = mergeRuns;\n this.forceMergeRuns = forceMergeRuns;\n this.pushRun = pushRun;\n}\n\nfunction sort(array, compare, lo, hi) {\n if (!lo) {\n lo = 0;\n }\n\n if (!hi) {\n hi = array.length;\n }\n\n var remaining = hi - lo;\n\n if (remaining < 2) {\n return;\n }\n\n var runLength = 0;\n\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n\n var ts = new TimSort(array, compare);\n var minRun = minRunLength(remaining);\n\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n\n if (runLength < minRun) {\n var force = remaining;\n\n if (force > minRun) {\n force = minRun;\n }\n\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n\n ts.forceMergeRuns();\n}\n\nmodule.exports = sort;","var util = require(\"./core/util\");\n\nvar env = require(\"./core/env\");\n\nvar Group = require(\"./container/Group\");\n\nvar timsort = require(\"./core/timsort\");\n\n// Use timsort because in most case elements are partially sorted\n// https://jsfiddle.net/pissang/jr4x7mdm/8/\nfunction shapeCompareFunc(a, b) {\n if (a.zlevel === b.zlevel) {\n if (a.z === b.z) {\n // if (a.z2 === b.z2) {\n // // FIXME Slow has renderidx compare\n // // http://stackoverflow.com/questions/20883421/sorting-in-javascript-should-every-compare-function-have-a-return-0-statement\n // // https://github.com/v8/v8/blob/47cce544a31ed5577ffe2963f67acb4144ee0232/src/js/array.js#L1012\n // return a.__renderidx - b.__renderidx;\n // }\n return a.z2 - b.z2;\n }\n\n return a.z - b.z;\n }\n\n return a.zlevel - b.zlevel;\n}\n/**\n * 内容仓库 (M)\n * @alias module:zrender/Storage\n * @constructor\n */\n\n\nvar Storage = function () {\n // jshint ignore:line\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n};\n\nStorage.prototype = {\n constructor: Storage,\n\n /**\n * @param {Function} cb\n *\n */\n traverse: function (cb, context) {\n for (var i = 0; i < this._roots.length; i++) {\n this._roots[i].traverse(cb, context);\n }\n },\n\n /**\n * 返回所有图形的绘制队列\n * @param {boolean} [update=false] 是否在返回前更新该数组\n * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组, 在 update 为 true 的时候有效\n *\n * 详见{@link module:zrender/graphic/Displayable.prototype.updateDisplayList}\n * @return {Array.}\n */\n getDisplayList: function (update, includeIgnore) {\n includeIgnore = includeIgnore || false;\n\n if (update) {\n this.updateDisplayList(includeIgnore);\n }\n\n return this._displayList;\n },\n\n /**\n * 更新图形的绘制队列。\n * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,\n * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列\n * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组\n */\n updateDisplayList: function (includeIgnore) {\n this._displayListLen = 0;\n var roots = this._roots;\n var displayList = this._displayList;\n\n for (var i = 0, len = roots.length; i < len; i++) {\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n }\n\n displayList.length = this._displayListLen;\n env.canvasSupported && timsort(displayList, shapeCompareFunc);\n },\n _updateAndAddDisplayable: function (el, clipPaths, includeIgnore) {\n if (el.ignore && !includeIgnore) {\n return;\n }\n\n el.beforeUpdate();\n\n if (el.__dirty) {\n el.update();\n }\n\n el.afterUpdate();\n var userSetClipPath = el.clipPath;\n\n if (userSetClipPath) {\n // FIXME 效率影响\n if (clipPaths) {\n clipPaths = clipPaths.slice();\n } else {\n clipPaths = [];\n }\n\n var currentClipPath = userSetClipPath;\n var parentClipPath = el; // Recursively add clip path\n\n while (currentClipPath) {\n // clipPath 的变换是基于使用这个 clipPath 的元素\n currentClipPath.parent = parentClipPath;\n currentClipPath.updateTransform();\n clipPaths.push(currentClipPath);\n parentClipPath = currentClipPath;\n currentClipPath = currentClipPath.clipPath;\n }\n }\n\n if (el.isGroup) {\n var children = el._children;\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i]; // Force to mark as dirty if group is dirty\n // FIXME __dirtyPath ?\n\n if (el.__dirty) {\n child.__dirty = true;\n }\n\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\n } // Mark group clean here\n\n\n el.__dirty = false;\n } else {\n el.__clipPaths = clipPaths;\n this._displayList[this._displayListLen++] = el;\n }\n },\n\n /**\n * 添加图形(Shape)或者组(Group)到根节点\n * @param {module:zrender/Element} el\n */\n addRoot: function (el) {\n if (el.__storage === this) {\n return;\n }\n\n if (el instanceof Group) {\n el.addChildrenToStorage(this);\n }\n\n this.addToStorage(el);\n\n this._roots.push(el);\n },\n\n /**\n * 删除指定的图形(Shape)或者组(Group)\n * @param {string|Array.} [el] 如果为空清空整个Storage\n */\n delRoot: function (el) {\n if (el == null) {\n // 不指定el清空\n for (var i = 0; i < this._roots.length; i++) {\n var root = this._roots[i];\n\n if (root instanceof Group) {\n root.delChildrenFromStorage(this);\n }\n }\n\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n return;\n }\n\n if (el instanceof Array) {\n for (var i = 0, l = el.length; i < l; i++) {\n this.delRoot(el[i]);\n }\n\n return;\n }\n\n var idx = util.indexOf(this._roots, el);\n\n if (idx >= 0) {\n this.delFromStorage(el);\n\n this._roots.splice(idx, 1);\n\n if (el instanceof Group) {\n el.delChildrenFromStorage(this);\n }\n }\n },\n addToStorage: function (el) {\n if (el) {\n el.__storage = this;\n el.dirty(false);\n }\n\n return this;\n },\n delFromStorage: function (el) {\n if (el) {\n el.__storage = null;\n }\n\n return this;\n },\n\n /**\n * 清空并且释放Storage\n */\n dispose: function () {\n this._renderList = this._roots = null;\n },\n displayableSortFunc: shapeCompareFunc\n};\nvar _default = Storage;\nmodule.exports = _default;","var SHADOW_PROPS = {\n 'shadowBlur': 1,\n 'shadowOffsetX': 1,\n 'shadowOffsetY': 1,\n 'textShadowBlur': 1,\n 'textShadowOffsetX': 1,\n 'textShadowOffsetY': 1,\n 'textBoxShadowBlur': 1,\n 'textBoxShadowOffsetX': 1,\n 'textBoxShadowOffsetY': 1\n};\n\nfunction _default(ctx, propName, value) {\n if (SHADOW_PROPS.hasOwnProperty(propName)) {\n return value *= ctx.dpr;\n }\n\n return value;\n}\n\nmodule.exports = _default;","var ContextCachedBy = {\n NONE: 0,\n STYLE_BIND: 1,\n PLAIN_TEXT: 2\n}; // Avoid confused with 0/false.\n\nvar WILL_BE_RESTORED = 9;\nexports.ContextCachedBy = ContextCachedBy;\nexports.WILL_BE_RESTORED = WILL_BE_RESTORED;","var fixShadow = require(\"./helper/fixShadow\");\n\nvar _constant = require(\"./constant\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\nvar STYLE_COMMON_PROPS = [['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'], ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]]; // var SHADOW_PROPS = STYLE_COMMON_PROPS.slice(0, 4);\n// var LINE_PROPS = STYLE_COMMON_PROPS.slice(4);\n\nvar Style = function (opts) {\n this.extendFrom(opts, false);\n};\n\nfunction createLinearGradient(ctx, obj, rect) {\n var x = obj.x == null ? 0 : obj.x;\n var x2 = obj.x2 == null ? 1 : obj.x2;\n var y = obj.y == null ? 0 : obj.y;\n var y2 = obj.y2 == null ? 0 : obj.y2;\n\n if (!obj.global) {\n x = x * rect.width + rect.x;\n x2 = x2 * rect.width + rect.x;\n y = y * rect.height + rect.y;\n y2 = y2 * rect.height + rect.y;\n } // Fix NaN when rect is Infinity\n\n\n x = isNaN(x) ? 0 : x;\n x2 = isNaN(x2) ? 1 : x2;\n y = isNaN(y) ? 0 : y;\n y2 = isNaN(y2) ? 0 : y2;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\n\nfunction createRadialGradient(ctx, obj, rect) {\n var width = rect.width;\n var height = rect.height;\n var min = Math.min(width, height);\n var x = obj.x == null ? 0.5 : obj.x;\n var y = obj.y == null ? 0.5 : obj.y;\n var r = obj.r == null ? 0.5 : obj.r;\n\n if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\n\nStyle.prototype = {\n constructor: Style,\n\n /**\n * @type {string}\n */\n fill: '#000',\n\n /**\n * @type {string}\n */\n stroke: null,\n\n /**\n * @type {number}\n */\n opacity: 1,\n\n /**\n * @type {number}\n */\n fillOpacity: null,\n\n /**\n * @type {number}\n */\n strokeOpacity: null,\n\n /**\n * `true` is not supported.\n * `false`/`null`/`undefined` are the same.\n * `false` is used to remove lineDash in some\n * case that `null`/`undefined` can not be set.\n * (e.g., emphasis.lineStyle in echarts)\n * @type {Array.|boolean}\n */\n lineDash: null,\n\n /**\n * @type {number}\n */\n lineDashOffset: 0,\n\n /**\n * @type {number}\n */\n shadowBlur: 0,\n\n /**\n * @type {number}\n */\n shadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n shadowOffsetY: 0,\n\n /**\n * @type {number}\n */\n lineWidth: 1,\n\n /**\n * If stroke ignore scale\n * @type {Boolean}\n */\n strokeNoScale: false,\n // Bounding rect text configuration\n // Not affected by element transform\n\n /**\n * @type {string}\n */\n text: null,\n\n /**\n * If `fontSize` or `fontFamily` exists, `font` will be reset by\n * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`.\n * So do not visit it directly in upper application (like echarts),\n * but use `contain/text#makeFont` instead.\n * @type {string}\n */\n font: null,\n\n /**\n * The same as font. Use font please.\n * @deprecated\n * @type {string}\n */\n textFont: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontStyle: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontWeight: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * Should be 12 but not '12px'.\n * @type {number}\n */\n fontSize: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontFamily: null,\n\n /**\n * Reserved for special functinality, like 'hr'.\n * @type {string}\n */\n textTag: null,\n\n /**\n * @type {string}\n */\n textFill: '#000',\n\n /**\n * @type {string}\n */\n textStroke: null,\n\n /**\n * @type {number}\n */\n textWidth: null,\n\n /**\n * Only for textBackground.\n * @type {number}\n */\n textHeight: null,\n\n /**\n * textStroke may be set as some color as a default\n * value in upper applicaion, where the default value\n * of textStrokeWidth should be 0 to make sure that\n * user can choose to do not use text stroke.\n * @type {number}\n */\n textStrokeWidth: 0,\n\n /**\n * @type {number}\n */\n textLineHeight: null,\n\n /**\n * 'inside', 'left', 'right', 'top', 'bottom'\n * [x, y]\n * Based on x, y of rect.\n * @type {string|Array.}\n * @default 'inside'\n */\n textPosition: 'inside',\n\n /**\n * If not specified, use the boundingRect of a `displayable`.\n * @type {Object}\n */\n textRect: null,\n\n /**\n * [x, y]\n * @type {Array.}\n */\n textOffset: null,\n\n /**\n * @type {string}\n */\n textAlign: null,\n\n /**\n * @type {string}\n */\n textVerticalAlign: null,\n\n /**\n * @type {number}\n */\n textDistance: 5,\n\n /**\n * @type {string}\n */\n textShadowColor: 'transparent',\n\n /**\n * @type {number}\n */\n textShadowBlur: 0,\n\n /**\n * @type {number}\n */\n textShadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n textShadowOffsetY: 0,\n\n /**\n * @type {string}\n */\n textBoxShadowColor: 'transparent',\n\n /**\n * @type {number}\n */\n textBoxShadowBlur: 0,\n\n /**\n * @type {number}\n */\n textBoxShadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n textBoxShadowOffsetY: 0,\n\n /**\n * Whether transform text.\n * Only available in Path and Image element,\n * where the text is called as `RectText`.\n * @type {boolean}\n */\n transformText: false,\n\n /**\n * Text rotate around position of Path or Image.\n * The origin of the rotation can be specified by `textOrigin`.\n * Only available in Path and Image element,\n * where the text is called as `RectText`.\n */\n textRotation: 0,\n\n /**\n * Text origin of text rotation.\n * Useful in the case like label rotation of circular symbol.\n * Only available in Path and Image element, where the text is called\n * as `RectText` and the element is called as \"host element\".\n * The value can be:\n * + If specified as a coordinate like `[10, 40]`, it is the `[x, y]`\n * base on the left-top corner of the rect of its host element.\n * + If specified as a string `center`, it is the center of the rect of\n * its host element.\n * + By default, this origin is the `textPosition`.\n * @type {string|Array.}\n */\n textOrigin: null,\n\n /**\n * @type {string}\n */\n textBackgroundColor: null,\n\n /**\n * @type {string}\n */\n textBorderColor: null,\n\n /**\n * @type {number}\n */\n textBorderWidth: 0,\n\n /**\n * @type {number}\n */\n textBorderRadius: 0,\n\n /**\n * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]`\n * @type {number|Array.}\n */\n textPadding: null,\n\n /**\n * Text styles for rich text.\n * @type {Object}\n */\n rich: null,\n\n /**\n * {outerWidth, outerHeight, ellipsis, placeholder}\n * @type {Object}\n */\n truncate: null,\n\n /**\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n * @type {string}\n */\n blend: null,\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n */\n bind: function (ctx, el, prevEl) {\n var style = this;\n var prevStyle = prevEl && prevEl.style; // If no prevStyle, it means first draw.\n // Only apply cache if the last time cachced by this function.\n\n var notCheckCache = !prevStyle || ctx.__attrCachedBy !== ContextCachedBy.STYLE_BIND;\n ctx.__attrCachedBy = ContextCachedBy.STYLE_BIND;\n\n for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) {\n var prop = STYLE_COMMON_PROPS[i];\n var styleName = prop[0];\n\n if (notCheckCache || style[styleName] !== prevStyle[styleName]) {\n // FIXME Invalid property value will cause style leak from previous element.\n ctx[styleName] = fixShadow(ctx, styleName, style[styleName] || prop[1]);\n }\n }\n\n if (notCheckCache || style.fill !== prevStyle.fill) {\n ctx.fillStyle = style.fill;\n }\n\n if (notCheckCache || style.stroke !== prevStyle.stroke) {\n ctx.strokeStyle = style.stroke;\n }\n\n if (notCheckCache || style.opacity !== prevStyle.opacity) {\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n\n if (notCheckCache || style.blend !== prevStyle.blend) {\n ctx.globalCompositeOperation = style.blend || 'source-over';\n }\n\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n ctx.lineWidth = lineWidth / (this.strokeNoScale && el && el.getLineScale ? el.getLineScale() : 1);\n }\n },\n hasFill: function () {\n var fill = this.fill;\n return fill != null && fill !== 'none';\n },\n hasStroke: function () {\n var stroke = this.stroke;\n return stroke != null && stroke !== 'none' && this.lineWidth > 0;\n },\n\n /**\n * Extend from other style\n * @param {zrender/graphic/Style} otherStyle\n * @param {boolean} overwrite true: overwrirte any way.\n * false: overwrite only when !target.hasOwnProperty\n * others: overwrite when property is not null/undefined.\n */\n extendFrom: function (otherStyle, overwrite) {\n if (otherStyle) {\n for (var name in otherStyle) {\n if (otherStyle.hasOwnProperty(name) && (overwrite === true || (overwrite === false ? !this.hasOwnProperty(name) : otherStyle[name] != null))) {\n this[name] = otherStyle[name];\n }\n }\n }\n },\n\n /**\n * Batch setting style with a given object\n * @param {Object|string} obj\n * @param {*} [obj]\n */\n set: function (obj, value) {\n if (typeof obj === 'string') {\n this[obj] = value;\n } else {\n this.extendFrom(obj, true);\n }\n },\n\n /**\n * Clone\n * @return {zrender/graphic/Style} [description]\n */\n clone: function () {\n var newStyle = new this.constructor();\n newStyle.extendFrom(this, true);\n return newStyle;\n },\n getGradient: function (ctx, obj, rect) {\n var method = obj.type === 'radial' ? createRadialGradient : createLinearGradient;\n var canvasGradient = method(ctx, obj, rect);\n var colorStops = obj.colorStops;\n\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n\n return canvasGradient;\n }\n};\nvar styleProto = Style.prototype;\n\nfor (var i = 0; i < STYLE_COMMON_PROPS.length; i++) {\n var prop = STYLE_COMMON_PROPS[i];\n\n if (!(prop[0] in styleProto)) {\n styleProto[prop[0]] = prop[1];\n }\n} // Provide for others\n\n\nStyle.getGradient = styleProto.getGradient;\nvar _default = Style;\nmodule.exports = _default;","var Pattern = function (image, repeat) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {image: ...}`, where this constructor will not be called.\n this.image = image;\n this.repeat = repeat; // Can be cloned\n\n this.type = 'pattern';\n};\n\nPattern.prototype.getCanvasPattern = function (ctx) {\n return ctx.createPattern(this.image, this.repeat || 'repeat');\n};\n\nvar _default = Pattern;\nmodule.exports = _default;","var util = require(\"./core/util\");\n\nvar _config = require(\"./config\");\n\nvar devicePixelRatio = _config.devicePixelRatio;\n\nvar Style = require(\"./graphic/Style\");\n\nvar Pattern = require(\"./graphic/Pattern\");\n\n/**\n * @module zrender/Layer\n * @author pissang(https://www.github.com/pissang)\n */\nfunction returnFalse() {\n return false;\n}\n/**\n * 创建dom\n *\n * @inner\n * @param {string} id dom id 待用\n * @param {Painter} painter painter instance\n * @param {number} number\n */\n\n\nfunction createDom(id, painter, dpr) {\n var newDom = util.createCanvas();\n var width = painter.getWidth();\n var height = painter.getHeight();\n var newDomStyle = newDom.style;\n\n if (newDomStyle) {\n // In node or some other non-browser environment\n newDomStyle.position = 'absolute';\n newDomStyle.left = 0;\n newDomStyle.top = 0;\n newDomStyle.width = width + 'px';\n newDomStyle.height = height + 'px';\n newDom.setAttribute('data-zr-dom-id', id);\n }\n\n newDom.width = width * dpr;\n newDom.height = height * dpr;\n return newDom;\n}\n/**\n * @alias module:zrender/Layer\n * @constructor\n * @extends module:zrender/mixin/Transformable\n * @param {string} id\n * @param {module:zrender/Painter} painter\n * @param {number} [dpr]\n */\n\n\nvar Layer = function (id, painter, dpr) {\n var dom;\n dpr = dpr || devicePixelRatio;\n\n if (typeof id === 'string') {\n dom = createDom(id, painter, dpr);\n } // Not using isDom because in node it will return false\n else if (util.isObject(id)) {\n dom = id;\n id = dom.id;\n }\n\n this.id = id;\n this.dom = dom;\n var domStyle = dom.style;\n\n if (domStyle) {\n // Not in node\n dom.onselectstart = returnFalse; // 避免页面选中的尴尬\n\n domStyle['-webkit-user-select'] = 'none';\n domStyle['user-select'] = 'none';\n domStyle['-webkit-touch-callout'] = 'none';\n domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)';\n domStyle['padding'] = 0; // eslint-disable-line dot-notation\n\n domStyle['margin'] = 0; // eslint-disable-line dot-notation\n\n domStyle['border-width'] = 0;\n }\n\n this.domBack = null;\n this.ctxBack = null;\n this.painter = painter;\n this.config = null; // Configs\n\n /**\n * 每次清空画布的颜色\n * @type {string}\n * @default 0\n */\n\n this.clearColor = 0;\n /**\n * 是否开启动态模糊\n * @type {boolean}\n * @default false\n */\n\n this.motionBlur = false;\n /**\n * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显\n * @type {number}\n * @default 0.7\n */\n\n this.lastFrameAlpha = 0.7;\n /**\n * Layer dpr\n * @type {number}\n */\n\n this.dpr = dpr;\n};\n\nLayer.prototype = {\n constructor: Layer,\n __dirty: true,\n __used: false,\n __drawIndex: 0,\n __startIndex: 0,\n __endIndex: 0,\n incremental: false,\n getElementCount: function () {\n return this.__endIndex - this.__startIndex;\n },\n initContext: function () {\n this.ctx = this.dom.getContext('2d');\n this.ctx.dpr = this.dpr;\n },\n createBackBuffer: function () {\n var dpr = this.dpr;\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\n this.ctxBack = this.domBack.getContext('2d');\n\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n },\n\n /**\n * @param {number} width\n * @param {number} height\n */\n resize: function (width, height) {\n var dpr = this.dpr;\n var dom = this.dom;\n var domStyle = dom.style;\n var domBack = this.domBack;\n\n if (domStyle) {\n domStyle.width = width + 'px';\n domStyle.height = height + 'px';\n }\n\n dom.width = width * dpr;\n dom.height = height * dpr;\n\n if (domBack) {\n domBack.width = width * dpr;\n domBack.height = height * dpr;\n\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n },\n\n /**\n * 清空该层画布\n * @param {boolean} [clearAll]=false Clear all with out motion blur\n * @param {Color} [clearColor]\n */\n clear: function (clearAll, clearColor) {\n var dom = this.dom;\n var ctx = this.ctx;\n var width = dom.width;\n var height = dom.height;\n var clearColor = clearColor || this.clearColor;\n var haveMotionBLur = this.motionBlur && !clearAll;\n var lastFrameAlpha = this.lastFrameAlpha;\n var dpr = this.dpr;\n\n if (haveMotionBLur) {\n if (!this.domBack) {\n this.createBackBuffer();\n }\n\n this.ctxBack.globalCompositeOperation = 'copy';\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\n }\n\n ctx.clearRect(0, 0, width, height);\n\n if (clearColor && clearColor !== 'transparent') {\n var clearColorGradientOrPattern; // Gradient\n\n if (clearColor.colorStops) {\n // Cache canvas gradient\n clearColorGradientOrPattern = clearColor.__canvasGradient || Style.getGradient(ctx, clearColor, {\n x: 0,\n y: 0,\n width: width,\n height: height\n });\n clearColor.__canvasGradient = clearColorGradientOrPattern;\n } // Pattern\n else if (clearColor.image) {\n clearColorGradientOrPattern = Pattern.prototype.getCanvasPattern.call(clearColor, ctx);\n }\n\n ctx.save();\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\n ctx.fillRect(0, 0, width, height);\n ctx.restore();\n }\n\n if (haveMotionBLur) {\n var domBack = this.domBack;\n ctx.save();\n ctx.globalAlpha = lastFrameAlpha;\n ctx.drawImage(domBack, 0, 0, width, height);\n ctx.restore();\n }\n }\n};\nvar _default = Layer;\nmodule.exports = _default;","var _default = typeof window !== 'undefined' && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || // https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809\nwindow.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (func) {\n setTimeout(func, 16);\n};\n\nmodule.exports = _default;","var LRU = require(\"../../core/LRU\");\n\nvar globalImageCache = new LRU(50);\n/**\n * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc\n * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image\n */\n\nfunction findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n } else {\n return newImageOrSrc;\n }\n}\n/**\n * Caution: User should cache loaded images, but not just count on LRU.\n * Consider if required images more than LRU size, will dead loop occur?\n *\n * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc\n * @param {HTMLImageElement|HTMLCanvasElement|Canvas} image Existent image.\n * @param {module:zrender/Element} [hostEl] For calling `dirty`.\n * @param {Function} [cb] params: (image, cbPayload)\n * @param {Object} [cbPayload] Payload on cb calling.\n * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image\n */\n\n\nfunction createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n } else if (typeof newImageOrSrc === 'string') {\n // Image should not be loaded repeatly.\n if (image && image.__zrImageSrc === newImageOrSrc || !hostEl) {\n return image;\n } // Only when there is no existent image or existent image src\n // is different, this method is responsible for load.\n\n\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = {\n hostEl: hostEl,\n cb: cb,\n cbPayload: cbPayload\n };\n\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n } else {\n image = new Image();\n image.onload = image.onerror = imageOnLoad;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n image.src = image.__zrImageSrc = newImageOrSrc;\n }\n\n return image;\n } // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas\n else {\n return newImageOrSrc;\n }\n}\n\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\n\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\n var pendingWrap = cachedImgObj.pending[i];\n var cb = pendingWrap.cb;\n cb && cb(this, pendingWrap.cbPayload);\n pendingWrap.hostEl.dirty();\n }\n\n cachedImgObj.pending.length = 0;\n}\n\nfunction isImageReady(image) {\n return image && image.width && image.height;\n}\n\nexports.findExistImage = findExistImage;\nexports.createOrUpdateImage = createOrUpdateImage;\nexports.isImageReady = isImageReady;","var BoundingRect = require(\"../core/BoundingRect\");\n\nvar imageHelper = require(\"../graphic/helper/image\");\n\nvar _util = require(\"../core/util\");\n\nvar getContext = _util.getContext;\nvar extend = _util.extend;\nvar retrieve2 = _util.retrieve2;\nvar retrieve3 = _util.retrieve3;\nvar trim = _util.trim;\nvar textWidthCache = {};\nvar textWidthCacheCounter = 0;\nvar TEXT_CACHE_MAX = 5000;\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nvar DEFAULT_FONT = '12px sans-serif'; // Avoid assign to an exported variable, for transforming to cjs.\n\nvar methods = {};\n\nfunction $override(name, fn) {\n methods[name] = fn;\n}\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @return {number} width\n */\n\n\nfunction getWidth(text, font) {\n font = font || DEFAULT_FONT;\n var key = text + ':' + font;\n\n if (textWidthCache[key]) {\n return textWidthCache[key];\n }\n\n var textLines = (text + '').split('\\n');\n var width = 0;\n\n for (var i = 0, l = textLines.length; i < l; i++) {\n // textContain.measureText may be overrided in SVG or VML\n width = Math.max(measureText(textLines[i], font).width, width);\n }\n\n if (textWidthCacheCounter > TEXT_CACHE_MAX) {\n textWidthCacheCounter = 0;\n textWidthCache = {};\n }\n\n textWidthCacheCounter++;\n textWidthCache[key] = width;\n return width;\n}\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @param {string} [textAlign='left']\n * @param {string} [textVerticalAlign='top']\n * @param {Array.} [textPadding]\n * @param {Object} [rich]\n * @param {Object} [truncate]\n * @return {Object} {x, y, width, height, lineHeight}\n */\n\n\nfunction getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) {\n return rich ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate);\n}\n\nfunction getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate) {\n var contentBlock = parsePlainText(text, font, textPadding, textLineHeight, truncate);\n var outerWidth = getWidth(text, font);\n\n if (textPadding) {\n outerWidth += textPadding[1] + textPadding[3];\n }\n\n var outerHeight = contentBlock.outerHeight;\n var x = adjustTextX(0, outerWidth, textAlign);\n var y = adjustTextY(0, outerHeight, textVerticalAlign);\n var rect = new BoundingRect(x, y, outerWidth, outerHeight);\n rect.lineHeight = contentBlock.lineHeight;\n return rect;\n}\n\nfunction getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) {\n var contentBlock = parseRichText(text, {\n rich: rich,\n truncate: truncate,\n font: font,\n textAlign: textAlign,\n textPadding: textPadding,\n textLineHeight: textLineHeight\n });\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var x = adjustTextX(0, outerWidth, textAlign);\n var y = adjustTextY(0, outerHeight, textVerticalAlign);\n return new BoundingRect(x, y, outerWidth, outerHeight);\n}\n/**\n * @public\n * @param {number} x\n * @param {number} width\n * @param {string} [textAlign='left']\n * @return {number} Adjusted x.\n */\n\n\nfunction adjustTextX(x, width, textAlign) {\n // FIXME Right to left language\n if (textAlign === 'right') {\n x -= width;\n } else if (textAlign === 'center') {\n x -= width / 2;\n }\n\n return x;\n}\n/**\n * @public\n * @param {number} y\n * @param {number} height\n * @param {string} [textVerticalAlign='top']\n * @return {number} Adjusted y.\n */\n\n\nfunction adjustTextY(y, height, textVerticalAlign) {\n if (textVerticalAlign === 'middle') {\n y -= height / 2;\n } else if (textVerticalAlign === 'bottom') {\n y -= height;\n }\n\n return y;\n}\n/**\n * Follow same interface to `Displayable.prototype.calculateTextPosition`.\n * @public\n * @param {Obejct} [out] Prepared out object. If not input, auto created in the method.\n * @param {module:zrender/graphic/Style} style where `textPosition` and `textDistance` are visited.\n * @param {Object} rect {x, y, width, height} Rect of the host elment, according to which the text positioned.\n * @return {Object} The input `out`. Set: {x, y, textAlign, textVerticalAlign}\n */\n\n\nfunction calculateTextPosition(out, style, rect) {\n var textPosition = style.textPosition;\n var distance = style.textDistance;\n var x = rect.x;\n var y = rect.y;\n distance = distance || 0;\n var height = rect.height;\n var width = rect.width;\n var halfHeight = height / 2;\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n\n out = out || {};\n out.x = x;\n out.y = y;\n out.textAlign = textAlign;\n out.textVerticalAlign = textVerticalAlign;\n return out;\n}\n/**\n * To be removed. But still do not remove in case that some one has imported it.\n * @deprecated\n * @public\n * @param {stirng} textPosition\n * @param {Object} rect {x, y, width, height}\n * @param {number} distance\n * @return {Object} {x, y, textAlign, textVerticalAlign}\n */\n\n\nfunction adjustTextPositionOnRect(textPosition, rect, distance) {\n var dummyStyle = {\n textPosition: textPosition,\n textDistance: distance\n };\n return calculateTextPosition({}, dummyStyle, rect);\n}\n/**\n * Show ellipsis if overflow.\n *\n * @public\n * @param {string} text\n * @param {string} containerWidth\n * @param {string} font\n * @param {number} [ellipsis='...']\n * @param {Object} [options]\n * @param {number} [options.maxIterations=3]\n * @param {number} [options.minChar=0] If truncate result are less\n * then minChar, ellipsis will not show, which is\n * better for user hint in some cases.\n * @param {number} [options.placeholder=''] When all truncated, use the placeholder.\n * @return {string}\n */\n\n\nfunction truncateText(text, containerWidth, font, ellipsis, options) {\n if (!containerWidth) {\n return '';\n }\n\n var textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options); // FIXME\n // It is not appropriate that every line has '...' when truncate multiple lines.\n\n for (var i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options);\n }\n\n return textLines.join('\\n');\n}\n\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n options = extend({}, options);\n options.font = font;\n var ellipsis = retrieve2(ellipsis, '...');\n options.maxIterations = retrieve2(options.maxIterations, 2);\n var minChar = options.minChar = retrieve2(options.minChar, 0); // FIXME\n // Other languages?\n\n options.cnCharWidth = getWidth('国', font); // FIXME\n // Consider proportional font?\n\n var ascCharWidth = options.ascCharWidth = getWidth('a', font);\n options.placeholder = retrieve2(options.placeholder, ''); // Example 1: minChar: 3, text: 'asdfzxcv', truncate result: 'asdf', but not: 'a...'.\n // Example 2: minChar: 3, text: '维度', truncate result: '维', but not: '...'.\n\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1); // Reserve some gap.\n\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n\n var ellipsisWidth = getWidth(ellipsis, font);\n\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n\n contentWidth = containerWidth - ellipsisWidth;\n options.ellipsis = ellipsis;\n options.ellipsisWidth = ellipsisWidth;\n options.contentWidth = contentWidth;\n options.containerWidth = containerWidth;\n return options;\n}\n\nfunction truncateSingleLine(textLine, options) {\n var containerWidth = options.containerWidth;\n var font = options.font;\n var contentWidth = options.contentWidth;\n\n if (!containerWidth) {\n return '';\n }\n\n var lineWidth = getWidth(textLine, font);\n\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n\n for (var j = 0;; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n\n var subLength = j === 0 ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0;\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n\n if (textLine === '') {\n textLine = options.placeholder;\n }\n\n return textLine;\n}\n\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\n var width = 0;\n var i = 0;\n\n for (var len = text.length; i < len && width < contentWidth; i++) {\n var charCode = text.charCodeAt(i);\n width += 0 <= charCode && charCode <= 127 ? ascCharWidth : cnCharWidth;\n }\n\n return i;\n}\n/**\n * @public\n * @param {string} font\n * @return {number} line height\n */\n\n\nfunction getLineHeight(font) {\n // FIXME A rough approach.\n return getWidth('国', font);\n}\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @return {Object} width\n */\n\n\nfunction measureText(text, font) {\n return methods.measureText(text, font);\n} // Avoid assign to an exported variable, for transforming to cjs.\n\n\nmethods.measureText = function (text, font) {\n var ctx = getContext();\n ctx.font = font || DEFAULT_FONT;\n return ctx.measureText(text);\n};\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @param {Object} [truncate]\n * @return {Object} block: {lineHeight, lines, height, outerHeight, canCacheByTextString}\n * Notice: for performance, do not calculate outerWidth util needed.\n * `canCacheByTextString` means the result `lines` is only determined by the input `text`.\n * Thus we can simply comparing the `input` text to determin whether the result changed,\n * without travel the result `lines`.\n */\n\n\nfunction parsePlainText(text, font, padding, textLineHeight, truncate) {\n text != null && (text += '');\n var lineHeight = retrieve2(textLineHeight, getLineHeight(font));\n var lines = text ? text.split('\\n') : [];\n var height = lines.length * lineHeight;\n var outerHeight = height;\n var canCacheByTextString = true;\n\n if (padding) {\n outerHeight += padding[0] + padding[2];\n }\n\n if (text && truncate) {\n canCacheByTextString = false;\n var truncOuterHeight = truncate.outerHeight;\n var truncOuterWidth = truncate.outerWidth;\n\n if (truncOuterHeight != null && outerHeight > truncOuterHeight) {\n text = '';\n lines = [];\n } else if (truncOuterWidth != null) {\n var options = prepareTruncateOptions(truncOuterWidth - (padding ? padding[1] + padding[3] : 0), font, truncate.ellipsis, {\n minChar: truncate.minChar,\n placeholder: truncate.placeholder\n }); // FIXME\n // It is not appropriate that every line has '...' when truncate multiple lines.\n\n for (var i = 0, len = lines.length; i < len; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n }\n\n return {\n lines: lines,\n height: height,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n canCacheByTextString: canCacheByTextString\n };\n}\n/**\n * For example: 'some text {a|some text}other text{b|some text}xxx{c|}xxx'\n * Also consider 'bbbb{a|xxx\\nzzz}xxxx\\naaaa'.\n *\n * @public\n * @param {string} text\n * @param {Object} style\n * @return {Object} block\n * {\n * width,\n * height,\n * lines: [{\n * lineHeight,\n * width,\n * tokens: [[{\n * styleName,\n * text,\n * width, // include textPadding\n * height, // include textPadding\n * textWidth, // pure text width\n * textHeight, // pure text height\n * lineHeihgt,\n * font,\n * textAlign,\n * textVerticalAlign\n * }], [...], ...]\n * }, ...]\n * }\n * If styleName is undefined, it is plain text.\n */\n\n\nfunction parseRichText(text, style) {\n var contentBlock = {\n lines: [],\n width: 0,\n height: 0\n };\n text != null && (text += '');\n\n if (!text) {\n return contentBlock;\n }\n\n var lastIndex = STYLE_REG.lastIndex = 0;\n var result;\n\n while ((result = STYLE_REG.exec(text)) != null) {\n var matchedIndex = result.index;\n\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex));\n }\n\n pushTokens(contentBlock, result[2], result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length));\n }\n\n var lines = contentBlock.lines;\n var contentHeight = 0;\n var contentWidth = 0; // For `textWidth: 100%`\n\n var pendingList = [];\n var stlPadding = style.textPadding;\n var truncate = style.truncate;\n var truncateWidth = truncate && truncate.outerWidth;\n var truncateHeight = truncate && truncate.outerHeight;\n\n if (stlPadding) {\n truncateWidth != null && (truncateWidth -= stlPadding[1] + stlPadding[3]);\n truncateHeight != null && (truncateHeight -= stlPadding[0] + stlPadding[2]);\n } // Calculate layout info of tokens.\n\n\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n var lineHeight = 0;\n var lineWidth = 0;\n\n for (var j = 0; j < line.tokens.length; j++) {\n var token = line.tokens[j];\n var tokenStyle = token.styleName && style.rich[token.styleName] || {}; // textPadding should not inherit from style.\n\n var textPadding = token.textPadding = tokenStyle.textPadding; // textFont has been asigned to font by `normalizeStyle`.\n\n var font = token.font = tokenStyle.font || style.font; // textHeight can be used when textVerticalAlign is specified in token.\n\n var tokenHeight = token.textHeight = retrieve2( // textHeight should not be inherited, consider it can be specified\n // as box height of the block.\n tokenStyle.textHeight, getLineHeight(font));\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n token.lineHeight = retrieve3(tokenStyle.textLineHeight, style.textLineHeight, tokenHeight);\n token.textAlign = tokenStyle && tokenStyle.textAlign || style.textAlign;\n token.textVerticalAlign = tokenStyle && tokenStyle.textVerticalAlign || 'middle';\n\n if (truncateHeight != null && contentHeight + token.lineHeight > truncateHeight) {\n return {\n lines: [],\n width: 0,\n height: 0\n };\n }\n\n token.textWidth = getWidth(token.text, font);\n var tokenWidth = tokenStyle.textWidth;\n var tokenWidthNotSpecified = tokenWidth == null || tokenWidth === 'auto'; // Percent width, can be `100%`, can be used in drawing separate\n // line when box width is needed to be auto.\n\n if (typeof tokenWidth === 'string' && tokenWidth.charAt(tokenWidth.length - 1) === '%') {\n token.percentWidth = tokenWidth;\n pendingList.push(token);\n tokenWidth = 0; // Do not truncate in this case, because there is no user case\n // and it is too complicated.\n } else {\n if (tokenWidthNotSpecified) {\n tokenWidth = token.textWidth; // FIXME: If image is not loaded and textWidth is not specified, calling\n // `getBoundingRect()` will not get correct result.\n\n var textBackgroundColor = tokenStyle.textBackgroundColor;\n var bgImg = textBackgroundColor && textBackgroundColor.image; // Use cases:\n // (1) If image is not loaded, it will be loaded at render phase and call\n // `dirty()` and `textBackgroundColor.image` will be replaced with the loaded\n // image, and then the right size will be calculated here at the next tick.\n // See `graphic/helper/text.js`.\n // (2) If image loaded, and `textBackgroundColor.image` is image src string,\n // use `imageHelper.findExistImage` to find cached image.\n // `imageHelper.findExistImage` will always be called here before\n // `imageHelper.createOrUpdateImage` in `graphic/helper/text.js#renderRichText`\n // which ensures that image will not be rendered before correct size calcualted.\n\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n\n if (imageHelper.isImageReady(bgImg)) {\n tokenWidth = Math.max(tokenWidth, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n\n var paddingW = textPadding ? textPadding[1] + textPadding[3] : 0;\n tokenWidth += paddingW;\n var remianTruncWidth = truncateWidth != null ? truncateWidth - lineWidth : null;\n\n if (remianTruncWidth != null && remianTruncWidth < tokenWidth) {\n if (!tokenWidthNotSpecified || remianTruncWidth < paddingW) {\n token.text = '';\n token.textWidth = tokenWidth = 0;\n } else {\n token.text = truncateText(token.text, remianTruncWidth - paddingW, font, truncate.ellipsis, {\n minChar: truncate.minChar\n });\n token.textWidth = getWidth(token.text, font);\n tokenWidth = token.textWidth + paddingW;\n }\n }\n }\n\n lineWidth += token.width = tokenWidth;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n }\n\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n contentHeight += lineHeight;\n contentWidth = Math.max(contentWidth, lineWidth);\n }\n\n contentBlock.outerWidth = contentBlock.width = retrieve2(style.textWidth, contentWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(style.textHeight, contentHeight);\n\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n\n for (var i = 0; i < pendingList.length; i++) {\n var token = pendingList[i];\n var percentWidth = token.percentWidth; // Should not base on outerWidth, because token can not be placed out of padding.\n\n token.width = parseInt(percentWidth, 10) / 100 * contentWidth;\n }\n\n return contentBlock;\n}\n\nfunction pushTokens(block, str, styleName) {\n var isEmptyStr = str === '';\n var strs = str.split('\\n');\n var lines = block.lines;\n\n for (var i = 0; i < strs.length; i++) {\n var text = strs[i];\n var token = {\n styleName: styleName,\n text: text,\n isLineHolder: !text && !isEmptyStr\n }; // The first token should be appended to the last line.\n\n if (!i) {\n var tokens = (lines[lines.length - 1] || (lines[0] = {\n tokens: []\n })).tokens; // Consider cases:\n // (1) ''.split('\\n') => ['', '\\n', ''], the '' at the first item\n // (which is a placeholder) should be replaced by new token.\n // (2) A image backage, where token likes {a|}.\n // (3) A redundant '' will affect textAlign in line.\n // (4) tokens with the same tplName should not be merged, because\n // they should be displayed in different box (with border and padding).\n\n var tokensLen = tokens.length;\n tokensLen === 1 && tokens[0].isLineHolder ? tokens[0] = token : // Consider text is '', only insert when it is the \"lineHolder\" or\n // \"emptyStr\". Otherwise a redundant '' will affect textAlign in line.\n (text || !tokensLen || isEmptyStr) && tokens.push(token);\n } // Other tokens always start a new line.\n else {\n // If there is '', insert it as a placeholder.\n lines.push({\n tokens: [token]\n });\n }\n }\n}\n\nfunction makeFont(style) {\n // FIXME in node-canvas fontWeight is before fontStyle\n // Use `fontSize` `fontFamily` to check whether font properties are defined.\n var font = (style.fontSize || style.fontFamily) && [style.fontStyle, style.fontWeight, (style.fontSize || 12) + 'px', // If font properties are defined, `fontFamily` should not be ignored.\n style.fontFamily || 'sans-serif'].join(' ');\n return font && trim(font) || style.textFont || style.font;\n}\n\nexports.DEFAULT_FONT = DEFAULT_FONT;\nexports.$override = $override;\nexports.getWidth = getWidth;\nexports.getBoundingRect = getBoundingRect;\nexports.adjustTextX = adjustTextX;\nexports.adjustTextY = adjustTextY;\nexports.calculateTextPosition = calculateTextPosition;\nexports.adjustTextPositionOnRect = adjustTextPositionOnRect;\nexports.truncateText = truncateText;\nexports.getLineHeight = getLineHeight;\nexports.measureText = measureText;\nexports.parsePlainText = parsePlainText;\nexports.parseRichText = parseRichText;\nexports.makeFont = makeFont;","/**\n * @param {Object} ctx\n * @param {Object} shape\n * @param {number} shape.x\n * @param {number} shape.y\n * @param {number} shape.width\n * @param {number} shape.height\n * @param {number} shape.r\n */\nfunction buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4; // Convert width and height to positive for better borderRadius\n\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n } else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n } else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n } else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n } else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n } else {\n r1 = r2 = r3 = r4 = 0;\n }\n\n var total;\n\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n\nexports.buildPath = buildPath;","var _util = require(\"../../core/util\");\n\nvar retrieve2 = _util.retrieve2;\nvar retrieve3 = _util.retrieve3;\nvar each = _util.each;\nvar normalizeCssArray = _util.normalizeCssArray;\nvar isString = _util.isString;\nvar isObject = _util.isObject;\n\nvar textContain = require(\"../../contain/text\");\n\nvar roundRectHelper = require(\"./roundRect\");\n\nvar imageHelper = require(\"./image\");\n\nvar fixShadow = require(\"./fixShadow\");\n\nvar _constant = require(\"../constant\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\nvar DEFAULT_FONT = textContain.DEFAULT_FONT; // TODO: Have not support 'start', 'end' yet.\n\nvar VALID_TEXT_ALIGN = {\n left: 1,\n right: 1,\n center: 1\n};\nvar VALID_TEXT_VERTICAL_ALIGN = {\n top: 1,\n bottom: 1,\n middle: 1\n}; // Different from `STYLE_COMMON_PROPS` of `graphic/Style`,\n// the default value of shadowColor is `'transparent'`.\n\nvar SHADOW_STYLE_COMMON_PROPS = [['textShadowBlur', 'shadowBlur', 0], ['textShadowOffsetX', 'shadowOffsetX', 0], ['textShadowOffsetY', 'shadowOffsetY', 0], ['textShadowColor', 'shadowColor', 'transparent']];\nvar _tmpTextPositionResult = {};\nvar _tmpBoxPositionResult = {};\n/**\n * @param {module:zrender/graphic/Style} style\n * @return {module:zrender/graphic/Style} The input style.\n */\n\nfunction normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\n\nfunction normalizeStyle(style) {\n if (style) {\n style.font = textContain.makeFont(style);\n var textAlign = style.textAlign;\n textAlign === 'middle' && (textAlign = 'center');\n style.textAlign = textAlign == null || VALID_TEXT_ALIGN[textAlign] ? textAlign : 'left'; // Compatible with textBaseline.\n\n var textVerticalAlign = style.textVerticalAlign || style.textBaseline;\n textVerticalAlign === 'center' && (textVerticalAlign = 'middle');\n style.textVerticalAlign = textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign] ? textVerticalAlign : 'top';\n var textPadding = style.textPadding;\n\n if (textPadding) {\n style.textPadding = normalizeCssArray(style.textPadding);\n }\n }\n}\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {string} text\n * @param {module:zrender/graphic/Style} style\n * @param {Object|boolean} [rect] {x, y, width, height}\n * If set false, rect text is not used.\n * @param {Element|module:zrender/graphic/helper/constant.WILL_BE_RESTORED} [prevEl] For ctx prop cache.\n */\n\n\nfunction renderText(hostEl, ctx, text, style, rect, prevEl) {\n style.rich ? renderRichText(hostEl, ctx, text, style, rect, prevEl) : renderPlainText(hostEl, ctx, text, style, rect, prevEl);\n} // Avoid setting to ctx according to prevEl if possible for\n// performance in scenarios of large amount text.\n\n\nfunction renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}\n\nfunction renderRichText(hostEl, ctx, text, style, rect, prevEl) {\n // Do not do cache for rich text because of the complexity.\n // But `RectText` this will be restored, do not need to clear other cache like `Style::bind`.\n if (prevEl !== WILL_BE_RESTORED) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parseRichText(text, style);\n }\n\n drawRichText(hostEl, ctx, contentBlock, style, rect);\n}\n\nfunction drawRichText(hostEl, ctx, contentBlock, style, rect) {\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.textPadding;\n var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign;\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n\n var xRight = xLeft + contentWidth;\n needDrawBackground(style) && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var tokens = line.tokens;\n var tokenCount = tokens.length;\n var lineHeight = line.lineHeight;\n var usedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token;\n\n while (leftIndex < tokenCount && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left')) {\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left');\n usedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n\n while (rightIndex >= 0 && (token = tokens[rightIndex], token.textAlign === 'right')) {\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right');\n usedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n } // The other tokens are placed as textAlign 'center' if there is enough space.\n\n\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2;\n\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex]; // Consider width specified by user, use 'center' rather than 'left'.\n\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center');\n lineXLeft += token.width;\n leftIndex++;\n }\n\n lineTop += lineHeight;\n }\n}\n\nfunction applyTextRotation(ctx, style, rect, x, y) {\n // textRotation only apply in RectText.\n if (rect && style.textRotation) {\n var origin = style.textOrigin;\n\n if (origin === 'center') {\n x = rect.width / 2 + rect.x;\n y = rect.height / 2 + rect.y;\n } else if (origin) {\n x = origin[0] + rect.x;\n y = origin[1] + rect.y;\n }\n\n ctx.translate(x, y); // Positive: anticlockwise\n\n ctx.rotate(-style.textRotation);\n ctx.translate(-x, -y);\n }\n}\n\nfunction placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text; // 'ctx.textBaseline' is always set as 'middle', for sake of\n // the bias of \"Microsoft YaHei\".\n\n var textVerticalAlign = token.textVerticalAlign;\n var y = lineTop + lineHeight / 2;\n\n if (textVerticalAlign === 'top') {\n y = lineTop + token.height / 2;\n } else if (textVerticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n\n !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground(hostEl, ctx, tokenStyle, textAlign === 'right' ? x - token.width : textAlign === 'center' ? x - token.width / 2 : x, y - token.height / 2, token.width, token.height);\n var textPadding = token.textPadding;\n\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[2] - token.textHeight / 2;\n }\n\n setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0));\n setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent');\n setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0));\n setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0));\n setCtx(ctx, 'textAlign', textAlign); // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n setCtx(ctx, 'textBaseline', 'middle');\n setCtx(ctx, 'font', token.font || DEFAULT_FONT);\n var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth);\n var textFill = getFill(tokenStyle.textFill || style.textFill);\n var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth); // Fill after stroke so the outline will not cover the main part.\n\n if (textStroke) {\n setCtx(ctx, 'lineWidth', textStrokeWidth);\n setCtx(ctx, 'strokeStyle', textStroke);\n ctx.strokeText(token.text, x, y);\n }\n\n if (textFill) {\n setCtx(ctx, 'fillStyle', textFill);\n ctx.fillText(token.text, x, y);\n }\n}\n\nfunction needDrawBackground(style) {\n return !!(style.textBackgroundColor || style.textBorderWidth && style.textBorderColor);\n} // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius, text}\n// shape: {x, y, width, height}\n\n\nfunction drawBackground(hostEl, ctx, style, x, y, width, height) {\n var textBackgroundColor = style.textBackgroundColor;\n var textBorderWidth = style.textBorderWidth;\n var textBorderColor = style.textBorderColor;\n var isPlainBg = isString(textBackgroundColor);\n setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0);\n setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent');\n setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0);\n setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0);\n\n if (isPlainBg || textBorderWidth && textBorderColor) {\n ctx.beginPath();\n var textBorderRadius = style.textBorderRadius;\n\n if (!textBorderRadius) {\n ctx.rect(x, y, width, height);\n } else {\n roundRectHelper.buildPath(ctx, {\n x: x,\n y: y,\n width: width,\n height: height,\n r: textBorderRadius\n });\n }\n\n ctx.closePath();\n }\n\n if (isPlainBg) {\n setCtx(ctx, 'fillStyle', textBackgroundColor);\n\n if (style.fillOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n ctx.fill();\n }\n } else if (isObject(textBackgroundColor)) {\n var image = textBackgroundColor.image;\n image = imageHelper.createOrUpdateImage(image, null, hostEl, onBgImageLoaded, textBackgroundColor);\n\n if (image && imageHelper.isImageReady(image)) {\n ctx.drawImage(image, x, y, width, height);\n }\n }\n\n if (textBorderWidth && textBorderColor) {\n setCtx(ctx, 'lineWidth', textBorderWidth);\n setCtx(ctx, 'strokeStyle', textBorderColor);\n\n if (style.strokeOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n ctx.stroke();\n }\n }\n}\n\nfunction onBgImageLoaded(image, textBackgroundColor) {\n // Replace image, so that `contain/text.js#parseRichText`\n // will get correct result in next tick.\n textBackgroundColor.image = image;\n}\n\nfunction getBoxPosition(out, hostEl, style, rect) {\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.textAlign;\n var textVerticalAlign = style.textVerticalAlign; // Text position represented by coord\n\n if (rect) {\n var textPosition = style.textPosition;\n\n if (textPosition instanceof Array) {\n // Percent\n baseX = rect.x + parsePercent(textPosition[0], rect.width);\n baseY = rect.y + parsePercent(textPosition[1], rect.height);\n } else {\n var res = hostEl && hostEl.calculateTextPosition ? hostEl.calculateTextPosition(_tmpTextPositionResult, style, rect) : textContain.calculateTextPosition(_tmpTextPositionResult, style, rect);\n baseX = res.x;\n baseY = res.y; // Default align and baseline when has textPosition\n\n textAlign = textAlign || res.textAlign;\n textVerticalAlign = textVerticalAlign || res.textVerticalAlign;\n } // textOffset is only support in RectText, otherwise\n // we have to adjust boundingRect for textOffset.\n\n\n var textOffset = style.textOffset;\n\n if (textOffset) {\n baseX += textOffset[0];\n baseY += textOffset[1];\n }\n }\n\n out = out || {};\n out.baseX = baseX;\n out.baseY = baseY;\n out.textAlign = textAlign;\n out.textVerticalAlign = textVerticalAlign;\n return out;\n}\n\nfunction setCtx(ctx, prop, value) {\n ctx[prop] = fixShadow(ctx, prop, value);\n return ctx[prop];\n}\n/**\n * @param {string} [stroke] If specified, do not check style.textStroke.\n * @param {string} [lineWidth] If specified, do not check style.textStroke.\n * @param {number} style\n */\n\n\nfunction getStroke(stroke, lineWidth) {\n return stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none' ? null // TODO pattern and gradient?\n : stroke.image || stroke.colorStops ? '#000' : stroke;\n}\n\nfunction getFill(fill) {\n return fill == null || fill === 'none' ? null // TODO pattern and gradient?\n : fill.image || fill.colorStops ? '#000' : fill;\n}\n\nfunction parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n\n return parseFloat(value);\n }\n\n return value;\n}\n\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right' ? x - textPadding[1] : textAlign === 'center' ? x + textPadding[3] / 2 - textPadding[1] / 2 : x + textPadding[3];\n}\n/**\n * @param {string} text\n * @param {module:zrender/Style} style\n * @return {boolean}\n */\n\n\nfunction needDrawText(text, style) {\n return text != null && (text || style.textBackgroundColor || style.textBorderWidth && style.textBorderColor || style.textPadding);\n}\n\nexports.normalizeTextStyle = normalizeTextStyle;\nexports.renderText = renderText;\nexports.getBoxPosition = getBoxPosition;\nexports.getStroke = getStroke;\nexports.getFill = getFill;\nexports.parsePercent = parsePercent;\nexports.needDrawText = needDrawText;","var textHelper = require(\"../helper/text\");\n\nvar BoundingRect = require(\"../../core/BoundingRect\");\n\nvar _constant = require(\"../constant\");\n\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\n\n/**\n * Mixin for drawing text in a element bounding rect\n * @module zrender/mixin/RectText\n */\nvar tmpRect = new BoundingRect();\n\nvar RectText = function () {};\n\nRectText.prototype = {\n constructor: RectText,\n\n /**\n * Draw text in a rect with specified position.\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} rect Displayable rect\n */\n drawRectText: function (ctx, rect) {\n var style = this.style;\n rect = style.textRect || rect; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n var text = style.text; // Convert to string\n\n text != null && (text += '');\n\n if (!textHelper.needDrawText(text, style)) {\n return;\n } // FIXME\n // Do not provide prevEl to `textHelper.renderText` for ctx prop cache,\n // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect\n // text propably break the cache for its host elements.\n\n\n ctx.save(); // Transform rect to view space\n\n var transform = this.transform;\n\n if (!style.transformText) {\n if (transform) {\n tmpRect.copy(rect);\n tmpRect.applyTransform(transform);\n rect = tmpRect;\n }\n } else {\n this.setTransform(ctx);\n } // transformText and textRotation can not be used at the same time.\n\n\n textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED);\n ctx.restore();\n }\n};\nvar _default = RectText;\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Style = require(\"./Style\");\n\nvar Element = require(\"../Element\");\n\nvar RectText = require(\"./mixin/RectText\");\n\n/**\n * Base class of all displayable graphic objects\n * @module zrender/graphic/Displayable\n */\n\n/**\n * @alias module:zrender/graphic/Displayable\n * @extends module:zrender/Element\n * @extends module:zrender/graphic/mixin/RectText\n */\nfunction Displayable(opts) {\n opts = opts || {};\n Element.call(this, opts); // Extend properties\n\n for (var name in opts) {\n if (opts.hasOwnProperty(name) && name !== 'style') {\n this[name] = opts[name];\n }\n }\n /**\n * @type {module:zrender/graphic/Style}\n */\n\n\n this.style = new Style(opts.style, this);\n this._rect = null; // Shapes for cascade clipping.\n // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array.\n // because it is easy to only using null to check whether clipPaths changed.\n\n this.__clipPaths = null; // FIXME Stateful must be mixined after style is setted\n // Stateful.call(this, opts);\n}\n\nDisplayable.prototype = {\n constructor: Displayable,\n type: 'displayable',\n\n /**\n * Dirty flag. From which painter will determine if this displayable object needs brush.\n * @name module:zrender/graphic/Displayable#__dirty\n * @type {boolean}\n */\n __dirty: true,\n\n /**\n * Whether the displayable object is visible. when it is true, the displayable object\n * is not drawn, but the mouse event can still trigger the object.\n * @name module:/zrender/graphic/Displayable#invisible\n * @type {boolean}\n * @default false\n */\n invisible: false,\n\n /**\n * @name module:/zrender/graphic/Displayable#z\n * @type {number}\n * @default 0\n */\n z: 0,\n\n /**\n * @name module:/zrender/graphic/Displayable#z\n * @type {number}\n * @default 0\n */\n z2: 0,\n\n /**\n * The z level determines the displayable object can be drawn in which layer canvas.\n * @name module:/zrender/graphic/Displayable#zlevel\n * @type {number}\n * @default 0\n */\n zlevel: 0,\n\n /**\n * Whether it can be dragged.\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n draggable: false,\n\n /**\n * Whether is it dragging.\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n dragging: false,\n\n /**\n * Whether to respond to mouse events.\n * @name module:/zrender/graphic/Displayable#silent\n * @type {boolean}\n * @default false\n */\n silent: false,\n\n /**\n * If enable culling\n * @type {boolean}\n * @default false\n */\n culling: false,\n\n /**\n * Mouse cursor when hovered\n * @name module:/zrender/graphic/Displayable#cursor\n * @type {string}\n */\n cursor: 'pointer',\n\n /**\n * If hover area is bounding rect\n * @name module:/zrender/graphic/Displayable#rectHover\n * @type {string}\n */\n rectHover: false,\n\n /**\n * Render the element progressively when the value >= 0,\n * usefull for large data.\n * @type {boolean}\n */\n progressive: false,\n\n /**\n * @type {boolean}\n */\n incremental: false,\n\n /**\n * Scale ratio for global scale.\n * @type {boolean}\n */\n globalScaleRatio: 1,\n beforeBrush: function (ctx) {},\n afterBrush: function (ctx) {},\n\n /**\n * Graphic drawing method.\n * @param {CanvasRenderingContext2D} ctx\n */\n // Interface\n brush: function (ctx, prevEl) {},\n\n /**\n * Get the minimum bounding box.\n * @return {module:zrender/core/BoundingRect}\n */\n // Interface\n getBoundingRect: function () {},\n\n /**\n * If displayable element contain coord x, y\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\n contain: function (x, y) {\n return this.rectContain(x, y);\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {\n cb.call(context, this);\n },\n\n /**\n * If bounding rect of element contain coord x, y\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\n rectContain: function (x, y) {\n var coord = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n return rect.contain(coord[0], coord[1]);\n },\n\n /**\n * Mark displayable element dirty and refresh next frame\n */\n dirty: function () {\n this.__dirty = this.__dirtyText = true;\n this._rect = null;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * If displayable object binded any event\n * @return {boolean}\n */\n // TODO, events bound by bind\n // isSilent: function () {\n // return !(\n // this.hoverable || this.draggable\n // || this.onmousemove || this.onmouseover || this.onmouseout\n // || this.onmousedown || this.onmouseup || this.onclick\n // || this.ondragenter || this.ondragover || this.ondragleave\n // || this.ondrop\n // );\n // },\n\n /**\n * Alias for animate('style')\n * @param {boolean} loop\n */\n animateStyle: function (loop) {\n return this.animate('style', loop);\n },\n attrKV: function (key, value) {\n if (key !== 'style') {\n Element.prototype.attrKV.call(this, key, value);\n } else {\n this.style.set(value);\n }\n },\n\n /**\n * @param {Object|string} key\n * @param {*} value\n */\n setStyle: function (key, value) {\n this.style.set(key, value);\n this.dirty(false);\n return this;\n },\n\n /**\n * Use given style object\n * @param {Object} obj\n */\n useStyle: function (obj) {\n this.style = new Style(obj, this);\n this.dirty(false);\n return this;\n },\n\n /**\n * The string value of `textPosition` needs to be calculated to a real postion.\n * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]`\n * by default. See `contain/text.js#calculateTextPosition` for more details.\n * But some coutom shapes like \"pin\", \"flag\" have center that is not exactly\n * `[width/2, height/2]`. So we provide this hook to customize the calculation\n * for those shapes. It will be called if the `style.textPosition` is a string.\n * @param {Obejct} [out] Prepared out object. If not provided, this method should\n * be responsible for creating one.\n * @param {module:zrender/graphic/Style} style\n * @param {Object} rect {x, y, width, height}\n * @return {Obejct} out The same as the input out.\n * {\n * x: number. mandatory.\n * y: number. mandatory.\n * textAlign: string. optional. use style.textAlign by default.\n * textVerticalAlign: string. optional. use style.textVerticalAlign by default.\n * }\n */\n calculateTextPosition: null\n};\nzrUtil.inherits(Displayable, Element);\nzrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);\n\nvar _default = Displayable;\nmodule.exports = _default;","var Displayable = require(\"./Displayable\");\n\nvar BoundingRect = require(\"../core/BoundingRect\");\n\nvar zrUtil = require(\"../core/util\");\n\nvar imageHelper = require(\"./helper/image\");\n\n/**\n * @alias zrender/graphic/Image\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\nfunction ZImage(opts) {\n Displayable.call(this, opts);\n}\n\nZImage.prototype = {\n constructor: ZImage,\n type: 'image',\n brush: function (ctx, prevEl) {\n var style = this.style;\n var src = style.image; // Must bind each time\n\n style.bind(ctx, this, prevEl);\n var image = this._image = imageHelper.createOrUpdateImage(src, this._image, this, this.onload);\n\n if (!image || !imageHelper.isImageReady(image)) {\n return;\n } // 图片已经加载完成\n // if (image.nodeName.toUpperCase() == 'IMG') {\n // if (!image.complete) {\n // return;\n // }\n // }\n // Else is canvas\n\n\n var x = style.x || 0;\n var y = style.y || 0;\n var width = style.width;\n var height = style.height;\n var aspect = image.width / image.height;\n\n if (width == null && height != null) {\n // Keep image/height ratio\n width = height * aspect;\n } else if (height == null && width != null) {\n height = width / aspect;\n } else if (width == null && height == null) {\n width = image.width;\n height = image.height;\n } // 设置transform\n\n\n this.setTransform(ctx);\n\n if (style.sWidth && style.sHeight) {\n var sx = style.sx || 0;\n var sy = style.sy || 0;\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\n } else if (style.sx && style.sy) {\n var sx = style.sx;\n var sy = style.sy;\n var sWidth = width - sx;\n var sHeight = height - sy;\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\n } else {\n ctx.drawImage(image, x, y, width, height);\n } // Draw rect text\n\n\n if (style.text != null) {\n // Only restore transform when needs draw text.\n this.restoreTransform(ctx);\n this.drawRectText(ctx, this.getBoundingRect());\n }\n },\n getBoundingRect: function () {\n var style = this.style;\n\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, style.width || 0, style.height || 0);\n }\n\n return this._rect;\n }\n};\nzrUtil.inherits(ZImage, Displayable);\nvar _default = ZImage;\nmodule.exports = _default;","var _config = require(\"./config\");\n\nvar devicePixelRatio = _config.devicePixelRatio;\n\nvar util = require(\"./core/util\");\n\nvar logError = require(\"./core/log\");\n\nvar BoundingRect = require(\"./core/BoundingRect\");\n\nvar timsort = require(\"./core/timsort\");\n\nvar Layer = require(\"./Layer\");\n\nvar requestAnimationFrame = require(\"./animation/requestAnimationFrame\");\n\nvar Image = require(\"./graphic/Image\");\n\nvar env = require(\"./core/env\");\n\nvar HOVER_LAYER_ZLEVEL = 1e5;\nvar CANVAS_ZLEVEL = 314159;\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\nvar INCREMENTAL_INC = 0.001;\n\nfunction parseInt10(val) {\n return parseInt(val, 10);\n}\n\nfunction isLayerValid(layer) {\n if (!layer) {\n return false;\n }\n\n if (layer.__builtin__) {\n return true;\n }\n\n if (typeof layer.resize !== 'function' || typeof layer.refresh !== 'function') {\n return false;\n }\n\n return true;\n}\n\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar viewRect = new BoundingRect(0, 0, 0, 0);\n\nfunction isDisplayableCulled(el, width, height) {\n tmpRect.copy(el.getBoundingRect());\n\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n\n viewRect.width = width;\n viewRect.height = height;\n return !tmpRect.intersect(viewRect);\n}\n\nfunction isClipPathChanged(clipPaths, prevClipPaths) {\n // displayable.__clipPaths can only be `null`/`undefined` or an non-empty array.\n if (clipPaths === prevClipPaths) {\n return false;\n }\n\n if (!clipPaths || !prevClipPaths || clipPaths.length !== prevClipPaths.length) {\n return true;\n }\n\n for (var i = 0; i < clipPaths.length; i++) {\n if (clipPaths[i] !== prevClipPaths[i]) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction doClip(clipPaths, ctx) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n clipPath.setTransform(ctx);\n ctx.beginPath();\n clipPath.buildPath(ctx, clipPath.shape);\n ctx.clip(); // Transform back\n\n clipPath.restoreTransform(ctx);\n }\n}\n\nfunction createRoot(width, height) {\n var domRoot = document.createElement('div'); // domRoot.onselectstart = returnFalse; // Avoid page selected\n\n domRoot.style.cssText = ['position:relative', // IOS13 safari probably has a compositing bug (z order of the canvas and the consequent\n // dom does not act as expected) when some of the parent dom has\n // `-webkit-overflow-scrolling: touch;` and the webpage is longer than one screen and\n // the canvas is not at the top part of the page.\n // Check `https://bugs.webkit.org/show_bug.cgi?id=203681` for more details. We remove\n // this `overflow:hidden` to avoid the bug.\n // 'overflow:hidden',\n 'width:' + width + 'px', 'height:' + height + 'px', 'padding:0', 'margin:0', 'border-width:0'].join(';') + ';';\n return domRoot;\n}\n/**\n * @alias module:zrender/Painter\n * @constructor\n * @param {HTMLElement} root 绘图容器\n * @param {module:zrender/Storage} storage\n * @param {Object} opts\n */\n\n\nvar Painter = function (root, storage, opts) {\n this.type = 'canvas'; // In node environment using node-canvas\n\n var singleCanvas = !root.nodeName // In node ?\n || root.nodeName.toUpperCase() === 'CANVAS';\n this._opts = opts = util.extend({}, opts || {});\n /**\n * @type {number}\n */\n\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\n /**\n * @type {boolean}\n * @private\n */\n\n this._singleCanvas = singleCanvas;\n /**\n * 绘图容器\n * @type {HTMLElement}\n */\n\n this.root = root;\n var rootStyle = root.style;\n\n if (rootStyle) {\n rootStyle['-webkit-tap-highlight-color'] = 'transparent';\n rootStyle['-webkit-user-select'] = rootStyle['user-select'] = rootStyle['-webkit-touch-callout'] = 'none';\n root.innerHTML = '';\n }\n /**\n * @type {module:zrender/Storage}\n */\n\n\n this.storage = storage;\n /**\n * @type {Array.}\n * @private\n */\n\n var zlevelList = this._zlevelList = [];\n /**\n * @type {Object.}\n * @private\n */\n\n var layers = this._layers = {};\n /**\n * @type {Object.}\n * @private\n */\n\n this._layerConfig = {};\n /**\n * zrender will do compositing when root is a canvas and have multiple zlevels.\n */\n\n this._needsManuallyCompositing = false;\n\n if (!singleCanvas) {\n this._width = this._getSize(0);\n this._height = this._getSize(1);\n var domRoot = this._domRoot = createRoot(this._width, this._height);\n root.appendChild(domRoot);\n } else {\n var width = root.width;\n var height = root.height;\n\n if (opts.width != null) {\n width = opts.width;\n }\n\n if (opts.height != null) {\n height = opts.height;\n }\n\n this.dpr = opts.devicePixelRatio || 1; // Use canvas width and height directly\n\n root.width = width * this.dpr;\n root.height = height * this.dpr;\n this._width = width;\n this._height = height; // Create layer if only one given canvas\n // Device can be specified to create a high dpi image.\n\n var mainLayer = new Layer(root, this, this.dpr);\n mainLayer.__builtin__ = true;\n mainLayer.initContext(); // FIXME Use canvas width and height\n // mainLayer.resize(width, height);\n\n layers[CANVAS_ZLEVEL] = mainLayer;\n mainLayer.zlevel = CANVAS_ZLEVEL; // Not use common zlevel.\n\n zlevelList.push(CANVAS_ZLEVEL);\n this._domRoot = root;\n }\n /**\n * @type {module:zrender/Layer}\n * @private\n */\n\n\n this._hoverlayer = null;\n this._hoverElements = [];\n};\n\nPainter.prototype = {\n constructor: Painter,\n getType: function () {\n return 'canvas';\n },\n\n /**\n * If painter use a single canvas\n * @return {boolean}\n */\n isSingleCanvas: function () {\n return this._singleCanvas;\n },\n\n /**\n * @return {HTMLDivElement}\n */\n getViewportRoot: function () {\n return this._domRoot;\n },\n getViewportRootOffset: function () {\n var viewportRoot = this.getViewportRoot();\n\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n },\n\n /**\n * 刷新\n * @param {boolean} [paintAll=false] 强制绘制所有displayable\n */\n refresh: function (paintAll) {\n var list = this.storage.getDisplayList(true);\n var zlevelList = this._zlevelList;\n this._redrawId = Math.random();\n\n this._paintList(list, paintAll, this._redrawId); // Paint custum layers\n\n\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n\n if (!layer.__builtin__ && layer.refresh) {\n var clearColor = i === 0 ? this._backgroundColor : null;\n layer.refresh(clearColor);\n }\n }\n\n this.refreshHover();\n return this;\n },\n addHover: function (el, hoverStyle) {\n if (el.__hoverMir) {\n return;\n }\n\n var elMirror = new el.constructor({\n style: el.style,\n shape: el.shape,\n z: el.z,\n z2: el.z2,\n silent: el.silent\n });\n elMirror.__from = el;\n el.__hoverMir = elMirror;\n hoverStyle && elMirror.setStyle(hoverStyle);\n\n this._hoverElements.push(elMirror);\n\n return elMirror;\n },\n removeHover: function (el) {\n var elMirror = el.__hoverMir;\n var hoverElements = this._hoverElements;\n var idx = util.indexOf(hoverElements, elMirror);\n\n if (idx >= 0) {\n hoverElements.splice(idx, 1);\n }\n\n el.__hoverMir = null;\n },\n clearHover: function (el) {\n var hoverElements = this._hoverElements;\n\n for (var i = 0; i < hoverElements.length; i++) {\n var from = hoverElements[i].__from;\n\n if (from) {\n from.__hoverMir = null;\n }\n }\n\n hoverElements.length = 0;\n },\n refreshHover: function () {\n var hoverElements = this._hoverElements;\n var len = hoverElements.length;\n var hoverLayer = this._hoverlayer;\n hoverLayer && hoverLayer.clear();\n\n if (!len) {\n return;\n }\n\n timsort(hoverElements, this.storage.displayableSortFunc); // Use a extream large zlevel\n // FIXME?\n\n if (!hoverLayer) {\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n\n var scope = {};\n hoverLayer.ctx.save();\n\n for (var i = 0; i < len;) {\n var el = hoverElements[i];\n var originalEl = el.__from; // Original el is removed\n // PENDING\n\n if (!(originalEl && originalEl.__zr)) {\n hoverElements.splice(i, 1);\n originalEl.__hoverMir = null;\n len--;\n continue;\n }\n\n i++; // Use transform\n // FIXME style and shape ?\n\n if (!originalEl.invisible) {\n el.transform = originalEl.transform;\n el.invTransform = originalEl.invTransform;\n el.__clipPaths = originalEl.__clipPaths; // el.\n\n this._doPaintEl(el, hoverLayer, true, scope);\n }\n }\n\n hoverLayer.ctx.restore();\n },\n getHoverLayer: function () {\n return this.getLayer(HOVER_LAYER_ZLEVEL);\n },\n _paintList: function (list, paintAll, redrawId) {\n if (this._redrawId !== redrawId) {\n return;\n }\n\n paintAll = paintAll || false;\n\n this._updateLayerStatus(list);\n\n var finished = this._doPaintList(list, paintAll);\n\n if (this._needsManuallyCompositing) {\n this._compositeManually();\n }\n\n if (!finished) {\n var self = this;\n requestAnimationFrame(function () {\n self._paintList(list, paintAll, redrawId);\n });\n }\n },\n _compositeManually: function () {\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n var width = this._domRoot.width;\n var height = this._domRoot.height;\n ctx.clearRect(0, 0, width, height); // PENDING, If only builtin layer?\n\n this.eachBuiltinLayer(function (layer) {\n if (layer.virtual) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n });\n },\n _doPaintList: function (list, paintAll) {\n var layerList = [];\n\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\n var zlevel = this._zlevelList[zi];\n var layer = this._layers[zlevel];\n\n if (layer.__builtin__ && layer !== this._hoverlayer && (layer.__dirty || paintAll)) {\n layerList.push(layer);\n }\n }\n\n var finished = true;\n\n for (var k = 0; k < layerList.length; k++) {\n var layer = layerList[k];\n var ctx = layer.ctx;\n var scope = {};\n ctx.save();\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\n var useTimer = !paintAll && layer.incremental && Date.now;\n var startTime = useTimer && Date.now();\n var clearColor = layer.zlevel === this._zlevelList[0] ? this._backgroundColor : null; // All elements in this layer are cleared.\n\n if (layer.__startIndex === layer.__endIndex) {\n layer.clear(false, clearColor);\n } else if (start === layer.__startIndex) {\n var firstEl = list[start];\n\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\n layer.clear(false, clearColor);\n }\n }\n\n if (start === -1) {\n console.error('For some unknown reason. drawIndex is -1');\n start = layer.__startIndex;\n }\n\n for (var i = start; i < layer.__endIndex; i++) {\n var el = list[i];\n\n this._doPaintEl(el, layer, paintAll, scope);\n\n el.__dirty = el.__dirtyText = false;\n\n if (useTimer) {\n // Date.now can be executed in 13,025,305 ops/second.\n var dTime = Date.now() - startTime; // Give 15 millisecond to draw.\n // The rest elements will be drawn in the next frame.\n\n if (dTime > 15) {\n break;\n }\n }\n }\n\n layer.__drawIndex = i;\n\n if (layer.__drawIndex < layer.__endIndex) {\n finished = false;\n }\n\n if (scope.prevElClipPaths) {\n // Needs restore the state. If last drawn element is in the clipping area.\n ctx.restore();\n }\n\n ctx.restore();\n }\n\n if (env.wxa) {\n // Flush for weixin application\n util.each(this._layers, function (layer) {\n if (layer && layer.ctx && layer.ctx.draw) {\n layer.ctx.draw();\n }\n });\n }\n\n return finished;\n },\n _doPaintEl: function (el, currentLayer, forcePaint, scope) {\n var ctx = currentLayer.ctx;\n var m = el.transform;\n\n if ((currentLayer.__dirty || forcePaint) && // Ignore invisible element\n !el.invisible // Ignore transparent element\n && el.style.opacity !== 0 // Ignore scale 0 element, in some environment like node-canvas\n // Draw a scale 0 element can cause all following draw wrong\n // And setTransform with scale 0 will cause set back transform failed.\n && !(m && !m[0] && !m[3]) // Ignore culled element\n && !(el.culling && isDisplayableCulled(el, this._width, this._height))) {\n var clipPaths = el.__clipPaths;\n var prevElClipPaths = scope.prevElClipPaths; // Optimize when clipping on group with several elements\n\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n // If has previous clipping state, restore from it\n if (prevElClipPaths) {\n ctx.restore();\n scope.prevElClipPaths = null; // Reset prevEl since context has been restored\n\n scope.prevEl = null;\n } // New clipping state\n\n\n if (clipPaths) {\n ctx.save();\n doClip(clipPaths, ctx);\n scope.prevElClipPaths = clipPaths;\n }\n }\n\n el.beforeBrush && el.beforeBrush(ctx);\n el.brush(ctx, scope.prevEl || null);\n scope.prevEl = el;\n el.afterBrush && el.afterBrush(ctx);\n }\n },\n\n /**\n * 获取 zlevel 所在层,如果不存在则会创建一个新的层\n * @param {number} zlevel\n * @param {boolean} virtual Virtual layer will not be inserted into dom.\n * @return {module:zrender/Layer}\n */\n getLayer: function (zlevel, virtual) {\n if (this._singleCanvas && !this._needsManuallyCompositing) {\n zlevel = CANVAS_ZLEVEL;\n }\n\n var layer = this._layers[zlevel];\n\n if (!layer) {\n // Create a new layer\n layer = new Layer('zr_' + zlevel, this, this.dpr);\n layer.zlevel = zlevel;\n layer.__builtin__ = true;\n\n if (this._layerConfig[zlevel]) {\n util.merge(layer, this._layerConfig[zlevel], true);\n } // TODO Remove EL_AFTER_INCREMENTAL_INC magic number\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n }\n\n if (virtual) {\n layer.virtual = virtual;\n }\n\n this.insertLayer(zlevel, layer); // Context is created after dom inserted to document\n // Or excanvas will get 0px clientWidth and clientHeight\n\n layer.initContext();\n }\n\n return layer;\n },\n insertLayer: function (zlevel, layer) {\n var layersMap = this._layers;\n var zlevelList = this._zlevelList;\n var len = zlevelList.length;\n var prevLayer = null;\n var i = -1;\n var domRoot = this._domRoot;\n\n if (layersMap[zlevel]) {\n logError('ZLevel ' + zlevel + ' has been used already');\n return;\n } // Check if is a valid layer\n\n\n if (!isLayerValid(layer)) {\n logError('Layer of zlevel ' + zlevel + ' is not valid');\n return;\n }\n\n if (len > 0 && zlevel > zlevelList[0]) {\n for (i = 0; i < len - 1; i++) {\n if (zlevelList[i] < zlevel && zlevelList[i + 1] > zlevel) {\n break;\n }\n }\n\n prevLayer = layersMap[zlevelList[i]];\n }\n\n zlevelList.splice(i + 1, 0, zlevel);\n layersMap[zlevel] = layer; // Vitual layer will not directly show on the screen.\n // (It can be a WebGL layer and assigned to a ZImage element)\n // But it still under management of zrender.\n\n if (!layer.virtual) {\n if (prevLayer) {\n var prevDom = prevLayer.dom;\n\n if (prevDom.nextSibling) {\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\n } else {\n domRoot.appendChild(layer.dom);\n }\n } else {\n if (domRoot.firstChild) {\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\n } else {\n domRoot.appendChild(layer.dom);\n }\n }\n }\n },\n // Iterate each layer\n eachLayer: function (cb, context) {\n var zlevelList = this._zlevelList;\n var z;\n var i;\n\n for (i = 0; i < zlevelList.length; i++) {\n z = zlevelList[i];\n cb.call(context, this._layers[z], z);\n }\n },\n // Iterate each buildin layer\n eachBuiltinLayer: function (cb, context) {\n var zlevelList = this._zlevelList;\n var layer;\n var z;\n var i;\n\n for (i = 0; i < zlevelList.length; i++) {\n z = zlevelList[i];\n layer = this._layers[z];\n\n if (layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n },\n // Iterate each other layer except buildin layer\n eachOtherLayer: function (cb, context) {\n var zlevelList = this._zlevelList;\n var layer;\n var z;\n var i;\n\n for (i = 0; i < zlevelList.length; i++) {\n z = zlevelList[i];\n layer = this._layers[z];\n\n if (!layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n },\n\n /**\n * 获取所有已创建的层\n * @param {Array.} [prevLayer]\n */\n getLayers: function () {\n return this._layers;\n },\n _updateLayerStatus: function (list) {\n this.eachBuiltinLayer(function (layer, z) {\n layer.__dirty = layer.__used = false;\n });\n\n function updatePrevLayer(idx) {\n if (prevLayer) {\n if (prevLayer.__endIndex !== idx) {\n prevLayer.__dirty = true;\n }\n\n prevLayer.__endIndex = idx;\n }\n }\n\n if (this._singleCanvas) {\n for (var i = 1; i < list.length; i++) {\n var el = list[i];\n\n if (el.zlevel !== list[i - 1].zlevel || el.incremental) {\n this._needsManuallyCompositing = true;\n break;\n }\n }\n }\n\n var prevLayer = null;\n var incrementalLayerCount = 0;\n var prevZlevel;\n\n for (var i = 0; i < list.length; i++) {\n var el = list[i];\n var zlevel = el.zlevel;\n var layer;\n\n if (prevZlevel !== zlevel) {\n prevZlevel = zlevel;\n incrementalLayerCount = 0;\n } // TODO Not use magic number on zlevel.\n // Each layer with increment element can be separated to 3 layers.\n // (Other Element drawn after incremental element)\n // -----------------zlevel + EL_AFTER_INCREMENTAL_INC--------------------\n // (Incremental element)\n // ----------------------zlevel + INCREMENTAL_INC------------------------\n // (Element drawn before incremental element)\n // --------------------------------zlevel--------------------------------\n\n\n if (el.incremental) {\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n layer.incremental = true;\n incrementalLayerCount = 1;\n } else {\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\n }\n\n if (!layer.__builtin__) {\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n }\n\n if (layer !== prevLayer) {\n layer.__used = true;\n\n if (layer.__startIndex !== i) {\n layer.__dirty = true;\n }\n\n layer.__startIndex = i;\n\n if (!layer.incremental) {\n layer.__drawIndex = i;\n } else {\n // Mark layer draw index needs to update.\n layer.__drawIndex = -1;\n }\n\n updatePrevLayer(i);\n prevLayer = layer;\n }\n\n if (el.__dirty) {\n layer.__dirty = true;\n\n if (layer.incremental && layer.__drawIndex < 0) {\n // Start draw from the first dirty element.\n layer.__drawIndex = i;\n }\n }\n }\n\n updatePrevLayer(i);\n this.eachBuiltinLayer(function (layer, z) {\n // Used in last frame but not in this frame. Needs clear\n if (!layer.__used && layer.getElementCount() > 0) {\n layer.__dirty = true;\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n } // For incremental layer. In case start index changed and no elements are dirty.\n\n\n if (layer.__dirty && layer.__drawIndex < 0) {\n layer.__drawIndex = layer.__startIndex;\n }\n });\n },\n\n /**\n * 清除hover层外所有内容\n */\n clear: function () {\n this.eachBuiltinLayer(this._clearLayer);\n return this;\n },\n _clearLayer: function (layer) {\n layer.clear();\n },\n setBackgroundColor: function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n },\n\n /**\n * 修改指定zlevel的绘制参数\n *\n * @param {string} zlevel\n * @param {Object} config 配置对象\n * @param {string} [config.clearColor=0] 每次清空画布的颜色\n * @param {string} [config.motionBlur=false] 是否开启动态模糊\n * @param {number} [config.lastFrameAlpha=0.7]\n * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显\n */\n configLayer: function (zlevel, config) {\n if (config) {\n var layerConfig = this._layerConfig;\n\n if (!layerConfig[zlevel]) {\n layerConfig[zlevel] = config;\n } else {\n util.merge(layerConfig[zlevel], config, true);\n }\n\n for (var i = 0; i < this._zlevelList.length; i++) {\n var _zlevel = this._zlevelList[i]; // TODO Remove EL_AFTER_INCREMENTAL_INC magic number\n\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n var layer = this._layers[_zlevel];\n util.merge(layer, layerConfig[zlevel], true);\n }\n }\n }\n },\n\n /**\n * 删除指定层\n * @param {number} zlevel 层所在的zlevel\n */\n delLayer: function (zlevel) {\n var layers = this._layers;\n var zlevelList = this._zlevelList;\n var layer = layers[zlevel];\n\n if (!layer) {\n return;\n }\n\n layer.dom.parentNode.removeChild(layer.dom);\n delete layers[zlevel];\n zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n },\n\n /**\n * 区域大小变化后重绘\n */\n resize: function (width, height) {\n if (!this._domRoot.style) {\n // Maybe in node or worker\n if (width == null || height == null) {\n return;\n }\n\n this._width = width;\n this._height = height;\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\n } else {\n var domRoot = this._domRoot; // FIXME Why ?\n\n domRoot.style.display = 'none'; // Save input w/h\n\n var opts = this._opts;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n width = this._getSize(0);\n height = this._getSize(1);\n domRoot.style.display = ''; // 优化没有实际改变的resize\n\n if (this._width !== width || height !== this._height) {\n domRoot.style.width = width + 'px';\n domRoot.style.height = height + 'px';\n\n for (var id in this._layers) {\n if (this._layers.hasOwnProperty(id)) {\n this._layers[id].resize(width, height);\n }\n }\n\n util.each(this._progressiveLayers, function (layer) {\n layer.resize(width, height);\n });\n this.refresh(true);\n }\n\n this._width = width;\n this._height = height;\n }\n\n return this;\n },\n\n /**\n * 清除单独的一个层\n * @param {number} zlevel\n */\n clearLayer: function (zlevel) {\n var layer = this._layers[zlevel];\n\n if (layer) {\n layer.clear();\n }\n },\n\n /**\n * 释放\n */\n dispose: function () {\n this.root.innerHTML = '';\n this.root = this.storage = this._domRoot = this._layers = null;\n },\n\n /**\n * Get canvas which has all thing rendered\n * @param {Object} opts\n * @param {string} [opts.backgroundColor]\n * @param {number} [opts.pixelRatio]\n */\n getRenderedCanvas: function (opts) {\n opts = opts || {};\n\n if (this._singleCanvas && !this._compositeManually) {\n return this._layers[CANVAS_ZLEVEL].dom;\n }\n\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n imageLayer.initContext();\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n\n if (opts.pixelRatio <= this.dpr) {\n this.refresh();\n var width = imageLayer.dom.width;\n var height = imageLayer.dom.height;\n var ctx = imageLayer.ctx;\n this.eachLayer(function (layer) {\n if (layer.__builtin__) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n } else if (layer.renderToCanvas) {\n imageLayer.ctx.save();\n layer.renderToCanvas(imageLayer.ctx);\n imageLayer.ctx.restore();\n }\n });\n } else {\n // PENDING, echarts-gl and incremental rendering.\n var scope = {};\n var displayList = this.storage.getDisplayList(true);\n\n for (var i = 0; i < displayList.length; i++) {\n var el = displayList[i];\n\n this._doPaintEl(el, imageLayer, true, scope);\n }\n }\n\n return imageLayer.dom;\n },\n\n /**\n * 获取绘图区域宽度\n */\n getWidth: function () {\n return this._width;\n },\n\n /**\n * 获取绘图区域高度\n */\n getHeight: function () {\n return this._height;\n },\n _getSize: function (whIdx) {\n var opts = this._opts;\n var wh = ['width', 'height'][whIdx];\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\n\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh]);\n }\n\n var root = this.root; // IE8 does not support getComputedStyle, but it use VML.\n\n var stl = document.defaultView.getComputedStyle(root);\n return (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) - (parseInt10(stl[plt]) || 0) - (parseInt10(stl[prb]) || 0) | 0;\n },\n pathToImage: function (path, dpr) {\n dpr = dpr || this.dpr;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var rect = path.getBoundingRect();\n var style = path.style;\n var shadowBlurSize = style.shadowBlur * dpr;\n var shadowOffsetX = style.shadowOffsetX * dpr;\n var shadowOffsetY = style.shadowOffsetY * dpr;\n var lineWidth = style.hasStroke() ? style.lineWidth : 0;\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\n var width = rect.width + leftMargin + rightMargin;\n var height = rect.height + topMargin + bottomMargin;\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n ctx.scale(dpr, dpr);\n ctx.clearRect(0, 0, width, height);\n ctx.dpr = dpr;\n var pathTransform = {\n position: path.position,\n rotation: path.rotation,\n scale: path.scale\n };\n path.position = [leftMargin - rect.x, topMargin - rect.y];\n path.rotation = 0;\n path.scale = [1, 1];\n path.updateTransform();\n\n if (path) {\n path.brush(ctx);\n }\n\n var ImageShape = Image;\n var imgShape = new ImageShape({\n style: {\n x: 0,\n y: 0,\n image: canvas\n }\n });\n\n if (pathTransform.position != null) {\n imgShape.position = path.position = pathTransform.position;\n }\n\n if (pathTransform.rotation != null) {\n imgShape.rotation = path.rotation = pathTransform.rotation;\n }\n\n if (pathTransform.scale != null) {\n imgShape.scale = path.scale = pathTransform.scale;\n }\n\n return imgShape;\n }\n};\nvar _default = Painter;\nmodule.exports = _default;","var util = require(\"../core/util\");\n\nvar _event = require(\"../core/event\");\n\nvar Dispatcher = _event.Dispatcher;\n\nvar requestAnimationFrame = require(\"./requestAnimationFrame\");\n\nvar Animator = require(\"./Animator\");\n\n/**\n * Animation main class, dispatch and manage all animation controllers\n *\n * @module zrender/animation/Animation\n * @author pissang(https://github.com/pissang)\n */\n// TODO Additive animation\n// http://iosoteric.com/additive-animations-animatewithduration-in-ios-8/\n// https://developer.apple.com/videos/wwdc2014/#236\n\n/**\n * @typedef {Object} IZRenderStage\n * @property {Function} update\n */\n\n/**\n * @alias module:zrender/animation/Animation\n * @constructor\n * @param {Object} [options]\n * @param {Function} [options.onframe]\n * @param {IZRenderStage} [options.stage]\n * @example\n * var animation = new Animation();\n * var obj = {\n * x: 100,\n * y: 100\n * };\n * animation.animate(node.position)\n * .when(1000, {\n * x: 500,\n * y: 500\n * })\n * .when(2000, {\n * x: 100,\n * y: 100\n * })\n * .start('spline');\n */\nvar Animation = function (options) {\n options = options || {};\n this.stage = options.stage || {};\n\n this.onframe = options.onframe || function () {}; // private properties\n\n\n this._clips = [];\n this._running = false;\n this._time;\n this._pausedTime;\n this._pauseStart;\n this._paused = false;\n Dispatcher.call(this);\n};\n\nAnimation.prototype = {\n constructor: Animation,\n\n /**\n * Add clip\n * @param {module:zrender/animation/Clip} clip\n */\n addClip: function (clip) {\n this._clips.push(clip);\n },\n\n /**\n * Add animator\n * @param {module:zrender/animation/Animator} animator\n */\n addAnimator: function (animator) {\n animator.animation = this;\n var clips = animator.getClips();\n\n for (var i = 0; i < clips.length; i++) {\n this.addClip(clips[i]);\n }\n },\n\n /**\n * Delete animation clip\n * @param {module:zrender/animation/Clip} clip\n */\n removeClip: function (clip) {\n var idx = util.indexOf(this._clips, clip);\n\n if (idx >= 0) {\n this._clips.splice(idx, 1);\n }\n },\n\n /**\n * Delete animation clip\n * @param {module:zrender/animation/Animator} animator\n */\n removeAnimator: function (animator) {\n var clips = animator.getClips();\n\n for (var i = 0; i < clips.length; i++) {\n this.removeClip(clips[i]);\n }\n\n animator.animation = null;\n },\n _update: function () {\n var time = new Date().getTime() - this._pausedTime;\n\n var delta = time - this._time;\n var clips = this._clips;\n var len = clips.length;\n var deferredEvents = [];\n var deferredClips = [];\n\n for (var i = 0; i < len; i++) {\n var clip = clips[i];\n var e = clip.step(time, delta); // Throw out the events need to be called after\n // stage.update, like destroy\n\n if (e) {\n deferredEvents.push(e);\n deferredClips.push(clip);\n }\n } // Remove the finished clip\n\n\n for (var i = 0; i < len;) {\n if (clips[i]._needsRemove) {\n clips[i] = clips[len - 1];\n clips.pop();\n len--;\n } else {\n i++;\n }\n }\n\n len = deferredEvents.length;\n\n for (var i = 0; i < len; i++) {\n deferredClips[i].fire(deferredEvents[i]);\n }\n\n this._time = time;\n this.onframe(delta); // 'frame' should be triggered before stage, because upper application\n // depends on the sequence (e.g., echarts-stream and finish\n // event judge)\n\n this.trigger('frame', delta);\n\n if (this.stage.update) {\n this.stage.update();\n }\n },\n _startLoop: function () {\n var self = this;\n this._running = true;\n\n function step() {\n if (self._running) {\n requestAnimationFrame(step);\n !self._paused && self._update();\n }\n }\n\n requestAnimationFrame(step);\n },\n\n /**\n * Start animation.\n */\n start: function () {\n this._time = new Date().getTime();\n this._pausedTime = 0;\n\n this._startLoop();\n },\n\n /**\n * Stop animation.\n */\n stop: function () {\n this._running = false;\n },\n\n /**\n * Pause animation.\n */\n pause: function () {\n if (!this._paused) {\n this._pauseStart = new Date().getTime();\n this._paused = true;\n }\n },\n\n /**\n * Resume animation.\n */\n resume: function () {\n if (this._paused) {\n this._pausedTime += new Date().getTime() - this._pauseStart;\n this._paused = false;\n }\n },\n\n /**\n * Clear animation.\n */\n clear: function () {\n this._clips = [];\n },\n\n /**\n * Whether animation finished.\n */\n isFinished: function () {\n return !this._clips.length;\n },\n\n /**\n * Creat animator for a target, whose props can be animated.\n *\n * @param {Object} target\n * @param {Object} options\n * @param {boolean} [options.loop=false] Whether loop animation.\n * @param {Function} [options.getter=null] Get value from target.\n * @param {Function} [options.setter=null] Set value to target.\n * @return {module:zrender/animation/Animation~Animator}\n */\n // TODO Gap\n animate: function (target, options) {\n options = options || {};\n var animator = new Animator(target, options.loop, options.getter, options.setter);\n this.addAnimator(animator);\n return animator;\n }\n};\nutil.mixin(Animation, Dispatcher);\nvar _default = Animation;\nmodule.exports = _default;","var _event = require(\"../core/event\");\n\nvar addEventListener = _event.addEventListener;\nvar removeEventListener = _event.removeEventListener;\nvar normalizeEvent = _event.normalizeEvent;\nvar getNativeEvent = _event.getNativeEvent;\n\nvar zrUtil = require(\"../core/util\");\n\nvar Eventful = require(\"../mixin/Eventful\");\n\nvar env = require(\"../core/env\");\n\n/* global document */\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\n\nvar localNativeListenerNames = function () {\n var mouseHandlerNames = ['click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu'];\n var touchHandlerNames = ['touchstart', 'touchend', 'touchmove'];\n var pointerEventNameMap = {\n pointerdown: 1,\n pointerup: 1,\n pointermove: 1,\n pointerout: 1\n };\n var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n var nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n}();\n\nvar globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\n\nfunction eventNameFix(name) {\n return name === 'mousewheel' && env.browser.firefox ? 'DOMMouseScroll' : name;\n}\n\nfunction isPointerFromTouch(event) {\n var pointerType = event.pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n} // function useMSGuesture(handlerProxy, event) {\n// return isPointerFromTouch(event) && !!handlerProxy._msGesture;\n// }\n// function onMSGestureChange(proxy, event) {\n// if (event.translationX || event.translationY) {\n// // mousemove is carried by MSGesture to reduce the sensitivity.\n// proxy.handler.dispatchToElement(event.target, 'mousemove', event);\n// }\n// if (event.scale !== 1) {\n// event.pinchX = event.offsetX;\n// event.pinchY = event.offsetY;\n// event.pinchScale = event.scale;\n// proxy.handler.dispatchToElement(event.target, 'pinch', event);\n// }\n// }\n\n/**\n * Prevent mouse event from being dispatched after Touch Events action\n * @see \n * 1. Mobile browsers dispatch mouse events 300ms after touchend.\n * 2. Chrome for Android dispatch mousedown for long-touch about 650ms\n * Result: Blocking Mouse Events for 700ms.\n *\n * @param {DOMHandlerScope} scope\n */\n\n\nfunction setTouchTimer(scope) {\n scope.touching = true;\n\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n} // Mark touch, which is useful in distinguish touch and\n// mouse event in upper applicatoin.\n\n\nfunction markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {\n// event && (event.__zrIsFromLocal = true);\n// }\n// function isTriggeredFromLocal(instance, event) {\n// return !!(event && event.__zrIsFromLocal);\n// }\n\n\nfunction normalizeGlobalEvent(instance, event) {\n // offsetX, offsetY still need to be calculated. They are necessary in the event\n // handlers of the upper applications. Set `true` to force calculate them.\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\n/**\n * Detect whether the given el is in `painterRoot`.\n */\n\n\nfunction isLocalEl(instance, el) {\n var elTmp = el;\n var isLocal = false;\n\n while (elTmp && elTmp.nodeType !== 9 && !(isLocal = elTmp.domBelongToZr || elTmp !== el && elTmp === instance.painterRoot)) {\n elTmp = elTmp.parentNode;\n }\n\n return isLocal;\n}\n/**\n * Make a fake event but not change the original event,\n * becuase the global event probably be used by other\n * listeners not belonging to zrender.\n * @class\n */\n\n\nfunction FakeGlobalEvent(instance, event) {\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = event.pointerType; // Necessray for the force calculation of zrX, zrY\n\n this.clientX = event.clientX;\n this.clientY = event.clientY; // Because we do not mount global listeners to touch events,\n // we do not copy `targetTouches` and `changedTouches` here.\n}\n\nvar fakeGlobalEventProto = FakeGlobalEvent.prototype; // we make the default methods on the event do nothing,\n// otherwise it is dangerous. See more details in\n// [Drag outside] in `Handler.js`.\n\nfakeGlobalEventProto.stopPropagation = fakeGlobalEventProto.stopImmediatePropagation = fakeGlobalEventProto.preventDefault = zrUtil.noop;\n/**\n * Local DOM Handlers\n * @this {HandlerProxy}\n */\n\nvar localDOMHandlers = {\n mousedown: function (event) {\n event = normalizeEvent(this.dom, event);\n this._mayPointerCapture = [event.zrX, event.zrY];\n this.trigger('mousedown', event);\n },\n mousemove: function (event) {\n event = normalizeEvent(this.dom, event);\n var downPoint = this._mayPointerCapture;\n\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n togglePointerCapture(this, true);\n }\n\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n event = normalizeEvent(this.dom, event);\n togglePointerCapture(this, false);\n this.trigger('mouseup', event);\n },\n mouseout: function (event) {\n event = normalizeEvent(this.dom, event); // Similarly to the browser did on `document` and touch event,\n // `globalout` will be delayed to final pointer cature release.\n\n if (this._pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n } // There might be some doms created by upper layer application\n // at the same level of painter.getViewportRoot() (e.g., tooltip\n // dom created by echarts), where 'globalout' event should not\n // be triggered when mouse enters these doms. (But 'mouseout'\n // should be triggered at the original hovered element as usual).\n\n\n var element = event.toElement || event.relatedTarget;\n event.zrIsToLocalDOM = isLocalEl(this, element);\n this.trigger('mouseout', event);\n },\n touchstart: function (event) {\n // Default mouse behaviour should not be disabled here.\n // For example, page may needs to be slided.\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this._lastTouchMoment = new Date();\n this.handler.processGesture(event, 'start'); // For consistent event listener for both touch device and mouse device,\n // we simulate \"mouseover-->mousedown\" in touch device. So we trigger\n // `mousemove` here (to trigger `mouseover` inside), and then trigger\n // `mousedown`.\n\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n touchmove: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'change'); // Mouse move should always be triggered no matter whether\n // there is gestrue event, because mouse move and pinch may\n // be used at the same time.\n\n localDOMHandlers.mousemove.call(this, event);\n },\n touchend: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'end');\n localDOMHandlers.mouseup.call(this, event); // Do not trigger `mouseout` here, in spite of `mousemove`(`mouseover`) is\n // triggered in `touchstart`. This seems to be illogical, but by this mechanism,\n // we can conveniently implement \"hover style\" in both PC and touch device just\n // by listening to `mouseover` to add \"hover style\" and listening to `mouseout`\n // to remove \"hover style\" on an element, without any additional code for\n // compatibility. (`mouseout` will not be triggered in `touchend`, so \"hover\n // style\" will remain for user view)\n // click event should always be triggered no matter whether\n // there is gestrue event. System click can not be prevented.\n\n if (+new Date() - this._lastTouchMoment < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n pointerdown: function (event) {\n localDOMHandlers.mousedown.call(this, event); // if (useMSGuesture(this, event)) {\n // this._msGesture.addPointer(event.pointerId);\n // }\n },\n pointermove: function (event) {\n // FIXME\n // pointermove is so sensitive that it always triggered when\n // tap(click) on touch screen, which affect some judgement in\n // upper application. So, we dont support mousemove on MS touch\n // device yet.\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n localDOMHandlers.mouseup.call(this, event);\n },\n pointerout: function (event) {\n // pointerout will be triggered when tap on touch screen\n // (IE11+/Edge on MS Surface) after click event triggered,\n // which is inconsistent with the mousout behavior we defined\n // in touchend. So we unify them.\n // (check localDOMHandlers.touchend for detailed explanation)\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n};\n/**\n * Othere DOM UI Event handlers for zr dom.\n * @this {HandlerProxy}\n */\n\nzrUtil.each(['click', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\n/**\n * DOM UI Event handlers for global page.\n *\n * [Caution]:\n * those handlers should both support in capture phase and bubble phase!\n *\n * @this {HandlerProxy}\n */\n\nvar globalDOMHandlers = {\n pointermove: function (event) {\n // FIXME\n // pointermove is so sensitive that it always triggered when\n // tap(click) on touch screen, which affect some judgement in\n // upper application. So, we dont support mousemove on MS touch\n // device yet.\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n mousemove: function (event) {\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n var pointerCaptureReleasing = this._pointerCapturing;\n togglePointerCapture(this, false);\n this.trigger('mouseup', event);\n\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n};\n/**\n * @param {HandlerProxy} instance\n * @param {DOMHandlerScope} scope\n */\n\nfunction mountLocalDOMEventListeners(instance, scope) {\n var domHandlers = scope.domHandlers;\n\n if (env.pointerEventsSupported) {\n // Only IE11+/Edge\n // 1. On devices that both enable touch and mouse (e.g., MS Surface and lenovo X240),\n // IE11+/Edge do not trigger touch event, but trigger pointer event and mouse event\n // at the same time.\n // 2. On MS Surface, it probablely only trigger mousedown but no mouseup when tap on\n // screen, which do not occurs in pointer event.\n // So we use pointer event to both detect touch gesture and mouse behavior.\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n });\n }); // FIXME\n // Note: MS Gesture require CSS touch-action set. But touch-action is not reliable,\n // which does not prevent defuault behavior occasionally (which may cause view port\n // zoomed in but use can not zoom it back). And event.preventDefault() does not work.\n // So we have to not to use MSGesture and not to support touchmove and pinch on MS\n // touch screen. And we only support click behavior on MS touch screen now.\n // MS Gesture Event is only supported on IE11+/Edge and on Windows 8+.\n // We dont support touch on IE on win7.\n // See \n // if (typeof MSGesture === 'function') {\n // (this._msGesture = new MSGesture()).target = dom; // jshint ignore:line\n // dom.addEventListener('MSGestureChange', onMSGestureChange);\n // }\n } else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n }); // Handler of 'mouseout' event is needed in touch mode, which will be mounted below.\n // addEventListener(root, 'mouseout', this._mouseoutHandler);\n } // 1. Considering some devices that both enable touch and mouse event (like on MS Surface\n // and lenovo X240, @see #2350), we make mouse event be always listened, otherwise\n // mouse event can not be handle in those devices.\n // 2. On MS Surface, Chrome will trigger both touch event and mouse event. How to prevent\n // mouseevent after touch event triggered, see `setTouchTimer`.\n\n\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n event = getNativeEvent(event);\n\n if (!scope.touching) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\n/**\n * @param {HandlerProxy} instance\n * @param {DOMHandlerScope} scope\n */\n\n\nfunction mountGlobalDOMEventListeners(instance, scope) {\n // Only IE11+/Edge. See the comment in `mountLocalDOMEventListeners`.\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n } // Touch event has implemented \"drag outside\" so we do not mount global listener for touch event.\n // (see https://www.w3.org/TR/touch-events/#the-touchmove-event)\n // We do not consider \"both-support-touch-and-mouse device\" for this feature (see the comment of\n // `mountLocalDOMEventListeners`) to avoid bugs util some requirements come.\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n\n function mount(nativeEventName) {\n function nativeEventListener(event) {\n event = getNativeEvent(event); // See the reason in [Drag outside] in `Handler.js`\n // This checking supports both `useCapture` or not.\n // PENDING: if there is performance issue in some devices,\n // we probably can not use `useCapture` and change a easier\n // to judes whether local (mark).\n\n if (!isLocalEl(instance, event.target)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, {\n capture: true\n } // See [Drag Outside] in `Handler.js`\n );\n }\n}\n\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, eventNameFix(nativeEventName), listener, opt);\n}\n\nfunction unmountDOMEventListeners(scope) {\n var mounted = scope.mounted;\n\n for (var nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(scope.domTarget, eventNameFix(nativeEventName), mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n }\n }\n\n scope.mounted = {};\n}\n/**\n * See [Drag Outside] in `Handler.js`.\n * @implement\n * @param {boolean} isPointerCapturing Should never be `null`/`undefined`.\n * `true`: start to capture pointer if it is not capturing.\n * `false`: end the capture if it is capturing.\n */\n\n\nfunction togglePointerCapture(instance, isPointerCapturing) {\n instance._mayPointerCapture = null;\n\n if (globalEventSupported && instance._pointerCapturing ^ isPointerCapturing) {\n instance._pointerCapturing = isPointerCapturing;\n var globalHandlerScope = instance._globalHandlerScope;\n isPointerCapturing ? mountGlobalDOMEventListeners(instance, globalHandlerScope) : unmountDOMEventListeners(globalHandlerScope);\n }\n}\n/**\n * @inner\n * @class\n */\n\n\nfunction DOMHandlerScope(domTarget, domHandlers) {\n this.domTarget = domTarget;\n this.domHandlers = domHandlers; // Key: eventName, value: mounted handler funcitons.\n // Used for unmount.\n\n this.mounted = {};\n this.listenerOpts = {};\n this.touchTimer = null;\n this.touching = false;\n}\n/**\n * @public\n * @class\n */\n\n\nfunction HandlerDomProxy(dom, painterRoot) {\n Eventful.call(this);\n this.dom = dom;\n this.painterRoot = painterRoot;\n this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n\n if (globalEventSupported) {\n this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n /**\n * @type {boolean}\n */\n\n\n this._pointerCapturing = false;\n /**\n * @type {Array.} [x, y] or null.\n */\n\n this._mayPointerCapture = null;\n mountLocalDOMEventListeners(this, this._localHandlerScope);\n}\n\nvar handlerDomProxyProto = HandlerDomProxy.prototype;\n\nhandlerDomProxyProto.dispose = function () {\n unmountDOMEventListeners(this._localHandlerScope);\n\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n};\n\nhandlerDomProxyProto.setCursor = function (cursorStyle) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n};\n\nzrUtil.mixin(HandlerDomProxy, Eventful);\nvar _default = HandlerDomProxy;\nmodule.exports = _default;","var guid = require(\"./core/guid\");\n\nvar env = require(\"./core/env\");\n\nvar zrUtil = require(\"./core/util\");\n\nvar Handler = require(\"./Handler\");\n\nvar Storage = require(\"./Storage\");\n\nvar Painter = require(\"./Painter\");\n\nvar Animation = require(\"./animation/Animation\");\n\nvar HandlerProxy = require(\"./dom/HandlerProxy\");\n\n/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\nvar useVML = !env.canvasSupported;\nvar painterCtors = {\n canvas: Painter\n};\nvar instances = {}; // ZRender实例map索引\n\n/**\n * @type {string}\n */\n\nvar version = '4.3.2';\n/**\n * Initializing a zrender instance\n * @param {HTMLElement} dom\n * @param {Object} [opts]\n * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg'\n * @param {number} [opts.devicePixelRatio]\n * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined)\n * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined)\n * @return {module:zrender/ZRender}\n */\n\nfunction init(dom, opts) {\n var zr = new ZRender(guid(), dom, opts);\n instances[zr.id] = zr;\n return zr;\n}\n/**\n * Dispose zrender instance\n * @param {module:zrender/ZRender} zr\n */\n\n\nfunction dispose(zr) {\n if (zr) {\n zr.dispose();\n } else {\n for (var key in instances) {\n if (instances.hasOwnProperty(key)) {\n instances[key].dispose();\n }\n }\n\n instances = {};\n }\n\n return this;\n}\n/**\n * Get zrender instance by id\n * @param {string} id zrender instance id\n * @return {module:zrender/ZRender}\n */\n\n\nfunction getInstance(id) {\n return instances[id];\n}\n\nfunction registerPainter(name, Ctor) {\n painterCtors[name] = Ctor;\n}\n\nfunction delInstance(id) {\n delete instances[id];\n}\n/**\n * @module zrender/ZRender\n */\n\n/**\n * @constructor\n * @alias module:zrender/ZRender\n * @param {string} id\n * @param {HTMLElement} dom\n * @param {Object} opts\n * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg'\n * @param {number} [opts.devicePixelRatio]\n * @param {number} [opts.width] Can be 'auto' (the same as null/undefined)\n * @param {number} [opts.height] Can be 'auto' (the same as null/undefined)\n */\n\n\nvar ZRender = function (id, dom, opts) {\n opts = opts || {};\n /**\n * @type {HTMLDomElement}\n */\n\n this.dom = dom;\n /**\n * @type {string}\n */\n\n this.id = id;\n var self = this;\n var storage = new Storage();\n var rendererType = opts.renderer; // TODO WebGL\n\n if (useVML) {\n if (!painterCtors.vml) {\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\n }\n\n rendererType = 'vml';\n } else if (!rendererType || !painterCtors[rendererType]) {\n rendererType = 'canvas';\n }\n\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\n this.storage = storage;\n this.painter = painter;\n var handerProxy = !env.node && !env.worker ? new HandlerProxy(painter.getViewportRoot(), painter.root) : null;\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\n /**\n * @type {module:zrender/animation/Animation}\n */\n\n this.animation = new Animation({\n stage: {\n update: zrUtil.bind(this.flush, this)\n }\n });\n this.animation.start();\n /**\n * @type {boolean}\n * @private\n */\n\n this._needsRefresh; // 修改 storage.delFromStorage, 每次删除元素之前删除动画\n // FIXME 有点ugly\n\n var oldDelFromStorage = storage.delFromStorage;\n var oldAddToStorage = storage.addToStorage;\n\n storage.delFromStorage = function (el) {\n oldDelFromStorage.call(storage, el);\n el && el.removeSelfFromZr(self);\n };\n\n storage.addToStorage = function (el) {\n oldAddToStorage.call(storage, el);\n el.addSelfToZr(self);\n };\n};\n\nZRender.prototype = {\n constructor: ZRender,\n\n /**\n * 获取实例唯一标识\n * @return {string}\n */\n getId: function () {\n return this.id;\n },\n\n /**\n * 添加元素\n * @param {module:zrender/Element} el\n */\n add: function (el) {\n this.storage.addRoot(el);\n this._needsRefresh = true;\n },\n\n /**\n * 删除元素\n * @param {module:zrender/Element} el\n */\n remove: function (el) {\n this.storage.delRoot(el);\n this._needsRefresh = true;\n },\n\n /**\n * Change configuration of layer\n * @param {string} zLevel\n * @param {Object} config\n * @param {string} [config.clearColor=0] Clear color\n * @param {string} [config.motionBlur=false] If enable motion blur\n * @param {number} [config.lastFrameAlpha=0.7] Motion blur factor. Larger value cause longer trailer\n */\n configLayer: function (zLevel, config) {\n if (this.painter.configLayer) {\n this.painter.configLayer(zLevel, config);\n }\n\n this._needsRefresh = true;\n },\n\n /**\n * Set background color\n * @param {string} backgroundColor\n */\n setBackgroundColor: function (backgroundColor) {\n if (this.painter.setBackgroundColor) {\n this.painter.setBackgroundColor(backgroundColor);\n }\n\n this._needsRefresh = true;\n },\n\n /**\n * Repaint the canvas immediately\n */\n refreshImmediately: function () {\n // var start = new Date();\n // Clear needsRefresh ahead to avoid something wrong happens in refresh\n // Or it will cause zrender refreshes again and again.\n this._needsRefresh = this._needsRefreshHover = false;\n this.painter.refresh(); // Avoid trigger zr.refresh in Element#beforeUpdate hook\n\n this._needsRefresh = this._needsRefreshHover = false; // var end = new Date();\n // var log = document.getElementById('log');\n // if (log) {\n // log.innerHTML = log.innerHTML + '
' + (end - start);\n // }\n },\n\n /**\n * Mark and repaint the canvas in the next frame of browser\n */\n refresh: function () {\n this._needsRefresh = true;\n },\n\n /**\n * Perform all refresh\n */\n flush: function () {\n var triggerRendered;\n\n if (this._needsRefresh) {\n triggerRendered = true;\n this.refreshImmediately();\n }\n\n if (this._needsRefreshHover) {\n triggerRendered = true;\n this.refreshHoverImmediately();\n }\n\n triggerRendered && this.trigger('rendered');\n },\n\n /**\n * Add element to hover layer\n * @param {module:zrender/Element} el\n * @param {Object} style\n */\n addHover: function (el, style) {\n if (this.painter.addHover) {\n var elMirror = this.painter.addHover(el, style);\n this.refreshHover();\n return elMirror;\n }\n },\n\n /**\n * Add element from hover layer\n * @param {module:zrender/Element} el\n */\n removeHover: function (el) {\n if (this.painter.removeHover) {\n this.painter.removeHover(el);\n this.refreshHover();\n }\n },\n\n /**\n * Clear all hover elements in hover layer\n * @param {module:zrender/Element} el\n */\n clearHover: function () {\n if (this.painter.clearHover) {\n this.painter.clearHover();\n this.refreshHover();\n }\n },\n\n /**\n * Refresh hover in next frame\n */\n refreshHover: function () {\n this._needsRefreshHover = true;\n },\n\n /**\n * Refresh hover immediately\n */\n refreshHoverImmediately: function () {\n this._needsRefreshHover = false;\n this.painter.refreshHover && this.painter.refreshHover();\n },\n\n /**\n * Resize the canvas.\n * Should be invoked when container size is changed\n * @param {Object} [opts]\n * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined)\n * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined)\n */\n resize: function (opts) {\n opts = opts || {};\n this.painter.resize(opts.width, opts.height);\n this.handler.resize();\n },\n\n /**\n * Stop and clear all animation immediately\n */\n clearAnimation: function () {\n this.animation.clear();\n },\n\n /**\n * Get container width\n */\n getWidth: function () {\n return this.painter.getWidth();\n },\n\n /**\n * Get container height\n */\n getHeight: function () {\n return this.painter.getHeight();\n },\n\n /**\n * Export the canvas as Base64 URL\n * @param {string} type\n * @param {string} [backgroundColor='#fff']\n * @return {string} Base64 URL\n */\n // toDataURL: function(type, backgroundColor) {\n // return this.painter.getRenderedCanvas({\n // backgroundColor: backgroundColor\n // }).toDataURL(type);\n // },\n\n /**\n * Converting a path to image.\n * It has much better performance of drawing image rather than drawing a vector path.\n * @param {module:zrender/graphic/Path} e\n * @param {number} width\n * @param {number} height\n */\n pathToImage: function (e, dpr) {\n return this.painter.pathToImage(e, dpr);\n },\n\n /**\n * Set default cursor\n * @param {string} [cursorStyle='default'] 例如 crosshair\n */\n setCursorStyle: function (cursorStyle) {\n this.handler.setCursorStyle(cursorStyle);\n },\n\n /**\n * Find hovered element\n * @param {number} x\n * @param {number} y\n * @return {Object} {target, topTarget}\n */\n findHover: function (x, y) {\n return this.handler.findHover(x, y);\n },\n\n /**\n * Bind event\n *\n * @param {string} eventName Event name\n * @param {Function} eventHandler Handler function\n * @param {Object} [context] Context object\n */\n on: function (eventName, eventHandler, context) {\n this.handler.on(eventName, eventHandler, context);\n },\n\n /**\n * Unbind event\n * @param {string} eventName Event name\n * @param {Function} [eventHandler] Handler function\n */\n off: function (eventName, eventHandler) {\n this.handler.off(eventName, eventHandler);\n },\n\n /**\n * Trigger event manually\n *\n * @param {string} eventName Event name\n * @param {event=} event Event object\n */\n trigger: function (eventName, event) {\n this.handler.trigger(eventName, event);\n },\n\n /**\n * Clear all objects and the canvas.\n */\n clear: function () {\n this.storage.delRoot();\n this.painter.clear();\n },\n\n /**\n * Dispose self.\n */\n dispose: function () {\n this.animation.stop();\n this.clear();\n this.storage.dispose();\n this.painter.dispose();\n this.handler.dispose();\n this.animation = this.storage = this.painter = this.handler = null;\n delInstance(this.id);\n }\n};\nexports.version = version;\nexports.init = init;\nexports.dispose = dispose;\nexports.getInstance = getInstance;\nexports.registerPainter = registerPainter;","\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 env = require(\"zrender/lib/core/env\");\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 isObject = zrUtil.isObject;\nvar isArray = zrUtil.isArray;\n/**\n * Make the name displayable. But we should\n * make sure it is not duplicated with user\n * specified name, so use '\\0';\n */\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\n/**\n * If value is not array, then translate it to array.\n * @param {*} value\n * @return {Array} [value] or value\n */\n\nfunction normalizeToArray(value) {\n return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\n * Sync default option between normal and emphasis like `position` and `show`\n * In case some one will write code like\n * label: {\n * show: false,\n * position: 'outside',\n * fontSize: 18\n * },\n * emphasis: {\n * label: { show: true }\n * }\n * @param {Object} opt\n * @param {string} key\n * @param {Array.} subOpts\n */\n\n\nfunction defaultEmphasis(opt, key, subOpts) {\n // Caution: performance sensitive.\n if (opt) {\n opt[key] = opt[key] || {};\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal\n\n for (var i = 0, len = subOpts.length; i < len; i++) {\n var subOptName = subOpts[i];\n\n if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) {\n opt.emphasis[key][subOptName] = opt[key][subOptName];\n }\n }\n }\n}\n\nvar TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding']; // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([\n// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',\n// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\n// // FIXME: deprecated, check and remove it.\n// 'textStyle'\n// ]);\n\n/**\n * The method do not ensure performance.\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method retieves value from data.\n * @param {string|number|Date|Array|Object} dataItem\n * @return {number|string|Date|Array.}\n */\n\nfunction getDataItemValue(dataItem) {\n return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method determine if dataItem has extra option besides value\n * @param {string|number|Date|Array|Object} dataItem\n */\n\n\nfunction isDataItemOption(dataItem) {\n return isObject(dataItem) && !(dataItem instanceof Array); // // markLine data can be array\n // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));\n}\n/**\n * Mapping to exists for merge.\n *\n * @public\n * @param {Array.|Array.} exists\n * @param {Object|Array.} newCptOptions\n * @return {Array.} Result, like [{exist: ..., option: ...}, {}],\n * index of which is the same as exists.\n */\n\n\nfunction mappingToExists(exists, newCptOptions) {\n // Mapping by the order by original option (but not order of\n // new option) in merge mode. Because we should ensure\n // some specified index (like xAxisIndex) is consistent with\n // original option, which is easy to understand, espatially in\n // media query. And in most case, merge option is used to\n // update partial option but not be expected to change order.\n newCptOptions = (newCptOptions || []).slice();\n var result = zrUtil.map(exists || [], function (obj, index) {\n return {\n exist: obj\n };\n }); // Mapping by id or name if specified.\n\n each(newCptOptions, function (cptOption, index) {\n if (!isObject(cptOption)) {\n return;\n } // id has highest priority.\n\n\n for (var i = 0; i < result.length; i++) {\n if (!result[i].option // Consider name: two map to one.\n && cptOption.id != null && result[i].exist.id === cptOption.id + '') {\n result[i].option = cptOption;\n newCptOptions[index] = null;\n return;\n }\n }\n\n for (var i = 0; i < result.length; i++) {\n var exist = result[i].exist;\n\n if (!result[i].option // Consider name: two map to one.\n // Can not match when both ids exist but different.\n && (exist.id == null || cptOption.id == null) && cptOption.name != null && !isIdInner(cptOption) && !isIdInner(exist) && exist.name === cptOption.name + '') {\n result[i].option = cptOption;\n newCptOptions[index] = null;\n return;\n }\n }\n }); // Otherwise mapping by index.\n\n each(newCptOptions, function (cptOption, index) {\n if (!isObject(cptOption)) {\n return;\n }\n\n var i = 0;\n\n for (; i < result.length; i++) {\n var exist = result[i].exist;\n\n if (!result[i].option // Existing model that already has id should be able to\n // mapped to (because after mapping performed model may\n // be assigned with a id, whish should not affect next\n // mapping), except those has inner id.\n && !isIdInner(exist) // Caution:\n // Do not overwrite id. But name can be overwritten,\n // because axis use name as 'show label text'.\n // 'exist' always has id and name and we dont\n // need to check it.\n && cptOption.id == null) {\n result[i].option = cptOption;\n break;\n }\n }\n\n if (i >= result.length) {\n result.push({\n option: cptOption\n });\n }\n });\n return result;\n}\n/**\n * Make id and name for mapping result (result of mappingToExists)\n * into `keyInfo` field.\n *\n * @public\n * @param {Array.} Result, like [{exist: ..., option: ...}, {}],\n * which order is the same as exists.\n * @return {Array.} The input.\n */\n\n\nfunction makeIdAndName(mapResult) {\n // We use this id to hash component models and view instances\n // in echarts. id can be specified by user, or auto generated.\n // The id generation rule ensures new view instance are able\n // to mapped to old instance when setOption are called in\n // no-merge mode. So we generate model id by name and plus\n // type in view id.\n // name can be duplicated among components, which is convenient\n // to specify multi components (like series) by one name.\n // Ensure that each id is distinct.\n var idMap = zrUtil.createHashMap();\n each(mapResult, function (item, index) {\n var existCpt = item.exist;\n existCpt && idMap.set(existCpt.id, item);\n });\n each(mapResult, function (item, index) {\n var opt = item.option;\n zrUtil.assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\n opt && opt.id != null && idMap.set(opt.id, item);\n !item.keyInfo && (item.keyInfo = {});\n }); // Make name and id.\n\n each(mapResult, function (item, index) {\n var existCpt = item.exist;\n var opt = item.option;\n var keyInfo = item.keyInfo;\n\n if (!isObject(opt)) {\n return;\n } // name can be overwitten. Consider case: axis.name = '20km'.\n // But id generated by name will not be changed, which affect\n // only in that case: setOption with 'not merge mode' and view\n // instance will be recreated, which can be accepted.\n\n\n keyInfo.name = opt.name != null ? opt.name + '' : existCpt ? existCpt.name // Avoid diffferent series has the same name,\n // because name may be used like in color pallet.\n : DUMMY_COMPONENT_NAME_PREFIX + index;\n\n if (existCpt) {\n keyInfo.id = existCpt.id;\n } else if (opt.id != null) {\n keyInfo.id = opt.id + '';\n } else {\n // Consider this situatoin:\n // optionA: [{name: 'a'}, {name: 'a'}, {..}]\n // optionB [{..}, {name: 'a'}, {name: 'a'}]\n // Series with the same name between optionA and optionB\n // should be mapped.\n var idNum = 0;\n\n do {\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\n } while (idMap.get(keyInfo.id));\n }\n\n idMap.set(keyInfo.id, item);\n });\n}\n\nfunction isNameSpecified(componentModel) {\n var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0.\n\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\n}\n/**\n * @public\n * @param {Object} cptOption\n * @return {boolean}\n */\n\n\nfunction isIdInner(cptOption) {\n return isObject(cptOption) && cptOption.id && (cptOption.id + '').indexOf('\\0_ec_\\0') === 0;\n}\n/**\n * A helper for removing duplicate items between batchA and batchB,\n * and in themselves, and categorize by series.\n *\n * @param {Array.} batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @param {Array.} batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @return {Array., Array.>} result: [resultBatchA, resultBatchB]\n */\n\n\nfunction compressBatches(batchA, batchB) {\n var mapA = {};\n var mapB = {};\n makeMap(batchA || [], mapA);\n makeMap(batchB || [], mapB, mapA);\n return [mapToArray(mapA), mapToArray(mapB)];\n\n function makeMap(sourceBatch, map, otherMap) {\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\n var seriesId = sourceBatch[i].seriesId;\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\n var otherDataIndices = otherMap && otherMap[seriesId];\n\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\n var dataIndex = dataIndices[j];\n\n if (otherDataIndices && otherDataIndices[dataIndex]) {\n otherDataIndices[dataIndex] = null;\n } else {\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\n }\n }\n }\n }\n\n function mapToArray(map, isData) {\n var result = [];\n\n for (var i in map) {\n if (map.hasOwnProperty(i) && map[i] != null) {\n if (isData) {\n result.push(+i);\n } else {\n var dataIndices = mapToArray(map[i], true);\n dataIndices.length && result.push({\n seriesId: i,\n dataIndex: dataIndices\n });\n }\n }\n }\n\n return result;\n }\n}\n/**\n * @param {module:echarts/data/List} data\n * @param {Object} payload Contains dataIndex (means rawIndex) / dataIndexInside / name\n * each of which can be Array or primary type.\n * @return {number|Array.} dataIndex If not found, return undefined/null.\n */\n\n\nfunction queryDataIndex(data, payload) {\n if (payload.dataIndexInside != null) {\n return payload.dataIndexInside;\n } else if (payload.dataIndex != null) {\n return zrUtil.isArray(payload.dataIndex) ? zrUtil.map(payload.dataIndex, function (value) {\n return data.indexOfRawIndex(value);\n }) : data.indexOfRawIndex(payload.dataIndex);\n } else if (payload.name != null) {\n return zrUtil.isArray(payload.name) ? zrUtil.map(payload.name, function (value) {\n return data.indexOfName(value);\n }) : data.indexOfName(payload.name);\n }\n}\n/**\n * Enable property storage to any host object.\n * Notice: Serialization is not supported.\n *\n * For example:\n * var inner = zrUitl.makeInner();\n *\n * function some1(hostObj) {\n * inner(hostObj).someProperty = 1212;\n * ...\n * }\n * function some2() {\n * var fields = inner(this);\n * fields.someProperty1 = 1212;\n * fields.someProperty2 = 'xx';\n * ...\n * }\n *\n * @return {Function}\n */\n\n\nfunction makeInner() {\n // Consider different scope by es module import.\n var key = '__\\0ec_inner_' + innerUniqueIndex++ + '_' + Math.random().toFixed(5);\n return function (hostObj) {\n return hostObj[key] || (hostObj[key] = {});\n };\n}\n\nvar innerUniqueIndex = 0;\n/**\n * @param {module:echarts/model/Global} ecModel\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex, seriesId, seriesName,\n * geoIndex, geoId, geoName,\n * bmapIndex, bmapId, bmapName,\n * xAxisIndex, xAxisId, xAxisName,\n * yAxisIndex, yAxisId, yAxisName,\n * gridIndex, gridId, gridName,\n * ... (can be extended)\n * }\n * Each properties can be number|string|Array.|Array.\n * For example, a finder could be\n * {\n * seriesIndex: 3,\n * geoId: ['aa', 'cc'],\n * gridName: ['xx', 'rr']\n * }\n * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)\n * If nothing or null/undefined specified, return nothing.\n * @param {Object} [opt]\n * @param {string} [opt.defaultMainType]\n * @param {Array.} [opt.includeMainTypes]\n * @return {Object} result like:\n * {\n * seriesModels: [seriesModel1, seriesModel2],\n * seriesModel: seriesModel1, // The first model\n * geoModels: [geoModel1, geoModel2],\n * geoModel: geoModel1, // The first model\n * ...\n * }\n */\n\nfunction parseFinder(ecModel, finder, opt) {\n if (zrUtil.isString(finder)) {\n var obj = {};\n obj[finder + 'Index'] = 0;\n finder = obj;\n }\n\n var defaultMainType = opt && opt.defaultMainType;\n\n if (defaultMainType && !has(finder, defaultMainType + 'Index') && !has(finder, defaultMainType + 'Id') && !has(finder, defaultMainType + 'Name')) {\n finder[defaultMainType + 'Index'] = 0;\n }\n\n var result = {};\n each(finder, function (value, key) {\n var value = finder[key]; // Exclude 'dataIndex' and other illgal keys.\n\n if (key === 'dataIndex' || key === 'dataIndexInside') {\n result[key] = value;\n return;\n }\n\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\n var mainType = parsedKey[1];\n var queryType = (parsedKey[2] || '').toLowerCase();\n\n if (!mainType || !queryType || value == null || queryType === 'index' && value === 'none' || opt && opt.includeMainTypes && zrUtil.indexOf(opt.includeMainTypes, mainType) < 0) {\n return;\n }\n\n var queryParam = {\n mainType: mainType\n };\n\n if (queryType !== 'index' || value !== 'all') {\n queryParam[queryType] = value;\n }\n\n var models = ecModel.queryComponents(queryParam);\n result[mainType + 'Models'] = models;\n result[mainType + 'Model'] = models[0];\n });\n return result;\n}\n\nfunction has(obj, prop) {\n return obj && obj.hasOwnProperty(prop);\n}\n\nfunction setAttribute(dom, key, value) {\n dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\n\nfunction getAttribute(dom, key) {\n return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\n\nfunction getTooltipRenderMode(renderModeOption) {\n if (renderModeOption === 'auto') {\n // Using html when `document` exists, use richText otherwise\n return env.domSupported ? 'html' : 'richText';\n } else {\n return renderModeOption || 'html';\n }\n}\n/**\n * Group a list by key.\n *\n * @param {Array} array\n * @param {Function} getKey\n * param {*} Array item\n * return {string} key\n * @return {Object} Result\n * {Array}: keys,\n * {module:zrender/core/util/HashMap} buckets: {key -> Array}\n */\n\n\nfunction groupData(array, getKey) {\n var buckets = zrUtil.createHashMap();\n var keys = [];\n zrUtil.each(array, function (item) {\n var key = getKey(item);\n (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item);\n });\n return {\n keys: keys,\n buckets: buckets\n };\n}\n\nexports.normalizeToArray = normalizeToArray;\nexports.defaultEmphasis = defaultEmphasis;\nexports.TEXT_STYLE_OPTIONS = TEXT_STYLE_OPTIONS;\nexports.getDataItemValue = getDataItemValue;\nexports.isDataItemOption = isDataItemOption;\nexports.mappingToExists = mappingToExists;\nexports.makeIdAndName = makeIdAndName;\nexports.isNameSpecified = isNameSpecified;\nexports.isIdInner = isIdInner;\nexports.compressBatches = compressBatches;\nexports.queryDataIndex = queryDataIndex;\nexports.makeInner = makeInner;\nexports.parseFinder = parseFinder;\nexports.setAttribute = setAttribute;\nexports.getAttribute = getAttribute;\nexports.getTooltipRenderMode = getTooltipRenderMode;\nexports.groupData = groupData;","\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\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 TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\n/**\n * Notice, parseClassType('') should returns {main: '', sub: ''}\n * @public\n */\n\nfunction parseClassType(componentType) {\n var ret = {\n main: '',\n sub: ''\n };\n\n if (componentType) {\n componentType = componentType.split(TYPE_DELIMITER);\n ret.main = componentType[0] || '';\n ret.sub = componentType[1] || '';\n }\n\n return ret;\n}\n/**\n * @public\n */\n\n\nfunction checkClassType(componentType) {\n zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\n/**\n * @public\n */\n\n\nfunction enableClassExtend(RootClass, mandatoryMethods) {\n RootClass.$constructor = RootClass;\n\n RootClass.extend = function (proto) {\n var superClass = this;\n\n var ExtendedClass = function () {\n if (!proto.$constructor) {\n superClass.apply(this, arguments);\n } else {\n proto.$constructor.apply(this, arguments);\n }\n };\n\n zrUtil.extend(ExtendedClass.prototype, proto);\n ExtendedClass.extend = this.extend;\n ExtendedClass.superCall = superCall;\n ExtendedClass.superApply = superApply;\n zrUtil.inherits(ExtendedClass, this);\n ExtendedClass.superClass = superClass;\n return ExtendedClass;\n };\n}\n\nvar classBase = 0;\n/**\n * Can not use instanceof, consider different scope by\n * cross domain or es module import in ec extensions.\n * Mount a method \"isInstance()\" to Clz.\n */\n\nfunction enableClassCheck(Clz) {\n var classAttr = ['__\\0is_clz', classBase++, Math.random().toFixed(3)].join('_');\n Clz.prototype[classAttr] = true;\n\n Clz.isInstance = function (obj) {\n return !!(obj && obj[classAttr]);\n };\n} // superCall should have class info, which can not be fetch from 'this'.\n// Consider this case:\n// class A has method f,\n// class B inherits class A, overrides method f, f call superApply('f'),\n// class C inherits class B, do not overrides method f,\n// then when method of class C is called, dead loop occured.\n\n\nfunction superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n}\n\nfunction superApply(context, methodName, args) {\n return this.superClass.prototype[methodName].apply(context, args);\n}\n/**\n * @param {Object} entity\n * @param {Object} options\n * @param {boolean} [options.registerWhenExtend]\n * @public\n */\n\n\nfunction enableClassManagement(entity, options) {\n options = options || {};\n /**\n * Component model classes\n * key: componentType,\n * value:\n * componentClass, when componentType is 'xxx'\n * or Object., when componentType is 'xxx.yy'\n * @type {Object}\n */\n\n var storage = {};\n\n entity.registerClass = function (Clazz, componentType) {\n if (componentType) {\n checkClassType(componentType);\n componentType = parseClassType(componentType);\n\n if (!componentType.sub) {\n storage[componentType.main] = Clazz;\n } else if (componentType.sub !== IS_CONTAINER) {\n var container = makeContainer(componentType);\n container[componentType.sub] = Clazz;\n }\n }\n\n return Clazz;\n };\n\n entity.getClass = function (componentMainType, subType, throwWhenNotFound) {\n var Clazz = storage[componentMainType];\n\n if (Clazz && Clazz[IS_CONTAINER]) {\n Clazz = subType ? Clazz[subType] : null;\n }\n\n if (throwWhenNotFound && !Clazz) {\n throw new Error(!subType ? componentMainType + '.' + 'type should be specified.' : 'Component ' + componentMainType + '.' + (subType || '') + ' not exists. Load it first.');\n }\n\n return Clazz;\n };\n\n entity.getClassesByMainType = function (componentType) {\n componentType = parseClassType(componentType);\n var result = [];\n var obj = storage[componentType.main];\n\n if (obj && obj[IS_CONTAINER]) {\n zrUtil.each(obj, function (o, type) {\n type !== IS_CONTAINER && result.push(o);\n });\n } else {\n result.push(obj);\n }\n\n return result;\n };\n\n entity.hasClass = function (componentType) {\n // Just consider componentType.main.\n componentType = parseClassType(componentType);\n return !!storage[componentType.main];\n };\n /**\n * @return {Array.} Like ['aa', 'bb'], but can not be ['aa.xx']\n */\n\n\n entity.getAllClassMainTypes = function () {\n var types = [];\n zrUtil.each(storage, function (obj, type) {\n types.push(type);\n });\n return types;\n };\n /**\n * If a main type is container and has sub types\n * @param {string} mainType\n * @return {boolean}\n */\n\n\n entity.hasSubTypes = function (componentType) {\n componentType = parseClassType(componentType);\n var obj = storage[componentType.main];\n return obj && obj[IS_CONTAINER];\n };\n\n entity.parseClassType = parseClassType;\n\n function makeContainer(componentType) {\n var container = storage[componentType.main];\n\n if (!container || !container[IS_CONTAINER]) {\n container = storage[componentType.main] = {};\n container[IS_CONTAINER] = true;\n }\n\n return container;\n }\n\n if (options.registerWhenExtend) {\n var originalExtend = entity.extend;\n\n if (originalExtend) {\n entity.extend = function (proto) {\n var ExtendedClass = originalExtend.call(this, proto);\n return entity.registerClass(ExtendedClass, proto.type);\n };\n }\n }\n\n return entity;\n}\n/**\n * @param {string|Array.} properties\n */\n\n\nfunction setReadOnly(obj, properties) {// FIXME It seems broken in IE8 simulation of IE11\n // if (!zrUtil.isArray(properties)) {\n // properties = properties != null ? [properties] : [];\n // }\n // zrUtil.each(properties, function (prop) {\n // var value = obj[prop];\n // Object.defineProperty\n // && Object.defineProperty(obj, prop, {\n // value: value, writable: false\n // });\n // zrUtil.isArray(obj[prop])\n // && Object.freeze\n // && Object.freeze(obj[prop]);\n // });\n}\n\nexports.parseClassType = parseClassType;\nexports.enableClassExtend = enableClassExtend;\nexports.enableClassCheck = enableClassCheck;\nexports.enableClassManagement = enableClassManagement;\nexports.setReadOnly = setReadOnly;","\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\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// TODO Parse shadow style\n// TODO Only shallow path support\nfunction _default(properties) {\n // Normalize\n for (var i = 0; i < properties.length; i++) {\n if (!properties[i][1]) {\n properties[i][1] = properties[i][0];\n }\n }\n\n return function (model, excludes, includes) {\n var style = {};\n\n for (var i = 0; i < properties.length; i++) {\n var propName = properties[i][1];\n\n if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) {\n continue;\n }\n\n var val = model.getShallow(propName);\n\n if (val != null) {\n style[properties[i][0]] = val;\n }\n }\n\n return style;\n };\n}\n\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 makeStyleMapper = require(\"./makeStyleMapper\");\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 getLineStyle = makeStyleMapper([['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor']]);\nvar _default = {\n getLineStyle: function (excludes) {\n var style = getLineStyle(this, excludes); // Always set lineDash whether dashed, otherwise we can not\n // erase the previous style when assigning to el.style.\n\n style.lineDash = this.getLineDash(style.lineWidth);\n return style;\n },\n getLineDash: function (lineWidth) {\n if (lineWidth == null) {\n lineWidth = 1;\n }\n\n var lineType = this.get('type');\n var dotSize = Math.max(lineWidth, 2);\n var dashSize = lineWidth * 4;\n return lineType === 'solid' || lineType == null ? // Use `false` but not `null` for the solid line here, because `null` might be\n // ignored when assigning to `el.style`. e.g., when setting `lineStyle.type` as\n // `'dashed'` and `emphasis.lineStyle.type` as `'solid'` in graph series, the\n // `lineDash` gotten form the latter one is not able to erase that from the former\n // one if using `null` here according to the emhpsis strategy in `util/graphic.js`.\n false : lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize];\n }\n};\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 makeStyleMapper = require(\"./makeStyleMapper\");\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 getAreaStyle = makeStyleMapper([['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor']]);\nvar _default = {\n getAreaStyle: function (excludes, includes) {\n return getAreaStyle(this, excludes, includes);\n }\n};\nmodule.exports = _default;","var _vector = require(\"./vector\");\n\nvar v2Create = _vector.create;\nvar v2DistSquare = _vector.distSquare;\n\n/**\n * 曲线辅助模块\n * @module zrender/core/curve\n * @author pissang(https://www.github.com/pissang)\n */\nvar mathPow = Math.pow;\nvar mathSqrt = Math.sqrt;\nvar EPSILON = 1e-8;\nvar EPSILON_NUMERIC = 1e-4;\nvar THREE_SQRT = mathSqrt(3);\nvar ONE_THIRD = 1 / 3; // 临时变量\n\nvar _v0 = v2Create();\n\nvar _v1 = v2Create();\n\nvar _v2 = v2Create();\n\nfunction isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}\n\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\n/**\n * 计算三次贝塞尔值\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @return {number}\n */\n\n\nfunction cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);\n}\n/**\n * 计算三次贝塞尔导数值\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @return {number}\n */\n\n\nfunction cubicDerivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);\n}\n/**\n * 计算三次贝塞尔方程根,使用盛金公式\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} val\n * @param {Array.} roots\n * @return {number} 有效根数目\n */\n\n\nfunction cubicRootAt(p0, p1, p2, p3, val, roots) {\n // Evaluate roots of cubic functions\n var a = p3 + 3 * (p1 - p2) - p0;\n var b = 3 * (p2 - p1 * 2 + p0);\n var c = 3 * (p1 - p0);\n var d = p0 - val;\n var A = b * b - 3 * a * c;\n var B = b * c - 9 * a * d;\n var C = c * c - 3 * b * d;\n var n = 0;\n\n if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n } else {\n var t1 = -c / b; //t1, t2, t3, b is not zero\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n } else {\n var disc = B * B - 4 * A * C;\n\n if (isAroundZero(disc)) {\n var K = B / A;\n var t1 = -b / a + K; // t1, a is not zero\n\n var t2 = -K / 2; // t2, t3\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n } else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\n\n if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n } else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n } else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n } else {\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\n var theta = Math.acos(T) / 3;\n var ASqrt = mathSqrt(A);\n var tmp = Math.cos(theta);\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n\n return n;\n}\n/**\n * 计算三次贝塞尔方程极限值的位置\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {Array.} extrema\n * @return {number} 有效数目\n */\n\n\nfunction cubicExtrema(p0, p1, p2, p3, extrema) {\n var b = 6 * p2 - 12 * p1 + 6 * p0;\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\n var c = 3 * p1 - 3 * p0;\n var n = 0;\n\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n } else {\n var disc = b * b - 4 * a * c;\n\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\n } else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n\n return n;\n}\n/**\n * 细分三次贝塞尔曲线\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @param {Array.} out\n */\n\n\nfunction cubicSubdivide(p0, p1, p2, p3, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p23 = (p3 - p2) * t + p2;\n var p012 = (p12 - p01) * t + p01;\n var p123 = (p23 - p12) * t + p12;\n var p0123 = (p123 - p012) * t + p012; // Seg0\n\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123; // Seg1\n\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\n/**\n * 投射点到三次贝塞尔曲线上,返回投射距离。\n * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @param {number} x\n * @param {number} y\n * @param {Array.} [out] 投射点\n * @return {number}\n */\n\n\nfunction cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\n // http://pomax.github.io/bezierinfo/#projections\n var t;\n var interval = 0.005;\n var d = Infinity;\n var prev;\n var next;\n var d1;\n var d2;\n _v0[0] = x;\n _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值\n // PENDING\n\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\n d1 = v2DistSquare(_v0, _v1);\n\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n\n d = Infinity; // At most 32 iteration\n\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n\n prev = t - interval;\n next = t + interval; // t - interval\n\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n d1 = v2DistSquare(_v1, _v0);\n\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n } else {\n // t + interval\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n } else {\n interval *= 0.5;\n }\n }\n } // t\n\n\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n } // console.log(interval, i);\n\n\n return mathSqrt(d);\n}\n/**\n * 计算二次方贝塞尔值\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @return {number}\n */\n\n\nfunction quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\n/**\n * 计算二次方贝塞尔导数值\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @return {number}\n */\n\n\nfunction quadraticDerivativeAt(p0, p1, p2, t) {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\n/**\n * 计算二次方贝塞尔方程根\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @param {Array.} roots\n * @return {number} 有效根数目\n */\n\n\nfunction quadraticRootAt(p0, p1, p2, val, roots) {\n var a = p0 - 2 * p1 + p2;\n var b = 2 * (p1 - p0);\n var c = p0 - val;\n var n = 0;\n\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n } else {\n var disc = b * b - 4 * a * c;\n\n if (isAroundZero(disc)) {\n var t1 = -b / (2 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n } else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n\n return n;\n}\n/**\n * 计算二次贝塞尔方程极限值\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @return {number}\n */\n\n\nfunction quadraticExtremum(p0, p1, p2) {\n var divider = p0 + p2 - 2 * p1;\n\n if (divider === 0) {\n // p1 is center of p0 and p2\n return 0.5;\n } else {\n return (p0 - p1) / divider;\n }\n}\n/**\n * 细分二次贝塞尔曲线\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @param {Array.} out\n */\n\n\nfunction quadraticSubdivide(p0, p1, p2, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p012 = (p12 - p01) * t + p01; // Seg0\n\n out[0] = p0;\n out[1] = p01;\n out[2] = p012; // Seg1\n\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\n/**\n * 投射点到二次贝塞尔曲线上,返回投射距离。\n * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x\n * @param {number} y\n * @param {Array.} out 投射点\n * @return {number}\n */\n\n\nfunction quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n // http://pomax.github.io/bezierinfo/#projections\n var t;\n var interval = 0.005;\n var d = Infinity;\n _v0[0] = x;\n _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值\n // PENDING\n\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = quadraticAt(x0, x1, x2, _t);\n _v1[1] = quadraticAt(y0, y1, y2, _t);\n var d1 = v2DistSquare(_v0, _v1);\n\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n\n d = Infinity; // At most 32 iteration\n\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n\n var prev = t - interval;\n var next = t + interval; // t - interval\n\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n var d1 = v2DistSquare(_v1, _v0);\n\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n } else {\n // t + interval\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n var d2 = v2DistSquare(_v2, _v0);\n\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n } else {\n interval *= 0.5;\n }\n }\n } // t\n\n\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n } // console.log(interval, i);\n\n\n return mathSqrt(d);\n}\n\nexports.cubicAt = cubicAt;\nexports.cubicDerivativeAt = cubicDerivativeAt;\nexports.cubicRootAt = cubicRootAt;\nexports.cubicExtrema = cubicExtrema;\nexports.cubicSubdivide = cubicSubdivide;\nexports.cubicProjectPoint = cubicProjectPoint;\nexports.quadraticAt = quadraticAt;\nexports.quadraticDerivativeAt = quadraticDerivativeAt;\nexports.quadraticRootAt = quadraticRootAt;\nexports.quadraticExtremum = quadraticExtremum;\nexports.quadraticSubdivide = quadraticSubdivide;\nexports.quadraticProjectPoint = quadraticProjectPoint;","var vec2 = require(\"./vector\");\n\nvar curve = require(\"./curve\");\n\n/**\n * @author Yi Shen(https://github.com/pissang)\n */\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI2 = Math.PI * 2;\nvar start = vec2.create();\nvar end = vec2.create();\nvar extremity = vec2.create();\n/**\n * 从顶点数组中计算出最小包围盒,写入`min`和`max`中\n * @module zrender/core/bbox\n * @param {Array} points 顶点数组\n * @param {number} min\n * @param {number} max\n */\n\nfunction fromPoints(points, min, max) {\n if (points.length === 0) {\n return;\n }\n\n var p = points[0];\n var left = p[0];\n var right = p[0];\n var top = p[1];\n var bottom = p[1];\n var i;\n\n for (i = 1; i < points.length; i++) {\n p = points[i];\n left = mathMin(left, p[0]);\n right = mathMax(right, p[0]);\n top = mathMin(top, p[1]);\n bottom = mathMax(bottom, p[1]);\n }\n\n min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\n/**\n * @memberOf module:zrender/core/bbox\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {Array.} min\n * @param {Array.} max\n */\n\n\nfunction fromLine(x0, y0, x1, y1, min, max) {\n min[0] = mathMin(x0, x1);\n min[1] = mathMin(y0, y1);\n max[0] = mathMax(x0, x1);\n max[1] = mathMax(y0, y1);\n}\n\nvar xDim = [];\nvar yDim = [];\n/**\n * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中\n * @memberOf module:zrender/core/bbox\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @param {Array.} min\n * @param {Array.} max\n */\n\nfunction fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n var cubicExtrema = curve.cubicExtrema;\n var cubicAt = curve.cubicAt;\n var i;\n var n = cubicExtrema(x0, x1, x2, x3, xDim);\n min[0] = Infinity;\n min[1] = Infinity;\n max[0] = -Infinity;\n max[1] = -Infinity;\n\n for (i = 0; i < n; i++) {\n var x = cubicAt(x0, x1, x2, x3, xDim[i]);\n min[0] = mathMin(x, min[0]);\n max[0] = mathMax(x, max[0]);\n }\n\n n = cubicExtrema(y0, y1, y2, y3, yDim);\n\n for (i = 0; i < n; i++) {\n var y = cubicAt(y0, y1, y2, y3, yDim[i]);\n min[1] = mathMin(y, min[1]);\n max[1] = mathMax(y, max[1]);\n }\n\n min[0] = mathMin(x0, min[0]);\n max[0] = mathMax(x0, max[0]);\n min[0] = mathMin(x3, min[0]);\n max[0] = mathMax(x3, max[0]);\n min[1] = mathMin(y0, min[1]);\n max[1] = mathMax(y0, max[1]);\n min[1] = mathMin(y3, min[1]);\n max[1] = mathMax(y3, max[1]);\n}\n/**\n * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中\n * @memberOf module:zrender/core/bbox\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {Array.} min\n * @param {Array.} max\n */\n\n\nfunction fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n var quadraticExtremum = curve.quadraticExtremum;\n var quadraticAt = curve.quadraticAt; // Find extremities, where derivative in x dim or y dim is zero\n\n var tx = mathMax(mathMin(quadraticExtremum(x0, x1, x2), 1), 0);\n var ty = mathMax(mathMin(quadraticExtremum(y0, y1, y2), 1), 0);\n var x = quadraticAt(x0, x1, x2, tx);\n var y = quadraticAt(y0, y1, y2, ty);\n min[0] = mathMin(x0, x2, x);\n min[1] = mathMin(y0, y2, y);\n max[0] = mathMax(x0, x2, x);\n max[1] = mathMax(y0, y2, y);\n}\n/**\n * 从圆弧中计算出最小包围盒,写入`min`和`max`中\n * @method\n * @memberOf module:zrender/core/bbox\n * @param {number} x\n * @param {number} y\n * @param {number} rx\n * @param {number} ry\n * @param {number} startAngle\n * @param {number} endAngle\n * @param {number} anticlockwise\n * @param {Array.} min\n * @param {Array.} max\n */\n\n\nfunction fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max) {\n var vec2Min = vec2.min;\n var vec2Max = vec2.max;\n var diff = Math.abs(startAngle - endAngle);\n\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\n // Is a circle\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\n }\n\n start[0] = mathCos(startAngle) * rx + x;\n start[1] = mathSin(startAngle) * ry + y;\n end[0] = mathCos(endAngle) * rx + x;\n end[1] = mathSin(endAngle) * ry + y;\n vec2Min(min, start, end);\n vec2Max(max, start, end); // Thresh to [0, Math.PI * 2]\n\n startAngle = startAngle % PI2;\n\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n\n endAngle = endAngle % PI2;\n\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n } else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n\n if (anticlockwise) {\n var tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\n } // var number = 0;\n // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;\n\n\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\n if (angle > startAngle) {\n extremity[0] = mathCos(angle) * rx + x;\n extremity[1] = mathSin(angle) * ry + y;\n vec2Min(min, extremity, min);\n vec2Max(max, extremity, max);\n }\n }\n}\n\nexports.fromPoints = fromPoints;\nexports.fromLine = fromLine;\nexports.fromCubic = fromCubic;\nexports.fromQuadratic = fromQuadratic;\nexports.fromArc = fromArc;","var curve = require(\"./curve\");\n\nvar vec2 = require(\"./vector\");\n\nvar bbox = require(\"./bbox\");\n\nvar BoundingRect = require(\"./BoundingRect\");\n\nvar _config = require(\"../config\");\n\nvar dpr = _config.devicePixelRatio;\n\n/**\n * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中\n * 可以用于 isInsidePath 判断以及获取boundingRect\n *\n * @module zrender/core/PathProxy\n * @author Yi Shen (http://www.github.com/pissang)\n */\n// TODO getTotalLength, getPointAtLength\n\n/* global Float32Array */\nvar CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n // Rect\n R: 7\n}; // var CMD_MEM_SIZE = {\n// M: 3,\n// L: 3,\n// C: 7,\n// Q: 5,\n// A: 9,\n// R: 5,\n// Z: 1\n// };\n\nvar min = [];\nvar max = [];\nvar min2 = [];\nvar max2 = [];\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathCos = Math.cos;\nvar mathSin = Math.sin;\nvar mathSqrt = Math.sqrt;\nvar mathAbs = Math.abs;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\n/**\n * @alias module:zrender/core/PathProxy\n * @constructor\n */\n\nvar PathProxy = function (notSaveData) {\n this._saveData = !(notSaveData || false);\n\n if (this._saveData) {\n /**\n * Path data. Stored as flat array\n * @type {Array.}\n */\n this.data = [];\n }\n\n this._ctx = null;\n};\n/**\n * 快速计算Path包围盒(并不是最小包围盒)\n * @return {Object}\n */\n\n\nPathProxy.prototype = {\n constructor: PathProxy,\n _xi: 0,\n _yi: 0,\n _x0: 0,\n _y0: 0,\n // Unit x, Unit y. Provide for avoiding drawing that too short line segment\n _ux: 0,\n _uy: 0,\n _len: 0,\n _lineDash: null,\n _dashOffset: 0,\n _dashIdx: 0,\n _dashSum: 0,\n\n /**\n * @readOnly\n */\n setScale: function (sx, sy, segmentIgnoreThreshold) {\n // Compat. Previously there is no segmentIgnoreThreshold.\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n },\n getContext: function () {\n return this._ctx;\n },\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n * @return {module:zrender/core/PathProxy}\n */\n beginPath: function (ctx) {\n this._ctx = ctx;\n ctx && ctx.beginPath();\n ctx && (this.dpr = ctx.dpr); // Reset\n\n if (this._saveData) {\n this._len = 0;\n }\n\n if (this._lineDash) {\n this._lineDash = null;\n this._dashOffset = 0;\n }\n\n return this;\n },\n\n /**\n * @param {number} x\n * @param {number} y\n * @return {module:zrender/core/PathProxy}\n */\n moveTo: function (x, y) {\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y); // x0, y0, xi, yi 是记录在 _dashedXXXXTo 方法中使用\n // xi, yi 记录当前点, x0, y0 在 closePath 的时候回到起始点。\n // 有可能在 beginPath 之后直接调用 lineTo,这时候 x0, y0 需要\n // 在 lineTo 方法中记录,这里先不考虑这种情况,dashed line 也只在 IE10- 中不支持\n\n this._x0 = x;\n this._y0 = y;\n this._xi = x;\n this._yi = y;\n return this;\n },\n\n /**\n * @param {number} x\n * @param {number} y\n * @return {module:zrender/core/PathProxy}\n */\n lineTo: function (x, y) {\n var exceedUnit = mathAbs(x - this._xi) > this._ux || mathAbs(y - this._yi) > this._uy // Force draw the first segment\n || this._len < 5;\n this.addData(CMD.L, x, y);\n\n if (this._ctx && exceedUnit) {\n this._needsDash() ? this._dashedLineTo(x, y) : this._ctx.lineTo(x, y);\n }\n\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n }\n\n return this;\n },\n\n /**\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @return {module:zrender/core/PathProxy}\n */\n bezierCurveTo: function (x1, y1, x2, y2, x3, y3) {\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n\n if (this._ctx) {\n this._needsDash() ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3) : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n\n this._xi = x3;\n this._yi = y3;\n return this;\n },\n\n /**\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @return {module:zrender/core/PathProxy}\n */\n quadraticCurveTo: function (x1, y1, x2, y2) {\n this.addData(CMD.Q, x1, y1, x2, y2);\n\n if (this._ctx) {\n this._needsDash() ? this._dashedQuadraticTo(x1, y1, x2, y2) : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n\n this._xi = x2;\n this._yi = y2;\n return this;\n },\n\n /**\n * @param {number} cx\n * @param {number} cy\n * @param {number} r\n * @param {number} startAngle\n * @param {number} endAngle\n * @param {boolean} anticlockwise\n * @return {module:zrender/core/PathProxy}\n */\n arc: function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.addData(CMD.A, cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1);\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n this._xi = mathCos(endAngle) * r + cx;\n this._yi = mathSin(endAngle) * r + cy;\n return this;\n },\n // TODO\n arcTo: function (x1, y1, x2, y2, radius) {\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n\n return this;\n },\n // TODO\n rect: function (x, y, w, h) {\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n },\n\n /**\n * @return {module:zrender/core/PathProxy}\n */\n closePath: function () {\n this.addData(CMD.Z);\n var ctx = this._ctx;\n var x0 = this._x0;\n var y0 = this._y0;\n\n if (ctx) {\n this._needsDash() && this._dashedLineTo(x0, y0);\n ctx.closePath();\n }\n\n this._xi = x0;\n this._yi = y0;\n return this;\n },\n\n /**\n * Context 从外部传入,因为有可能是 rebuildPath 完之后再 fill。\n * stroke 同样\n * @param {CanvasRenderingContext2D} ctx\n * @return {module:zrender/core/PathProxy}\n */\n fill: function (ctx) {\n ctx && ctx.fill();\n this.toStatic();\n },\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n * @return {module:zrender/core/PathProxy}\n */\n stroke: function (ctx) {\n ctx && ctx.stroke();\n this.toStatic();\n },\n\n /**\n * 必须在其它绘制命令前调用\n * Must be invoked before all other path drawing methods\n * @return {module:zrender/core/PathProxy}\n */\n setLineDash: function (lineDash) {\n if (lineDash instanceof Array) {\n this._lineDash = lineDash;\n this._dashIdx = 0;\n var lineDashSum = 0;\n\n for (var i = 0; i < lineDash.length; i++) {\n lineDashSum += lineDash[i];\n }\n\n this._dashSum = lineDashSum;\n }\n\n return this;\n },\n\n /**\n * 必须在其它绘制命令前调用\n * Must be invoked before all other path drawing methods\n * @return {module:zrender/core/PathProxy}\n */\n setLineDashOffset: function (offset) {\n this._dashOffset = offset;\n return this;\n },\n\n /**\n *\n * @return {boolean}\n */\n len: function () {\n return this._len;\n },\n\n /**\n * 直接设置 Path 数据\n */\n setData: function (data) {\n var len = data.length;\n\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n\n for (var i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n\n this._len = len;\n },\n\n /**\n * 添加子路径\n * @param {module:zrender/core/PathProxy|Array.} path\n */\n appendPath: function (path) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n\n var len = path.length;\n var appendSize = 0;\n var offset = this._len;\n\n for (var i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n\n if (hasTypedArray && this.data instanceof Float32Array) {\n this.data = new Float32Array(offset + appendSize);\n }\n\n for (var i = 0; i < len; i++) {\n var appendPathData = path[i].data;\n\n for (var k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n\n this._len = offset;\n },\n\n /**\n * 填充 Path 数据。\n * 尽量复用而不申明新的数组。大部分图形重绘的指令数据长度都是不变的。\n */\n addData: function (cmd) {\n if (!this._saveData) {\n return;\n }\n\n var data = this.data;\n\n if (this._len + arguments.length > data.length) {\n // 因为之前的数组已经转换成静态的 Float32Array\n // 所以不够用时需要扩展一个新的动态数组\n this._expandData();\n\n data = this.data;\n }\n\n for (var i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n\n this._prevCmd = cmd;\n },\n _expandData: function () {\n // Only if data is Float32Array\n if (!(this.data instanceof Array)) {\n var newData = [];\n\n for (var i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n\n this.data = newData;\n }\n },\n\n /**\n * If needs js implemented dashed line\n * @return {boolean}\n * @private\n */\n _needsDash: function () {\n return this._lineDash;\n },\n _dashedLineTo: function (x1, y1) {\n var dashSum = this._dashSum;\n var offset = this._dashOffset;\n var lineDash = this._lineDash;\n var ctx = this._ctx;\n var x0 = this._xi;\n var y0 = this._yi;\n var dx = x1 - x0;\n var dy = y1 - y0;\n var dist = mathSqrt(dx * dx + dy * dy);\n var x = x0;\n var y = y0;\n var dash;\n var nDash = lineDash.length;\n var idx;\n dx /= dist;\n dy /= dist;\n\n if (offset < 0) {\n // Convert to positive offset\n offset = dashSum + offset;\n }\n\n offset %= dashSum;\n x -= offset * dx;\n y -= offset * dy;\n\n while (dx > 0 && x <= x1 || dx < 0 && x >= x1 || dx === 0 && (dy > 0 && y <= y1 || dy < 0 && y >= y1)) {\n idx = this._dashIdx;\n dash = lineDash[idx];\n x += dx * dash;\n y += dy * dash;\n this._dashIdx = (idx + 1) % nDash; // Skip positive offset\n\n if (dx > 0 && x < x0 || dx < 0 && x > x0 || dy > 0 && y < y0 || dy < 0 && y > y0) {\n continue;\n }\n\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin(x, x1) : mathMax(x, x1), dy >= 0 ? mathMin(y, y1) : mathMax(y, y1));\n } // Offset for next lineTo\n\n\n dx = x - x1;\n dy = y - y1;\n this._dashOffset = -mathSqrt(dx * dx + dy * dy);\n },\n // Not accurate dashed line to\n _dashedBezierTo: function (x1, y1, x2, y2, x3, y3) {\n var dashSum = this._dashSum;\n var offset = this._dashOffset;\n var lineDash = this._lineDash;\n var ctx = this._ctx;\n var x0 = this._xi;\n var y0 = this._yi;\n var t;\n var dx;\n var dy;\n var cubicAt = curve.cubicAt;\n var bezierLen = 0;\n var idx = this._dashIdx;\n var nDash = lineDash.length;\n var x;\n var y;\n var tmpLen = 0;\n\n if (offset < 0) {\n // Convert to positive offset\n offset = dashSum + offset;\n }\n\n offset %= dashSum; // Bezier approx length\n\n for (t = 0; t < 1; t += 0.1) {\n dx = cubicAt(x0, x1, x2, x3, t + 0.1) - cubicAt(x0, x1, x2, x3, t);\n dy = cubicAt(y0, y1, y2, y3, t + 0.1) - cubicAt(y0, y1, y2, y3, t);\n bezierLen += mathSqrt(dx * dx + dy * dy);\n } // Find idx after add offset\n\n\n for (; idx < nDash; idx++) {\n tmpLen += lineDash[idx];\n\n if (tmpLen > offset) {\n break;\n }\n }\n\n t = (tmpLen - offset) / bezierLen;\n\n while (t <= 1) {\n x = cubicAt(x0, x1, x2, x3, t);\n y = cubicAt(y0, y1, y2, y3, t); // Use line to approximate dashed bezier\n // Bad result if dash is long\n\n idx % 2 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);\n t += lineDash[idx] / bezierLen;\n idx = (idx + 1) % nDash;\n } // Finish the last segment and calculate the new offset\n\n\n idx % 2 !== 0 && ctx.lineTo(x3, y3);\n dx = x3 - x;\n dy = y3 - y;\n this._dashOffset = -mathSqrt(dx * dx + dy * dy);\n },\n _dashedQuadraticTo: function (x1, y1, x2, y2) {\n // Convert quadratic to cubic using degree elevation\n var x3 = x2;\n var y3 = y2;\n x2 = (x2 + 2 * x1) / 3;\n y2 = (y2 + 2 * y1) / 3;\n x1 = (this._xi + 2 * x1) / 3;\n y1 = (this._yi + 2 * y1) / 3;\n\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\n },\n\n /**\n * 转成静态的 Float32Array 减少堆内存占用\n * Convert dynamic array to static Float32Array\n */\n toStatic: function () {\n var data = this.data;\n\n if (data instanceof Array) {\n data.length = this._len;\n\n if (hasTypedArray) {\n this.data = new Float32Array(data);\n }\n }\n },\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function () {\n min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;\n max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\n var data = this.data;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n\n if (i === 1) {\n // 如果第一个命令是 L, C, Q\n // 则 previous point 同绘制命令的第一个 point\n //\n // 第一个命令为 Arc 的情况下会在后面特殊处理\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点\n // 在 closePath 的时候使用\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n\n case CMD.L:\n bbox.fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n bbox.fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n bbox.fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.A:\n // TODO Arc 判断的开销比较大\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var endAngle = data[i++] + startAngle; // TODO Arc 旋转\n\n i += 1;\n var anticlockwise = 1 - data[i++];\n\n if (i === 1) {\n // 直接使用 arc 命令\n // 第一个命令起点还未定义\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n\n bbox.fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++]; // Use fromLine\n\n bbox.fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n } // Union\n\n\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n },\n\n /**\n * Rebuild path from current data\n * Rebuild path will not consider javascript implemented line dash.\n * @param {CanvasRenderingContext2D} ctx\n */\n rebuildPath: function (ctx) {\n var d = this.data;\n var x0;\n var y0;\n var xi;\n var yi;\n var x;\n var y;\n var ux = this._ux;\n var uy = this._uy;\n var len = this._len;\n\n for (var i = 0; i < len;) {\n var cmd = d[i++];\n\n if (i === 1) {\n // 如果第一个命令是 L, C, Q\n // 则 previous point 同绘制命令的第一个 point\n //\n // 第一个命令为 Arc 的情况下会在后面特殊处理\n xi = d[i];\n yi = d[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n x0 = xi = d[i++];\n y0 = yi = d[i++];\n ctx.moveTo(xi, yi);\n break;\n\n case CMD.L:\n x = d[i++];\n y = d[i++]; // Not draw too small seg between\n\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n }\n\n break;\n\n case CMD.C:\n ctx.bezierCurveTo(d[i++], d[i++], d[i++], d[i++], d[i++], d[i++]);\n xi = d[i - 2];\n yi = d[i - 1];\n break;\n\n case CMD.Q:\n ctx.quadraticCurveTo(d[i++], d[i++], d[i++], d[i++]);\n xi = d[i - 2];\n yi = d[i - 1];\n break;\n\n case CMD.A:\n var cx = d[i++];\n var cy = d[i++];\n var rx = d[i++];\n var ry = d[i++];\n var theta = d[i++];\n var dTheta = d[i++];\n var psi = d[i++];\n var fs = d[i++];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n var isEllipse = Math.abs(rx - ry) > 1e-3;\n var endAngle = theta + dTheta;\n\n if (isEllipse) {\n ctx.translate(cx, cy);\n ctx.rotate(psi);\n ctx.scale(scaleX, scaleY);\n ctx.arc(0, 0, r, theta, endAngle, 1 - fs);\n ctx.scale(1 / scaleX, 1 / scaleY);\n ctx.rotate(-psi);\n ctx.translate(-cx, -cy);\n } else {\n ctx.arc(cx, cy, r, theta, endAngle, 1 - fs);\n }\n\n if (i === 1) {\n // 直接使用 arc 命令\n // 第一个命令起点还未定义\n x0 = mathCos(theta) * rx + cx;\n y0 = mathSin(theta) * ry + cy;\n }\n\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n ctx.rect(d[i++], d[i++], d[i++], d[i++]);\n break;\n\n case CMD.Z:\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n }\n};\nPathProxy.CMD = CMD;\nvar _default = PathProxy;\nmodule.exports = _default;","/**\n * 线段包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth;\n var _a = 0;\n var _b = x0; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) {\n return false;\n }\n\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n } else {\n return Math.abs(x - x0) <= _l / 2;\n }\n\n var tmp = _a * x - y + _b;\n\n var _s = tmp * tmp / (_a * _a + 1);\n\n return _s <= _l / 2 * _l / 2;\n}\n\nexports.containStroke = containStroke;","var curve = require(\"../core/curve\");\n\n/**\n * 三次贝塞尔曲线描边包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) {\n return false;\n }\n\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n\nexports.containStroke = containStroke;","var _curve = require(\"../core/curve\");\n\nvar quadraticProjectPoint = _curve.quadraticProjectPoint;\n\n/**\n * 二次贝塞尔曲线描边包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) {\n return false;\n }\n\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n\nexports.containStroke = containStroke;","var PI2 = Math.PI * 2;\n\nfunction normalizeRadian(angle) {\n angle %= PI2;\n\n if (angle < 0) {\n angle += PI2;\n }\n\n return angle;\n}\n\nexports.normalizeRadian = normalizeRadian;","var _util = require(\"./util\");\n\nvar normalizeRadian = _util.normalizeRadian;\nvar PI2 = Math.PI * 2;\n/**\n * 圆弧描边包含判断\n * @param {number} cx\n * @param {number} cy\n * @param {number} r\n * @param {number} startAngle\n * @param {number} endAngle\n * @param {boolean} anticlockwise\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {Boolean}\n */\n\nfunction containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n\n if (d - _l > r || d + _l < r) {\n return false;\n }\n\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n return true;\n }\n\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n } else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n\n var angle = Math.atan2(y, x);\n\n if (angle < 0) {\n angle += PI2;\n }\n\n return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;\n}\n\nexports.containStroke = containStroke;","function windingLine(x0, y0, x1, y1, x, y) {\n if (y > y0 && y > y1 || y < y0 && y < y1) {\n return 0;\n } // Ignore horizontal line\n\n\n if (y1 === y0) {\n return 0;\n }\n\n var dir = y1 < y0 ? 1 : -1;\n var t = (y - y0) / (y1 - y0); // Avoid winding error when intersection point is the connect point of two line of polygon\n\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n\n var x_ = t * (x1 - x0) + x0; // If (x, y) on the line, considered as \"contain\".\n\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n\nmodule.exports = windingLine;","var PathProxy = require(\"../core/PathProxy\");\n\nvar line = require(\"./line\");\n\nvar cubic = require(\"./cubic\");\n\nvar quadratic = require(\"./quadratic\");\n\nvar arc = require(\"./arc\");\n\nvar _util = require(\"./util\");\n\nvar normalizeRadian = _util.normalizeRadian;\n\nvar curve = require(\"../core/curve\");\n\nvar windingLine = require(\"./windingLine\");\n\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\n\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n} // 临时数组\n\n\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\n\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\n\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n // Quick reject\n if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {\n return 0;\n }\n\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n\n if (nRoots === 0) {\n return 0;\n } else {\n var w = 0;\n var nExtrema = -1;\n var y0_;\n var y1_;\n\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i]; // Avoid winding error when intersection point is the connect point of two line of polygon\n\n var unit = t === 0 || t === 1 ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n\n if (x_ < x) {\n // Quick reject\n continue;\n }\n\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n\n if (nExtrema === 2) {\n // 分成三段单调函数\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n } else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n } else {\n w += y3 < y1_ ? unit : -unit;\n }\n } else {\n // 分成两段单调函数\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n } else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n\n return w;\n }\n}\n\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n // Quick reject\n if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {\n return 0;\n }\n\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n\n if (nRoots === 0) {\n return 0;\n } else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n\n for (var i = 0; i < nRoots; i++) {\n // Remove one endpoint.\n var unit = roots[i] === 0 || roots[i] === 1 ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n\n if (x_ < x) {\n // Quick reject\n continue;\n }\n\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n } else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n\n return w;\n } else {\n // Remove one endpoint.\n var unit = roots[0] === 0 || roots[0] === 1 ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n\n if (x_ < x) {\n // Quick reject\n return 0;\n }\n\n return y2 < y0 ? unit : -unit;\n }\n }\n} // TODO\n// Arc 旋转\n\n\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n\n if (y > r || y < -r) {\n return 0;\n }\n\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var diff = Math.abs(startAngle - endAngle);\n\n if (diff < 1e-4) {\n return 0;\n }\n\n if (diff % PI2 < 1e-4) {\n // Is a circle\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n } else {\n return 0;\n }\n }\n\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n } else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n\n var w = 0;\n\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n\n if (angle < 0) {\n angle = PI2 + angle;\n }\n\n if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n\n w += dir;\n }\n }\n }\n\n return w;\n}\n\nfunction containPath(data, lineWidth, isStroke, x, y) {\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++]; // Begin a new subpath\n\n if (cmd === CMD.M && i > 1) {\n // Close previous subpath\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n } // 如果被任何一个 subpath 包含\n // if (w !== 0) {\n // return true;\n // }\n\n }\n\n if (i === 1) {\n // 如果第一个命令是 L, C, Q\n // 则 previous point 同绘制命令的第一个 point\n //\n // 第一个命令为 Arc 的情况下会在后面特殊处理\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点\n // 在 closePath 的时候使用\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n\n case CMD.L:\n if (isStroke) {\n if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n } else {\n // NOTE 在第一个命令为 L, C, Q 的时候会计算出 NaN\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n if (isStroke) {\n if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n } else {\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n if (isStroke) {\n if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n } else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.A:\n // TODO Arc 判断的开销比较大\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++]; // TODO Arc 旋转\n\n i += 1;\n var anticlockwise = 1 - data[i++];\n var x1 = Math.cos(theta) * rx + cx;\n var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令\n\n if (i > 1) {\n w += windingLine(xi, yi, x1, y1, x, y);\n } else {\n // 第一个命令起点还未定义\n x0 = x1;\n y0 = y1;\n } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放\n\n\n var _x = (x - cx) * ry / rx + cx;\n\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n } else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n var x1 = x0 + width;\n var y1 = y0 + height;\n\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y) || line.containStroke(x1, y0, x1, y1, lineWidth, x, y) || line.containStroke(x1, y1, x0, y1, lineWidth, x, y) || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n } else {\n // FIXME Clockwise ?\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n\n break;\n\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n } else {\n // Close a subpath\n w += windingLine(xi, yi, x0, y0, x, y); // 如果被任何一个 subpath 包含\n // FIXME subpaths may overlap\n // if (w !== 0) {\n // return true;\n // }\n }\n\n xi = x0;\n yi = y0;\n break;\n }\n }\n\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n\n return w !== 0;\n}\n\nfunction contain(pathData, x, y) {\n return containPath(pathData, 0, false, x, y);\n}\n\nfunction containStroke(pathData, lineWidth, x, y) {\n return containPath(pathData, lineWidth, true, x, y);\n}\n\nexports.contain = contain;\nexports.containStroke = containStroke;","var Displayable = require(\"./Displayable\");\n\nvar zrUtil = require(\"../core/util\");\n\nvar PathProxy = require(\"../core/PathProxy\");\n\nvar pathContain = require(\"../contain/path\");\n\nvar Pattern = require(\"./Pattern\");\n\nvar getCanvasPattern = Pattern.prototype.getCanvasPattern;\nvar abs = Math.abs;\nvar pathProxyForDraw = new PathProxy(true);\n/**\n * @alias module:zrender/graphic/Path\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\n\nfunction Path(opts) {\n Displayable.call(this, opts);\n /**\n * @type {module:zrender/core/PathProxy}\n * @readOnly\n */\n\n this.path = null;\n}\n\nPath.prototype = {\n constructor: Path,\n type: 'path',\n __dirtyPath: true,\n strokeContainThreshold: 5,\n // This item default to be false. But in map series in echarts,\n // in order to improve performance, it should be set to true,\n // so the shorty segment won't draw.\n segmentIgnoreThreshold: 0,\n\n /**\n * See `module:zrender/src/graphic/helper/subPixelOptimize`.\n * @type {boolean}\n */\n subPixelOptimize: false,\n brush: function (ctx, prevEl) {\n var style = this.style;\n var path = this.path || pathProxyForDraw;\n var hasStroke = style.hasStroke();\n var hasFill = style.hasFill();\n var fill = style.fill;\n var stroke = style.stroke;\n var hasFillGradient = hasFill && !!fill.colorStops;\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\n var hasFillPattern = hasFill && !!fill.image;\n var hasStrokePattern = hasStroke && !!stroke.image;\n style.bind(ctx, this, prevEl);\n this.setTransform(ctx);\n\n if (this.__dirty) {\n var rect; // Update gradient because bounding rect may changed\n\n if (hasFillGradient) {\n rect = rect || this.getBoundingRect();\n this._fillGradient = style.getGradient(ctx, fill, rect);\n }\n\n if (hasStrokeGradient) {\n rect = rect || this.getBoundingRect();\n this._strokeGradient = style.getGradient(ctx, stroke, rect);\n }\n } // Use the gradient or pattern\n\n\n if (hasFillGradient) {\n // PENDING If may have affect the state\n ctx.fillStyle = this._fillGradient;\n } else if (hasFillPattern) {\n ctx.fillStyle = getCanvasPattern.call(fill, ctx);\n }\n\n if (hasStrokeGradient) {\n ctx.strokeStyle = this._strokeGradient;\n } else if (hasStrokePattern) {\n ctx.strokeStyle = getCanvasPattern.call(stroke, ctx);\n }\n\n var lineDash = style.lineDash;\n var lineDashOffset = style.lineDashOffset;\n var ctxLineDash = !!ctx.setLineDash; // Update path sx, sy\n\n var scale = this.getGlobalScale();\n path.setScale(scale[0], scale[1], this.segmentIgnoreThreshold); // Proxy context\n // Rebuild path in following 2 cases\n // 1. Path is dirty\n // 2. Path needs javascript implemented lineDash stroking.\n // In this case, lineDash information will not be saved in PathProxy\n\n if (this.__dirtyPath || lineDash && !ctxLineDash && hasStroke) {\n path.beginPath(ctx); // Setting line dash before build path\n\n if (lineDash && !ctxLineDash) {\n path.setLineDash(lineDash);\n path.setLineDashOffset(lineDashOffset);\n }\n\n this.buildPath(path, this.shape, false); // Clear path dirty flag\n\n if (this.path) {\n this.__dirtyPath = false;\n }\n } else {\n // Replay path building\n ctx.beginPath();\n this.path.rebuildPath(ctx);\n }\n\n if (hasFill) {\n if (style.fillOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n path.fill(ctx);\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n path.fill(ctx);\n }\n }\n\n if (lineDash && ctxLineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n\n if (hasStroke) {\n if (style.strokeOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n path.stroke(ctx);\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n path.stroke(ctx);\n }\n }\n\n if (lineDash && ctxLineDash) {\n // PENDING\n // Remove lineDash\n ctx.setLineDash([]);\n } // Draw rect text\n\n\n if (style.text != null) {\n // Only restore transform when needs draw text.\n this.restoreTransform(ctx);\n this.drawRectText(ctx, this.getBoundingRect());\n }\n },\n // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath\n // Like in circle\n buildPath: function (ctx, shapeCfg, inBundle) {},\n createPathProxy: function () {\n this.path = new PathProxy();\n },\n getBoundingRect: function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n\n if (needsUpdateRect) {\n var path = this.path;\n\n if (!path) {\n // Create path on demand.\n path = this.path = new PathProxy();\n }\n\n if (this.__dirtyPath) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n }\n\n rect = path.getBoundingRect();\n }\n\n this._rect = rect;\n\n if (style.hasStroke()) {\n // Needs update rect with stroke lineWidth when\n // 1. Element changes scale or lineWidth\n // 2. Shape is changed\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\n\n if (this.__dirty || needsUpdateRect) {\n rectWithStroke.copy(rect); // FIXME Must after updateTransform\n\n var w = style.lineWidth; // PENDING, Min line width is needed when line is horizontal or vertical\n\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Only add extra hover lineWidth when there are no fill\n\n if (!style.hasFill()) {\n w = Math.max(w, this.strokeContainThreshold || 4);\n } // Consider line width\n // Line scale can't be 0;\n\n\n if (lineScale > 1e-10) {\n rectWithStroke.width += w / lineScale;\n rectWithStroke.height += w / lineScale;\n rectWithStroke.x -= w / lineScale / 2;\n rectWithStroke.y -= w / lineScale / 2;\n }\n } // Return rect with stroke\n\n\n return rectWithStroke;\n }\n\n return rect;\n },\n contain: function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n var style = this.style;\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n var pathData = this.path.data;\n\n if (style.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Line scale can't be 0;\n\n if (lineScale > 1e-10) {\n // Only add extra hover lineWidth when there are no fill\n if (!style.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n\n if (pathContain.containStroke(pathData, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n\n if (style.hasFill()) {\n return pathContain.contain(pathData, x, y);\n }\n }\n\n return false;\n },\n\n /**\n * @param {boolean} dirtyPath\n */\n dirty: function (dirtyPath) {\n if (dirtyPath == null) {\n dirtyPath = true;\n } // Only mark dirty, not mark clean\n\n\n if (dirtyPath) {\n this.__dirtyPath = dirtyPath;\n this._rect = null;\n }\n\n this.__dirty = this.__dirtyText = true;\n this.__zr && this.__zr.refresh(); // Used as a clipping path\n\n if (this.__clipTarget) {\n this.__clipTarget.dirty();\n }\n },\n\n /**\n * Alias for animate('shape')\n * @param {boolean} loop\n */\n animateShape: function (loop) {\n return this.animate('shape', loop);\n },\n // Overwrite attrKV\n attrKV: function (key, value) {\n // FIXME\n if (key === 'shape') {\n this.setShape(value);\n this.__dirtyPath = true;\n this._rect = null;\n } else {\n Displayable.prototype.attrKV.call(this, key, value);\n }\n },\n\n /**\n * @param {Object|string} key\n * @param {*} value\n */\n setShape: function (key, value) {\n var shape = this.shape; // Path from string may not have shape\n\n if (shape) {\n if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n shape[name] = key[name];\n }\n }\n } else {\n shape[key] = value;\n }\n\n this.dirty(true);\n }\n\n return this;\n },\n getLineScale: function () {\n var m = this.transform; // Get the line scale.\n // Determinant of `m` means how much the area is enlarged by the\n // transformation. So its square root can be used as a scale factor\n // for width.\n\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10 ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1])) : 1;\n }\n};\n/**\n * 扩展一个 Path element, 比如星形,圆等。\n * Extend a path element\n * @param {Object} props\n * @param {string} props.type Path type\n * @param {Function} props.init Initialize\n * @param {Function} props.buildPath Overwrite buildPath method\n * @param {Object} [props.style] Extended default style config\n * @param {Object} [props.shape] Extended default shape config\n */\n\nPath.extend = function (defaults) {\n var Sub = function (opts) {\n Path.call(this, opts);\n\n if (defaults.style) {\n // Extend default style\n this.style.extendFrom(defaults.style, false);\n } // Extend default shape\n\n\n var defaultShape = defaults.shape;\n\n if (defaultShape) {\n this.shape = this.shape || {};\n var thisShape = this.shape;\n\n for (var name in defaultShape) {\n if (!thisShape.hasOwnProperty(name) && defaultShape.hasOwnProperty(name)) {\n thisShape[name] = defaultShape[name];\n }\n }\n }\n\n defaults.init && defaults.init.call(this, opts);\n };\n\n zrUtil.inherits(Sub, Path); // FIXME 不能 extend position, rotation 等引用对象\n\n for (var name in defaults) {\n // Extending prototype values and methods\n if (name !== 'style' && name !== 'shape') {\n Sub.prototype[name] = defaults[name];\n }\n }\n\n return Sub;\n};\n\nzrUtil.inherits(Path, Displayable);\nvar _default = Path;\nmodule.exports = _default;","var PathProxy = require(\"../core/PathProxy\");\n\nvar _vector = require(\"../core/vector\");\n\nvar v2ApplyTransform = _vector.applyTransform;\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\n\nfunction _default(path, m) {\n var data = path.data;\n var cmd;\n var nPoint;\n var i;\n var j;\n var k;\n var p;\n var M = CMD.M;\n var C = CMD.C;\n var L = CMD.L;\n var R = CMD.R;\n var A = CMD.A;\n var Q = CMD.Q;\n\n for (i = 0, j = 0; i < data.length;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n\n case L:\n nPoint = 1;\n break;\n\n case C:\n nPoint = 3;\n break;\n\n case Q:\n nPoint = 2;\n break;\n\n case A:\n var x = m[4];\n var y = m[5];\n var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);\n var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);\n var angle = mathAtan2(-m[1] / sy, m[0] / sx); // cx\n\n data[i] *= sx;\n data[i++] += x; // cy\n\n data[i] *= sy;\n data[i++] += y; // Scale rx and ry\n // FIXME Assume psi is 0 here\n\n data[i++] *= sx;\n data[i++] *= sy; // Start angle\n\n data[i++] += angle; // end angle\n\n data[i++] += angle; // FIXME psi\n\n i += 2;\n j = i;\n break;\n\n case R:\n // x0, y0\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1]; // x1, y1\n\n p[0] += data[i++];\n p[1] += data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n }\n\n for (k = 0; k < nPoint; k++) {\n var p = points[k];\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m); // Write back\n\n data[j++] = p[0];\n data[j++] = p[1];\n }\n }\n}\n\nmodule.exports = _default;","var Path = require(\"../graphic/Path\");\n\nvar PathProxy = require(\"../core/PathProxy\");\n\nvar transformPath = require(\"./transformPath\");\n\n// command chars\n// var cc = [\n// 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z',\n// 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A'\n// ];\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\n\nvar vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n};\n\nvar vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n};\n\nvar vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n};\n\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n var psi = psiDeg * (PI / 180.0);\n var xp = mathCos(psi) * (x1 - x2) / 2.0 + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0 + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);\n\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n\n var f = (fa === fs ? -1 : 1) * mathSqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))) || 0;\n var cxp = f * rx * yp / ry;\n var cyp = f * -ry * xp / rx;\n var cx = (x1 + x2) / 2.0 + mathCos(psi) * cxp - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + mathSin(psi) * cxp + mathCos(psi) * cyp;\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * PI;\n }\n\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * PI;\n }\n\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\n\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; // Consider case:\n// (1) delimiter can be comma or space, where continuous commas\n// or spaces should be seen as one comma.\n// (2) value can be like:\n// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983',\n// 'l-.5E1,54', '121-23-44-11' (no delimiter)\n\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g; // var valueSplitReg = /[\\s,]+/;\n\nfunction createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem\n\n\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n opts = opts || {};\n\n opts.buildPath = function (path) {\n if (path.setData) {\n path.setData(pathProxy.data); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n } else {\n var ctx = path;\n pathProxy.rebuildPath(ctx);\n }\n };\n\n opts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirty(true);\n };\n\n return opts;\n}\n/**\n * Create a Path object from path string data\n * http://www.w3.org/TR/SVG/paths.html#PathData\n * @param {Object} opts Other options\n */\n\n\nfunction createFromString(str, opts) {\n return new Path(createPathOptions(str, opts));\n}\n/**\n * Create a Path class from path string data\n * @param {string} str\n * @param {Object} opts Other options\n */\n\n\nfunction extendFromString(str, opts) {\n return Path.extend(createPathOptions(str, opts));\n}\n/**\n * Merge multiple paths\n */\n// TODO Apply transform\n// TODO stroke dash\n// TODO Optimize double memory cost problem\n\n\nfunction mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n\n if (!pathEl.path) {\n pathEl.createPathProxy();\n }\n\n if (pathEl.__dirtyPath) {\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\n }\n\n pathList.push(pathEl.path);\n }\n\n var pathBundle = new Path(opts); // Need path proxy.\n\n pathBundle.createPathProxy();\n\n pathBundle.buildPath = function (path) {\n path.appendPath(pathList); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n };\n\n return pathBundle;\n}\n\nexports.createFromString = createFromString;\nexports.extendFromString = extendFromString;\nexports.mergePath = mergePath;","var Displayable = require(\"./Displayable\");\n\nvar zrUtil = require(\"../core/util\");\n\nvar textContain = require(\"../contain/text\");\n\nvar textHelper = require(\"./helper/text\");\n\nvar _constant = require(\"./constant\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\n\n/**\n * @alias zrender/graphic/Text\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\nvar Text = function (opts) {\n // jshint ignore:line\n Displayable.call(this, opts);\n};\n\nText.prototype = {\n constructor: Text,\n type: 'text',\n brush: function (ctx, prevEl) {\n var style = this.style; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true); // Use props with prefix 'text'.\n\n style.fill = style.stroke = style.shadowBlur = style.shadowColor = style.shadowOffsetX = style.shadowOffsetY = null;\n var text = style.text; // Convert to string\n\n text != null && (text += ''); // Do not apply style.bind in Text node. Because the real bind job\n // is in textHelper.renderText, and performance of text render should\n // be considered.\n // style.bind(ctx, this, prevEl);\n\n if (!textHelper.needDrawText(text, style)) {\n // The current el.style is not applied\n // and should not be used as cache.\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n return;\n }\n\n this.setTransform(ctx);\n textHelper.renderText(this, ctx, text, style, null, prevEl);\n this.restoreTransform(ctx);\n },\n getBoundingRect: function () {\n var style = this.style; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n\n if (!this._rect) {\n var text = style.text;\n text != null ? text += '' : text = '';\n var rect = textContain.getBoundingRect(style.text + '', style.font, style.textAlign, style.textVerticalAlign, style.textPadding, style.textLineHeight, style.rich);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n\n if (textHelper.getStroke(style.textStroke, style.textStrokeWidth)) {\n var w = style.textStrokeWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n }\n};\nzrUtil.inherits(Text, Displayable);\nvar _default = Text;\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 圆形\n * @module zrender/shape/Circle\n */\nvar _default = Path.extend({\n type: 'circle',\n shape: {\n cx: 0,\n cy: 0,\n r: 0\n },\n buildPath: function (ctx, shape, inBundle) {\n // Better stroking in ShapeBundle\n // Always do it may have performence issue ( fill may be 2x more cost)\n if (inBundle) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n } // else {\n // if (ctx.allocate && !ctx.data.length) {\n // ctx.allocate(ctx.CMD_MEM_SIZE.A);\n // }\n // }\n // Better stroking in ShapeBundle\n // ctx.moveTo(shape.cx + shape.r, shape.cy);\n\n\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);\n }\n});\n\nmodule.exports = _default;","var env = require(\"../../core/env\");\n\n// Fix weird bug in some version of IE11 (like 11.0.9600.178**),\n// where exception \"unexpected call to method or property access\"\n// might be thrown when calling ctx.fill or ctx.stroke after a path\n// whose area size is zero is drawn and ctx.clip() is called and\n// shadowBlur is set. See #4572, #3112, #5777.\n// (e.g.,\n// ctx.moveTo(10, 10);\n// ctx.lineTo(20, 10);\n// ctx.closePath();\n// ctx.clip();\n// ctx.shadowBlur = 10;\n// ...\n// ctx.fill();\n// )\nvar shadowTemp = [['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0]];\n\nfunction _default(orignalBrush) {\n // version string can be: '11.0'\n return env.browser.ie && env.browser.version >= 11 ? function () {\n var clipPaths = this.__clipPaths;\n var style = this.style;\n var modified;\n\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n var shape = clipPath && clipPath.shape;\n var type = clipPath && clipPath.type;\n\n if (shape && (type === 'sector' && shape.startAngle === shape.endAngle || type === 'rect' && (!shape.width || !shape.height))) {\n for (var j = 0; j < shadowTemp.length; j++) {\n // It is save to put shadowTemp static, because shadowTemp\n // will be all modified each item brush called.\n shadowTemp[j][2] = style[shadowTemp[j][0]];\n style[shadowTemp[j][0]] = shadowTemp[j][1];\n }\n\n modified = true;\n break;\n }\n }\n }\n\n orignalBrush.apply(this, arguments);\n\n if (modified) {\n for (var j = 0; j < shadowTemp.length; j++) {\n style[shadowTemp[j][0]] = shadowTemp[j][2];\n }\n }\n } : orignalBrush;\n}\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar fixClipWithShadow = require(\"../helper/fixClipWithShadow\");\n\n/**\n * 扇形\n * @module zrender/graphic/shape/Sector\n */\nvar _default = Path.extend({\n type: 'sector',\n shape: {\n cx: 0,\n cy: 0,\n r0: 0,\n r: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n clockwise: true\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r0 + x, unitY * r0 + y);\n ctx.lineTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n ctx.lineTo(Math.cos(endAngle) * r0 + x, Math.sin(endAngle) * r0 + y);\n\n if (r0 !== 0) {\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\n }\n\n ctx.closePath();\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 圆环\n * @module zrender/graphic/shape/Ring\n */\nvar _default = Path.extend({\n type: 'ring',\n shape: {\n cx: 0,\n cy: 0,\n r: 0,\n r0: 0\n },\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var PI2 = Math.PI * 2;\n ctx.moveTo(x + shape.r, y);\n ctx.arc(x, y, shape.r, 0, PI2, false);\n ctx.moveTo(x + shape.r0, y);\n ctx.arc(x, y, shape.r0, 0, PI2, true);\n }\n});\n\nmodule.exports = _default;","var _vector = require(\"../../core/vector\");\n\nvar v2Distance = _vector.distance;\n\n/**\n * Catmull-Rom spline 插值折线\n * @module zrender/shape/util/smoothSpline\n * @author pissang (https://www.github.com/pissang)\n * Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * errorrik (errorrik@gmail.com)\n */\n\n/**\n * @inner\n */\nfunction interpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n/**\n * @alias module:zrender/shape/util/smoothSpline\n * @param {Array} points 线段顶点数组\n * @param {boolean} isLoop\n * @return {Array}\n */\n\n\nfunction _default(points, isLoop) {\n var len = points.length;\n var ret = [];\n var distance = 0;\n\n for (var i = 1; i < len; i++) {\n distance += v2Distance(points[i - 1], points[i]);\n }\n\n var segs = distance / 2;\n segs = segs < len ? len : segs;\n\n for (var i = 0; i < segs; i++) {\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\n var idx = Math.floor(pos);\n var w = pos - idx;\n var p0;\n var p1 = points[idx % len];\n var p2;\n var p3;\n\n if (!isLoop) {\n p0 = points[idx === 0 ? idx : idx - 1];\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\n } else {\n p0 = points[(idx - 1 + len) % len];\n p2 = points[(idx + 1) % len];\n p3 = points[(idx + 2) % len];\n }\n\n var w2 = w * w;\n var w3 = w * w2;\n ret.push([interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)]);\n }\n\n return ret;\n}\n\nmodule.exports = _default;","var _vector = require(\"../../core/vector\");\n\nvar v2Min = _vector.min;\nvar v2Max = _vector.max;\nvar v2Scale = _vector.scale;\nvar v2Distance = _vector.distance;\nvar v2Add = _vector.add;\nvar v2Clone = _vector.clone;\nvar v2Sub = _vector.sub;\n\n/**\n * 贝塞尔平滑曲线\n * @module zrender/shape/util/smoothBezier\n * @author pissang (https://www.github.com/pissang)\n * Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * errorrik (errorrik@gmail.com)\n */\n\n/**\n * 贝塞尔平滑曲线\n * @alias module:zrender/shape/util/smoothBezier\n * @param {Array} points 线段顶点数组\n * @param {number} smooth 平滑等级, 0-1\n * @param {boolean} isLoop\n * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内\n * 比如 [[0, 0], [100, 100]], 这个包围盒会与\n * 整个折线的包围盒做一个并集用来约束控制点。\n * @param {Array} 计算出来的控制点数组\n */\nfunction _default(points, smooth, isLoop, constraint) {\n var cps = [];\n var v = [];\n var v1 = [];\n var v2 = [];\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n\n if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\n\n for (var i = 0, len = points.length; i < len; i++) {\n v2Min(min, min, points[i]);\n v2Max(max, max, points[i]);\n } // 与指定的包围盒做并集\n\n\n v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n } else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n } else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n\n v2Sub(v, nextPoint, prevPoint); // use degree to scale the handle length\n\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\n\n if (constraint) {\n v2Max(cp0, cp0, min);\n v2Min(cp0, cp0, max);\n v2Max(cp1, cp1, min);\n v2Min(cp1, cp1, max);\n }\n\n cps.push(cp0);\n cps.push(cp1);\n }\n\n if (isLoop) {\n cps.push(cps.shift());\n }\n\n return cps;\n}\n\nmodule.exports = _default;","var smoothSpline = require(\"./smoothSpline\");\n\nvar smoothBezier = require(\"./smoothBezier\");\n\nfunction buildPath(ctx, shape, closePath) {\n var points = shape.points;\n var smooth = shape.smooth;\n\n if (points && points.length >= 2) {\n if (smooth && smooth !== 'spline') {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n } else {\n if (smooth === 'spline') {\n points = smoothSpline(points, closePath);\n }\n\n ctx.moveTo(points[0][0], points[0][1]);\n\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n\n closePath && ctx.closePath();\n }\n}\n\nexports.buildPath = buildPath;","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * 多边形\n * @module zrender/shape/Polygon\n */\nvar _default = Path.extend({\n type: 'polygon',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * @module zrender/graphic/shape/Polyline\n */\nvar _default = Path.extend({\n type: 'polyline',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n }\n});\n\nmodule.exports = _default;","/**\n * Sub-pixel optimize for canvas rendering, prevent from blur\n * when rendering a thin vertical/horizontal line.\n */\nvar round = Math.round;\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x1`, `x2`, `y1`, `y2` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x1]\n * @param {number} [inputShape.y1]\n * @param {number} [inputShape.x2]\n * @param {number} [inputShape.y2]\n * @param {Object} [style]\n * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize.\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n var lineWidth = style && style.lineWidth;\n\n if (!lineWidth) {\n return;\n }\n\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x`, `y`, `width`, `height` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x]\n * @param {number} [inputShape.y]\n * @param {number} [inputShape.width]\n * @param {number} [inputShape.height]\n * @param {Object} [style]\n * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize.\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n var lineWidth = style && style.lineWidth;\n\n if (!lineWidth) {\n return;\n }\n\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth If `null`/`undefined`/`0`, do not optimize.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n if (!lineWidth) {\n return position;\n } // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n\n\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;","var Path = require(\"../Path\");\n\nvar roundRectHelper = require(\"../helper/roundRect\");\n\nvar _subPixelOptimize = require(\"../helper/subPixelOptimize\");\n\nvar subPixelOptimizeRect = _subPixelOptimize.subPixelOptimizeRect;\n\n/**\n * 矩形\n * @module zrender/graphic/shape/Rect\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'rect',\n shape: {\n // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4\n // r缩写为1 相当于 [1, 1, 1, 1]\n // r缩写为[1] 相当于 [1, 1, 1, 1]\n // r缩写为[1, 2] 相当于 [1, 2, 1, 2]\n // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]\n r: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = subPixelOptimizeOutputShape.x;\n y = subPixelOptimizeOutputShape.y;\n width = subPixelOptimizeOutputShape.width;\n height = subPixelOptimizeOutputShape.height;\n subPixelOptimizeOutputShape.r = shape.r;\n shape = subPixelOptimizeOutputShape;\n } else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n } else {\n roundRectHelper.buildPath(ctx, shape);\n }\n\n ctx.closePath();\n return;\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar _subPixelOptimize = require(\"../helper/subPixelOptimize\");\n\nvar subPixelOptimizeLine = _subPixelOptimize.subPixelOptimizeLine;\n\n/**\n * 直线\n * @module zrender/graphic/shape/Line\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'line',\n shape: {\n // Start point\n x1: 0,\n y1: 0,\n // End point\n x2: 0,\n y2: 0,\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = subPixelOptimizeOutputShape.x1;\n y1 = subPixelOptimizeOutputShape.y1;\n x2 = subPixelOptimizeOutputShape.x2;\n y2 = subPixelOptimizeOutputShape.y2;\n } else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n\n ctx.lineTo(x2, y2);\n },\n\n /**\n * Get point at percent\n * @param {number} percent\n * @return {Array.}\n */\n pointAt: function (p) {\n var shape = this.shape;\n return [shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p];\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar vec2 = require(\"../../core/vector\");\n\nvar _curve = require(\"../../core/curve\");\n\nvar quadraticSubdivide = _curve.quadraticSubdivide;\nvar cubicSubdivide = _curve.cubicSubdivide;\nvar quadraticAt = _curve.quadraticAt;\nvar cubicAt = _curve.cubicAt;\nvar quadraticDerivativeAt = _curve.quadraticDerivativeAt;\nvar cubicDerivativeAt = _curve.cubicDerivativeAt;\n\n/**\n * 贝塞尔曲线\n * @module zrender/shape/BezierCurve\n */\nvar out = [];\n\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n\n if (cpx2 === null || cpy2 === null) {\n return [(isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)];\n } else {\n return [(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)];\n }\n}\n\nvar _default = Path.extend({\n type: 'bezier-curve',\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n cpx1: 0,\n cpy1: 0,\n // cpx2: 0,\n // cpy2: 0\n // Curve show percent, for animating\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1 = shape.x1;\n var y1 = shape.y1;\n var x2 = shape.x2;\n var y2 = shape.y2;\n var cpx1 = shape.cpx1;\n var cpy1 = shape.cpy1;\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (cpx2 == null || cpy2 == null) {\n if (percent < 1) {\n quadraticSubdivide(x1, cpx1, x2, percent, out);\n cpx1 = out[1];\n x2 = out[2];\n quadraticSubdivide(y1, cpy1, y2, percent, out);\n cpy1 = out[1];\n y2 = out[2];\n }\n\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n } else {\n if (percent < 1) {\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n cpx1 = out[1];\n cpx2 = out[2];\n x2 = out[3];\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n cpy1 = out[1];\n cpy2 = out[2];\n y2 = out[3];\n }\n\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n },\n\n /**\n * Get point at percent\n * @param {number} t\n * @return {Array.}\n */\n pointAt: function (t) {\n return someVectorAt(this.shape, t, false);\n },\n\n /**\n * Get tangent at percent\n * @param {number} t\n * @return {Array.}\n */\n tangentAt: function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 圆弧\n * @module zrender/graphic/shape/Arc\n */\nvar _default = Path.extend({\n type: 'arc',\n shape: {\n cx: 0,\n cy: 0,\n r: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n clockwise: true\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"./Path\");\n\n// CompoundPath to improve performance\nvar _default = Path.extend({\n type: 'compound',\n shape: {\n paths: null\n },\n _updatePathDirty: function () {\n var dirtyPath = this.__dirtyPath;\n var paths = this.shape.paths;\n\n for (var i = 0; i < paths.length; i++) {\n // Mark as dirty if any subpath is dirty\n dirtyPath = dirtyPath || paths[i].__dirtyPath;\n }\n\n this.__dirtyPath = dirtyPath;\n this.__dirty = this.__dirty || dirtyPath;\n },\n beforeBrush: function () {\n this._updatePathDirty();\n\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale(); // Update path scale\n\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n },\n buildPath: function (ctx, shape) {\n var paths = shape.paths || [];\n\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n },\n afterBrush: function () {\n var paths = this.shape.paths || [];\n\n for (var i = 0; i < paths.length; i++) {\n paths[i].__dirtyPath = false;\n }\n },\n getBoundingRect: function () {\n this._updatePathDirty();\n\n return Path.prototype.getBoundingRect.call(this);\n }\n});\n\nmodule.exports = _default;","/**\n * @param {Array.} colorStops\n */\nvar Gradient = function (colorStops) {\n this.colorStops = colorStops || [];\n};\n\nGradient.prototype = {\n constructor: Gradient,\n addColorStop: function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n }\n};\nvar _default = Gradient;\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Gradient = require(\"./Gradient\");\n\n/**\n * x, y, x2, y2 are all percent from 0 to 1\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [x2=1]\n * @param {number} [y2=0]\n * @param {Array.} colorStops\n * @param {boolean} [globalCoord=false]\n */\nvar LinearGradient = function (x, y, x2, y2, colorStops, globalCoord) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'linear', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0 : x;\n this.y = y == null ? 0 : y;\n this.x2 = x2 == null ? 1 : x2;\n this.y2 = y2 == null ? 0 : y2; // Can be cloned\n\n this.type = 'linear'; // If use global coord\n\n this.global = globalCoord || false;\n Gradient.call(this, colorStops);\n};\n\nLinearGradient.prototype = {\n constructor: LinearGradient\n};\nzrUtil.inherits(LinearGradient, Gradient);\nvar _default = LinearGradient;\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Gradient = require(\"./Gradient\");\n\n/**\n * x, y, r are all percent from 0 to 1\n * @param {number} [x=0.5]\n * @param {number} [y=0.5]\n * @param {number} [r=0.5]\n * @param {Array.} [colorStops]\n * @param {boolean} [globalCoord=false]\n */\nvar RadialGradient = function (x, y, r, colorStops, globalCoord) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'radial', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0.5 : x;\n this.y = y == null ? 0.5 : y;\n this.r = r == null ? 0.5 : r; // Can be cloned\n\n this.type = 'radial'; // If use global coord\n\n this.global = globalCoord || false;\n Gradient.call(this, colorStops);\n};\n\nRadialGradient.prototype = {\n constructor: RadialGradient\n};\nzrUtil.inherits(RadialGradient, Gradient);\nvar _default = RadialGradient;\nmodule.exports = _default;","var _util = require(\"../core/util\");\n\nvar inherits = _util.inherits;\n\nvar Displayble = require(\"./Displayable\");\n\nvar BoundingRect = require(\"../core/BoundingRect\");\n\n/**\n * Displayable for incremental rendering. It will be rendered in a separate layer\n * IncrementalDisplay have two main methods. `clearDisplayables` and `addDisplayables`\n * addDisplayables will render the added displayables incremetally.\n *\n * It use a not clearFlag to tell the painter don't clear the layer if it's the first element.\n */\n// TODO Style override ?\nfunction IncrementalDisplayble(opts) {\n Displayble.call(this, opts);\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.notClear = true;\n}\n\nIncrementalDisplayble.prototype.incremental = true;\n\nIncrementalDisplayble.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.dirty();\n this.notClear = false;\n};\n\nIncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n } else {\n this._displayables.push(displayable);\n }\n\n this.dirty();\n};\n\nIncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n};\n\nIncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n};\n\nIncrementalDisplayble.prototype.update = function () {\n this.updateTransform();\n\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i]; // PENDING\n\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i]; // PENDING\n\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n};\n\nIncrementalDisplayble.prototype.brush = function (ctx, prevEl) {\n // Render persistant displayables.\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.beforeBrush && displayable.beforeBrush(ctx);\n displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]);\n displayable.afterBrush && displayable.afterBrush(ctx);\n }\n\n this._cursor = i; // Render temporary displayables.\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.beforeBrush && displayable.beforeBrush(ctx);\n displayable.brush(ctx, i === 0 ? null : this._temporaryDisplayables[i - 1]);\n displayable.afterBrush && displayable.afterBrush(ctx);\n }\n\n this._temporaryDisplayables = [];\n this.notClear = true;\n};\n\nvar m = [];\n\nIncrementalDisplayble.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n\n rect.union(childRect);\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n};\n\nIncrementalDisplayble.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n\n if (rect.contain(localPos[0], localPos[1])) {\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n};\n\ninherits(IncrementalDisplayble, Displayble);\nvar _default = IncrementalDisplayble;\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 pathTool = require(\"zrender/lib/tool/path\");\n\nvar colorTool = require(\"zrender/lib/tool/color\");\n\nvar matrix = require(\"zrender/lib/core/matrix\");\n\nvar vector = require(\"zrender/lib/core/vector\");\n\nvar Path = require(\"zrender/lib/graphic/Path\");\n\nvar Transformable = require(\"zrender/lib/mixin/Transformable\");\n\nvar ZImage = require(\"zrender/lib/graphic/Image\");\n\nexports.Image = ZImage;\n\nvar Group = require(\"zrender/lib/container/Group\");\n\nexports.Group = Group;\n\nvar Text = require(\"zrender/lib/graphic/Text\");\n\nexports.Text = Text;\n\nvar Circle = require(\"zrender/lib/graphic/shape/Circle\");\n\nexports.Circle = Circle;\n\nvar Sector = require(\"zrender/lib/graphic/shape/Sector\");\n\nexports.Sector = Sector;\n\nvar Ring = require(\"zrender/lib/graphic/shape/Ring\");\n\nexports.Ring = Ring;\n\nvar Polygon = require(\"zrender/lib/graphic/shape/Polygon\");\n\nexports.Polygon = Polygon;\n\nvar Polyline = require(\"zrender/lib/graphic/shape/Polyline\");\n\nexports.Polyline = Polyline;\n\nvar Rect = require(\"zrender/lib/graphic/shape/Rect\");\n\nexports.Rect = Rect;\n\nvar Line = require(\"zrender/lib/graphic/shape/Line\");\n\nexports.Line = Line;\n\nvar BezierCurve = require(\"zrender/lib/graphic/shape/BezierCurve\");\n\nexports.BezierCurve = BezierCurve;\n\nvar Arc = require(\"zrender/lib/graphic/shape/Arc\");\n\nexports.Arc = Arc;\n\nvar CompoundPath = require(\"zrender/lib/graphic/CompoundPath\");\n\nexports.CompoundPath = CompoundPath;\n\nvar LinearGradient = require(\"zrender/lib/graphic/LinearGradient\");\n\nexports.LinearGradient = LinearGradient;\n\nvar RadialGradient = require(\"zrender/lib/graphic/RadialGradient\");\n\nexports.RadialGradient = RadialGradient;\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nexports.BoundingRect = BoundingRect;\n\nvar IncrementalDisplayable = require(\"zrender/lib/graphic/IncrementalDisplayable\");\n\nexports.IncrementalDisplayable = IncrementalDisplayable;\n\nvar subPixelOptimizeUtil = require(\"zrender/lib/graphic/helper/subPixelOptimize\");\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 mathMax = Math.max;\nvar mathMin = Math.min;\nvar EMPTY_OBJ = {};\nvar Z2_EMPHASIS_LIFT = 1; // key: label model property nane, value: style property name.\n\nvar CACHED_LABEL_STYLE_PROPERTIES = {\n color: 'textFill',\n textBorderColor: 'textStroke',\n textBorderWidth: 'textStrokeWidth'\n};\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal'; // Reserve 0 as default.\n\nvar _highlightNextDigit = 1;\nvar _highlightKeyMap = {};\nvar _customShapeMap = {};\n/**\n * Extend shape with parameters\n */\n\nfunction extendShape(opts) {\n return Path.extend(opts);\n}\n/**\n * Extend path\n */\n\n\nfunction extendPath(pathData, opts) {\n return pathTool.extendFromString(pathData, opts);\n}\n/**\n * Register a user defined shape.\n * The shape class can be fetched by `getShapeClass`\n * This method will overwrite the registered shapes, including\n * the registered built-in shapes, if using the same `name`.\n * The shape can be used in `custom series` and\n * `graphic component` by declaring `{type: name}`.\n *\n * @param {string} name\n * @param {Object} ShapeClass Can be generated by `extendShape`.\n */\n\n\nfunction registerShape(name, ShapeClass) {\n _customShapeMap[name] = ShapeClass;\n}\n/**\n * Find shape class registered by `registerShape`. Usually used in\n * fetching user defined shape.\n *\n * [Caution]:\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\n * to use user registered shapes.\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\n * `registerShape` by default. That enables users to get both built-in\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\n * the built-in shapes by using names like 'circle', 'rect' via calling\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\n * in case that it is overwritten by users, except that some features, like\n * `custom series`, `graphic component`, do it deliberately.\n *\n * (2) In the features like `custom series`, `graphic component`, the user input\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\n * are reserved names, that is, if some user register a shape named `'image'`,\n * the shape will not be used. If we intending to add some more reserved names\n * in feature, that might bring break changes (disable some existing user shape\n * names). But that case probably rearly happen. So we dont make more mechanism\n * to resolve this issue here.\n *\n * @param {string} name\n * @return {Object} The shape class. If not found, return nothing.\n */\n\n\nfunction getShapeClass(name) {\n if (_customShapeMap.hasOwnProperty(name)) {\n return _customShapeMap[name];\n }\n}\n/**\n * Create a path element from path data string\n * @param {string} pathData\n * @param {Object} opts\n * @param {module:zrender/core/BoundingRect} rect\n * @param {string} [layout=cover] 'center' or 'cover'\n */\n\n\nfunction makePath(pathData, opts, rect, layout) {\n var path = pathTool.createFromString(pathData, opts);\n\n if (rect) {\n if (layout === 'center') {\n rect = centerGraphic(rect, path.getBoundingRect());\n }\n\n resizePath(path, rect);\n }\n\n return path;\n}\n/**\n * Create a image element from image url\n * @param {string} imageUrl image url\n * @param {Object} opts options\n * @param {module:zrender/core/BoundingRect} rect constrain rect\n * @param {string} [layout=cover] 'center' or 'cover'\n */\n\n\nfunction makeImage(imageUrl, rect, layout) {\n var path = new ZImage({\n style: {\n image: imageUrl,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n onload: function (img) {\n if (layout === 'center') {\n var boundingRect = {\n width: img.width,\n height: img.height\n };\n path.setStyle(centerGraphic(rect, boundingRect));\n }\n }\n });\n return path;\n}\n/**\n * Get position of centered element in bounding box.\n *\n * @param {Object} rect element local bounding box\n * @param {Object} boundingRect constraint bounding box\n * @return {Object} element position containing x, y, width, and height\n */\n\n\nfunction centerGraphic(rect, boundingRect) {\n // Set rect to center, keep width / height ratio.\n var aspect = boundingRect.width / boundingRect.height;\n var width = rect.height * aspect;\n var height;\n\n if (width <= rect.width) {\n height = rect.height;\n } else {\n width = rect.width;\n height = width / aspect;\n }\n\n var cx = rect.x + rect.width / 2;\n var cy = rect.y + rect.height / 2;\n return {\n x: cx - width / 2,\n y: cy - height / 2,\n width: width,\n height: height\n };\n}\n\nvar mergePath = pathTool.mergePath;\n/**\n * Resize a path to fit the rect\n * @param {module:zrender/graphic/Path} path\n * @param {Object} rect\n */\n\nfunction resizePath(path, rect) {\n if (!path.applyTransform) {\n return;\n }\n\n var pathRect = path.getBoundingRect();\n var m = pathRect.calculateTransform(rect);\n path.applyTransform(m);\n}\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} param\n * @param {Object} [param.shape]\n * @param {number} [param.shape.x1]\n * @param {number} [param.shape.y1]\n * @param {number} [param.shape.x2]\n * @param {number} [param.shape.y2]\n * @param {Object} [param.style]\n * @param {number} [param.style.lineWidth]\n * @return {Object} Modified param\n */\n\n\nfunction subPixelOptimizeLine(param) {\n subPixelOptimizeUtil.subPixelOptimizeLine(param.shape, param.shape, param.style);\n return param;\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} param\n * @param {Object} [param.shape]\n * @param {number} [param.shape.x]\n * @param {number} [param.shape.y]\n * @param {number} [param.shape.width]\n * @param {number} [param.shape.height]\n * @param {Object} [param.style]\n * @param {number} [param.style.lineWidth]\n * @return {Object} Modified param\n */\n\n\nfunction subPixelOptimizeRect(param) {\n subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);\n return param;\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nvar subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\n\nfunction hasFillOrStroke(fillOrStroke) {\n return fillOrStroke != null && fillOrStroke !== 'none';\n} // Most lifted color are duplicated.\n\n\nvar liftedColorMap = zrUtil.createHashMap();\nvar liftedColorCount = 0;\n\nfunction liftColor(color) {\n if (typeof color !== 'string') {\n return color;\n }\n\n var liftedColor = liftedColorMap.get(color);\n\n if (!liftedColor) {\n liftedColor = colorTool.lift(color, -0.1);\n\n if (liftedColorCount < 10000) {\n liftedColorMap.set(color, liftedColor);\n liftedColorCount++;\n }\n }\n\n return liftedColor;\n}\n\nfunction cacheElementStl(el) {\n if (!el.__hoverStlDirty) {\n return;\n }\n\n el.__hoverStlDirty = false;\n var hoverStyle = el.__hoverStl;\n\n if (!hoverStyle) {\n el.__cachedNormalStl = el.__cachedNormalZ2 = null;\n return;\n }\n\n var normalStyle = el.__cachedNormalStl = {};\n el.__cachedNormalZ2 = el.z2;\n var elStyle = el.style;\n\n for (var name in hoverStyle) {\n // See comment in `singleEnterEmphasis`.\n if (hoverStyle[name] != null) {\n normalStyle[name] = elStyle[name];\n }\n } // Always cache fill and stroke to normalStyle for lifting color.\n\n\n normalStyle.fill = elStyle.fill;\n normalStyle.stroke = elStyle.stroke;\n}\n\nfunction singleEnterEmphasis(el) {\n var hoverStl = el.__hoverStl;\n\n if (!hoverStl || el.__highlighted) {\n return;\n }\n\n var zr = el.__zr;\n var useHoverLayer = el.useHoverLayer && zr && zr.painter.type === 'canvas';\n el.__highlighted = useHoverLayer ? 'layer' : 'plain';\n\n if (el.isGroup || !zr && el.useHoverLayer) {\n return;\n }\n\n var elTarget = el;\n var targetStyle = el.style;\n\n if (useHoverLayer) {\n elTarget = zr.addHover(el);\n targetStyle = elTarget.style;\n }\n\n rollbackDefaultTextStyle(targetStyle);\n\n if (!useHoverLayer) {\n cacheElementStl(elTarget);\n } // styles can be:\n // {\n // label: {\n // show: false,\n // position: 'outside',\n // fontSize: 18\n // },\n // emphasis: {\n // label: {\n // show: true\n // }\n // }\n // },\n // where properties of `emphasis` may not appear in `normal`. We previously use\n // module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`.\n // But consider rich text and setOption in merge mode, it is impossible to cover\n // all properties in merge. So we use merge mode when setting style here.\n // But we choose the merge strategy that only properties that is not `null/undefined`.\n // Because when making a textStyle (espacially rich text), it is not easy to distinguish\n // `hasOwnProperty` and `null/undefined` in code, so we trade them as the same for simplicity.\n // But this strategy brings a trouble that `null/undefined` can not be used to remove\n // style any more in `emphasis`. Users can both set properties directly on normal and\n // emphasis to avoid this issue, or we might support `'none'` for this case if required.\n\n\n targetStyle.extendFrom(hoverStl);\n setDefaultHoverFillStroke(targetStyle, hoverStl, 'fill');\n setDefaultHoverFillStroke(targetStyle, hoverStl, 'stroke');\n applyDefaultTextStyle(targetStyle);\n\n if (!useHoverLayer) {\n el.dirty(false);\n el.z2 += Z2_EMPHASIS_LIFT;\n }\n}\n\nfunction setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) {\n if (!hasFillOrStroke(hoverStyle[prop]) && hasFillOrStroke(targetStyle[prop])) {\n targetStyle[prop] = liftColor(targetStyle[prop]);\n }\n}\n\nfunction singleEnterNormal(el) {\n var highlighted = el.__highlighted;\n\n if (!highlighted) {\n return;\n }\n\n el.__highlighted = false;\n\n if (el.isGroup) {\n return;\n }\n\n if (highlighted === 'layer') {\n el.__zr && el.__zr.removeHover(el);\n } else {\n var style = el.style;\n var normalStl = el.__cachedNormalStl;\n\n if (normalStl) {\n rollbackDefaultTextStyle(style);\n el.setStyle(normalStl);\n applyDefaultTextStyle(style);\n } // `__cachedNormalZ2` will not be reset if calling `setElementHoverStyle`\n // when `el` is on emphasis state. So here by comparing with 1, we try\n // hard to make the bug case rare.\n\n\n var normalZ2 = el.__cachedNormalZ2;\n\n if (normalZ2 != null && el.z2 - normalZ2 === Z2_EMPHASIS_LIFT) {\n el.z2 = normalZ2;\n }\n }\n}\n\nfunction traverseUpdate(el, updater, commonParam) {\n // If root is group, also enter updater for `highDownOnUpdate`.\n var fromState = NORMAL;\n var toState = NORMAL;\n var trigger; // See the rule of `highDownOnUpdate` on `graphic.setAsHighDownDispatcher`.\n\n el.__highlighted && (fromState = EMPHASIS, trigger = true);\n updater(el, commonParam);\n el.__highlighted && (toState = EMPHASIS, trigger = true);\n el.isGroup && el.traverse(function (child) {\n !child.isGroup && updater(child, commonParam);\n });\n trigger && el.__highDownOnUpdate && el.__highDownOnUpdate(fromState, toState);\n}\n/**\n * Set hover style (namely \"emphasis style\") of element, based on the current\n * style of the given `el`.\n * This method should be called after all of the normal styles have been adopted\n * to the `el`. See the reason on `setHoverStyle`.\n *\n * @param {module:zrender/Element} el Should not be `zrender/container/Group`.\n * @param {Object} [el.hoverStyle] Can be set on el or its descendants,\n * e.g., `el.hoverStyle = ...; graphic.setHoverStyle(el); `.\n * Often used when item group has a label element and it's hoverStyle is different.\n * @param {Object|boolean} [hoverStl] The specified hover style.\n * If set as `false`, disable the hover style.\n * Similarly, The `el.hoverStyle` can alse be set\n * as `false` to disable the hover style.\n * Otherwise, use the default hover style if not provided.\n */\n\n\nfunction setElementHoverStyle(el, hoverStl) {\n // For performance consideration, it might be better to make the \"hover style\" only the\n // difference properties from the \"normal style\", but not a entire copy of all styles.\n hoverStl = el.__hoverStl = hoverStl !== false && (el.hoverStyle || hoverStl || {});\n el.__hoverStlDirty = true; // FIXME\n // It is not completely right to save \"normal\"/\"emphasis\" flag on elements.\n // It probably should be saved on `data` of series. Consider the cases:\n // (1) A highlighted elements are moved out of the view port and re-enter\n // again by dataZoom.\n // (2) call `setOption` and replace elements totally when they are highlighted.\n\n if (el.__highlighted) {\n // Consider the case:\n // The styles of a highlighted `el` is being updated. The new \"emphasis style\"\n // should be adapted to the `el`. Notice here new \"normal styles\" should have\n // been set outside and the cached \"normal style\" is out of date.\n el.__cachedNormalStl = null; // Do not clear `__cachedNormalZ2` here, because setting `z2` is not a constraint\n // of this method. In most cases, `z2` is not set and hover style should be able\n // to rollback. Of course, that would bring bug, but only in a rare case, see\n // `doSingleLeaveHover` for details.\n\n singleEnterNormal(el);\n singleEnterEmphasis(el);\n }\n}\n\nfunction onElementMouseOver(e) {\n !shouldSilent(this, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !this.__highByOuter && traverseUpdate(this, singleEnterEmphasis);\n}\n\nfunction onElementMouseOut(e) {\n !shouldSilent(this, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !this.__highByOuter && traverseUpdate(this, singleEnterNormal);\n}\n\nfunction onElementEmphasisEvent(highlightDigit) {\n this.__highByOuter |= 1 << (highlightDigit || 0);\n traverseUpdate(this, singleEnterEmphasis);\n}\n\nfunction onElementNormalEvent(highlightDigit) {\n !(this.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdate(this, singleEnterNormal);\n}\n\nfunction shouldSilent(el, e) {\n return el.__highDownSilentOnTouch && e.zrByTouch;\n}\n/**\n * Set hover style (namely \"emphasis style\") of element,\n * based on the current style of the given `el`.\n *\n * (1)\n * **CONSTRAINTS** for this method:\n * This method MUST be called after all of the normal styles having been adopted\n * to the `el`.\n * The input `hoverStyle` (that is, \"emphasis style\") MUST be the subset of the\n * \"normal style\" having been set to the el.\n * `color` MUST be one of the \"normal styles\" (because color might be lifted as\n * a default hover style).\n *\n * The reason: this method treat the current style of the `el` as the \"normal style\"\n * and cache them when enter/update the \"emphasis style\". Consider the case: the `el`\n * is in \"emphasis\" state and `setOption`/`dispatchAction` trigger the style updating\n * logic, where the el should shift from the original emphasis style to the new\n * \"emphasis style\" and should be able to \"downplay\" back to the new \"normal style\".\n *\n * Indeed, it is error-prone to make a interface has so many constraints, but I have\n * not found a better solution yet to fit the backward compatibility, performance and\n * the current programming style.\n *\n * (2)\n * Call the method for a \"root\" element once. Do not call it for each descendants.\n * If the descendants elemenets of a group has itself hover style different from the\n * root group, we can simply mount the style on `el.hoverStyle` for them, but should\n * not call this method for them.\n *\n * (3) These input parameters can be set directly on `el`:\n *\n * @param {module:zrender/Element} el\n * @param {Object} [el.hoverStyle] See `graphic.setElementHoverStyle`.\n * @param {boolean} [el.highDownSilentOnTouch=false] See `graphic.setAsHighDownDispatcher`.\n * @param {Function} [el.highDownOnUpdate] See `graphic.setAsHighDownDispatcher`.\n * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.\n */\n\n\nfunction setHoverStyle(el, hoverStyle) {\n setAsHighDownDispatcher(el, true);\n traverseUpdate(el, setElementHoverStyle, hoverStyle);\n}\n/**\n * @param {module:zrender/Element} el\n * @param {Function} [el.highDownOnUpdate] Called when state updated.\n * Since `setHoverStyle` has the constraint that it must be called after\n * all of the normal style updated, `highDownOnUpdate` is not needed to\n * trigger if both `fromState` and `toState` is 'normal', and needed to\n * trigger if both `fromState` and `toState` is 'emphasis', which enables\n * to sync outside style settings to \"emphasis\" state.\n * @this {string} This dispatcher `el`.\n * @param {string} fromState Can be \"normal\" or \"emphasis\".\n * `fromState` might equal to `toState`,\n * for example, when this method is called when `el` is\n * on \"emphasis\" state.\n * @param {string} toState Can be \"normal\" or \"emphasis\".\n *\n * FIXME\n * CAUTION: Do not expose `highDownOnUpdate` outside echarts.\n * Because it is not a complete solution. The update\n * listener should not have been mount in element,\n * and the normal/emphasis state should not have\n * mantained on elements.\n *\n * @param {boolean} [el.highDownSilentOnTouch=false]\n * In touch device, mouseover event will be trigger on touchstart event\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\n * conveniently use hoverStyle when tap on touch screen without additional\n * code for compatibility.\n * But if the chart/component has select feature, which usually also use\n * hoverStyle, there might be conflict between 'select-highlight' and\n * 'hover-highlight' especially when roam is enabled (see geo for example).\n * In this case, `highDownSilentOnTouch` should be used to disable\n * hover-highlight on touch device.\n * @param {boolean} [asDispatcher=true] If `false`, do not set as \"highDownDispatcher\".\n */\n\n\nfunction setAsHighDownDispatcher(el, asDispatcher) {\n var disable = asDispatcher === false; // Make `highDownSilentOnTouch` and `highDownOnUpdate` only work after\n // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\n\n el.__highDownSilentOnTouch = el.highDownSilentOnTouch;\n el.__highDownOnUpdate = el.highDownOnUpdate; // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n if (!disable || el.__highDownDispatcher) {\n var method = disable ? 'off' : 'on'; // Duplicated function will be auto-ignored, see Eventful.js.\n\n el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); // Emphasis, normal can be triggered manually by API or other components like hover link.\n\n el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); // Also keep previous record.\n\n el.__highByOuter = el.__highByOuter || 0;\n el.__highDownDispatcher = !disable;\n }\n}\n/**\n * @param {module:zrender/src/Element} el\n * @return {boolean}\n */\n\n\nfunction isHighDownDispatcher(el) {\n return !!(el && el.__highDownDispatcher);\n}\n/**\n * Support hightlight/downplay record on each elements.\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\n * user triggerred hightlight/downplay should not conflict.\n * Only all of the highlightDigit cleared, return to normal.\n * @param {string} highlightKey\n * @return {number} highlightDigit\n */\n\n\nfunction getHighlightDigit(highlightKey) {\n var highlightDigit = _highlightKeyMap[highlightKey];\n\n if (highlightDigit == null && _highlightNextDigit <= 32) {\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\n }\n\n return highlightDigit;\n}\n/**\n * See more info in `setTextStyleCommon`.\n * @param {Object|module:zrender/graphic/Style} normalStyle\n * @param {Object} emphasisStyle\n * @param {module:echarts/model/Model} normalModel\n * @param {module:echarts/model/Model} emphasisModel\n * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props.\n * @param {string|Function} [opt.defaultText]\n * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by\n * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`\n * @param {number} [opt.labelDataIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`\n * @param {number} [opt.labelDimIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`\n * @param {string} [opt.labelProp] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`\n * @param {Object} [normalSpecified]\n * @param {Object} [emphasisSpecified]\n */\n\n\nfunction setLabelStyle(normalStyle, emphasisStyle, normalModel, emphasisModel, opt, normalSpecified, emphasisSpecified) {\n opt = opt || EMPTY_OBJ;\n var labelFetcher = opt.labelFetcher;\n var labelDataIndex = opt.labelDataIndex;\n var labelDimIndex = opt.labelDimIndex;\n var labelProp = opt.labelProp; // This scenario, `label.normal.show = true; label.emphasis.show = false`,\n // is not supported util someone requests.\n\n var showNormal = normalModel.getShallow('show');\n var showEmphasis = emphasisModel.getShallow('show'); // Consider performance, only fetch label when necessary.\n // If `normal.show` is `false` and `emphasis.show` is `true` and `emphasis.formatter` is not set,\n // label should be displayed, where text is fetched by `normal.formatter` or `opt.defaultText`.\n\n var baseText;\n\n if (showNormal || showEmphasis) {\n if (labelFetcher) {\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, labelProp);\n }\n\n if (baseText == null) {\n baseText = zrUtil.isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText;\n }\n }\n\n var normalStyleText = showNormal ? baseText : null;\n var emphasisStyleText = showEmphasis ? zrUtil.retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex, labelProp) : null, baseText) : null; // Optimize: If style.text is null, text will not be drawn.\n\n if (normalStyleText != null || emphasisStyleText != null) {\n // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n // If we set default values on `emphasisStyle`, consider case:\n // Firstly, `setOption(... label: {normal: {text: null}, emphasis: {show: true}} ...);`\n // Secondly, `setOption(... label: {noraml: {show: true, text: 'abc', color: 'red'} ...);`\n // Then the 'red' will not work on emphasis.\n setTextStyle(normalStyle, normalModel, normalSpecified, opt);\n setTextStyle(emphasisStyle, emphasisModel, emphasisSpecified, opt, true);\n }\n\n normalStyle.text = normalStyleText;\n emphasisStyle.text = emphasisStyleText;\n}\n/**\n * Modify label style manually.\n * Only works after `setLabelStyle` and `setElementHoverStyle` called.\n *\n * @param {module:zrender/src/Element} el\n * @param {Object} [normalStyleProps] optional\n * @param {Object} [emphasisStyleProps] optional\n */\n\n\nfunction modifyLabelStyle(el, normalStyleProps, emphasisStyleProps) {\n var elStyle = el.style;\n\n if (normalStyleProps) {\n rollbackDefaultTextStyle(elStyle);\n el.setStyle(normalStyleProps);\n applyDefaultTextStyle(elStyle);\n }\n\n elStyle = el.__hoverStl;\n\n if (emphasisStyleProps && elStyle) {\n rollbackDefaultTextStyle(elStyle);\n zrUtil.extend(elStyle, emphasisStyleProps);\n applyDefaultTextStyle(elStyle);\n }\n}\n/**\n * Set basic textStyle properties.\n * See more info in `setTextStyleCommon`.\n * @param {Object|module:zrender/graphic/Style} textStyle\n * @param {module:echarts/model/Model} model\n * @param {Object} [specifiedTextStyle] Can be overrided by settings in model.\n * @param {Object} [opt] See `opt` of `setTextStyleCommon`.\n * @param {boolean} [isEmphasis]\n */\n\n\nfunction setTextStyle(textStyle, textStyleModel, specifiedTextStyle, opt, isEmphasis) {\n setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis);\n specifiedTextStyle && zrUtil.extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\n return textStyle;\n}\n/**\n * Set text option in the style.\n * See more info in `setTextStyleCommon`.\n * @deprecated\n * @param {Object} textStyle\n * @param {module:echarts/model/Model} labelModel\n * @param {string|boolean} defaultColor Default text color.\n * If set as false, it will be processed as a emphasis style.\n */\n\n\nfunction setText(textStyle, labelModel, defaultColor) {\n var opt = {\n isRectText: true\n };\n var isEmphasis;\n\n if (defaultColor === false) {\n isEmphasis = true;\n } else {\n // Support setting color as 'auto' to get visual color.\n opt.autoColor = defaultColor;\n }\n\n setTextStyleCommon(textStyle, labelModel, opt, isEmphasis); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n}\n/**\n * The uniform entry of set text style, that is, retrieve style definitions\n * from `model` and set to `textStyle` object.\n *\n * Never in merge mode, but in overwrite mode, that is, all of the text style\n * properties will be set. (Consider the states of normal and emphasis and\n * default value can be adopted, merge would make the logic too complicated\n * to manage.)\n *\n * The `textStyle` object can either be a plain object or an instance of\n * `zrender/src/graphic/Style`, and either be the style of normal or emphasis.\n * After this mothod called, the `textStyle` object can then be used in\n * `el.setStyle(textStyle)` or `el.hoverStyle = textStyle`.\n *\n * Default value will be adopted and `insideRollbackOpt` will be created.\n * See `applyDefaultTextStyle` `rollbackDefaultTextStyle` for more details.\n *\n * opt: {\n * disableBox: boolean, Whether diable drawing box of block (outer most).\n * isRectText: boolean,\n * autoColor: string, specify a color when color is 'auto',\n * for textFill, textStroke, textBackgroundColor, and textBorderColor.\n * If autoColor specified, it is used as default textFill.\n * useInsideStyle:\n * `true`: Use inside style (textFill, textStroke, textStrokeWidth)\n * if `textFill` is not specified.\n * `false`: Do not use inside style.\n * `null/undefined`: use inside style if `isRectText` is true and\n * `textFill` is not specified and textPosition contains `'inside'`.\n * forceRich: boolean\n * }\n */\n\n\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\n\n if (opt.isRectText) {\n var textPosition;\n\n if (opt.getTextPosition) {\n textPosition = opt.getTextPosition(textStyleModel, isEmphasis);\n } else {\n textPosition = textStyleModel.getShallow('position') || (isEmphasis ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used\n // in bar series, and magric type should be considered.\n\n textPosition === 'outside' && (textPosition = 'top');\n }\n\n textStyle.textPosition = textPosition;\n textStyle.textOffset = textStyleModel.getShallow('offset');\n var labelRotate = textStyleModel.getShallow('rotate');\n labelRotate != null && (labelRotate *= Math.PI / 180);\n textStyle.textRotation = labelRotate;\n textStyle.textDistance = zrUtil.retrieve2(textStyleModel.getShallow('distance'), isEmphasis ? null : 5);\n }\n\n var ecModel = textStyleModel.ecModel;\n var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case:\n // {\n // data: [{\n // value: 12,\n // label: {\n // rich: {\n // // no 'a' here but using parent 'a'.\n // }\n // }\n // }],\n // rich: {\n // a: { ... }\n // }\n // }\n\n var richItemNames = getRichItemNames(textStyleModel);\n var richResult;\n\n if (richItemNames) {\n richResult = {};\n\n for (var name in richItemNames) {\n if (richItemNames.hasOwnProperty(name)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name]); // In rich, never `disableBox`.\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\n // That might confuses users. So probably we should put `textStyleModel` as the\n // root ancestor of the `richTextStyle`. But that would be a break change.\n\n setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis);\n }\n }\n }\n\n textStyle.rich = richResult;\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, true);\n\n if (opt.forceRich && !opt.textStyle) {\n opt.textStyle = {};\n }\n\n return textStyle;\n} // Consider case:\n// {\n// data: [{\n// value: 12,\n// label: {\n// rich: {\n// // no 'a' here but using parent 'a'.\n// }\n// }\n// }],\n// rich: {\n// a: { ... }\n// }\n// }\n\n\nfunction getRichItemNames(textStyleModel) {\n // Use object to remove duplicated names.\n var richItemNameMap;\n\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\n\n if (rich) {\n richItemNameMap = richItemNameMap || {};\n\n for (var name in rich) {\n if (rich.hasOwnProperty(name)) {\n richItemNameMap[name] = 1;\n }\n }\n }\n\n textStyleModel = textStyleModel.parentModel;\n }\n\n return richItemNameMap;\n}\n\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, isBlock) {\n // In merge mode, default value should not be given.\n globalTextStyle = !isEmphasis && globalTextStyle || EMPTY_OBJ;\n textStyle.textFill = getAutoColor(textStyleModel.getShallow('color'), opt) || globalTextStyle.color;\n textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt) || globalTextStyle.textBorderColor;\n textStyle.textStrokeWidth = zrUtil.retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\n\n if (!isEmphasis) {\n if (isBlock) {\n textStyle.insideRollbackOpt = opt;\n applyDefaultTextStyle(textStyle);\n } // Set default finally.\n\n\n if (textStyle.textFill == null) {\n textStyle.textFill = opt.autoColor;\n }\n } // Do not use `getFont` here, because merge should be supported, where\n // part of these properties may be changed in emphasis style, and the\n // others should remain their original value got from normal style.\n\n\n textStyle.fontStyle = textStyleModel.getShallow('fontStyle') || globalTextStyle.fontStyle;\n textStyle.fontWeight = textStyleModel.getShallow('fontWeight') || globalTextStyle.fontWeight;\n textStyle.fontSize = textStyleModel.getShallow('fontSize') || globalTextStyle.fontSize;\n textStyle.fontFamily = textStyleModel.getShallow('fontFamily') || globalTextStyle.fontFamily;\n textStyle.textAlign = textStyleModel.getShallow('align');\n textStyle.textVerticalAlign = textStyleModel.getShallow('verticalAlign') || textStyleModel.getShallow('baseline');\n textStyle.textLineHeight = textStyleModel.getShallow('lineHeight');\n textStyle.textWidth = textStyleModel.getShallow('width');\n textStyle.textHeight = textStyleModel.getShallow('height');\n textStyle.textTag = textStyleModel.getShallow('tag');\n\n if (!isBlock || !opt.disableBox) {\n textStyle.textBackgroundColor = getAutoColor(textStyleModel.getShallow('backgroundColor'), opt);\n textStyle.textPadding = textStyleModel.getShallow('padding');\n textStyle.textBorderColor = getAutoColor(textStyleModel.getShallow('borderColor'), opt);\n textStyle.textBorderWidth = textStyleModel.getShallow('borderWidth');\n textStyle.textBorderRadius = textStyleModel.getShallow('borderRadius');\n textStyle.textBoxShadowColor = textStyleModel.getShallow('shadowColor');\n textStyle.textBoxShadowBlur = textStyleModel.getShallow('shadowBlur');\n textStyle.textBoxShadowOffsetX = textStyleModel.getShallow('shadowOffsetX');\n textStyle.textBoxShadowOffsetY = textStyleModel.getShallow('shadowOffsetY');\n }\n\n textStyle.textShadowColor = textStyleModel.getShallow('textShadowColor') || globalTextStyle.textShadowColor;\n textStyle.textShadowBlur = textStyleModel.getShallow('textShadowBlur') || globalTextStyle.textShadowBlur;\n textStyle.textShadowOffsetX = textStyleModel.getShallow('textShadowOffsetX') || globalTextStyle.textShadowOffsetX;\n textStyle.textShadowOffsetY = textStyleModel.getShallow('textShadowOffsetY') || globalTextStyle.textShadowOffsetY;\n}\n\nfunction getAutoColor(color, opt) {\n return color !== 'auto' ? color : opt && opt.autoColor ? opt.autoColor : null;\n}\n/**\n * Give some default value to the input `textStyle` object, based on the current settings\n * in this `textStyle` object.\n *\n * The Scenario:\n * when text position is `inside` and `textFill` is not specified, we show\n * text border by default for better view. But it should be considered that text position\n * might be changed when hovering or being emphasis, where the `insideRollback` is used to\n * restore the style.\n *\n * Usage (& NOTICE):\n * When a style object (eithor plain object or instance of `zrender/src/graphic/Style`) is\n * about to be modified on its text related properties, `rollbackDefaultTextStyle` should\n * be called before the modification and `applyDefaultTextStyle` should be called after that.\n * (For the case that all of the text related properties is reset, like `setTextStyleCommon`\n * does, `rollbackDefaultTextStyle` is not needed to be called).\n */\n\n\nfunction applyDefaultTextStyle(textStyle) {\n var textPosition = textStyle.textPosition;\n var opt = textStyle.insideRollbackOpt;\n var insideRollback;\n\n if (opt && textStyle.textFill == null) {\n var autoColor = opt.autoColor;\n var isRectText = opt.isRectText;\n var useInsideStyle = opt.useInsideStyle;\n var useInsideStyleCache = useInsideStyle !== false && (useInsideStyle === true || isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0);\n var useAutoColorCache = !useInsideStyleCache && autoColor != null; // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached.\n\n if (useInsideStyleCache || useAutoColorCache) {\n insideRollback = {\n textFill: textStyle.textFill,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\n }\n\n if (useInsideStyleCache) {\n textStyle.textFill = '#fff'; // Consider text with #fff overflow its container.\n\n if (textStyle.textStroke == null) {\n textStyle.textStroke = autoColor;\n textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);\n }\n }\n\n if (useAutoColorCache) {\n textStyle.textFill = autoColor;\n }\n } // Always set `insideRollback`, so that the previous one can be cleared.\n\n\n textStyle.insideRollback = insideRollback;\n}\n/**\n * Consider the case: in a scatter,\n * label: {\n * normal: {position: 'inside'},\n * emphasis: {position: 'top'}\n * }\n * In the normal state, the `textFill` will be set as '#fff' for pretty view (see\n * `applyDefaultTextStyle`), but when switching to emphasis state, the `textFill`\n * should be retured to 'autoColor', but not keep '#fff'.\n */\n\n\nfunction rollbackDefaultTextStyle(style) {\n var insideRollback = style.insideRollback;\n\n if (insideRollback) {\n // Reset all of the props in `CACHED_LABEL_STYLE_PROPERTIES`.\n style.textFill = insideRollback.textFill;\n style.textStroke = insideRollback.textStroke;\n style.textStrokeWidth = insideRollback.textStrokeWidth;\n style.insideRollback = null;\n }\n}\n\nfunction getFont(opt, ecModel) {\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\n return zrUtil.trim([// FIXME in node-canvas fontWeight is before fontStyle\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' '));\n}\n\nfunction animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb) {\n if (typeof dataIndex === 'function') {\n cb = dataIndex;\n dataIndex = null;\n } // Do not check 'animation' property directly here. Consider this case:\n // animation model is an `itemModel`, whose does not have `isAnimationEnabled`\n // but its parent model (`seriesModel`) does.\n\n\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n\n if (animationEnabled) {\n var postfix = isUpdate ? 'Update' : '';\n var duration = animatableModel.getShallow('animationDuration' + postfix);\n var animationEasing = animatableModel.getShallow('animationEasing' + postfix);\n var animationDelay = animatableModel.getShallow('animationDelay' + postfix);\n\n if (typeof animationDelay === 'function') {\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n }\n\n if (typeof duration === 'function') {\n duration = duration(dataIndex);\n }\n\n duration > 0 ? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb) : (el.stopAnimation(), el.attr(props), cb && cb());\n } else {\n el.stopAnimation();\n el.attr(props);\n cb && cb();\n }\n}\n/**\n * Update graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n *\n * @param {module:zrender/Element} el\n * @param {Object} props\n * @param {module:echarts/model/Model} [animatableModel]\n * @param {number} [dataIndex]\n * @param {Function} [cb]\n * @example\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\n * // Or\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, function () { console.log('Animation done!'); });\n */\n\n\nfunction updateProps(el, props, animatableModel, dataIndex, cb) {\n animateOrSetProps(true, el, props, animatableModel, dataIndex, cb);\n}\n/**\n * Init graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n *\n * @param {module:zrender/Element} el\n * @param {Object} props\n * @param {module:echarts/model/Model} [animatableModel]\n * @param {number} [dataIndex]\n * @param {Function} cb\n */\n\n\nfunction initProps(el, props, animatableModel, dataIndex, cb) {\n animateOrSetProps(false, el, props, animatableModel, dataIndex, cb);\n}\n/**\n * Get transform matrix of target (param target),\n * in coordinate of its ancestor (param ancestor)\n *\n * @param {module:zrender/mixin/Transformable} target\n * @param {module:zrender/mixin/Transformable} [ancestor]\n */\n\n\nfunction getTransform(target, ancestor) {\n var mat = matrix.identity([]);\n\n while (target && target !== ancestor) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n return mat;\n}\n/**\n * Apply transform to an vertex.\n * @param {Array.} target [x, y]\n * @param {Array.|TypedArray.|Object} transform Can be:\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\n * @param {boolean=} invert Whether use invert matrix.\n * @return {Array.} [x, y]\n */\n\n\nfunction applyTransform(target, transform, invert) {\n if (transform && !zrUtil.isArrayLike(transform)) {\n transform = Transformable.getLocalTransform(transform);\n }\n\n if (invert) {\n transform = matrix.invert([], transform);\n }\n\n return vector.applyTransform([], target, transform);\n}\n/**\n * @param {string} direction 'left' 'right' 'top' 'bottom'\n * @param {Array.} transform Transform matrix: like [1, 0, 0, 1, 0, 0]\n * @param {boolean=} invert Whether use invert matrix.\n * @return {string} Transformed direction. 'left' 'right' 'top' 'bottom'\n */\n\n\nfunction transformDirection(direction, transform, invert) {\n // Pick a base, ensure that transform result will not be (0, 0).\n var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]);\n var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]);\n var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0];\n vertex = applyTransform(vertex, transform, invert);\n return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top';\n}\n/**\n * Apply group transition animation from g1 to g2.\n * If no animatableModel, no animation.\n */\n\n\nfunction groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}\n/**\n * @param {Array.>} points Like: [[23, 44], [53, 66], ...]\n * @param {Object} rect {x, y, width, height}\n * @return {Array.>} A new clipped points.\n */\n\n\nfunction clipPointsByRect(points, rect) {\n // FIXME: this way migth be incorrect when grpahic clipped by a corner.\n // and when element have border.\n return zrUtil.map(points, function (point) {\n var x = point[0];\n x = mathMax(x, rect.x);\n x = mathMin(x, rect.x + rect.width);\n var y = point[1];\n y = mathMax(y, rect.y);\n y = mathMin(y, rect.y + rect.height);\n return [x, y];\n });\n}\n/**\n * @param {Object} targetRect {x, y, width, height}\n * @param {Object} rect {x, y, width, height}\n * @return {Object} A new clipped rect. If rect size are negative, return undefined.\n */\n\n\nfunction clipRectByRect(targetRect, rect) {\n var x = mathMax(targetRect.x, rect.x);\n var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\n var y = mathMax(targetRect.y, rect.y);\n var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border,\n // should be painted. So return undefined.\n\n if (x2 >= x && y2 >= y) {\n return {\n x: x,\n y: y,\n width: x2 - x,\n height: y2 - y\n };\n }\n}\n/**\n * @param {string} iconStr Support 'image://' or 'path://' or direct svg path.\n * @param {Object} [opt] Properties of `module:zrender/Element`, except `style`.\n * @param {Object} [rect] {x, y, width, height}\n * @return {module:zrender/Element} Icon path or image element.\n */\n\n\nfunction createIcon(iconStr, opt, rect) {\n opt = zrUtil.extend({\n rectHover: true\n }, opt);\n var style = opt.style = {\n strokeNoScale: true\n };\n rect = rect || {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n };\n\n if (iconStr) {\n return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), zrUtil.defaults(style, rect), new ZImage(opt)) : makePath(iconStr.replace('path://', ''), opt, rect, 'center');\n }\n}\n/**\n * Return `true` if the given line (line `a`) and the given polygon\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n *\n * @param {number} a1x\n * @param {number} a1y\n * @param {number} a2x\n * @param {number} a2y\n * @param {Array.>} points Points of the polygon.\n * @return {boolean}\n */\n\n\nfunction linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n var p = points[i];\n\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n return true;\n }\n\n p2 = p;\n }\n}\n/**\n * Return `true` if the given two lines (line `a` and line `b`)\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n *\n * @param {number} a1x\n * @param {number} a1y\n * @param {number} a2x\n * @param {number} a2y\n * @param {number} b1x\n * @param {number} b1y\n * @param {number} b2x\n * @param {number} b2y\n * @return {boolean}\n */\n\n\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\n if (nearZero(nmCrossProduct)) {\n return false;\n } // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\n\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\n if (q < 0 || q > 1) {\n return false;\n }\n\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\n if (p < 0 || p > 1) {\n return false;\n }\n\n return true;\n}\n/**\n * Cross product of 2-dimension vector.\n */\n\n\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction nearZero(val) {\n return val <= 1e-6 && val >= -1e-6;\n} // Register built-in shapes. These shapes might be overwirtten\n// by users, although we do not recommend that.\n\n\nregisterShape('circle', Circle);\nregisterShape('sector', Sector);\nregisterShape('ring', Ring);\nregisterShape('polygon', Polygon);\nregisterShape('polyline', Polyline);\nregisterShape('rect', Rect);\nregisterShape('line', Line);\nregisterShape('bezierCurve', BezierCurve);\nregisterShape('arc', Arc);\nexports.Z2_EMPHASIS_LIFT = Z2_EMPHASIS_LIFT;\nexports.CACHED_LABEL_STYLE_PROPERTIES = CACHED_LABEL_STYLE_PROPERTIES;\nexports.extendShape = extendShape;\nexports.extendPath = extendPath;\nexports.registerShape = registerShape;\nexports.getShapeClass = getShapeClass;\nexports.makePath = makePath;\nexports.makeImage = makeImage;\nexports.mergePath = mergePath;\nexports.resizePath = resizePath;\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;\nexports.setElementHoverStyle = setElementHoverStyle;\nexports.setHoverStyle = setHoverStyle;\nexports.setAsHighDownDispatcher = setAsHighDownDispatcher;\nexports.isHighDownDispatcher = isHighDownDispatcher;\nexports.getHighlightDigit = getHighlightDigit;\nexports.setLabelStyle = setLabelStyle;\nexports.modifyLabelStyle = modifyLabelStyle;\nexports.setTextStyle = setTextStyle;\nexports.setText = setText;\nexports.getFont = getFont;\nexports.updateProps = updateProps;\nexports.initProps = initProps;\nexports.getTransform = getTransform;\nexports.applyTransform = applyTransform;\nexports.transformDirection = transformDirection;\nexports.groupTransition = groupTransition;\nexports.clipPointsByRect = clipPointsByRect;\nexports.clipRectByRect = clipRectByRect;\nexports.createIcon = createIcon;\nexports.linePolygonIntersect = linePolygonIntersect;\nexports.lineLineIntersect = lineLineIntersect;","\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 textContain = require(\"zrender/lib/contain/text\");\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*/\nvar PATH_COLOR = ['textStyle', 'color'];\nvar _default = {\n /**\n * Get color property or get color from option.textStyle.color\n * @param {boolean} [isEmphasis]\n * @return {string}\n */\n getTextColor: function (isEmphasis) {\n var ecModel = this.ecModel;\n return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);\n },\n\n /**\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\n * @return {string}\n */\n getFont: function () {\n return graphicUtil.getFont({\n fontStyle: this.getShallow('fontStyle'),\n fontWeight: this.getShallow('fontWeight'),\n fontSize: this.getShallow('fontSize'),\n fontFamily: this.getShallow('fontFamily')\n }, this.ecModel);\n },\n getTextRect: function (text) {\n return textContain.getBoundingRect(text, this.getFont(), this.getShallow('align'), this.getShallow('verticalAlign') || this.getShallow('baseline'), this.getShallow('padding'), this.getShallow('lineHeight'), this.getShallow('rich'), this.getShallow('truncateText'));\n }\n};\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 makeStyleMapper = require(\"./makeStyleMapper\");\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 getItemStyle = makeStyleMapper([['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['textPosition'], ['textAlign']]);\nvar _default = {\n getItemStyle: function (excludes, includes) {\n var style = getItemStyle(this, excludes, includes);\n var lineDash = this.getBorderLineDash();\n lineDash && (style.lineDash = lineDash);\n return style;\n },\n getBorderLineDash: function () {\n var lineType = this.get('borderType');\n return lineType === 'solid' || lineType == null ? null : lineType === 'dashed' ? [5, 5] : [1, 1];\n }\n};\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 env = require(\"zrender/lib/core/env\");\n\nvar _model = require(\"../util/model\");\n\nvar makeInner = _model.makeInner;\n\nvar _clazz = require(\"../util/clazz\");\n\nvar enableClassExtend = _clazz.enableClassExtend;\nvar enableClassCheck = _clazz.enableClassCheck;\n\nvar lineStyleMixin = require(\"./mixin/lineStyle\");\n\nvar areaStyleMixin = require(\"./mixin/areaStyle\");\n\nvar textStyleMixin = require(\"./mixin/textStyle\");\n\nvar itemStyleMixin = require(\"./mixin/itemStyle\");\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 * @module echarts/model/Model\n */\nvar mixin = zrUtil.mixin;\nvar inner = makeInner();\n/**\n * @alias module:echarts/model/Model\n * @constructor\n * @param {Object} [option]\n * @param {module:echarts/model/Model} [parentModel]\n * @param {module:echarts/model/Global} [ecModel]\n */\n\nfunction Model(option, parentModel, ecModel) {\n /**\n * @type {module:echarts/model/Model}\n * @readOnly\n */\n this.parentModel = parentModel;\n /**\n * @type {module:echarts/model/Global}\n * @readOnly\n */\n\n this.ecModel = ecModel;\n /**\n * @type {Object}\n * @protected\n */\n\n this.option = option; // Simple optimization\n // if (this.init) {\n // if (arguments.length <= 4) {\n // this.init(option, parentModel, ecModel, extraOpt);\n // }\n // else {\n // this.init.apply(this, arguments);\n // }\n // }\n}\n\nModel.prototype = {\n constructor: Model,\n\n /**\n * Model 的初始化函数\n * @param {Object} option\n */\n init: null,\n\n /**\n * 从新的 Option merge\n */\n mergeOption: function (option) {\n zrUtil.merge(this.option, option, true);\n },\n\n /**\n * @param {string|Array.} path\n * @param {boolean} [ignoreParent=false]\n * @return {*}\n */\n get: function (path, ignoreParent) {\n if (path == null) {\n return this.option;\n }\n\n return doGet(this.option, this.parsePath(path), !ignoreParent && getParent(this, path));\n },\n\n /**\n * @param {string} key\n * @param {boolean} [ignoreParent=false]\n * @return {*}\n */\n getShallow: function (key, ignoreParent) {\n var option = this.option;\n var val = option == null ? option : option[key];\n var parentModel = !ignoreParent && getParent(this, key);\n\n if (val == null && parentModel) {\n val = parentModel.getShallow(key);\n }\n\n return val;\n },\n\n /**\n * @param {string|Array.} [path]\n * @param {module:echarts/model/Model} [parentModel]\n * @return {module:echarts/model/Model}\n */\n getModel: function (path, parentModel) {\n var obj = path == null ? this.option : doGet(this.option, path = this.parsePath(path));\n var thisParentModel;\n parentModel = parentModel || (thisParentModel = getParent(this, path)) && thisParentModel.getModel(path);\n return new Model(obj, parentModel, this.ecModel);\n },\n\n /**\n * If model has option\n */\n isEmpty: function () {\n return this.option == null;\n },\n restoreData: function () {},\n // Pending\n clone: function () {\n var Ctor = this.constructor;\n return new Ctor(zrUtil.clone(this.option));\n },\n setReadOnly: function (properties) {// clazzUtil.setReadOnly(this, properties);\n },\n // If path is null/undefined, return null/undefined.\n parsePath: function (path) {\n if (typeof path === 'string') {\n path = path.split('.');\n }\n\n return path;\n },\n\n /**\n * @param {Function} getParentMethod\n * param {Array.|string} path\n * return {module:echarts/model/Model}\n */\n customizeGetParent: function (getParentMethod) {\n inner(this).getParent = getParentMethod;\n },\n isAnimationEnabled: function () {\n if (!env.node) {\n if (this.option.animation != null) {\n return !!this.option.animation;\n } else if (this.parentModel) {\n return this.parentModel.isAnimationEnabled();\n }\n }\n }\n};\n\nfunction doGet(obj, pathArr, parentModel) {\n for (var i = 0; i < pathArr.length; i++) {\n // Ignore empty\n if (!pathArr[i]) {\n continue;\n } // obj could be number/string/... (like 0)\n\n\n obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null;\n\n if (obj == null) {\n break;\n }\n }\n\n if (obj == null && parentModel) {\n obj = parentModel.get(pathArr);\n }\n\n return obj;\n} // `path` can be null/undefined\n\n\nfunction getParent(model, path) {\n var getParentMethod = inner(model).getParent;\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n} // Enable Model.extend.\n\n\nenableClassExtend(Model);\nenableClassCheck(Model);\nmixin(Model, lineStyleMixin);\nmixin(Model, areaStyleMixin);\nmixin(Model, textStyleMixin);\nmixin(Model, itemStyleMixin);\nvar _default = Model;\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 _clazz = require(\"./clazz\");\n\nvar parseClassType = _clazz.parseClassType;\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 base = 0;\n/**\n * @public\n * @param {string} type\n * @return {string}\n */\n\nfunction getUID(type) {\n // Considering the case of crossing js context,\n // use Math.random to make id as unique as possible.\n return [type || '', base++, Math.random().toFixed(5)].join('_');\n}\n/**\n * @inner\n */\n\n\nfunction enableSubTypeDefaulter(entity) {\n var subTypeDefaulters = {};\n\n entity.registerSubTypeDefaulter = function (componentType, defaulter) {\n componentType = parseClassType(componentType);\n subTypeDefaulters[componentType.main] = defaulter;\n };\n\n entity.determineSubType = function (componentType, option) {\n var type = option.type;\n\n if (!type) {\n var componentTypeMain = parseClassType(componentType).main;\n\n if (entity.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\n type = subTypeDefaulters[componentTypeMain](option);\n }\n }\n\n return type;\n };\n\n return entity;\n}\n/**\n * Topological travel on Activity Network (Activity On Vertices).\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\n *\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\n *\n * If there is circle dependencey, Error will be thrown.\n *\n */\n\n\nfunction enableTopologicalTravel(entity, dependencyGetter) {\n /**\n * @public\n * @param {Array.} targetNameList Target Component type list.\n * Can be ['aa', 'bb', 'aa.xx']\n * @param {Array.} fullNameList By which we can build dependency graph.\n * @param {Function} callback Params: componentType, dependencies.\n * @param {Object} context Scope of callback.\n */\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\n if (!targetNameList.length) {\n return;\n }\n\n var result = makeDepndencyGraph(fullNameList);\n var graph = result.graph;\n var stack = result.noEntryList;\n var targetNameSet = {};\n zrUtil.each(targetNameList, function (name) {\n targetNameSet[name] = true;\n });\n\n while (stack.length) {\n var currComponentType = stack.pop();\n var currVertex = graph[currComponentType];\n var isInTargetNameSet = !!targetNameSet[currComponentType];\n\n if (isInTargetNameSet) {\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\n delete targetNameSet[currComponentType];\n }\n\n zrUtil.each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\n }\n\n zrUtil.each(targetNameSet, function () {\n throw new Error('Circle dependency may exists');\n });\n\n function removeEdge(succComponentType) {\n graph[succComponentType].entryCount--;\n\n if (graph[succComponentType].entryCount === 0) {\n stack.push(succComponentType);\n }\n } // Consider this case: legend depends on series, and we call\n // chart.setOption({series: [...]}), where only series is in option.\n // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\n // not be called, but only sereis.mergeOption is called. Thus legend\n // have no chance to update its local record about series (like which\n // name of series is available in legend).\n\n\n function removeEdgeAndAdd(succComponentType) {\n targetNameSet[succComponentType] = true;\n removeEdge(succComponentType);\n }\n };\n /**\n * DepndencyGraph: {Object}\n * key: conponentType,\n * value: {\n * successor: [conponentTypes...],\n * originalDeps: [conponentTypes...],\n * entryCount: {number}\n * }\n */\n\n\n function makeDepndencyGraph(fullNameList) {\n var graph = {};\n var noEntryList = [];\n zrUtil.each(fullNameList, function (name) {\n var thisItem = createDependencyGraphItem(graph, name);\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\n thisItem.entryCount = availableDeps.length;\n\n if (thisItem.entryCount === 0) {\n noEntryList.push(name);\n }\n\n zrUtil.each(availableDeps, function (dependentName) {\n if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\n thisItem.predecessor.push(dependentName);\n }\n\n var thatItem = createDependencyGraphItem(graph, dependentName);\n\n if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\n thatItem.successor.push(name);\n }\n });\n });\n return {\n graph: graph,\n noEntryList: noEntryList\n };\n }\n\n function createDependencyGraphItem(graph, name) {\n if (!graph[name]) {\n graph[name] = {\n predecessor: [],\n successor: []\n };\n }\n\n return graph[name];\n }\n\n function getAvailableDependencies(originalDeps, fullNameList) {\n var availableDeps = [];\n zrUtil.each(originalDeps, function (dep) {\n zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\n });\n return availableDeps;\n }\n}\n\nexports.getUID = getUID;\nexports.enableSubTypeDefaulter = enableSubTypeDefaulter;\nexports.enableTopologicalTravel = enableTopologicalTravel;","\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\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* A third-party license is embeded for some of the code in this file:\n* The method \"quantile\" was copied from \"d3.js\".\n* (See more details in the comment of the method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\nvar RADIAN_EPSILON = 1e-4;\n\nfunction _trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n/**\n * Linear mapping a value from domain to range\n * @memberOf module:echarts/util/number\n * @param {(number|Array.)} val\n * @param {Array.} domain Domain extent domain[0] can be bigger than domain[1]\n * @param {Array.} range Range extent range[0] can be bigger than range[1]\n * @param {boolean} clamp\n * @return {(number|Array.}\n */\n\n\nfunction linearMap(val, domain, range, clamp) {\n var subDomain = domain[1] - domain[0];\n var subRange = range[1] - range[0];\n\n if (subDomain === 0) {\n return subRange === 0 ? range[0] : (range[0] + range[1]) / 2;\n } // Avoid accuracy problem in edge, such as\n // 146.39 - 62.83 === 83.55999999999999.\n // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\n // It is a little verbose for efficiency considering this method\n // is a hotspot.\n\n\n if (clamp) {\n if (subDomain > 0) {\n if (val <= domain[0]) {\n return range[0];\n } else if (val >= domain[1]) {\n return range[1];\n }\n } else {\n if (val >= domain[0]) {\n return range[0];\n } else if (val <= domain[1]) {\n return range[1];\n }\n }\n } else {\n if (val === domain[0]) {\n return range[0];\n }\n\n if (val === domain[1]) {\n return range[1];\n }\n }\n\n return (val - domain[0]) / subDomain * subRange + range[0];\n}\n/**\n * Convert a percent string to absolute number.\n * Returns NaN if percent is not a valid string or number\n * @memberOf module:echarts/util/number\n * @param {string|number} percent\n * @param {number} all\n * @return {number}\n */\n\n\nfunction parsePercent(percent, all) {\n switch (percent) {\n case 'center':\n case 'middle':\n percent = '50%';\n break;\n\n case 'left':\n case 'top':\n percent = '0%';\n break;\n\n case 'right':\n case 'bottom':\n percent = '100%';\n break;\n }\n\n if (typeof percent === 'string') {\n if (_trim(percent).match(/%$/)) {\n return parseFloat(percent) / 100 * all;\n }\n\n return parseFloat(percent);\n }\n\n return percent == null ? NaN : +percent;\n}\n/**\n * (1) Fix rounding error of float numbers.\n * (2) Support return string to avoid scientific notation like '3.5e-7'.\n *\n * @param {number} x\n * @param {number} [precision]\n * @param {boolean} [returnStr]\n * @return {number|string}\n */\n\n\nfunction round(x, precision, returnStr) {\n if (precision == null) {\n precision = 10;\n } // Avoid range error\n\n\n precision = Math.min(Math.max(0, precision), 20);\n x = (+x).toFixed(precision);\n return returnStr ? x : +x;\n}\n/**\n * asc sort arr.\n * The input arr will be modified.\n *\n * @param {Array} arr\n * @return {Array} The input arr.\n */\n\n\nfunction asc(arr) {\n arr.sort(function (a, b) {\n return a - b;\n });\n return arr;\n}\n/**\n * Get precision\n * @param {number} val\n */\n\n\nfunction getPrecision(val) {\n val = +val;\n\n if (isNaN(val)) {\n return 0;\n } // It is much faster than methods converting number to string as follows\n // var tmp = val.toString();\n // return tmp.length - 1 - tmp.indexOf('.');\n // especially when precision is low\n\n\n var e = 1;\n var count = 0;\n\n while (Math.round(val * e) / e !== val) {\n e *= 10;\n count++;\n }\n\n return count;\n}\n/**\n * @param {string|number} val\n * @return {number}\n */\n\n\nfunction getPrecisionSafe(val) {\n var str = val.toString(); // Consider scientific notation: '3.4e-12' '3.4e+12'\n\n var eIndex = str.indexOf('e');\n\n if (eIndex > 0) {\n var precision = +str.slice(eIndex + 1);\n return precision < 0 ? -precision : 0;\n } else {\n var dotIndex = str.indexOf('.');\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\n }\n}\n/**\n * Minimal dicernible data precisioin according to a single pixel.\n *\n * @param {Array.} dataExtent\n * @param {Array.} pixelExtent\n * @return {number} precision\n */\n\n\nfunction getPixelPrecision(dataExtent, pixelExtent) {\n var log = Math.log;\n var LN10 = Math.LN10;\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20.\n\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\n return !isFinite(precision) ? 20 : precision;\n}\n/**\n * Get a data of given precision, assuring the sum of percentages\n * in valueList is 1.\n * The largest remainer method is used.\n * https://en.wikipedia.org/wiki/Largest_remainder_method\n *\n * @param {Array.} valueList a list of all data\n * @param {number} idx index of the data to be processed in valueList\n * @param {number} precision integer number showing digits of precision\n * @return {number} percent ranging from 0 to 100\n */\n\n\nfunction getPercentWithPrecision(valueList, idx, precision) {\n if (!valueList[idx]) {\n return 0;\n }\n\n var sum = zrUtil.reduce(valueList, function (acc, val) {\n return acc + (isNaN(val) ? 0 : val);\n }, 0);\n\n if (sum === 0) {\n return 0;\n }\n\n var digits = Math.pow(10, precision);\n var votesPerQuota = zrUtil.map(valueList, function (val) {\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\n });\n var targetSeats = digits * 100;\n var seats = zrUtil.map(votesPerQuota, function (votes) {\n // Assign automatic seats.\n return Math.floor(votes);\n });\n var currentSum = zrUtil.reduce(seats, function (acc, val) {\n return acc + val;\n }, 0);\n var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\n return votes - seats[idx];\n }); // Has remainding votes.\n\n while (currentSum < targetSeats) {\n // Find next largest remainder.\n var max = Number.NEGATIVE_INFINITY;\n var maxId = null;\n\n for (var i = 0, len = remainder.length; i < len; ++i) {\n if (remainder[i] > max) {\n max = remainder[i];\n maxId = i;\n }\n } // Add a vote to max remainder.\n\n\n ++seats[maxId];\n remainder[maxId] = 0;\n ++currentSum;\n }\n\n return seats[idx] / digits;\n} // Number.MAX_SAFE_INTEGER, ie do not support.\n\n\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * To 0 - 2 * PI, considering negative radian.\n * @param {number} radian\n * @return {number}\n */\n\nfunction remRadian(radian) {\n var pi2 = Math.PI * 2;\n return (radian % pi2 + pi2) % pi2;\n}\n/**\n * @param {type} radian\n * @return {boolean}\n */\n\n\nfunction isRadianAroundZero(val) {\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\n}\n/* eslint-disable */\n\n\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d\\d)(?::(\\d\\d)(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\n\n/* eslint-enable */\n\n/**\n * @param {string|Date|number} value These values can be accepted:\n * + An instance of Date, represent a time in its own time zone.\n * + Or string in a subset of ISO 8601, only including:\n * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\n * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\n * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\n * all of which will be treated as local time if time zone is not specified\n * (see ).\n * + Or other string format, including (all of which will be treated as loacal time):\n * '2012', '2012-3-1', '2012/3/1', '2012/03/01',\n * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\n * + a timestamp, which represent a time in UTC.\n * @return {Date} date\n */\n\nfunction parseDate(value) {\n if (value instanceof Date) {\n return value;\n } else if (typeof value === 'string') {\n // Different browsers parse date in different way, so we parse it manually.\n // Some other issues:\n // new Date('1970-01-01') is UTC,\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\n // See issue #3623\n var match = TIME_REG.exec(value);\n\n if (!match) {\n // return Invalid Date.\n return new Date(NaN);\n } // Use local time when no timezone offset specifed.\n\n\n if (!match[8]) {\n // match[n] can only be string or undefined.\n // But take care of '12' + 1 => '121'.\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\n } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\n // then these code will get different result:\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\n // So we should not use `new Date`, but use `Date.UTC`.\n else {\n var hour = +match[4] || 0;\n\n if (match[8].toUpperCase() !== 'Z') {\n hour -= match[8].slice(0, 3);\n }\n\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\n }\n } else if (value == null) {\n return new Date(NaN);\n }\n\n return new Date(Math.round(value));\n}\n/**\n * Quantity of a number. e.g. 0.1, 1, 10, 100\n *\n * @param {number} val\n * @return {number}\n */\n\n\nfunction quantity(val) {\n return Math.pow(10, quantityExponent(val));\n}\n/**\n * Exponent of the quantity of a number\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\n *\n * @param {number} val non-negative value\n * @return {number}\n */\n\n\nfunction quantityExponent(val) {\n if (val === 0) {\n return 0;\n }\n\n var exp = Math.floor(Math.log(val) / Math.LN10);\n /**\n * exp is expected to be the rounded-down result of the base-10 log of val.\n * But due to the precision loss with Math.log(val), we need to restore it\n * using 10^exp to make sure we can get val back from exp. #11249\n */\n\n if (val / Math.pow(10, exp) >= 10) {\n exp++;\n }\n\n return exp;\n}\n/**\n * find a “nice” number approximately equal to x. Round the number if round = true,\n * take ceiling if round = false. The primary observation is that the “nicest”\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\n *\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\n *\n * @param {number} val Non-negative value.\n * @param {boolean} round\n * @return {number}\n */\n\n\nfunction nice(val, round) {\n var exponent = quantityExponent(val);\n var exp10 = Math.pow(10, exponent);\n var f = val / exp10; // 1 <= f < 10\n\n var nf;\n\n if (round) {\n if (f < 1.5) {\n nf = 1;\n } else if (f < 2.5) {\n nf = 2;\n } else if (f < 4) {\n nf = 3;\n } else if (f < 7) {\n nf = 5;\n } else {\n nf = 10;\n }\n } else {\n if (f < 1) {\n nf = 1;\n } else if (f < 2) {\n nf = 2;\n } else if (f < 3) {\n nf = 3;\n } else if (f < 5) {\n nf = 5;\n } else {\n nf = 10;\n }\n }\n\n val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\n // 20 is the uppper bound of toFixed.\n\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\n}\n/**\n * This code was copied from \"d3.js\"\n * .\n * See the license statement at the head of this file.\n * @param {Array.} ascArr\n */\n\n\nfunction quantile(ascArr, p) {\n var H = (ascArr.length - 1) * p + 1;\n var h = Math.floor(H);\n var v = +ascArr[h - 1];\n var e = H - h;\n return e ? v + e * (ascArr[h] - v) : v;\n}\n/**\n * Order intervals asc, and split them when overlap.\n * expect(numberUtil.reformIntervals([\n * {interval: [18, 62], close: [1, 1]},\n * {interval: [-Infinity, -70], close: [0, 0]},\n * {interval: [-70, -26], close: [1, 1]},\n * {interval: [-26, 18], close: [1, 1]},\n * {interval: [62, 150], close: [1, 1]},\n * {interval: [106, 150], close: [1, 1]},\n * {interval: [150, Infinity], close: [0, 0]}\n * ])).toEqual([\n * {interval: [-Infinity, -70], close: [0, 0]},\n * {interval: [-70, -26], close: [1, 1]},\n * {interval: [-26, 18], close: [0, 1]},\n * {interval: [18, 62], close: [0, 1]},\n * {interval: [62, 150], close: [0, 1]},\n * {interval: [150, Infinity], close: [0, 0]}\n * ]);\n * @param {Array.} list, where `close` mean open or close\n * of the interval, and Infinity can be used.\n * @return {Array.} The origin list, which has been reformed.\n */\n\n\nfunction reformIntervals(list) {\n list.sort(function (a, b) {\n return littleThan(a, b, 0) ? -1 : 1;\n });\n var curr = -Infinity;\n var currClose = 1;\n\n for (var i = 0; i < list.length;) {\n var interval = list[i].interval;\n var close = list[i].close;\n\n for (var lg = 0; lg < 2; lg++) {\n if (interval[lg] <= curr) {\n interval[lg] = curr;\n close[lg] = !lg ? 1 - currClose : 1;\n }\n\n curr = interval[lg];\n currClose = close[lg];\n }\n\n if (interval[0] === interval[1] && close[0] * close[1] !== 1) {\n list.splice(i, 1);\n } else {\n i++;\n }\n }\n\n return list;\n\n function littleThan(a, b, lg) {\n return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1));\n }\n}\n/**\n * parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n * ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n * subtraction forces infinities to NaN\n *\n * @param {*} v\n * @return {boolean}\n */\n\n\nfunction isNumeric(v) {\n return v - parseFloat(v) >= 0;\n}\n\nexports.linearMap = linearMap;\nexports.parsePercent = parsePercent;\nexports.round = round;\nexports.asc = asc;\nexports.getPrecision = getPrecision;\nexports.getPrecisionSafe = getPrecisionSafe;\nexports.getPixelPrecision = getPixelPrecision;\nexports.getPercentWithPrecision = getPercentWithPrecision;\nexports.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;\nexports.remRadian = remRadian;\nexports.isRadianAroundZero = isRadianAroundZero;\nexports.parseDate = parseDate;\nexports.quantity = quantity;\nexports.quantityExponent = quantityExponent;\nexports.nice = nice;\nexports.quantile = quantile;\nexports.reformIntervals = reformIntervals;\nexports.isNumeric = isNumeric;","\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 textContain = require(\"zrender/lib/contain/text\");\n\nvar numberUtil = require(\"./number\");\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// import Text from 'zrender/src/graphic/Text';\n\n/**\n * add commas after every three numbers\n * @param {string|number} x\n * @return {string}\n */\nfunction addCommas(x) {\n if (isNaN(x)) {\n return '-';\n }\n\n x = (x + '').split('.');\n return x[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,') + (x.length > 1 ? '.' + x[1] : '');\n}\n/**\n * @param {string} str\n * @param {boolean} [upperCaseFirst=false]\n * @return {string} str\n */\n\n\nfunction toCamelCase(str, upperCaseFirst) {\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\n return group1.toUpperCase();\n });\n\n if (upperCaseFirst && str) {\n str = str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n return str;\n}\n\nvar normalizeCssArray = zrUtil.normalizeCssArray;\nvar replaceReg = /([&<>\"'])/g;\nvar replaceMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\n\nfunction encodeHTML(source) {\n return source == null ? '' : (source + '').replace(replaceReg, function (str, c) {\n return replaceMap[c];\n });\n}\n\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\n\nvar wrapVar = function (varName, seriesIdx) {\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\n};\n/**\n * Template formatter\n * @param {string} tpl\n * @param {Array.|Object} paramsList\n * @param {boolean} [encode=false]\n * @return {string}\n */\n\n\nfunction formatTpl(tpl, paramsList, encode) {\n if (!zrUtil.isArray(paramsList)) {\n paramsList = [paramsList];\n }\n\n var seriesLen = paramsList.length;\n\n if (!seriesLen) {\n return '';\n }\n\n var $vars = paramsList[0].$vars || [];\n\n for (var i = 0; i < $vars.length; i++) {\n var alias = TPL_VAR_ALIAS[i];\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\n }\n\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\n for (var k = 0; k < $vars.length; k++) {\n var val = paramsList[seriesIdx][$vars[k]];\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\n }\n }\n\n return tpl;\n}\n/**\n * simple Template formatter\n *\n * @param {string} tpl\n * @param {Object} param\n * @param {boolean} [encode=false]\n * @return {string}\n */\n\n\nfunction formatTplSimple(tpl, param, encode) {\n zrUtil.each(param, function (value, key) {\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\n });\n return tpl;\n}\n/**\n * @param {Object|string} [opt] If string, means color.\n * @param {string} [opt.color]\n * @param {string} [opt.extraCssText]\n * @param {string} [opt.type='item'] 'item' or 'subItem'\n * @param {string} [opt.renderMode='html'] render mode of tooltip, 'html' or 'richText'\n * @param {string} [opt.markerId='X'] id name for marker. If only one marker is in a rich text, this can be omitted.\n * @return {string}\n */\n\n\nfunction getTooltipMarker(opt, extraCssText) {\n opt = zrUtil.isString(opt) ? {\n color: opt,\n extraCssText: extraCssText\n } : opt || {};\n var color = opt.color;\n var type = opt.type;\n var extraCssText = opt.extraCssText;\n var renderMode = opt.renderMode || 'html';\n var markerId = opt.markerId || 'X';\n\n if (!color) {\n return '';\n }\n\n if (renderMode === 'html') {\n return type === 'subItem' ? '' : '';\n } else {\n // Space for rich element marker\n return {\n renderMode: renderMode,\n content: '{marker' + markerId + '|} ',\n style: {\n color: color\n }\n };\n }\n}\n\nfunction pad(str, len) {\n str += '';\n return '0000'.substr(0, len - str.length) + str;\n}\n/**\n * ISO Date format\n * @param {string} tpl\n * @param {number} value\n * @param {boolean} [isUTC=false] Default in local time.\n * see `module:echarts/scale/Time`\n * and `module:echarts/util/number#parseDate`.\n * @inner\n */\n\n\nfunction formatTime(tpl, value, isUTC) {\n if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') {\n tpl = 'MM-dd\\nyyyy';\n }\n\n var date = numberUtil.parseDate(value);\n var utc = isUTC ? 'UTC' : '';\n var y = date['get' + utc + 'FullYear']();\n var M = date['get' + utc + 'Month']() + 1;\n var d = date['get' + utc + 'Date']();\n var h = date['get' + utc + 'Hours']();\n var m = date['get' + utc + 'Minutes']();\n var s = date['get' + utc + 'Seconds']();\n var S = date['get' + utc + 'Milliseconds']();\n tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', y % 100).replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3));\n return tpl;\n}\n/**\n * Capital first\n * @param {string} str\n * @return {string}\n */\n\n\nfunction capitalFirst(str) {\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\n}\n\nvar truncateText = textContain.truncateText;\n/**\n * @public\n * @param {Object} opt\n * @param {string} opt.text\n * @param {string} opt.font\n * @param {string} [opt.textAlign='left']\n * @param {string} [opt.textVerticalAlign='top']\n * @param {Array.} [opt.textPadding]\n * @param {number} [opt.textLineHeight]\n * @param {Object} [opt.rich]\n * @param {Object} [opt.truncate]\n * @return {Object} {x, y, width, height, lineHeight}\n */\n\nfunction getTextBoundingRect(opt) {\n return textContain.getBoundingRect(opt.text, opt.font, opt.textAlign, opt.textVerticalAlign, opt.textPadding, opt.textLineHeight, opt.rich, opt.truncate);\n}\n/**\n * @deprecated\n * the `textLineHeight` was added later.\n * For backward compatiblility, put it as the last parameter.\n * But deprecated this interface. Please use `getTextBoundingRect` instead.\n */\n\n\nfunction getTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate, textLineHeight) {\n return textContain.getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate);\n}\n/**\n * open new tab\n * @param {string} link url\n * @param {string} target blank or self\n */\n\n\nfunction windowOpen(link, target) {\n if (target === '_blank' || target === 'blank') {\n var blank = window.open();\n blank.opener = null;\n blank.location = link;\n } else {\n window.open(link, target);\n }\n}\n\nexports.addCommas = addCommas;\nexports.toCamelCase = toCamelCase;\nexports.normalizeCssArray = normalizeCssArray;\nexports.encodeHTML = encodeHTML;\nexports.formatTpl = formatTpl;\nexports.formatTplSimple = formatTplSimple;\nexports.getTooltipMarker = getTooltipMarker;\nexports.formatTime = formatTime;\nexports.capitalFirst = capitalFirst;\nexports.truncateText = truncateText;\nexports.getTextBoundingRect = getTextBoundingRect;\nexports.getTextRect = getTextRect;\nexports.windowOpen = windowOpen;","\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 BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar _number = require(\"./number\");\n\nvar parsePercent = _number.parsePercent;\n\nvar formatUtil = require(\"./format\");\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// Layout helpers for each component positioning\nvar each = zrUtil.each;\n/**\n * @public\n */\n\nvar LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];\n/**\n * @public\n */\n\nvar HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']];\n\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\n var x = 0;\n var y = 0;\n\n if (maxWidth == null) {\n maxWidth = Infinity;\n }\n\n if (maxHeight == null) {\n maxHeight = Infinity;\n }\n\n var currentLineMaxSize = 0;\n group.eachChild(function (child, idx) {\n var position = child.position;\n var rect = child.getBoundingRect();\n var nextChild = group.childAt(idx + 1);\n var nextChildRect = nextChild && nextChild.getBoundingRect();\n var nextX;\n var nextY;\n\n if (orient === 'horizontal') {\n var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);\n nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group\n // FIXME compare before adding gap?\n\n if (nextX > maxWidth || child.newline) {\n x = 0;\n nextX = moveX;\n y += currentLineMaxSize + gap;\n currentLineMaxSize = rect.height;\n } else {\n // FIXME: consider rect.y is not `0`?\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\n }\n } else {\n var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);\n nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group\n\n if (nextY > maxHeight || child.newline) {\n x += currentLineMaxSize + gap;\n y = 0;\n nextY = moveY;\n currentLineMaxSize = rect.width;\n } else {\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\n }\n }\n\n if (child.newline) {\n return;\n }\n\n position[0] = x;\n position[1] = y;\n orient === 'horizontal' ? x = nextX + gap : y = nextY + gap;\n });\n}\n/**\n * VBox or HBox layouting\n * @param {string} orient\n * @param {module:zrender/container/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\n\n\nvar box = boxLayout;\n/**\n * VBox layouting\n * @param {module:zrender/container/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\n\nvar vbox = zrUtil.curry(boxLayout, 'vertical');\n/**\n * HBox layouting\n * @param {module:zrender/container/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\n\nvar hbox = zrUtil.curry(boxLayout, 'horizontal');\n/**\n * If x or x2 is not specified or 'center' 'left' 'right',\n * the width would be as long as possible.\n * If y or y2 is not specified or 'middle' 'top' 'bottom',\n * the height would be as long as possible.\n *\n * @param {Object} positionInfo\n * @param {number|string} [positionInfo.x]\n * @param {number|string} [positionInfo.y]\n * @param {number|string} [positionInfo.x2]\n * @param {number|string} [positionInfo.y2]\n * @param {Object} containerRect {width, height}\n * @param {string|number} margin\n * @return {Object} {width, height}\n */\n\nfunction getAvailableSize(positionInfo, containerRect, margin) {\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var x = parsePercent(positionInfo.x, containerWidth);\n var y = parsePercent(positionInfo.y, containerHeight);\n var x2 = parsePercent(positionInfo.x2, containerWidth);\n var y2 = parsePercent(positionInfo.y2, containerHeight);\n (isNaN(x) || isNaN(parseFloat(positionInfo.x))) && (x = 0);\n (isNaN(x2) || isNaN(parseFloat(positionInfo.x2))) && (x2 = containerWidth);\n (isNaN(y) || isNaN(parseFloat(positionInfo.y))) && (y = 0);\n (isNaN(y2) || isNaN(parseFloat(positionInfo.y2))) && (y2 = containerHeight);\n margin = formatUtil.normalizeCssArray(margin || 0);\n return {\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\n };\n}\n/**\n * Parse position info.\n *\n * @param {Object} positionInfo\n * @param {number|string} [positionInfo.left]\n * @param {number|string} [positionInfo.top]\n * @param {number|string} [positionInfo.right]\n * @param {number|string} [positionInfo.bottom]\n * @param {number|string} [positionInfo.width]\n * @param {number|string} [positionInfo.height]\n * @param {number|string} [positionInfo.aspect] Aspect is width / height\n * @param {Object} containerRect\n * @param {string|number} [margin]\n *\n * @return {module:zrender/core/BoundingRect}\n */\n\n\nfunction getLayoutRect(positionInfo, containerRect, margin) {\n margin = formatUtil.normalizeCssArray(margin || 0);\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var left = parsePercent(positionInfo.left, containerWidth);\n var top = parsePercent(positionInfo.top, containerHeight);\n var right = parsePercent(positionInfo.right, containerWidth);\n var bottom = parsePercent(positionInfo.bottom, containerHeight);\n var width = parsePercent(positionInfo.width, containerWidth);\n var height = parsePercent(positionInfo.height, containerHeight);\n var verticalMargin = margin[2] + margin[0];\n var horizontalMargin = margin[1] + margin[3];\n var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right\n\n if (isNaN(width)) {\n width = containerWidth - right - horizontalMargin - left;\n }\n\n if (isNaN(height)) {\n height = containerHeight - bottom - verticalMargin - top;\n }\n\n if (aspect != null) {\n // If width and height are not given\n // 1. Graph should not exceeds the container\n // 2. Aspect must be keeped\n // 3. Graph should take the space as more as possible\n // FIXME\n // Margin is not considered, because there is no case that both\n // using margin and aspect so far.\n if (isNaN(width) && isNaN(height)) {\n if (aspect > containerWidth / containerHeight) {\n width = containerWidth * 0.8;\n } else {\n height = containerHeight * 0.8;\n }\n } // Calculate width or height with given aspect\n\n\n if (isNaN(width)) {\n width = aspect * height;\n }\n\n if (isNaN(height)) {\n height = width / aspect;\n }\n } // If left is not specified, calculate left from right and width\n\n\n if (isNaN(left)) {\n left = containerWidth - right - width - horizontalMargin;\n }\n\n if (isNaN(top)) {\n top = containerHeight - bottom - height - verticalMargin;\n } // Align left and top\n\n\n switch (positionInfo.left || positionInfo.right) {\n case 'center':\n left = containerWidth / 2 - width / 2 - margin[3];\n break;\n\n case 'right':\n left = containerWidth - width - horizontalMargin;\n break;\n }\n\n switch (positionInfo.top || positionInfo.bottom) {\n case 'middle':\n case 'center':\n top = containerHeight / 2 - height / 2 - margin[0];\n break;\n\n case 'bottom':\n top = containerHeight - height - verticalMargin;\n break;\n } // If something is wrong and left, top, width, height are calculated as NaN\n\n\n left = left || 0;\n top = top || 0;\n\n if (isNaN(width)) {\n // Width may be NaN if only one value is given except width\n width = containerWidth - horizontalMargin - left - (right || 0);\n }\n\n if (isNaN(height)) {\n // Height may be NaN if only one value is given except height\n height = containerHeight - verticalMargin - top - (bottom || 0);\n }\n\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\n rect.margin = margin;\n return rect;\n}\n/**\n * Position a zr element in viewport\n * Group position is specified by either\n * {left, top}, {right, bottom}\n * If all properties exists, right and bottom will be igonred.\n *\n * Logic:\n * 1. Scale (against origin point in parent coord)\n * 2. Rotate (against origin point in parent coord)\n * 3. Traslate (with el.position by this method)\n * So this method only fixes the last step 'Traslate', which does not affect\n * scaling and rotating.\n *\n * If be called repeatly with the same input el, the same result will be gotten.\n *\n * @param {module:zrender/Element} el Should have `getBoundingRect` method.\n * @param {Object} positionInfo\n * @param {number|string} [positionInfo.left]\n * @param {number|string} [positionInfo.top]\n * @param {number|string} [positionInfo.right]\n * @param {number|string} [positionInfo.bottom]\n * @param {number|string} [positionInfo.width] Only for opt.boundingModel: 'raw'\n * @param {number|string} [positionInfo.height] Only for opt.boundingModel: 'raw'\n * @param {Object} containerRect\n * @param {string|number} margin\n * @param {Object} [opt]\n * @param {Array.} [opt.hv=[1,1]] Only horizontal or only vertical.\n * @param {Array.} [opt.boundingMode='all']\n * Specify how to calculate boundingRect when locating.\n * 'all': Position the boundingRect that is transformed and uioned\n * both itself and its descendants.\n * This mode simplies confine the elements in the bounding\n * of their container (e.g., using 'right: 0').\n * 'raw': Position the boundingRect that is not transformed and only itself.\n * This mode is useful when you want a element can overflow its\n * container. (Consider a rotated circle needs to be located in a corner.)\n * In this mode positionInfo.width/height can only be number.\n */\n\n\nfunction positionElement(el, positionInfo, containerRect, margin, opt) {\n var h = !opt || !opt.hv || opt.hv[0];\n var v = !opt || !opt.hv || opt.hv[1];\n var boundingMode = opt && opt.boundingMode || 'all';\n\n if (!h && !v) {\n return;\n }\n\n var rect;\n\n if (boundingMode === 'raw') {\n rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();\n } else {\n rect = el.getBoundingRect();\n\n if (el.needLocalTransform()) {\n var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el,\n // which should not be modified.\n\n rect = rect.clone();\n rect.applyTransform(transform);\n }\n } // The real width and height can not be specified but calculated by the given el.\n\n\n positionInfo = getLayoutRect(zrUtil.defaults({\n width: rect.width,\n height: rect.height\n }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform\n // (see zrender/core/Transformable#getLocalTransform),\n // we can just only modify el.position to get final result.\n\n var elPos = el.position;\n var dx = h ? positionInfo.x - rect.x : 0;\n var dy = v ? positionInfo.y - rect.y : 0;\n el.attr('position', boundingMode === 'raw' ? [dx, dy] : [elPos[0] + dx, elPos[1] + dy]);\n}\n/**\n * @param {Object} option Contains some of the properties in HV_NAMES.\n * @param {number} hvIdx 0: horizontal; 1: vertical.\n */\n\n\nfunction sizeCalculable(option, hvIdx) {\n return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;\n}\n/**\n * Consider Case:\n * When defulat option has {left: 0, width: 100}, and we set {right: 0}\n * through setOption or media query, using normal zrUtil.merge will cause\n * {right: 0} does not take effect.\n *\n * @example\n * ComponentModel.extend({\n * init: function () {\n * ...\n * var inputPositionParams = layout.getLayoutParams(option);\n * this.mergeOption(inputPositionParams);\n * },\n * mergeOption: function (newOption) {\n * newOption && zrUtil.merge(thisOption, newOption, true);\n * layout.mergeLayoutParam(thisOption, newOption);\n * }\n * });\n *\n * @param {Object} targetOption\n * @param {Object} newOption\n * @param {Object|string} [opt]\n * @param {boolean|Array.} [opt.ignoreSize=false] Used for the components\n * that width (or height) should not be calculated by left and right (or top and bottom).\n */\n\n\nfunction mergeLayoutParam(targetOption, newOption, opt) {\n !zrUtil.isObject(opt) && (opt = {});\n var ignoreSize = opt.ignoreSize;\n !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\n var hResult = merge(HV_NAMES[0], 0);\n var vResult = merge(HV_NAMES[1], 1);\n copy(HV_NAMES[0], targetOption, hResult);\n copy(HV_NAMES[1], targetOption, vResult);\n\n function merge(names, hvIdx) {\n var newParams = {};\n var newValueCount = 0;\n var merged = {};\n var mergedValueCount = 0;\n var enoughParamNumber = 2;\n each(names, function (name) {\n merged[name] = targetOption[name];\n });\n each(names, function (name) {\n // Consider case: newOption.width is null, which is\n // set by user for removing width setting.\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\n hasValue(newParams, name) && newValueCount++;\n hasValue(merged, name) && mergedValueCount++;\n });\n\n if (ignoreSize[hvIdx]) {\n // Only one of left/right is premitted to exist.\n if (hasValue(newOption, names[1])) {\n merged[names[2]] = null;\n } else if (hasValue(newOption, names[2])) {\n merged[names[1]] = null;\n }\n\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // or targetOption: {right: ...} and newOption: {width: ...},\n // There is no conflict when merged only has params count\n // little than enoughParamNumber.\n\n\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // Than we can make sure user only want those two, and ignore\n // all origin params in targetOption.\n else if (newValueCount >= enoughParamNumber) {\n return newParams;\n } else {\n // Chose another param from targetOption by priority.\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n\n if (!hasProp(newParams, name) && hasProp(targetOption, name)) {\n newParams[name] = targetOption[name];\n break;\n }\n }\n\n return newParams;\n }\n }\n\n function hasProp(obj, name) {\n return obj.hasOwnProperty(name);\n }\n\n function hasValue(obj, name) {\n return obj[name] != null && obj[name] !== 'auto';\n }\n\n function copy(names, target, source) {\n each(names, function (name) {\n target[name] = source[name];\n });\n }\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n * @param {Object} source\n * @return {Object} Result contains those props.\n */\n\n\nfunction getLayoutParams(source) {\n return copyLayoutParams({}, source);\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n * @param {Object} source\n * @return {Object} Result contains those props.\n */\n\n\nfunction copyLayoutParams(target, source) {\n source && target && each(LOCATION_PARAMS, function (name) {\n source.hasOwnProperty(name) && (target[name] = source[name]);\n });\n return target;\n}\n\nexports.LOCATION_PARAMS = LOCATION_PARAMS;\nexports.HV_NAMES = HV_NAMES;\nexports.box = box;\nexports.vbox = vbox;\nexports.hbox = hbox;\nexports.getAvailableSize = getAvailableSize;\nexports.getLayoutRect = getLayoutRect;\nexports.positionElement = positionElement;\nexports.sizeCalculable = sizeCalculable;\nexports.mergeLayoutParam = mergeLayoutParam;\nexports.getLayoutParams = getLayoutParams;\nexports.copyLayoutParams = copyLayoutParams;","\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 _default = {\n getBoxLayoutParams: function () {\n return {\n left: this.get('left'),\n top: this.get('top'),\n right: this.get('right'),\n bottom: this.get('bottom'),\n width: this.get('width'),\n height: this.get('height')\n };\n }\n};\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 Model = require(\"./Model\");\n\nvar componentUtil = require(\"../util/component\");\n\nvar _clazz = require(\"../util/clazz\");\n\nvar enableClassManagement = _clazz.enableClassManagement;\nvar parseClassType = _clazz.parseClassType;\n\nvar _model = require(\"../util/model\");\n\nvar makeInner = _model.makeInner;\n\nvar layout = require(\"../util/layout\");\n\nvar boxLayoutMixin = require(\"./mixin/boxLayout\");\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 * Component model\n *\n * @module echarts/model/Component\n */\nvar inner = makeInner();\n/**\n * @alias module:echarts/model/Component\n * @constructor\n * @param {Object} option\n * @param {module:echarts/model/Model} parentModel\n * @param {module:echarts/model/Model} ecModel\n */\n\nvar ComponentModel = Model.extend({\n type: 'component',\n\n /**\n * @readOnly\n * @type {string}\n */\n id: '',\n\n /**\n * Because simplified concept is probably better, series.name (or component.name)\n * has been having too many resposibilities:\n * (1) Generating id (which requires name in option should not be modified).\n * (2) As an index to mapping series when merging option or calling API (a name\n * can refer to more then one components, which is convinient is some case).\n * (3) Display.\n * @readOnly\n */\n name: '',\n\n /**\n * @readOnly\n * @type {string}\n */\n mainType: '',\n\n /**\n * @readOnly\n * @type {string}\n */\n subType: '',\n\n /**\n * @readOnly\n * @type {number}\n */\n componentIndex: 0,\n\n /**\n * @type {Object}\n * @protected\n */\n defaultOption: null,\n\n /**\n * @type {module:echarts/model/Global}\n * @readOnly\n */\n ecModel: null,\n\n /**\n * key: componentType\n * value: Component model list, can not be null.\n * @type {Object.>}\n * @readOnly\n */\n dependentModels: [],\n\n /**\n * @type {string}\n * @readOnly\n */\n uid: null,\n\n /**\n * Support merge layout params.\n * Only support 'box' now (left/right/top/bottom/width/height).\n * @type {string|Object} Object can be {ignoreSize: true}\n * @readOnly\n */\n layoutMode: null,\n $constructor: function (option, parentModel, ecModel, extraOpt) {\n Model.call(this, option, parentModel, ecModel, extraOpt);\n this.uid = componentUtil.getUID('ec_cpt_model');\n },\n init: function (option, parentModel, ecModel, extraOpt) {\n this.mergeDefaultAndTheme(option, ecModel);\n },\n mergeDefaultAndTheme: function (option, ecModel) {\n var layoutMode = this.layoutMode;\n var inputPositionParams = layoutMode ? layout.getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n zrUtil.merge(option, themeModel.get(this.mainType));\n zrUtil.merge(option, this.getDefaultOption());\n\n if (layoutMode) {\n layout.mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n },\n mergeOption: function (option, extraOpt) {\n zrUtil.merge(this.option, option, true);\n var layoutMode = this.layoutMode;\n\n if (layoutMode) {\n layout.mergeLayoutParam(this.option, option, layoutMode);\n }\n },\n // Hooker after init or mergeOption\n optionUpdated: function (newCptOption, isInit) {},\n getDefaultOption: function () {\n var fields = inner(this);\n\n if (!fields.defaultOption) {\n var optList = [];\n var Class = this.constructor;\n\n while (Class) {\n var opt = Class.prototype.defaultOption;\n opt && optList.push(opt);\n Class = Class.superClass;\n }\n\n var defaultOption = {};\n\n for (var i = optList.length - 1; i >= 0; i--) {\n defaultOption = zrUtil.merge(defaultOption, optList[i], true);\n }\n\n fields.defaultOption = defaultOption;\n }\n\n return fields.defaultOption;\n },\n getReferringComponents: function (mainType) {\n return this.ecModel.queryComponents({\n mainType: mainType,\n index: this.get(mainType + 'Index', true),\n id: this.get(mainType + 'Id', true)\n });\n }\n}); // Reset ComponentModel.extend, add preConstruct.\n// clazzUtil.enableClassExtend(\n// ComponentModel,\n// function (option, parentModel, ecModel, extraOpt) {\n// // Set dependentModels, componentIndex, name, id, mainType, subType.\n// zrUtil.extend(this, extraOpt);\n// this.uid = componentUtil.getUID('componentModel');\n// // this.setReadOnly([\n// // 'type', 'id', 'uid', 'name', 'mainType', 'subType',\n// // 'dependentModels', 'componentIndex'\n// // ]);\n// }\n// );\n// Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.\n\nenableClassManagement(ComponentModel, {\n registerWhenExtend: true\n});\ncomponentUtil.enableSubTypeDefaulter(ComponentModel); // Add capability of ComponentModel.topologicalTravel.\n\ncomponentUtil.enableTopologicalTravel(ComponentModel, getDependencies);\n\nfunction getDependencies(componentType) {\n var deps = [];\n zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (Clazz) {\n deps = deps.concat(Clazz.prototype.dependencies || []);\n }); // Ensure main type.\n\n deps = zrUtil.map(deps, function (type) {\n return parseClassType(type).main;\n }); // Hack dataset for convenience.\n\n if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\n deps.unshift('dataset');\n }\n\n return deps;\n}\n\nzrUtil.mixin(ComponentModel, boxLayoutMixin);\nvar _default = ComponentModel;\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\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 platform = ''; // Navigator not exists in node\n\nif (typeof navigator !== 'undefined') {\n platform = navigator.platform || '';\n}\n\nvar _default = {\n // backgroundColor: 'rgba(0,0,0,0)',\n // https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization\n // color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'],\n // Light colors:\n // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'],\n // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'],\n // Dark colors:\n color: ['#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'],\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\n // If xAxis and yAxis declared, grid is created by default.\n // grid: {},\n textStyle: {\n // color: '#000',\n // decoration: 'none',\n // PENDING\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\n // fontFamily: 'Arial, Verdana, sans-serif',\n fontSize: 12,\n fontStyle: 'normal',\n fontWeight: 'normal'\n },\n // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n // Default is source-over\n blendMode: null,\n animation: 'auto',\n animationDuration: 1000,\n animationDurationUpdate: 300,\n animationEasing: 'exponentialOut',\n animationEasingUpdate: 'cubicOut',\n animationThreshold: 2000,\n // Configuration for progressive/incremental rendering\n progressiveThreshold: 3000,\n progressive: 400,\n // Threshold of if use single hover layer to optimize.\n // It is recommended that `hoverLayerThreshold` is equivalent to or less than\n // `progressiveThreshold`, otherwise hover will cause restart of progressive,\n // which is unexpected.\n // see example .\n hoverLayerThreshold: 3000,\n // See: module:echarts/scale/Time\n useUTC: false\n};\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 _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\nvar normalizeToArray = _model.normalizeToArray;\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 inner = makeInner();\n\nfunction getNearestColorPalette(colors, requestColorNum) {\n var paletteNum = colors.length; // TODO colors must be in order\n\n for (var i = 0; i < paletteNum; i++) {\n if (colors[i].length > requestColorNum) {\n return colors[i];\n }\n }\n\n return colors[paletteNum - 1];\n}\n\nvar _default = {\n clearColorPalette: function () {\n inner(this).colorIdx = 0;\n inner(this).colorNameMap = {};\n },\n\n /**\n * @param {string} name MUST NOT be null/undefined. Otherwise call this function\n * twise with the same parameters will get different result.\n * @param {Object} [scope=this]\n * @param {Object} [requestColorNum]\n * @return {string} color string.\n */\n getColorFromPalette: function (name, scope, requestColorNum) {\n scope = scope || this;\n var scopeFields = inner(scope);\n var colorIdx = scopeFields.colorIdx || 0;\n var colorNameMap = scopeFields.colorNameMap = scopeFields.colorNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n\n if (colorNameMap.hasOwnProperty(name)) {\n return colorNameMap[name];\n }\n\n var defaultColorPalette = normalizeToArray(this.get('color', true));\n var layeredColorPalette = this.get('colorLayer', true);\n var colorPalette = requestColorNum == null || !layeredColorPalette ? defaultColorPalette : getNearestColorPalette(layeredColorPalette, requestColorNum); // In case can't find in layered color palette.\n\n colorPalette = colorPalette || defaultColorPalette;\n\n if (!colorPalette || !colorPalette.length) {\n return;\n }\n\n var color = colorPalette[colorIdx];\n\n if (name) {\n colorNameMap[name] = color;\n }\n\n scopeFields.colorIdx = (colorIdx + 1) % colorPalette.length;\n return color;\n }\n};\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\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// Avoid typo.\nvar SOURCE_FORMAT_ORIGINAL = 'original';\nvar SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nvar SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nvar SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nvar SOURCE_FORMAT_UNKNOWN = 'unknown'; // ??? CHANGE A NAME\n\nvar SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nvar SERIES_LAYOUT_BY_COLUMN = 'column';\nvar SERIES_LAYOUT_BY_ROW = 'row';\nexports.SOURCE_FORMAT_ORIGINAL = SOURCE_FORMAT_ORIGINAL;\nexports.SOURCE_FORMAT_ARRAY_ROWS = SOURCE_FORMAT_ARRAY_ROWS;\nexports.SOURCE_FORMAT_OBJECT_ROWS = SOURCE_FORMAT_OBJECT_ROWS;\nexports.SOURCE_FORMAT_KEYED_COLUMNS = SOURCE_FORMAT_KEYED_COLUMNS;\nexports.SOURCE_FORMAT_UNKNOWN = SOURCE_FORMAT_UNKNOWN;\nexports.SOURCE_FORMAT_TYPED_ARRAY = SOURCE_FORMAT_TYPED_ARRAY;\nexports.SERIES_LAYOUT_BY_COLUMN = SERIES_LAYOUT_BY_COLUMN;\nexports.SERIES_LAYOUT_BY_ROW = SERIES_LAYOUT_BY_ROW;","\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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar isTypedArray = _util.isTypedArray;\n\nvar _clazz = require(\"../util/clazz\");\n\nvar enableClassCheck = _clazz.enableClassCheck;\n\nvar _sourceType = require(\"./helper/sourceType\");\n\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\nvar SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN;\nvar SOURCE_FORMAT_UNKNOWN = _sourceType.SOURCE_FORMAT_UNKNOWN;\nvar SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY;\nvar SOURCE_FORMAT_KEYED_COLUMNS = _sourceType.SOURCE_FORMAT_KEYED_COLUMNS;\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 * [sourceFormat]\n *\n * + \"original\":\n * This format is only used in series.data, where\n * itemStyle can be specified in data item.\n *\n * + \"arrayRows\":\n * [\n * ['product', 'score', 'amount'],\n * ['Matcha Latte', 89.3, 95.8],\n * ['Milk Tea', 92.1, 89.4],\n * ['Cheese Cocoa', 94.4, 91.2],\n * ['Walnut Brownie', 85.4, 76.9]\n * ]\n *\n * + \"objectRows\":\n * [\n * {product: 'Matcha Latte', score: 89.3, amount: 95.8},\n * {product: 'Milk Tea', score: 92.1, amount: 89.4},\n * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},\n * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}\n * ]\n *\n * + \"keyedColumns\":\n * {\n * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],\n * 'count': [823, 235, 1042, 988],\n * 'score': [95.8, 81.4, 91.2, 76.9]\n * }\n *\n * + \"typedArray\"\n *\n * + \"unknown\"\n */\n\n/**\n * @constructor\n * @param {Object} fields\n * @param {string} fields.sourceFormat\n * @param {Array|Object} fields.fromDataset\n * @param {Array|Object} [fields.data]\n * @param {string} [seriesLayoutBy='column']\n * @param {Array.} [dimensionsDefine]\n * @param {Objet|HashMap} [encodeDefine]\n * @param {number} [startIndex=0]\n * @param {number} [dimensionsDetectCount]\n */\nfunction Source(fields) {\n /**\n * @type {boolean}\n */\n this.fromDataset = fields.fromDataset;\n /**\n * Not null/undefined.\n * @type {Array|Object}\n */\n\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n /**\n * See also \"detectSourceFormat\".\n * Not null/undefined.\n * @type {string}\n */\n\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\n /**\n * 'row' or 'column'\n * Not null/undefined.\n * @type {string} seriesLayoutBy\n */\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n /**\n * dimensions definition in option.\n * can be null/undefined.\n * @type {Array.}\n */\n\n this.dimensionsDefine = fields.dimensionsDefine;\n /**\n * encode definition in option.\n * can be null/undefined.\n * @type {Objet|HashMap}\n */\n\n this.encodeDefine = fields.encodeDefine && createHashMap(fields.encodeDefine);\n /**\n * Not null/undefined, uint.\n * @type {number}\n */\n\n this.startIndex = fields.startIndex || 0;\n /**\n * Can be null/undefined (when unknown), uint.\n * @type {number}\n */\n\n this.dimensionsDetectCount = fields.dimensionsDetectCount;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\n\n\nSource.seriesDataToSource = function (data) {\n return new Source({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL,\n fromDataset: false\n });\n};\n\nenableClassCheck(Source);\nvar _default = Source;\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 _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\nvar getDataItemValue = _model.getDataItemValue;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\nvar map = _util.map;\nvar isArray = _util.isArray;\nvar isString = _util.isString;\nvar isObject = _util.isObject;\nvar isTypedArray = _util.isTypedArray;\nvar isArrayLike = _util.isArrayLike;\nvar extend = _util.extend;\nvar assert = _util.assert;\n\nvar Source = require(\"../Source\");\n\nvar _sourceType = require(\"./sourceType\");\n\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\nvar SOURCE_FORMAT_ARRAY_ROWS = _sourceType.SOURCE_FORMAT_ARRAY_ROWS;\nvar SOURCE_FORMAT_OBJECT_ROWS = _sourceType.SOURCE_FORMAT_OBJECT_ROWS;\nvar SOURCE_FORMAT_KEYED_COLUMNS = _sourceType.SOURCE_FORMAT_KEYED_COLUMNS;\nvar SOURCE_FORMAT_UNKNOWN = _sourceType.SOURCE_FORMAT_UNKNOWN;\nvar SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY;\nvar SERIES_LAYOUT_BY_ROW = _sourceType.SERIES_LAYOUT_BY_ROW;\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// The result of `guessOrdinal`.\nvar BE_ORDINAL = {\n Must: 1,\n // Encounter string but not '-' and not number-like.\n Might: 2,\n // Encounter string but number-like.\n Not: 3 // Other cases\n\n};\nvar inner = makeInner();\n/**\n * @see {module:echarts/data/Source}\n * @param {module:echarts/component/dataset/DatasetModel} datasetModel\n * @return {string} sourceFormat\n */\n\nfunction detectSourceFormat(datasetModel) {\n var data = datasetModel.option.source;\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n\n if (isTypedArray(data)) {\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n } else if (isArray(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n }\n\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n\n if (item == null) {\n continue;\n } else if (isArray(item)) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n break;\n } else if (isObject(item)) {\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n break;\n }\n }\n } else if (isObject(data)) {\n for (var key in data) {\n if (data.hasOwnProperty(key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n } else if (data != null) {\n throw new Error('Invalid data');\n }\n\n inner(datasetModel).sourceFormat = sourceFormat;\n}\n/**\n * [Scenarios]:\n * (1) Provide source data directly:\n * series: {\n * encode: {...},\n * dimensions: [...]\n * seriesLayoutBy: 'row',\n * data: [[...]]\n * }\n * (2) Refer to datasetModel.\n * series: [{\n * encode: {...}\n * // Ignore datasetIndex means `datasetIndex: 0`\n * // and the dimensions defination in dataset is used\n * }, {\n * encode: {...},\n * seriesLayoutBy: 'column',\n * datasetIndex: 1\n * }]\n *\n * Get data from series itself or datset.\n * @return {module:echarts/data/Source} source\n */\n\n\nfunction getSource(seriesModel) {\n return inner(seriesModel).source;\n}\n/**\n * MUST be called before mergeOption of all series.\n * @param {module:echarts/model/Global} ecModel\n */\n\n\nfunction resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n inner(ecModel).datasetMap = createHashMap();\n}\n/**\n * [Caution]:\n * MUST be called after series option merged and\n * before \"series.getInitailData()\" called.\n *\n * [The rule of making default encode]:\n * Category axis (if exists) alway map to the first dimension.\n * Each other axis occupies a subsequent dimension.\n *\n * [Why make default encode]:\n * Simplify the typing of encode in option, avoiding the case like that:\n * series: [{encode: {x: 0, y: 1}}, {encode: {x: 0, y: 2}}, {encode: {x: 0, y: 3}}],\n * where the \"y\" have to be manually typed as \"1, 2, 3, ...\".\n *\n * @param {module:echarts/model/Series} seriesModel\n */\n\n\nfunction prepareSource(seriesModel) {\n var seriesOption = seriesModel.option;\n var data = seriesOption.data;\n var sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n var fromDataset = false;\n var seriesLayoutBy = seriesOption.seriesLayoutBy;\n var sourceHeader = seriesOption.sourceHeader;\n var dimensionsDefine = seriesOption.dimensions;\n var datasetModel = getDatasetModel(seriesModel);\n\n if (datasetModel) {\n var datasetOption = datasetModel.option;\n data = datasetOption.source;\n sourceFormat = inner(datasetModel).sourceFormat;\n fromDataset = true; // These settings from series has higher priority.\n\n seriesLayoutBy = seriesLayoutBy || datasetOption.seriesLayoutBy;\n sourceHeader == null && (sourceHeader = datasetOption.sourceHeader);\n dimensionsDefine = dimensionsDefine || datasetOption.dimensions;\n }\n\n var completeResult = completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine);\n inner(seriesModel).source = new Source({\n data: data,\n fromDataset: fromDataset,\n seriesLayoutBy: seriesLayoutBy,\n sourceFormat: sourceFormat,\n dimensionsDefine: completeResult.dimensionsDefine,\n startIndex: completeResult.startIndex,\n dimensionsDetectCount: completeResult.dimensionsDetectCount,\n // Note: dataset option does not have `encode`.\n encodeDefine: seriesOption.encode\n });\n} // return {startIndex, dimensionsDefine, dimensionsCount}\n\n\nfunction completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine)\n };\n }\n\n var dimensionsDetectCount;\n var startIndex;\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (isString(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n } // 10 is an experience number, avoid long loop.\n\n }, seriesLayoutBy, data, 10);\n } else {\n startIndex = sourceHeader ? 1 : 0;\n }\n\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val : '';\n }, seriesLayoutBy, data);\n }\n\n dimensionsDetectCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? data.length : data[0] ? data[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n each(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var value0 = getDataItemValue(data[0]);\n dimensionsDetectCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {}\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine),\n dimensionsDetectCount: dimensionsDetectCount\n };\n} // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefiend or string.\n\n\nfunction normalizeDimensionsDefine(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (item, index) {\n item = extend({}, isObject(item) ? item : {\n name: item\n }); // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}\n\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n maxLoop == null && (maxLoop = Infinity);\n\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n cb(data[i] ? data[i][0] : null, i);\n }\n } else {\n var value0 = data[0] || [];\n\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\n cb(value0[i], i);\n }\n }\n}\n\nfunction objectRowsCollectDimensions(data) {\n var firstIndex = 0;\n var obj;\n\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n\n\n if (obj) {\n var dimensions = [];\n each(obj, function (value, key) {\n dimensions.push(key);\n });\n return dimensions;\n }\n}\n/**\n * [The strategy of the arrengment of data dimensions for dataset]:\n * \"value way\": all axes are non-category axes. So series one by one take\n * several (the number is coordSysDims.length) dimensions from dataset.\n * The result of data arrengment of data dimensions like:\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\n * \"category way\": at least one axis is category axis. So the the first data\n * dimension is always mapped to the first category axis and shared by\n * all of the series. The other data dimensions are taken by series like\n * \"value way\" does.\n * The result of data arrengment of data dimensions like:\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\n *\n * @param {Array.} coordDimensions [{name: , type: , dimsDef: }, ...]\n * @param {module:model/Series} seriesModel\n * @param {module:data/Source} source\n * @return {Object} encode Never be `null/undefined`.\n */\n\n\nfunction makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = getDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = inner(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n !isObject(coordDimInfo) && (coordDimensions[coordDimIdx] = {\n name: coordDimInfo\n });\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimensions[coordDimIdx]);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\n * Work for data like [{name: ..., value: ...}, ...].\n *\n * @param {module:model/Series} seriesModel\n * @param {module:data/Source} source\n * @return {Object} encode Never be `null/undefined`.\n */\n\n\nfunction makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n var encode = {};\n var datasetModel = getDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel) {\n return encode;\n }\n\n var sourceFormat = source.sourceFormat;\n var dimensionsDefine = source.dimensionsDefine;\n var potentialNameDimIndex;\n\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n } // idxResult: {v, n}.\n\n\n var idxResult = function () {\n var idxRes0 = {};\n var idxRes1 = {};\n var guessRecords = []; // 5 is an experience value.\n\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n guessRecords.push(guessResult);\n var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n // and then find a name dim with the priority:\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n idxRes0.v = i;\n }\n\n if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n idxRes0.n = i;\n }\n\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n return idxRes0;\n } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n // find the first BE_ORDINAL.Might as the value dim,\n // and then find a name dim with the priority:\n // \"other dim\" > \"the value dim itself\".\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n // treated as number.\n\n\n if (!isPureNumber) {\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n idxRes1.v = i;\n }\n\n if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n idxRes1.n = i;\n }\n }\n }\n\n function fulfilled(idxResult) {\n return idxResult.v != null && idxResult.n != null;\n }\n\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n }();\n\n if (idxResult) {\n encode.value = idxResult.v; // `potentialNameDimIndex` has highest priority.\n\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encode.itemName = [nameDimIndex];\n encode.seriesName = [nameDimIndex];\n }\n\n return encode;\n}\n/**\n * If return null/undefined, indicate that should not use datasetModel.\n */\n\n\nfunction getDatasetModel(seriesModel) {\n var option = seriesModel.option; // Caution: consider the scenario:\n // A dataset is declared and a series is not expected to use the dataset,\n // and at the beginning `setOption({series: { noData })` (just prepare other\n // option but no data), then `setOption({series: {data: [...]}); In this case,\n // the user should set an empty array to avoid that dataset is used by default.\n\n var thisData = option.data;\n\n if (!thisData) {\n return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0);\n }\n}\n/**\n * The rule should not be complex, otherwise user might not\n * be able to known where the data is wrong.\n * The code is ugly, but how to make it neat?\n *\n * @param {module:echars/data/Source} source\n * @param {number} dimIndex\n * @return {BE_ORDINAL} guess result.\n */\n\n\nfunction guessOrdinal(source, dimIndex) {\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\n} // dimIndex may be overflow source data.\n// return {BE_ORDINAL}\n\n\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\n var result; // Experience value.\n\n var maxLoop = 5;\n\n if (isTypedArray(data)) {\n return BE_ORDINAL.Not;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n var dimType;\n\n if (dimensionsDefine) {\n var dimDefItem = dimensionsDefine[dimIndex];\n\n if (isObject(dimDefItem)) {\n dimName = dimDefItem.name;\n dimType = dimDefItem.type;\n } else if (isString(dimDefItem)) {\n dimName = dimDefItem;\n }\n }\n\n if (dimType != null) {\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = data[dimIndex];\n\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\n if ((result = detectValue(sample[startIndex + i])) != null) {\n return result;\n }\n }\n } else {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n var row = data[startIndex + i];\n\n if (row && (result = detectValue(row[dimIndex])) != null) {\n return result;\n }\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n var item = data[i];\n\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n var sample = data[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\n if ((result = detectValue(sample[i])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n var item = data[i];\n var val = getDataItemValue(item);\n\n if (!isArray(val)) {\n return BE_ORDINAL.Not;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n\n if (val != null && isFinite(val) && val !== '') {\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n } else if (beStr && val !== '-') {\n return BE_ORDINAL.Must;\n }\n }\n\n return BE_ORDINAL.Not;\n}\n\nexports.BE_ORDINAL = BE_ORDINAL;\nexports.detectSourceFormat = detectSourceFormat;\nexports.getSource = getSource;\nexports.resetSourceDefaulter = resetSourceDefaulter;\nexports.prepareSource = prepareSource;\nexports.makeSeriesEncodeForAxisCoordSys = makeSeriesEncodeForAxisCoordSys;\nexports.makeSeriesEncodeForNameBased = makeSeriesEncodeForNameBased;\nexports.guessOrdinal = guessOrdinal;","\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar filter = _util.filter;\nvar map = _util.map;\nvar isArray = _util.isArray;\nvar indexOf = _util.indexOf;\nvar isObject = _util.isObject;\nvar isString = _util.isString;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\nvar clone = _util.clone;\nvar merge = _util.merge;\nvar extend = _util.extend;\nvar mixin = _util.mixin;\n\nvar modelUtil = require(\"../util/model\");\n\nvar Model = require(\"./Model\");\n\nvar ComponentModel = require(\"./Component\");\n\nvar globalDefault = require(\"./globalDefault\");\n\nvar colorPaletteMixin = require(\"./mixin/colorPalette\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar resetSourceDefaulter = _sourceHelper.resetSourceDefaulter;\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 * ECharts global model\n *\n * @module {echarts/model/Global}\n */\n\n/**\n * Caution: If the mechanism should be changed some day, these cases\n * should be considered:\n *\n * (1) In `merge option` mode, if using the same option to call `setOption`\n * many times, the result should be the same (try our best to ensure that).\n * (2) In `merge option` mode, if a component has no id/name specified, it\n * will be merged by index, and the result sequence of the components is\n * consistent to the original sequence.\n * (3) `reset` feature (in toolbox). Find detailed info in comments about\n * `mergeOption` in module:echarts/model/OptionManager.\n */\nvar OPTION_INNER_KEY = '\\0_ec_inner';\n/**\n * @alias module:echarts/model/Global\n *\n * @param {Object} option\n * @param {module:echarts/model/Model} parentModel\n * @param {Object} theme\n */\n\nvar GlobalModel = Model.extend({\n init: function (option, parentModel, theme, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n\n /**\n * @type {module:echarts/model/Model}\n * @private\n */\n\n this._theme = new Model(theme);\n /**\n * @type {module:echarts/model/OptionManager}\n */\n\n this._optionManager = optionManager;\n },\n setOption: function (option, optionPreprocessorFuncs) {\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\n\n this._optionManager.setOption(option, optionPreprocessorFuncs);\n\n this.resetOption(null);\n },\n\n /**\n * @param {string} type null/undefined: reset all.\n * 'recreate': force recreate all.\n * 'timeline': only reset timeline option\n * 'media': only reset media query option\n * @return {boolean} Whether option changed.\n */\n resetOption: function (type) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n\n if (!this.option || type === 'recreate') {\n initBase.call(this, baseOption);\n } else {\n this.restoreData();\n this.mergeOption(baseOption);\n }\n\n optionChanged = true;\n }\n\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n }\n\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n timelineOption && (this.mergeOption(timelineOption), optionChanged = true);\n }\n\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this, this._api);\n\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n this.mergeOption(mediaOption, optionChanged = true);\n }, this);\n }\n }\n\n return optionChanged;\n },\n\n /**\n * @protected\n */\n mergeOption: function (newOption) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var newCptTypes = [];\n resetSourceDefaulter(this); // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n\n if (!ComponentModel.hasClass(mainType)) {\n // globalSettingTask.dirty();\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCptTypes.push(mainType);\n }\n });\n ComponentModel.topologicalTravel(newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n\n function visitComponent(mainType, dependencies) {\n var newCptOptionList = modelUtil.normalizeToArray(newOption[mainType]);\n var mapResult = modelUtil.mappingToExists(componentsMap.get(mainType), newCptOptionList);\n modelUtil.makeIdAndName(mapResult); // Set mainType and complete subType.\n\n each(mapResult, function (item, index) {\n var opt = item.option;\n\n if (isObject(opt)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, opt, item.exist);\n }\n });\n var dependentModels = getComponentsByTypes(componentsMap, dependencies);\n option[mainType] = [];\n componentsMap.set(mainType, []);\n each(mapResult, function (resultItem, index) {\n var componentModel = resultItem.exist;\n var newCptOption = resultItem.option;\n assert(isObject(newCptOption) || componentModel, 'Empty component definition'); // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n\n if (!newCptOption) {\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n } else {\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\n\n if (componentModel && componentModel.constructor === ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty();\n\n componentModel.mergeOption(newCptOption, this);\n componentModel.optionUpdated(newCptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n dependentModels: dependentModels,\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCptOption, this, this, extraOpt);\n extend(componentModel, extraOpt);\n componentModel.init(newCptOption, this, this, extraOpt); // Call optionUpdated after init.\n // newCptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n\n componentModel.optionUpdated(null, true);\n }\n }\n\n componentsMap.get(mainType)[index] = componentModel;\n option[mainType][index] = componentModel.option;\n }, this); // Backup series for filtering.\n\n if (mainType === 'series') {\n createSeriesIndices(this, componentsMap.get('series'));\n }\n }\n\n this._seriesIndicesMap = createHashMap(this._seriesIndices = this._seriesIndices || []);\n },\n\n /**\n * Get option for output (cloned option and inner info removed)\n * @public\n * @return {Object}\n */\n getOption: function () {\n var option = clone(this.option);\n each(option, function (opts, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(opts);\n\n for (var i = opts.length - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (modelUtil.isIdInner(opts[i])) {\n opts.splice(i, 1);\n }\n }\n\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n },\n\n /**\n * @return {module:echarts/model/Model}\n */\n getTheme: function () {\n return this._theme;\n },\n\n /**\n * @param {string} mainType\n * @param {number} [idx=0]\n * @return {module:echarts/model/Component}\n */\n getComponent: function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n\n if (list) {\n return list[idx || 0];\n }\n },\n\n /**\n * If none of index and id and name used, return all components with mainType.\n * @param {Object} condition\n * @param {string} condition.mainType\n * @param {string} [condition.subType] If ignore, only query by mainType\n * @param {number|Array.} [condition.index] Either input index or id or name.\n * @param {string|Array.} [condition.id] Either input index or id or name.\n * @param {string|Array.} [condition.name] Either input index or id or name.\n * @return {Array.}\n */\n queryComponents: function (condition) {\n var mainType = condition.mainType;\n\n if (!mainType) {\n return [];\n }\n\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n\n var cpts = this._componentsMap.get(mainType);\n\n if (!cpts || !cpts.length) {\n return [];\n }\n\n var result;\n\n if (index != null) {\n if (!isArray(index)) {\n index = [index];\n }\n\n result = filter(map(index, function (idx) {\n return cpts[idx];\n }), function (val) {\n return !!val;\n });\n } else if (id != null) {\n var isIdArray = isArray(id);\n result = filter(cpts, function (cpt) {\n return isIdArray && indexOf(id, cpt.id) >= 0 || !isIdArray && cpt.id === id;\n });\n } else if (name != null) {\n var isNameArray = isArray(name);\n result = filter(cpts, function (cpt) {\n return isNameArray && indexOf(name, cpt.name) >= 0 || !isNameArray && cpt.name === name;\n });\n } else {\n // Return all components with mainType\n result = cpts.slice();\n }\n\n return filterBySubType(result, condition);\n },\n\n /**\n * The interface is different from queryComponents,\n * which is convenient for inner usage.\n *\n * @usage\n * var result = findComponents(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\n * );\n * var result = findComponents(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\n * );\n * var result = findComponents(\n * {mainType: 'series',\n * filter: function (model, index) {...}}\n * );\n * // result like [component0, componnet1, ...]\n *\n * @param {Object} condition\n * @param {string} condition.mainType Mandatory.\n * @param {string} [condition.subType] Optional.\n * @param {Object} [condition.query] like {xxxIndex, xxxId, xxxName},\n * where xxx is mainType.\n * If query attribute is null/undefined or has no index/id/name,\n * do not filtering by query conditions, which is convenient for\n * no-payload situations or when target of action is global.\n * @param {Function} [condition.filter] parameter: component, return boolean.\n * @return {Array.}\n */\n findComponents: function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond) : this._componentsMap.get(mainType);\n return doFilter(filterBySubType(result, condition));\n\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n },\n\n /**\n * @usage\n * eachComponent('legend', function (legendModel, index) {\n * ...\n * });\n * eachComponent(function (componentType, model, index) {\n * // componentType does not include subType\n * // (componentType is 'xxx' but not 'xxx.aa')\n * });\n * eachComponent(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},\n * function (model, index) {...}\n * );\n * eachComponent(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},\n * function (model, index) {...}\n * );\n *\n * @param {string|Object=} mainType When mainType is object, the definition\n * is the same as the method 'findComponents'.\n * @param {Function} cb\n * @param {*} context\n */\n eachComponent: function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n\n if (typeof mainType === 'function') {\n context = cb;\n cb = mainType;\n componentsMap.each(function (components, componentType) {\n each(components, function (component, index) {\n cb.call(context, componentType, component, index);\n });\n });\n } else if (isString(mainType)) {\n each(componentsMap.get(mainType), cb, context);\n } else if (isObject(mainType)) {\n var queryResult = this.findComponents(mainType);\n each(queryResult, cb, context);\n }\n },\n\n /**\n * @param {string} name\n * @return {Array.}\n */\n getSeriesByName: function (name) {\n var series = this._componentsMap.get('series');\n\n return filter(series, function (oneSeries) {\n return oneSeries.name === name;\n });\n },\n\n /**\n * @param {number} seriesIndex\n * @return {module:echarts/model/Series}\n */\n getSeriesByIndex: function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n },\n\n /**\n * Get series list before filtered by type.\n * FIXME: rename to getRawSeriesByType?\n *\n * @param {string} subType\n * @return {Array.}\n */\n getSeriesByType: function (subType) {\n var series = this._componentsMap.get('series');\n\n return filter(series, function (oneSeries) {\n return oneSeries.subType === subType;\n });\n },\n\n /**\n * @return {Array.}\n */\n getSeries: function () {\n return this._componentsMap.get('series').slice();\n },\n\n /**\n * @return {number}\n */\n getSeriesCount: function () {\n return this._componentsMap.get('series').length;\n },\n\n /**\n * After filtering, series may be different\n * frome raw series.\n *\n * @param {Function} cb\n * @param {*} context\n */\n eachSeries: function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n cb.call(context, series, rawSeriesIndex);\n }, this);\n },\n\n /**\n * Iterate raw series before filtered.\n *\n * @param {Function} cb\n * @param {*} context\n */\n eachRawSeries: function (cb, context) {\n each(this._componentsMap.get('series'), cb, context);\n },\n\n /**\n * After filtering, series may be different.\n * frome raw series.\n *\n * @param {string} subType.\n * @param {Function} cb\n * @param {*} context\n */\n eachSeriesByType: function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n },\n\n /**\n * Iterate raw series before filtered of given type.\n *\n * @parma {string} subType\n * @param {Function} cb\n * @param {*} context\n */\n eachRawSeriesByType: function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n },\n\n /**\n * @param {module:echarts/model/Series} seriesModel\n */\n isSeriesFiltered: function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n },\n\n /**\n * @return {Array.}\n */\n getCurrentSeriesIndices: function () {\n return (this._seriesIndices || []).slice();\n },\n\n /**\n * @param {Function} cb\n * @param {*} context\n */\n filterSeries: function (cb, context) {\n assertSeriesInitialized(this);\n var filteredSeries = filter(this._componentsMap.get('series'), cb, context);\n createSeriesIndices(this, filteredSeries);\n },\n restoreData: function (payload) {\n var componentsMap = this._componentsMap;\n createSeriesIndices(this, componentsMap.get('series'));\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n componentTypes.push(componentType);\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType, dependencies) {\n each(componentsMap.get(componentType), function (component) {\n (componentType !== 'series' || !isNotTargetSeries(component, payload)) && component.restoreData();\n });\n });\n }\n});\n\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seiresIndex;\n var id = payload.seriesId;\n var name = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name != null && seriesModel.name !== name;\n }\n}\n/**\n * @inner\n */\n\n\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n } // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理\n\n\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\n\nfunction initBase(baseOption) {\n baseOption = baseOption; // Using OPTION_INNER_KEY to mark that this option can not be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbiden.\n\n this.option = {};\n this.option[OPTION_INNER_KEY] = 1;\n /**\n * Init with series: [], in case of calling findSeries method\n * before series initialized.\n * @type {Object.>}\n * @private\n */\n\n this._componentsMap = createHashMap({\n series: []\n });\n /**\n * Mapping between filtered series list and raw series list.\n * key: filtered series indices, value: raw series indices.\n * @type {Array.}\n * @private\n */\n\n this._seriesIndices;\n this._seriesIndicesMap;\n mergeTheme(baseOption, this._theme.option); // TODO Needs clone when merging to the unexisted property\n\n merge(baseOption, globalDefault, false);\n this.mergeOption(baseOption);\n}\n/**\n * @inner\n * @param {Array.|string} types model types\n * @return {Object} key: {string} type, value: {Array.} models\n */\n\n\nfunction getComponentsByTypes(componentsMap, types) {\n if (!isArray(types)) {\n types = types ? [types] : [];\n }\n\n var ret = {};\n each(types, function (type) {\n ret[type] = (componentsMap.get(type) || []).slice();\n });\n return ret;\n}\n/**\n * @inner\n */\n\n\nfunction determineSubType(mainType, newCptOption, existComponent) {\n var subType = newCptOption.type ? newCptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent.\n : ComponentModel.determineSubType(mainType, newCptOption); // tooltip, markline, markpoint may always has no subType\n\n return subType;\n}\n/**\n * @inner\n */\n\n\nfunction createSeriesIndices(ecModel, seriesModels) {\n ecModel._seriesIndicesMap = createHashMap(ecModel._seriesIndices = map(seriesModels, function (series) {\n return series.componentIndex;\n }) || []);\n}\n/**\n * @inner\n */\n\n\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cpt) {\n return cpt.subType === condition.subType;\n }) : components;\n}\n/**\n * @inner\n */\n\n\nfunction assertSeriesInitialized(ecModel) {}\n\nmixin(GlobalModel, colorPaletteMixin);\nvar _default = GlobalModel;\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\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 echartsAPIList = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption', 'getViewOfComponentModel', 'getViewOfSeriesModel']; // And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js\n\nfunction ExtensionAPI(chartInstance) {\n zrUtil.each(echartsAPIList, function (name) {\n this[name] = zrUtil.bind(chartInstance[name], chartInstance);\n }, this);\n}\n\nvar _default = ExtensionAPI;\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\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 coordinateSystemCreators = {};\n\nfunction CoordinateSystemManager() {\n this._coordinateSystems = [];\n}\n\nCoordinateSystemManager.prototype = {\n constructor: CoordinateSystemManager,\n create: function (ecModel, api) {\n var coordinateSystems = [];\n zrUtil.each(coordinateSystemCreators, function (creater, type) {\n var list = creater.create(ecModel, api);\n coordinateSystems = coordinateSystems.concat(list || []);\n });\n this._coordinateSystems = coordinateSystems;\n },\n update: function (ecModel, api) {\n zrUtil.each(this._coordinateSystems, function (coordSys) {\n coordSys.update && coordSys.update(ecModel, api);\n });\n },\n getCoordinateSystems: function () {\n return this._coordinateSystems.slice();\n }\n};\n\nCoordinateSystemManager.register = function (type, coordinateSystemCreator) {\n coordinateSystemCreators[type] = coordinateSystemCreator;\n};\n\nCoordinateSystemManager.get = function (type) {\n return coordinateSystemCreators[type];\n};\n\nvar _default = CoordinateSystemManager;\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 modelUtil = require(\"../util/model\");\n\nvar ComponentModel = require(\"./Component\");\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 * ECharts option manager\n *\n * @module {echarts/model/OptionManager}\n */\nvar each = zrUtil.each;\nvar clone = zrUtil.clone;\nvar map = zrUtil.map;\nvar merge = zrUtil.merge;\nvar QUERY_REG = /^(min|max)?(.+)$/;\n/**\n * TERM EXPLANATIONS:\n *\n * [option]:\n *\n * An object that contains definitions of components. For example:\n * var option = {\n * title: {...},\n * legend: {...},\n * visualMap: {...},\n * series: [\n * {data: [...]},\n * {data: [...]},\n * ...\n * ]\n * };\n *\n * [rawOption]:\n *\n * An object input to echarts.setOption. 'rawOption' may be an\n * 'option', or may be an object contains multi-options. For example:\n * var option = {\n * baseOption: {\n * title: {...},\n * legend: {...},\n * series: [\n * {data: [...]},\n * {data: [...]},\n * ...\n * ]\n * },\n * timeline: {...},\n * options: [\n * {title: {...}, series: {data: [...]}},\n * {title: {...}, series: {data: [...]}},\n * ...\n * ],\n * media: [\n * {\n * query: {maxWidth: 320},\n * option: {series: {x: 20}, visualMap: {show: false}}\n * },\n * {\n * query: {minWidth: 320, maxWidth: 720},\n * option: {series: {x: 500}, visualMap: {show: true}}\n * },\n * {\n * option: {series: {x: 1200}, visualMap: {show: true}}\n * }\n * ]\n * };\n *\n * @alias module:echarts/model/OptionManager\n * @param {module:echarts/ExtensionAPI} api\n */\n\nfunction OptionManager(api) {\n /**\n * @private\n * @type {module:echarts/ExtensionAPI}\n */\n this._api = api;\n /**\n * @private\n * @type {Array.}\n */\n\n this._timelineOptions = [];\n /**\n * @private\n * @type {Array.}\n */\n\n this._mediaList = [];\n /**\n * @private\n * @type {Object}\n */\n\n this._mediaDefault;\n /**\n * -1, means default.\n * empty means no media.\n * @private\n * @type {Array.}\n */\n\n this._currentMediaIndices = [];\n /**\n * @private\n * @type {Object}\n */\n\n this._optionBackup;\n /**\n * @private\n * @type {Object}\n */\n\n this._newBaseOption;\n} // timeline.notMerge is not supported in ec3. Firstly there is rearly\n// case that notMerge is needed. Secondly supporting 'notMerge' requires\n// rawOption cloned and backuped when timeline changed, which does no\n// good to performance. What's more, that both timeline and setOption\n// method supply 'notMerge' brings complex and some problems.\n// Consider this case:\n// (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\n// (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\n\n\nOptionManager.prototype = {\n constructor: OptionManager,\n\n /**\n * @public\n * @param {Object} rawOption Raw option.\n * @param {module:echarts/model/Global} ecModel\n * @param {Array.} optionPreprocessorFuncs\n * @return {Object} Init option\n */\n setOption: function (rawOption, optionPreprocessorFuncs) {\n if (rawOption) {\n // That set dat primitive is dangerous if user reuse the data when setOption again.\n zrUtil.each(modelUtil.normalizeToArray(rawOption.series), function (series) {\n series && series.data && zrUtil.isTypedArray(series.data) && zrUtil.setAsPrimitive(series.data);\n });\n } // Caution: some series modify option data, if do not clone,\n // it should ensure that the repeat modify correctly\n // (create a new object when modify itself).\n\n\n rawOption = clone(rawOption); // FIXME\n // 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。\n\n var oldOptionBackup = this._optionBackup;\n var newParsedOption = parseRawOption.call(this, rawOption, optionPreprocessorFuncs, !oldOptionBackup);\n this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode);\n\n if (oldOptionBackup) {\n // Only baseOption can be merged.\n mergeOption(oldOptionBackup.baseOption, newParsedOption.baseOption); // For simplicity, timeline options and media options do not support merge,\n // that is, if you `setOption` twice and both has timeline options, the latter\n // timeline opitons will not be merged to the formers, but just substitude them.\n\n if (newParsedOption.timelineOptions.length) {\n oldOptionBackup.timelineOptions = newParsedOption.timelineOptions;\n }\n\n if (newParsedOption.mediaList.length) {\n oldOptionBackup.mediaList = newParsedOption.mediaList;\n }\n\n if (newParsedOption.mediaDefault) {\n oldOptionBackup.mediaDefault = newParsedOption.mediaDefault;\n }\n } else {\n this._optionBackup = newParsedOption;\n }\n },\n\n /**\n * @param {boolean} isRecreate\n * @return {Object}\n */\n mountOption: function (isRecreate) {\n var optionBackup = this._optionBackup; // TODO\n // 如果没有reset功能则不clone。\n\n this._timelineOptions = map(optionBackup.timelineOptions, clone);\n this._mediaList = map(optionBackup.mediaList, clone);\n this._mediaDefault = clone(optionBackup.mediaDefault);\n this._currentMediaIndices = [];\n return clone(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption`\n // called, and is merged into every new option by inner method `mergeOption`\n // each time `setOption` called, can be only used in `isRecreate`, because\n // its reliability is under suspicion. In other cases option merge is\n // performed by `model.mergeOption`.\n ? optionBackup.baseOption : this._newBaseOption);\n },\n\n /**\n * @param {module:echarts/model/Global} ecModel\n * @return {Object}\n */\n getTimelineOption: function (ecModel) {\n var option;\n var timelineOptions = this._timelineOptions;\n\n if (timelineOptions.length) {\n // getTimelineOption can only be called after ecModel inited,\n // so we can get currentIndex from timelineModel.\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel) {\n option = clone(timelineOptions[timelineModel.getCurrentIndex()], true);\n }\n }\n\n return option;\n },\n\n /**\n * @param {module:echarts/model/Global} ecModel\n * @return {Array.}\n */\n getMediaOption: function (ecModel) {\n var ecWidth = this._api.getWidth();\n\n var ecHeight = this._api.getHeight();\n\n var mediaList = this._mediaList;\n var mediaDefault = this._mediaDefault;\n var indices = [];\n var result = []; // No media defined.\n\n if (!mediaList.length && !mediaDefault) {\n return result;\n } // Multi media may be applied, the latter defined media has higher priority.\n\n\n for (var i = 0, len = mediaList.length; i < len; i++) {\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\n indices.push(i);\n }\n } // FIXME\n // 是否mediaDefault应该强制用户设置,否则可能修改不能回归。\n\n\n if (!indices.length && mediaDefault) {\n indices = [-1];\n }\n\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\n result = map(indices, function (index) {\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\n });\n } // Otherwise return nothing.\n\n\n this._currentMediaIndices = indices;\n return result;\n }\n};\n\nfunction parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\n var timelineOptions = [];\n var mediaList = [];\n var mediaDefault;\n var baseOption; // Compatible with ec2.\n\n var timelineOpt = rawOption.timeline;\n\n if (rawOption.baseOption) {\n baseOption = rawOption.baseOption;\n } // For timeline\n\n\n if (timelineOpt || rawOption.options) {\n baseOption = baseOption || {};\n timelineOptions = (rawOption.options || []).slice();\n } // For media query\n\n\n if (rawOption.media) {\n baseOption = baseOption || {};\n var media = rawOption.media;\n each(media, function (singleMedia) {\n if (singleMedia && singleMedia.option) {\n if (singleMedia.query) {\n mediaList.push(singleMedia);\n } else if (!mediaDefault) {\n // Use the first media default.\n mediaDefault = singleMedia;\n }\n }\n });\n } // For normal option\n\n\n if (!baseOption) {\n baseOption = rawOption;\n } // Set timelineOpt to baseOption in ec3,\n // which is convenient for merge option.\n\n\n if (!baseOption.timeline) {\n baseOption.timeline = timelineOpt;\n } // Preprocess.\n\n\n each([baseOption].concat(timelineOptions).concat(zrUtil.map(mediaList, function (media) {\n return media.option;\n })), function (option) {\n each(optionPreprocessorFuncs, function (preProcess) {\n preProcess(option, isNew);\n });\n });\n return {\n baseOption: baseOption,\n timelineOptions: timelineOptions,\n mediaDefault: mediaDefault,\n mediaList: mediaList\n };\n}\n/**\n * @see \n * Support: width, height, aspectRatio\n * Can use max or min as prefix.\n */\n\n\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\n var realMap = {\n width: ecWidth,\n height: ecHeight,\n aspectratio: ecWidth / ecHeight // lowser case for convenientce.\n\n };\n var applicatable = true;\n zrUtil.each(query, function (value, attr) {\n var matched = attr.match(QUERY_REG);\n\n if (!matched || !matched[1] || !matched[2]) {\n return;\n }\n\n var operator = matched[1];\n var realAttr = matched[2].toLowerCase();\n\n if (!compare(realMap[realAttr], value, operator)) {\n applicatable = false;\n }\n });\n return applicatable;\n}\n\nfunction compare(real, expect, operator) {\n if (operator === 'min') {\n return real >= expect;\n } else if (operator === 'max') {\n return real <= expect;\n } else {\n // Equals\n return real === expect;\n }\n}\n\nfunction indicesEquals(indices1, indices2) {\n // indices is always order by asc and has only finite number.\n return indices1.join(',') === indices2.join(',');\n}\n/**\n * Consider case:\n * `chart.setOption(opt1);`\n * Then user do some interaction like dataZoom, dataView changing.\n * `chart.setOption(opt2);`\n * Then user press 'reset button' in toolbox.\n *\n * After doing that all of the interaction effects should be reset, the\n * chart should be the same as the result of invoke\n * `chart.setOption(opt1); chart.setOption(opt2);`.\n *\n * Although it is not able ensure that\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\n * `chart.setOption(merge(opt1, opt2));` exactly,\n * this might be the only simple way to implement that feature.\n *\n * MEMO: We've considered some other approaches:\n * 1. Each model handle its self restoration but not uniform treatment.\n * (Too complex in logic and error-prone)\n * 2. Use a shadow ecModel. (Performace expensive)\n */\n\n\nfunction mergeOption(oldOption, newOption) {\n newOption = newOption || {};\n each(newOption, function (newCptOpt, mainType) {\n if (newCptOpt == null) {\n return;\n }\n\n var oldCptOpt = oldOption[mainType];\n\n if (!ComponentModel.hasClass(mainType)) {\n oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n } else {\n newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n oldOption[mainType] = map(mapResult, function (item) {\n return item.option && item.exist ? merge(item.exist, item.option, true) : item.exist || item.option;\n });\n }\n });\n}\n\nvar _default = OptionManager;\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 modelUtil = require(\"../../util/model\");\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 isObject = zrUtil.isObject;\nvar POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];\n\nfunction compatEC2ItemStyle(opt) {\n var itemStyleOpt = opt && opt.itemStyle;\n\n if (!itemStyleOpt) {\n return;\n }\n\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\n var styleName = POSSIBLE_STYLES[i];\n var normalItemStyleOpt = itemStyleOpt.normal;\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\n\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].normal) {\n opt[styleName].normal = normalItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\n }\n\n normalItemStyleOpt[styleName] = null;\n }\n\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].emphasis) {\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\n }\n\n emphasisItemStyleOpt[styleName] = null;\n }\n }\n}\n\nfunction convertNormalEmphasis(opt, optType, useExtend) {\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\n var normalOpt = opt[optType].normal;\n var emphasisOpt = opt[optType].emphasis;\n\n if (normalOpt) {\n // Timeline controlStyle has other properties besides normal and emphasis\n if (useExtend) {\n opt[optType].normal = opt[optType].emphasis = null;\n zrUtil.defaults(opt[optType], normalOpt);\n } else {\n opt[optType] = normalOpt;\n }\n }\n\n if (emphasisOpt) {\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[optType] = emphasisOpt;\n }\n }\n}\n\nfunction removeEC3NormalStatus(opt) {\n convertNormalEmphasis(opt, 'itemStyle');\n convertNormalEmphasis(opt, 'lineStyle');\n convertNormalEmphasis(opt, 'areaStyle');\n convertNormalEmphasis(opt, 'label');\n convertNormalEmphasis(opt, 'labelLine'); // treemap\n\n convertNormalEmphasis(opt, 'upperLabel'); // graph\n\n convertNormalEmphasis(opt, 'edgeLabel');\n}\n\nfunction compatTextStyle(opt, propName) {\n // Check whether is not object (string\\null\\undefined ...)\n var labelOptSingle = isObject(opt) && opt[propName];\n var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\n\n if (textStyle) {\n for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\n var propName = modelUtil.TEXT_STYLE_OPTIONS[i];\n\n if (textStyle.hasOwnProperty(propName)) {\n labelOptSingle[propName] = textStyle[propName];\n }\n }\n }\n}\n\nfunction compatEC3CommonStyles(opt) {\n if (opt) {\n removeEC3NormalStatus(opt);\n compatTextStyle(opt, 'label');\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\n }\n}\n\nfunction processSeries(seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n compatEC2ItemStyle(seriesOpt);\n removeEC3NormalStatus(seriesOpt);\n compatTextStyle(seriesOpt, 'label'); // treemap\n\n compatTextStyle(seriesOpt, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt, 'edgeLabel');\n\n if (seriesOpt.emphasis) {\n compatTextStyle(seriesOpt.emphasis, 'label'); // treemap\n\n compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\n }\n\n var markPoint = seriesOpt.markPoint;\n\n if (markPoint) {\n compatEC2ItemStyle(markPoint);\n compatEC3CommonStyles(markPoint);\n }\n\n var markLine = seriesOpt.markLine;\n\n if (markLine) {\n compatEC2ItemStyle(markLine);\n compatEC3CommonStyles(markLine);\n }\n\n var markArea = seriesOpt.markArea;\n\n if (markArea) {\n compatEC3CommonStyles(markArea);\n }\n\n var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option,\n // then the backward compat based on option type will not be performed.\n\n if (seriesOpt.type === 'graph') {\n data = data || seriesOpt.nodes;\n var edgeData = seriesOpt.links || seriesOpt.edges;\n\n if (edgeData && !zrUtil.isTypedArray(edgeData)) {\n for (var i = 0; i < edgeData.length; i++) {\n compatEC3CommonStyles(edgeData[i]);\n }\n }\n\n zrUtil.each(seriesOpt.categories, function (opt) {\n removeEC3NormalStatus(opt);\n });\n }\n\n if (data && !zrUtil.isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatEC3CommonStyles(data[i]);\n }\n } // mark point data\n\n\n var markPoint = seriesOpt.markPoint;\n\n if (markPoint && markPoint.data) {\n var mpData = markPoint.data;\n\n for (var i = 0; i < mpData.length; i++) {\n compatEC3CommonStyles(mpData[i]);\n }\n } // mark line data\n\n\n var markLine = seriesOpt.markLine;\n\n if (markLine && markLine.data) {\n var mlData = markLine.data;\n\n for (var i = 0; i < mlData.length; i++) {\n if (zrUtil.isArray(mlData[i])) {\n compatEC3CommonStyles(mlData[i][0]);\n compatEC3CommonStyles(mlData[i][1]);\n } else {\n compatEC3CommonStyles(mlData[i]);\n }\n }\n } // Series\n\n\n if (seriesOpt.type === 'gauge') {\n compatTextStyle(seriesOpt, 'axisLabel');\n compatTextStyle(seriesOpt, 'title');\n compatTextStyle(seriesOpt, 'detail');\n } else if (seriesOpt.type === 'treemap') {\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\n zrUtil.each(seriesOpt.levels, function (opt) {\n removeEC3NormalStatus(opt);\n });\n } else if (seriesOpt.type === 'tree') {\n removeEC3NormalStatus(seriesOpt.leaves);\n } // sunburst starts from ec4, so it does not need to compat levels.\n\n}\n\nfunction toArr(o) {\n return zrUtil.isArray(o) ? o : o ? [o] : [];\n}\n\nfunction toObj(o) {\n return (zrUtil.isArray(o) ? o[0] : o) || {};\n}\n\nfunction _default(option, isTheme) {\n each(toArr(option.series), function (seriesOpt) {\n isObject(seriesOpt) && processSeries(seriesOpt);\n });\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\n each(axes, function (axisName) {\n each(toArr(option[axisName]), function (axisOpt) {\n if (axisOpt) {\n compatTextStyle(axisOpt, 'axisLabel');\n compatTextStyle(axisOpt.axisPointer, 'label');\n }\n });\n });\n each(toArr(option.parallel), function (parallelOpt) {\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\n compatTextStyle(parallelAxisDefault, 'axisLabel');\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\n });\n each(toArr(option.calendar), function (calendarOpt) {\n convertNormalEmphasis(calendarOpt, 'itemStyle');\n compatTextStyle(calendarOpt, 'dayLabel');\n compatTextStyle(calendarOpt, 'monthLabel');\n compatTextStyle(calendarOpt, 'yearLabel');\n }); // radar.name.textStyle\n\n each(toArr(option.radar), function (radarOpt) {\n compatTextStyle(radarOpt, 'name');\n });\n each(toArr(option.geo), function (geoOpt) {\n if (isObject(geoOpt)) {\n compatEC3CommonStyles(geoOpt);\n each(toArr(geoOpt.regions), function (regionObj) {\n compatEC3CommonStyles(regionObj);\n });\n }\n });\n each(toArr(option.timeline), function (timelineOpt) {\n compatEC3CommonStyles(timelineOpt);\n convertNormalEmphasis(timelineOpt, 'label');\n convertNormalEmphasis(timelineOpt, 'itemStyle');\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\n var data = timelineOpt.data;\n zrUtil.isArray(data) && zrUtil.each(data, function (item) {\n if (zrUtil.isObject(item)) {\n convertNormalEmphasis(item, 'label');\n convertNormalEmphasis(item, 'itemStyle');\n }\n });\n });\n each(toArr(option.toolbox), function (toolboxOpt) {\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\n each(toolboxOpt.feature, function (featureOpt) {\n convertNormalEmphasis(featureOpt, 'iconStyle');\n });\n });\n compatTextStyle(toObj(option.axisPointer), 'label');\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\n}\n\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar isArray = _util.isArray;\nvar isObject = _util.isObject;\n\nvar compatStyle = require(\"./helper/compatStyle\");\n\nvar _model = require(\"../util/model\");\n\nvar normalizeToArray = _model.normalizeToArray;\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// Compatitable with 2.0\nfunction get(opt, path) {\n path = path.split(',');\n var obj = opt;\n\n for (var i = 0; i < path.length; i++) {\n obj = obj && obj[path[i]];\n\n if (obj == null) {\n break;\n }\n }\n\n return obj;\n}\n\nfunction set(opt, path, val, overwrite) {\n path = path.split(',');\n var obj = opt;\n var key;\n\n for (var i = 0; i < path.length - 1; i++) {\n key = path[i];\n\n if (obj[key] == null) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n if (overwrite || obj[path[i]] == null) {\n obj[path[i]] = val;\n }\n}\n\nfunction compatLayoutProperties(option) {\n each(LAYOUT_PROPERTIES, function (prop) {\n if (prop[0] in option && !(prop[1] in option)) {\n option[prop[1]] = option[prop[0]];\n }\n });\n}\n\nvar LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];\nvar COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];\n\nfunction _default(option, isTheme) {\n compatStyle(option, isTheme); // Make sure series array for model initialization.\n\n option.series = normalizeToArray(option.series);\n each(option.series, function (seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n var seriesType = seriesOpt.type;\n\n if (seriesType === 'line') {\n if (seriesOpt.clipOverflow != null) {\n seriesOpt.clip = seriesOpt.clipOverflow;\n }\n } else if (seriesType === 'pie' || seriesType === 'gauge') {\n if (seriesOpt.clockWise != null) {\n seriesOpt.clockwise = seriesOpt.clockWise;\n }\n } else if (seriesType === 'gauge') {\n var pointerColor = get(seriesOpt, 'pointer.color');\n pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);\n }\n\n compatLayoutProperties(seriesOpt);\n }); // dataRange has changed to visualMap\n\n if (option.dataRange) {\n option.visualMap = option.dataRange;\n }\n\n each(COMPATITABLE_COMPONENTS, function (componentName) {\n var options = option[componentName];\n\n if (options) {\n if (!isArray(options)) {\n options = [options];\n }\n\n each(options, function (option) {\n compatLayoutProperties(option);\n });\n }\n });\n}\n\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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\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// (1) [Caution]: the logic is correct based on the premises:\n// data processing stage is blocked in stream.\n// See \n// (2) Only register once when import repeatly.\n// Should be executed after series filtered and before stack calculation.\nfunction _default(ecModel) {\n var stackInfoMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var stack = seriesModel.get('stack'); // Compatibal: when `stack` is set as '', do not stack.\n\n if (stack) {\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\n var data = seriesModel.getData();\n var stackInfo = {\n // Used for calculate axis extent automatically.\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\n stackedDimension: data.getCalculationInfo('stackedDimension'),\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\n data: data,\n seriesModel: seriesModel\n }; // If stacked on axis that do not support data stack.\n\n if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\n return;\n }\n\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\n stackInfoList.push(stackInfo);\n }\n });\n stackInfoMap.each(calculateStack);\n}\n\nfunction calculateStack(stackInfoList) {\n each(stackInfoList, function (targetStackInfo, idxInStack) {\n var resultVal = [];\n var resultNaN = [NaN, NaN];\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\n var targetData = targetStackInfo.data;\n var isStackedByIndex = targetStackInfo.isStackedByIndex; // Should not write on raw data, because stack series model list changes\n // depending on legend selection.\n\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver\n // should also be NaN, to draw a appropriate belt area.\n\n if (isNaN(sum)) {\n return resultNaN;\n }\n\n var byValue;\n var stackedDataRawIndex;\n\n if (isStackedByIndex) {\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\n } else {\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\n } // If stackOver is NaN, chart view will render point on value start.\n\n\n var stackedOver = NaN;\n\n for (var j = idxInStack - 1; j >= 0; j--) {\n var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`.\n\n if (!isStackedByIndex) {\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\n }\n\n if (stackedDataRawIndex >= 0) {\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data\n\n if (sum >= 0 && val > 0 || // Positive stack\n sum <= 0 && val < 0 // Negative stack\n ) {\n sum += val;\n stackedOver = val;\n break;\n }\n }\n }\n\n resultVal[0] = sum;\n resultVal[1] = stackedOver;\n return resultVal;\n });\n targetData.hostModel.setData(newData); // Update for consequent calculation\n\n targetStackInfo.data = newData;\n });\n}\n\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 _util = require(\"zrender/lib/core/util\");\n\nvar isTypedArray = _util.isTypedArray;\nvar extend = _util.extend;\nvar assert = _util.assert;\nvar each = _util.each;\nvar isObject = _util.isObject;\n\nvar _model = require(\"../../util/model\");\n\nvar getDataItemValue = _model.getDataItemValue;\nvar isDataItemOption = _model.isDataItemOption;\n\nvar _number = require(\"../../util/number\");\n\nvar parseDate = _number.parseDate;\n\nvar Source = require(\"../Source\");\n\nvar _sourceType = require(\"./sourceType\");\n\nvar SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY;\nvar SOURCE_FORMAT_ARRAY_ROWS = _sourceType.SOURCE_FORMAT_ARRAY_ROWS;\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\nvar SOURCE_FORMAT_OBJECT_ROWS = _sourceType.SOURCE_FORMAT_OBJECT_ROWS;\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// TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\n\n/**\n * If normal array used, mutable chunk size is supported.\n * If typed array used, chunk size must be fixed.\n */\nfunction DefaultDataProvider(source, dimSize) {\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n this._source = source;\n var data = this._data = source.data;\n var sourceFormat = source.sourceFormat; // Typed array. TODO IE10+?\n\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n this._offset = 0;\n this._dimSize = dimSize;\n this._data = data;\n }\n\n var methods = providerMethods[sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + source.seriesLayoutBy : sourceFormat];\n extend(this, methods);\n}\n\nvar providerProto = DefaultDataProvider.prototype; // If data is pure without style configuration\n\nproviderProto.pure = false; // If data is persistent and will not be released after use.\n\nproviderProto.persistent = true; // ???! FIXME legacy data provider do not has method getSource\n\nproviderProto.getSource = function () {\n return this._source;\n};\n\nvar providerMethods = {\n 'arrayRows_column': {\n pure: true,\n count: function () {\n return Math.max(0, this._data.length - this._source.startIndex);\n },\n getItem: function (idx) {\n return this._data[idx + this._source.startIndex];\n },\n appendData: appendDataSimply\n },\n 'arrayRows_row': {\n pure: true,\n count: function () {\n var row = this._data[0];\n return row ? Math.max(0, row.length - this._source.startIndex) : 0;\n },\n getItem: function (idx) {\n idx += this._source.startIndex;\n var item = [];\n var data = this._data;\n\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n item.push(row ? row[idx] : null);\n }\n\n return item;\n },\n appendData: function () {\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n }\n },\n 'objectRows': {\n pure: true,\n count: countSimply,\n getItem: getItemSimply,\n appendData: appendDataSimply\n },\n 'keyedColumns': {\n pure: true,\n count: function () {\n var dimName = this._source.dimensionsDefine[0].name;\n var col = this._data[dimName];\n return col ? col.length : 0;\n },\n getItem: function (idx) {\n var item = [];\n var dims = this._source.dimensionsDefine;\n\n for (var i = 0; i < dims.length; i++) {\n var col = this._data[dims[i].name];\n item.push(col ? col[idx] : null);\n }\n\n return item;\n },\n appendData: function (newData) {\n var data = this._data;\n each(newData, function (newCol, key) {\n var oldCol = data[key] || (data[key] = []);\n\n for (var i = 0; i < (newCol || []).length; i++) {\n oldCol.push(newCol[i]);\n }\n });\n }\n },\n 'original': {\n count: countSimply,\n getItem: getItemSimply,\n appendData: appendDataSimply\n },\n 'typedArray': {\n persistent: false,\n pure: true,\n count: function () {\n return this._data ? this._data.length / this._dimSize : 0;\n },\n getItem: function (idx, out) {\n idx = idx - this._offset;\n out = out || [];\n var offset = this._dimSize * idx;\n\n for (var i = 0; i < this._dimSize; i++) {\n out[i] = this._data[offset + i];\n }\n\n return out;\n },\n appendData: function (newData) {\n this._data = newData;\n },\n // Clean self if data is already used.\n clean: function () {\n // PENDING\n this._offset += this.count();\n this._data = null;\n }\n }\n};\n\nfunction countSimply() {\n return this._data.length;\n}\n\nfunction getItemSimply(idx) {\n return this._data[idx];\n}\n\nfunction appendDataSimply(newData) {\n for (var i = 0; i < newData.length; i++) {\n this._data.push(newData[i]);\n }\n}\n\nvar rawValueGetters = {\n arrayRows: getRawValueSimply,\n objectRows: function (dataItem, dataIndex, dimIndex, dimName) {\n return dimIndex != null ? dataItem[dimName] : dataItem;\n },\n keyedColumns: getRawValueSimply,\n original: function (dataItem, dataIndex, dimIndex, dimName) {\n // FIXME\n // In some case (markpoint in geo (geo-map.html)), dataItem\n // is {coord: [...]}\n var value = getDataItemValue(dataItem);\n return dimIndex == null || !(value instanceof Array) ? value : value[dimIndex];\n },\n typedArray: getRawValueSimply\n};\n\nfunction getRawValueSimply(dataItem, dataIndex, dimIndex, dimName) {\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\n}\n\nvar defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\n return converDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, dimName, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the var `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertDataValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); // If any dataItem is like { value: 10 }\n\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n return converDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array.\n : value, this._dimensionInfos[dimName]);\n },\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n};\n\nfunction getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\n return converDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\n}\n/**\n * This helper method convert value in data.\n * @param {string|number|Date} value\n * @param {Object|string} [dimInfo] If string (like 'x'), dimType defaults 'number'.\n * If \"dimInfo.ordinalParseAndSave\", ordinal value can be parsed.\n */\n\n\nfunction converDataValue(value, dimInfo) {\n // Performance sensitive.\n var dimType = dimInfo && dimInfo.type;\n\n if (dimType === 'ordinal') {\n // If given value is a category string\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.parseAndCollect(value) : value;\n }\n\n if (dimType === 'time' // spead up when using timestamp\n && typeof value !== 'number' && value != null && value !== '-') {\n value = +parseDate(value);\n } // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n\n\n return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : +value;\n} // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\n\n/**\n * @param {module:echarts/data/List} data\n * @param {number} dataIndex\n * @param {string|number} [dim] dimName or dimIndex\n * @return {Array.|string|number} can be null/undefined.\n */\n\n\nfunction retrieveRawValue(data, dataIndex, dim) {\n if (!data) {\n return;\n } // Consider data may be not persistent.\n\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (dataItem == null) {\n return;\n }\n\n var sourceFormat = data.getProvider().getSource().sourceFormat;\n var dimName;\n var dimIndex;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (dimInfo) {\n dimName = dimInfo.name;\n dimIndex = dimInfo.index;\n }\n\n return rawValueGetters[sourceFormat](dataItem, dataIndex, dimIndex, dimName);\n}\n/**\n * Compatible with some cases (in pie, map) like:\n * data: [{name: 'xx', value: 5, selected: true}, ...]\n * where only sourceFormat is 'original' and 'objectRows' supported.\n *\n * ??? TODO\n * Supported detail options in data item when using 'arrayRows'.\n *\n * @param {module:echarts/data/List} data\n * @param {number} dataIndex\n * @param {string} attr like 'selected'\n */\n\n\nfunction retrieveRawAttr(data, dataIndex, attr) {\n if (!data) {\n return;\n }\n\n var sourceFormat = data.getProvider().getSource().sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n return;\n }\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n dataItem = null;\n }\n\n if (dataItem) {\n return dataItem[attr];\n }\n}\n\nexports.DefaultDataProvider = DefaultDataProvider;\nexports.defaultDimValueGetters = defaultDimValueGetters;\nexports.retrieveRawValue = retrieveRawValue;\nexports.retrieveRawAttr = retrieveRawAttr;","\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 _dataProvider = require(\"../../data/helper/dataProvider\");\n\nvar retrieveRawValue = _dataProvider.retrieveRawValue;\n\nvar _format = require(\"../../util/format\");\n\nvar getTooltipMarker = _format.getTooltipMarker;\nvar formatTpl = _format.formatTpl;\n\nvar _model = require(\"../../util/model\");\n\nvar getTooltipRenderMode = _model.getTooltipRenderMode;\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 DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g; // PENDING A little ugly\n\nvar _default = {\n /**\n * Get params for formatter\n * @param {number} dataIndex\n * @param {string} [dataType]\n * @return {Object}\n */\n getDataParams: function (dataIndex, dataType) {\n var data = this.getData(dataType);\n var rawValue = this.getRawValue(dataIndex, dataType);\n var rawDataIndex = data.getRawIndex(dataIndex);\n var name = data.getName(dataIndex);\n var itemOpt = data.getRawDataItem(dataIndex);\n var color = data.getItemVisual(dataIndex, 'color');\n var borderColor = data.getItemVisual(dataIndex, 'borderColor');\n var tooltipModel = this.ecModel.getComponent('tooltip');\n var renderModeOption = tooltipModel && tooltipModel.get('renderMode');\n var renderMode = getTooltipRenderMode(renderModeOption);\n var mainType = this.mainType;\n var isSeries = mainType === 'series';\n var userOutput = data.userOutput;\n return {\n componentType: mainType,\n componentSubType: this.subType,\n componentIndex: this.componentIndex,\n seriesType: isSeries ? this.subType : null,\n seriesIndex: this.seriesIndex,\n seriesId: isSeries ? this.id : null,\n seriesName: isSeries ? this.name : null,\n name: name,\n dataIndex: rawDataIndex,\n data: itemOpt,\n dataType: dataType,\n value: rawValue,\n color: color,\n borderColor: borderColor,\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\n encode: userOutput ? userOutput.encode : null,\n marker: getTooltipMarker({\n color: color,\n renderMode: renderMode\n }),\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\n $vars: ['seriesName', 'name', 'value']\n };\n },\n\n /**\n * Format label\n * @param {number} dataIndex\n * @param {string} [status='normal'] 'normal' or 'emphasis'\n * @param {string} [dataType]\n * @param {number} [dimIndex] Only used in some chart that\n * use formatter in different dimensions, like radar.\n * @param {string} [labelProp='label']\n * @return {string} If not formatter, return null/undefined\n */\n getFormattedLabel: function (dataIndex, status, dataType, dimIndex, labelProp) {\n status = status || 'normal';\n var data = this.getData(dataType);\n var itemModel = data.getItemModel(dataIndex);\n var params = this.getDataParams(dataIndex, dataType);\n\n if (dimIndex != null && params.value instanceof Array) {\n params.value = params.value[dimIndex];\n }\n\n var formatter = itemModel.get(status === 'normal' ? [labelProp || 'label', 'formatter'] : [status, labelProp || 'label', 'formatter']);\n\n if (typeof formatter === 'function') {\n params.status = status;\n params.dimensionIndex = dimIndex;\n return formatter(params);\n } else if (typeof formatter === 'string') {\n var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'.\n // Do not support '}' in dim name util have to.\n\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\n var len = dim.length;\n\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\n dim = +dim.slice(1, len - 1); // Also: '[]' => 0\n }\n\n return retrieveRawValue(data, dataIndex, dim);\n });\n }\n },\n\n /**\n * Get raw value in option\n * @param {number} idx\n * @param {string} [dataType]\n * @return {Array|number|string}\n */\n getRawValue: function (idx, dataType) {\n return retrieveRawValue(this.getData(dataType), idx);\n },\n\n /**\n * Should be implemented.\n * @param {number} dataIndex\n * @param {boolean} [multipleSeries=false]\n * @param {number} [dataType]\n * @return {string} tooltip string\n */\n formatTooltip: function () {// Empty function\n }\n};\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 _util = require(\"zrender/lib/core/util\");\n\nvar assert = _util.assert;\nvar isArray = _util.isArray;\n\nvar _config = require(\"../config\");\n\nvar __DEV__ = _config.__DEV__;\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 * @param {Object} define\n * @return See the return of `createTask`.\n */\nfunction createTask(define) {\n return new Task(define);\n}\n/**\n * @constructor\n * @param {Object} define\n * @param {Function} define.reset Custom reset\n * @param {Function} [define.plan] Returns 'reset' indicate reset immediately.\n * @param {Function} [define.count] count is used to determin data task.\n * @param {Function} [define.onDirty] count is used to determin data task.\n */\n\n\nfunction Task(define) {\n define = define || {};\n this._reset = define.reset;\n this._plan = define.plan;\n this._count = define.count;\n this._onDirty = define.onDirty;\n this._dirty = true; // Context must be specified implicitly, to\n // avoid miss update context when model changed.\n\n this.context;\n}\n\nvar taskProto = Task.prototype;\n/**\n * @param {Object} performArgs\n * @param {number} [performArgs.step] Specified step.\n * @param {number} [performArgs.skip] Skip customer perform call.\n * @param {number} [performArgs.modBy] Sampling window size.\n * @param {number} [performArgs.modDataCount] Sampling count.\n */\n\ntaskProto.perform = function (performArgs) {\n var upTask = this._upstream;\n var skip = performArgs && performArgs.skip; // TODO some refactor.\n // Pull data. Must pull data each time, because context.data\n // may be updated by Series.setData.\n\n if (this._dirty && upTask) {\n var context = this.context;\n context.data = context.outputData = upTask.context.outputData;\n }\n\n if (this.__pipeline) {\n this.__pipeline.currentTask = this;\n }\n\n var planResult;\n\n if (this._plan && !skip) {\n planResult = this._plan(this.context);\n } // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n // elements uniformed distributed when progress, especially when moving or zooming.\n\n\n var lastModBy = normalizeModBy(this._modBy);\n var lastModDataCount = this._modDataCount || 0;\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\n var modDataCount = performArgs && performArgs.modDataCount || 0;\n\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n planResult = 'reset';\n }\n\n function normalizeModBy(val) {\n !(val >= 1) && (val = 1); // jshint ignore:line\n\n return val;\n }\n\n var forceFirstProgress;\n\n if (this._dirty || planResult === 'reset') {\n this._dirty = false;\n forceFirstProgress = reset(this, skip);\n }\n\n this._modBy = modBy;\n this._modDataCount = modDataCount;\n var step = performArgs && performArgs.step;\n\n if (upTask) {\n this._dueEnd = upTask._outputDueEnd;\n } // DataTask or overallTask\n else {\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\n } // Note: Stubs, that its host overall task let it has progress, has progress.\n // If no progress, pass index from upstream to downstream each time plan called.\n\n\n if (this._progress) {\n var start = this._dueIndex;\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n\n if (!skip && (forceFirstProgress || start < end)) {\n var progress = this._progress;\n\n if (isArray(progress)) {\n for (var i = 0; i < progress.length; i++) {\n doProgress(this, progress[i], start, end, modBy, modDataCount);\n }\n } else {\n doProgress(this, progress, start, end, modBy, modDataCount);\n }\n }\n\n this._dueIndex = end; // If no `outputDueEnd`, assume that output data and\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\n\n var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n this._outputDueEnd = outputDueEnd;\n } else {\n // (1) Some overall task has no progress.\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n // This should always be performed so it can be passed to downstream.\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n }\n\n return this.unfinished();\n};\n\nvar iterator = function () {\n var end;\n var current;\n var modBy;\n var modDataCount;\n var winCount;\n var it = {\n reset: function (s, e, sStep, sCount) {\n current = s;\n end = e;\n modBy = sStep;\n modDataCount = sCount;\n winCount = Math.ceil(modDataCount / modBy);\n it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n }\n };\n return it;\n\n function sequentialNext() {\n return current < end ? current++ : null;\n }\n\n function modNext() {\n var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case),\n // Use normal linear rendering mode.\n : current;\n current++;\n return result;\n }\n}();\n\ntaskProto.dirty = function () {\n this._dirty = true;\n this._onDirty && this._onDirty(this.context);\n};\n\nfunction doProgress(taskIns, progress, start, end, modBy, modDataCount) {\n iterator.reset(start, end, modBy, modDataCount);\n taskIns._callingProgress = progress;\n\n taskIns._callingProgress({\n start: start,\n end: end,\n count: end - start,\n next: iterator.next\n }, taskIns.context);\n}\n\nfunction reset(taskIns, skip) {\n taskIns._dueIndex = taskIns._outputDueEnd = taskIns._dueEnd = 0;\n taskIns._settedOutputEnd = null;\n var progress;\n var forceFirstProgress;\n\n if (!skip && taskIns._reset) {\n progress = taskIns._reset(taskIns.context);\n\n if (progress && progress.progress) {\n forceFirstProgress = progress.forceFirstProgress;\n progress = progress.progress;\n } // To simplify no progress checking, array must has item.\n\n\n if (isArray(progress) && !progress.length) {\n progress = null;\n }\n }\n\n taskIns._progress = progress;\n taskIns._modBy = taskIns._modDataCount = null;\n var downstream = taskIns._downstream;\n downstream && downstream.dirty();\n return forceFirstProgress;\n}\n/**\n * @return {boolean}\n */\n\n\ntaskProto.unfinished = function () {\n return this._progress && this._dueIndex < this._dueEnd;\n};\n/**\n * @param {Object} downTask The downstream task.\n * @return {Object} The downstream task.\n */\n\n\ntaskProto.pipe = function (downTask) {\n // If already downstream, do not dirty downTask.\n if (this._downstream !== downTask || this._dirty) {\n this._downstream = downTask;\n downTask._upstream = this;\n downTask.dirty();\n }\n};\n\ntaskProto.dispose = function () {\n if (this._disposed) {\n return;\n }\n\n this._upstream && (this._upstream._downstream = null);\n this._downstream && (this._downstream._upstream = null);\n this._dirty = false;\n this._disposed = true;\n};\n\ntaskProto.getUpstream = function () {\n return this._upstream;\n};\n\ntaskProto.getDownstream = function () {\n return this._downstream;\n};\n\ntaskProto.setOutputEnd = function (end) {\n // This only happend in dataTask, dataZoom, map, currently.\n // where dataZoom do not set end each time, but only set\n // when reset. So we should record the setted end, in case\n // that the stub of dataZoom perform again and earse the\n // setted end by upstream.\n this._outputDueEnd = this._settedOutputEnd = end;\n}; ///////////////////////////////////////////////////////////\n// For stream debug (Should be commented out after used!)\n// Usage: printTask(this, 'begin');\n// Usage: printTask(this, null, {someExtraProp});\n// function printTask(task, prefix, extra) {\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n// var props = [];\n// if (task.__pipeline) {\n// var val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n// props.push({text: 'idx', value: val});\n// } else {\n// var stubCount = 0;\n// task.agentStubMap.each(() => stubCount++);\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n// }\n// props.push({text: 'uid', value: task.uidDebug});\n// if (task.__pipeline) {\n// props.push({text: 'pid', value: task.__pipeline.id});\n// task.agent && props.push(\n// {text: 'stubFor', value: task.agent.uidDebug}\n// );\n// }\n// props.push(\n// {text: 'dirty', value: task._dirty},\n// {text: 'dueIndex', value: task._dueIndex},\n// {text: 'dueEnd', value: task._dueEnd},\n// {text: 'outputDueEnd', value: task._outputDueEnd}\n// );\n// if (extra) {\n// Object.keys(extra).forEach(key => {\n// props.push({text: key, value: extra[key]});\n// });\n// }\n// var args = ['color: blue'];\n// var msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n// args.push('color: black', 'color: red'),\n// `${item.text}: %c${item.value}`\n// )).join('%c, ');\n// console.log.apply(console, [msg].concat(args));\n// // console.log(this);\n// }\n\n\nexports.createTask = createTask;","\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 env = require(\"zrender/lib/core/env\");\n\nvar _format = require(\"../util/format\");\n\nvar formatTime = _format.formatTime;\nvar encodeHTML = _format.encodeHTML;\nvar addCommas = _format.addCommas;\nvar getTooltipMarker = _format.getTooltipMarker;\n\nvar modelUtil = require(\"../util/model\");\n\nvar ComponentModel = require(\"./Component\");\n\nvar colorPaletteMixin = require(\"./mixin/colorPalette\");\n\nvar dataFormatMixin = require(\"../model/mixin/dataFormat\");\n\nvar _layout = require(\"../util/layout\");\n\nvar getLayoutParams = _layout.getLayoutParams;\nvar mergeLayoutParam = _layout.mergeLayoutParam;\n\nvar _task = require(\"../stream/task\");\n\nvar createTask = _task.createTask;\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar prepareSource = _sourceHelper.prepareSource;\nvar getSource = _sourceHelper.getSource;\n\nvar _dataProvider = require(\"../data/helper/dataProvider\");\n\nvar retrieveRawValue = _dataProvider.retrieveRawValue;\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 inner = modelUtil.makeInner();\nvar SeriesModel = ComponentModel.extend({\n type: 'series.__base__',\n\n /**\n * @readOnly\n */\n seriesIndex: 0,\n // coodinateSystem will be injected in the echarts/CoordinateSystem\n coordinateSystem: null,\n\n /**\n * @type {Object}\n * @protected\n */\n defaultOption: null,\n\n /**\n * legend visual provider to the legend component\n * @type {Object}\n */\n // PENDING\n legendVisualProvider: null,\n\n /**\n * Access path of color for visual\n */\n visualColorAccessPath: 'itemStyle.color',\n\n /**\n * Access path of borderColor for visual\n */\n visualBorderColorAccessPath: 'itemStyle.borderColor',\n\n /**\n * Support merge layout params.\n * Only support 'box' now (left/right/top/bottom/width/height).\n * @type {string|Object} Object can be {ignoreSize: true}\n * @readOnly\n */\n layoutMode: null,\n init: function (option, parentModel, ecModel, extraOpt) {\n /**\n * @type {number}\n * @readOnly\n */\n this.seriesIndex = this.componentIndex;\n this.dataTask = createTask({\n count: dataTaskCount,\n reset: dataTaskReset\n });\n this.dataTask.context = {\n model: this\n };\n this.mergeDefaultAndTheme(option, ecModel);\n prepareSource(this);\n var data = this.getInitialData(option, ecModel);\n wrapData(data, this);\n this.dataTask.context.data = data;\n\n /**\n * @type {module:echarts/data/List|module:echarts/data/Tree|module:echarts/data/Graph}\n * @private\n */\n inner(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make\n // dataBeforeProcessed by cloneShallow), cloneShallow will\n // cause data.graph.data !== data when using\n // module:echarts/data/Graph or module:echarts/data/Tree.\n // See module:echarts/data/helper/linkList\n // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\n // init or merge stage, because the data can be restored. So we do not `restoreData`\n // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\n // Call `seriesModel.getRawData()` instead.\n // this.restoreData();\n\n autoSeriesName(this);\n },\n\n /**\n * Util for merge default and theme to option\n * @param {Object} option\n * @param {module:echarts/model/Global} ecModel\n */\n mergeDefaultAndTheme: function (option, ecModel) {\n var layoutMode = this.layoutMode;\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme.\n // But if name duplicate between series subType\n // (for example: parallel) add component mainType,\n // add suffix 'Series'.\n\n var themeSubType = this.subType;\n\n if (ComponentModel.hasClass(themeSubType)) {\n themeSubType += 'Series';\n }\n\n zrUtil.merge(option, ecModel.getTheme().get(this.subType));\n zrUtil.merge(option, this.getDefaultOption()); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n this.fillDataTextStyle(option.data);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n },\n mergeOption: function (newSeriesOption, ecModel) {\n // this.settingTask.dirty();\n newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\n this.fillDataTextStyle(newSeriesOption.data);\n var layoutMode = this.layoutMode;\n\n if (layoutMode) {\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\n }\n\n prepareSource(this);\n var data = this.getInitialData(newSeriesOption, ecModel);\n wrapData(data, this);\n this.dataTask.dirty();\n this.dataTask.context.data = data;\n inner(this).dataBeforeProcessed = data;\n autoSeriesName(this);\n },\n fillDataTextStyle: function (data) {\n // Default data label emphasis `show`\n // FIXME Tree structure data ?\n // FIXME Performance ?\n if (data && !zrUtil.isTypedArray(data)) {\n var props = ['show'];\n\n for (var i = 0; i < data.length; i++) {\n if (data[i] && data[i].label) {\n modelUtil.defaultEmphasis(data[i], 'label', props);\n }\n }\n }\n },\n\n /**\n * Init a data structure from data related option in series\n * Must be overwritten\n */\n getInitialData: function () {},\n\n /**\n * Append data to list\n * @param {Object} params\n * @param {Array|TypedArray} params.data\n */\n appendData: function (params) {\n // FIXME ???\n // (1) If data from dataset, forbidden append.\n // (2) support append data of dataset.\n var data = this.getRawData();\n data.appendData(params.data);\n },\n\n /**\n * Consider some method like `filter`, `map` need make new data,\n * We should make sure that `seriesModel.getData()` get correct\n * data in the stream procedure. So we fetch data from upstream\n * each time `task.perform` called.\n * @param {string} [dataType]\n * @return {module:echarts/data/List}\n */\n getData: function (dataType) {\n var task = getCurrentTask(this);\n\n if (task) {\n var data = task.context.data;\n return dataType == null ? data : data.getLinkedData(dataType);\n } else {\n // When series is not alive (that may happen when click toolbox\n // restore or setOption with not merge mode), series data may\n // be still need to judge animation or something when graphic\n // elements want to know whether fade out.\n return inner(this).data;\n }\n },\n\n /**\n * @param {module:echarts/data/List} data\n */\n setData: function (data) {\n var task = getCurrentTask(this);\n\n if (task) {\n var context = task.context; // Consider case: filter, data sample.\n\n if (context.data !== data && task.modifyOutputEnd) {\n task.setOutputEnd(data.count());\n }\n\n context.outputData = data; // Caution: setData should update context.data,\n // Because getData may be called multiply in a\n // single stage and expect to get the data just\n // set. (For example, AxisProxy, x y both call\n // getData and setDate sequentially).\n // So the context.data should be fetched from\n // upstream each time when a stage starts to be\n // performed.\n\n if (task !== this.dataTask) {\n context.data = data;\n }\n }\n\n inner(this).data = data;\n },\n\n /**\n * @see {module:echarts/data/helper/sourceHelper#getSource}\n * @return {module:echarts/data/Source} source\n */\n getSource: function () {\n return getSource(this);\n },\n\n /**\n * Get data before processed\n * @return {module:echarts/data/List}\n */\n getRawData: function () {\n return inner(this).dataBeforeProcessed;\n },\n\n /**\n * Get base axis if has coordinate system and has axis.\n * By default use coordSys.getBaseAxis();\n * Can be overrided for some chart.\n * @return {type} description\n */\n getBaseAxis: function () {\n var coordSys = this.coordinateSystem;\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\n },\n // FIXME\n\n /**\n * Default tooltip formatter\n *\n * @param {number} dataIndex\n * @param {boolean} [multipleSeries=false]\n * @param {number} [dataType]\n * @param {string} [renderMode='html'] valid values: 'html' and 'richText'.\n * 'html' is used for rendering tooltip in extra DOM form, and the result\n * string is used as DOM HTML content.\n * 'richText' is used for rendering tooltip in rich text form, for those where\n * DOM operation is not supported.\n * @return {Object} formatted tooltip with `html` and `markers`\n */\n formatTooltip: function (dataIndex, multipleSeries, dataType, renderMode) {\n var series = this;\n renderMode = renderMode || 'html';\n var newLine = renderMode === 'html' ? '
' : '\\n';\n var isRichText = renderMode === 'richText';\n var markers = {};\n var markerId = 0;\n\n function formatArrayValue(value) {\n // ??? TODO refactor these logic.\n // check: category-no-encode-has-axis-data in dataset.html\n var vertially = zrUtil.reduce(value, function (vertially, val, idx) {\n var dimItem = data.getDimensionInfo(idx);\n return vertially |= dimItem && dimItem.tooltip !== false && dimItem.displayName != null;\n }, 0);\n var result = [];\n tooltipDims.length ? zrUtil.each(tooltipDims, function (dim) {\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\n }) // By default, all dims is used on tooltip.\n : zrUtil.each(value, setEachItem);\n\n function setEachItem(val, dim) {\n var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip.\n\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\n return;\n }\n\n var dimType = dimInfo.type;\n var markName = 'sub' + series.seriesIndex + 'at' + markerId;\n var dimHead = getTooltipMarker({\n color: color,\n type: 'subItem',\n renderMode: renderMode,\n markerId: markName\n });\n var dimHeadStr = typeof dimHead === 'string' ? dimHead : dimHead.content;\n var valStr = (vertially ? dimHeadStr + encodeHTML(dimInfo.displayName || '-') + ': ' : '') + // FIXME should not format time for raw data?\n encodeHTML(dimType === 'ordinal' ? val + '' : dimType === 'time' ? multipleSeries ? '' : formatTime('yyyy/MM/dd hh:mm:ss', val) : addCommas(val));\n valStr && result.push(valStr);\n\n if (isRichText) {\n markers[markName] = color;\n ++markerId;\n }\n }\n\n var newLine = vertially ? isRichText ? '\\n' : '
' : '';\n var content = newLine + result.join(newLine || ', ');\n return {\n renderMode: renderMode,\n content: content,\n style: markers\n };\n }\n\n function formatSingleValue(val) {\n // return encodeHTML(addCommas(val));\n return {\n renderMode: renderMode,\n content: encodeHTML(addCommas(val)),\n style: markers\n };\n }\n\n var data = this.getData();\n var tooltipDims = data.mapDimension('defaultedTooltip', true);\n var tooltipDimLen = tooltipDims.length;\n var value = this.getRawValue(dataIndex);\n var isValueArr = zrUtil.isArray(value);\n var color = data.getItemVisual(dataIndex, 'color');\n\n if (zrUtil.isObject(color) && color.colorStops) {\n color = (color.colorStops[0] || {}).color;\n }\n\n color = color || 'transparent'; // Complicated rule for pretty tooltip.\n\n var formattedValue = tooltipDimLen > 1 || isValueArr && !tooltipDimLen ? formatArrayValue(value) : tooltipDimLen ? formatSingleValue(retrieveRawValue(data, dataIndex, tooltipDims[0])) : formatSingleValue(isValueArr ? value[0] : value);\n var content = formattedValue.content;\n var markName = series.seriesIndex + 'at' + markerId;\n var colorEl = getTooltipMarker({\n color: color,\n type: 'item',\n renderMode: renderMode,\n markerId: markName\n });\n markers[markName] = color;\n ++markerId;\n var name = data.getName(dataIndex);\n var seriesName = this.name;\n\n if (!modelUtil.isNameSpecified(this)) {\n seriesName = '';\n }\n\n seriesName = seriesName ? encodeHTML(seriesName) + (!multipleSeries ? newLine : ': ') : '';\n var colorStr = typeof colorEl === 'string' ? colorEl : colorEl.content;\n var html = !multipleSeries ? seriesName + colorStr + (name ? encodeHTML(name) + ': ' + content : content) : colorStr + seriesName + content;\n return {\n html: html,\n markers: markers\n };\n },\n\n /**\n * @return {boolean}\n */\n isAnimationEnabled: function () {\n if (env.node) {\n return false;\n }\n\n var animationEnabled = this.getShallow('animation');\n\n if (animationEnabled) {\n if (this.getData().count() > this.getShallow('animationThreshold')) {\n animationEnabled = false;\n }\n }\n\n return animationEnabled;\n },\n restoreData: function () {\n this.dataTask.dirty();\n },\n getColorFromPalette: function (name, scope, requestColorNum) {\n var ecModel = this.ecModel; // PENDING\n\n var color = colorPaletteMixin.getColorFromPalette.call(this, name, scope, requestColorNum);\n\n if (!color) {\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\n }\n\n return color;\n },\n\n /**\n * Use `data.mapDimension(coordDim, true)` instead.\n * @deprecated\n */\n coordDimToDataDim: function (coordDim) {\n return this.getRawData().mapDimension(coordDim, true);\n },\n\n /**\n * Get progressive rendering count each step\n * @return {number}\n */\n getProgressive: function () {\n return this.get('progressive');\n },\n\n /**\n * Get progressive rendering count each step\n * @return {number}\n */\n getProgressiveThreshold: function () {\n return this.get('progressiveThreshold');\n },\n\n /**\n * Get data indices for show tooltip content. See tooltip.\n * @abstract\n * @param {Array.|string} dim\n * @param {Array.} value\n * @param {module:echarts/coord/single/SingleAxis} baseAxis\n * @return {Object} {dataIndices, nestestValue}.\n */\n getAxisTooltipData: null,\n\n /**\n * See tooltip.\n * @abstract\n * @param {number} dataIndex\n * @return {Array.} Point of tooltip. null/undefined can be returned.\n */\n getTooltipPosition: null,\n\n /**\n * @see {module:echarts/stream/Scheduler}\n */\n pipeTask: null,\n\n /**\n * Convinient for override in extended class.\n * @protected\n * @type {Function}\n */\n preventIncremental: null,\n\n /**\n * @public\n * @readOnly\n * @type {Object}\n */\n pipelineContext: null\n});\nzrUtil.mixin(SeriesModel, dataFormatMixin);\nzrUtil.mixin(SeriesModel, colorPaletteMixin);\n/**\n * MUST be called after `prepareSource` called\n * Here we need to make auto series, especially for auto legend. But we\n * do not modify series.name in option to avoid side effects.\n */\n\nfunction autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!modelUtil.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}\n\nfunction getSeriesAutoName(seriesModel) {\n var data = seriesModel.getRawData();\n var dataDims = data.mapDimension('seriesName', true);\n var nameArr = [];\n zrUtil.each(dataDims, function (dataDim) {\n var dimInfo = data.getDimensionInfo(dataDim);\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\n });\n return nameArr.join(' ');\n}\n\nfunction dataTaskCount(context) {\n return context.model.getRawData().count();\n}\n\nfunction dataTaskReset(context) {\n var seriesModel = context.model;\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\n return dataTaskProgress;\n}\n\nfunction dataTaskProgress(param, context) {\n // Avoid repead cloneShallow when data just created in reset.\n if (context.outputData && param.end > context.outputData.count()) {\n context.model.getRawData().cloneShallow(context.outputData);\n }\n} // TODO refactor\n\n\nfunction wrapData(data, seriesModel) {\n zrUtil.each(data.CHANGABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(onDataSelfChange, seriesModel));\n });\n}\n\nfunction onDataSelfChange(seriesModel) {\n var task = getCurrentTask(seriesModel);\n\n if (task) {\n // Consider case: filter, selectRange\n task.setOutputEnd(this.count());\n }\n}\n\nfunction getCurrentTask(seriesModel) {\n var scheduler = (seriesModel.ecModel || {}).scheduler;\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\n\n if (pipeline) {\n // When pipline finished, the currrentTask keep the last\n // task (renderTask).\n var task = pipeline.currentTask;\n\n if (task) {\n var agentStubMap = task.agentStubMap;\n\n if (agentStubMap) {\n task = agentStubMap.get(seriesModel.uid);\n }\n }\n\n return task;\n }\n}\n\nvar _default = SeriesModel;\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 Group = require(\"zrender/lib/container/Group\");\n\nvar componentUtil = require(\"../util/component\");\n\nvar clazzUtil = require(\"../util/clazz\");\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 Component = function () {\n /**\n * @type {module:zrender/container/Group}\n * @readOnly\n */\n this.group = new Group();\n /**\n * @type {string}\n * @readOnly\n */\n\n this.uid = componentUtil.getUID('viewComponent');\n};\n\nComponent.prototype = {\n constructor: Component,\n init: function (ecModel, api) {},\n render: function (componentModel, ecModel, api, payload) {},\n dispose: function () {},\n\n /**\n * @param {string} eventType\n * @param {Object} query\n * @param {module:zrender/Element} targetEl\n * @param {Object} packedEvent\n * @return {boolen} Pass only when return `true`.\n */\n filterForExposedEvent: null\n};\nvar componentProto = Component.prototype;\n\ncomponentProto.updateView = componentProto.updateLayout = componentProto.updateVisual = function (seriesModel, ecModel, api, payload) {// Do nothing;\n}; // Enable Component.extend.\n\n\nclazzUtil.enableClassExtend(Component); // Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.\n\nclazzUtil.enableClassManagement(Component, {\n registerWhenExtend: true\n});\nvar _default = Component;\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 _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\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 * @return {string} If large mode changed, return string 'reset';\n */\nfunction _default() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = fields.large;\n var originalProgressive = fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n\n var large = fields.large = pipelineContext && pipelineContext.large;\n var progressive = fields.progressiveRender = pipelineContext && pipelineContext.progressiveRender;\n return !!(originalLarge ^ large || originalProgressive ^ progressive) && 'reset';\n };\n}\n\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\n\nvar Group = require(\"zrender/lib/container/Group\");\n\nvar componentUtil = require(\"../util/component\");\n\nvar clazzUtil = require(\"../util/clazz\");\n\nvar modelUtil = require(\"../util/model\");\n\nvar graphicUtil = require(\"../util/graphic\");\n\nvar _task = require(\"../stream/task\");\n\nvar createTask = _task.createTask;\n\nvar createRenderPlanner = require(\"../chart/helper/createRenderPlanner\");\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 inner = modelUtil.makeInner();\nvar renderPlanner = createRenderPlanner();\n\nfunction Chart() {\n /**\n * @type {module:zrender/container/Group}\n * @readOnly\n */\n this.group = new Group();\n /**\n * @type {string}\n * @readOnly\n */\n\n this.uid = componentUtil.getUID('viewChart');\n this.renderTask = createTask({\n plan: renderTaskPlan,\n reset: renderTaskReset\n });\n this.renderTask.context = {\n view: this\n };\n}\n\nChart.prototype = {\n type: 'chart',\n\n /**\n * Init the chart.\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n */\n init: function (ecModel, api) {},\n\n /**\n * Render the chart.\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} payload\n */\n render: function (seriesModel, ecModel, api, payload) {},\n\n /**\n * Highlight series or specified data item.\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} payload\n */\n highlight: function (seriesModel, ecModel, api, payload) {\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\n },\n\n /**\n * Downplay series or specified data item.\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} payload\n */\n downplay: function (seriesModel, ecModel, api, payload) {\n toggleHighlight(seriesModel.getData(), payload, 'normal');\n },\n\n /**\n * Remove self.\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n */\n remove: function (ecModel, api) {\n this.group.removeAll();\n },\n\n /**\n * Dispose self.\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n */\n dispose: function () {},\n\n /**\n * Rendering preparation in progressive mode.\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} payload\n */\n incrementalPrepareRender: null,\n\n /**\n * Render in progressive mode.\n * @param {Object} params See taskParams in `stream/task.js`\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} payload\n */\n incrementalRender: null,\n\n /**\n * Update transform directly.\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} payload\n * @return {Object} {update: true}\n */\n updateTransform: null,\n\n /**\n * The view contains the given point.\n * @interface\n * @param {Array.} point\n * @return {boolean}\n */\n // containPoint: function () {}\n\n /**\n * @param {string} eventType\n * @param {Object} query\n * @param {module:zrender/Element} targetEl\n * @param {Object} packedEvent\n * @return {boolen} Pass only when return `true`.\n */\n filterForExposedEvent: null\n};\nvar chartProto = Chart.prototype;\n\nchartProto.updateView = chartProto.updateLayout = chartProto.updateVisual = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n};\n/**\n * Set state of single element\n * @param {module:zrender/Element} el\n * @param {string} state 'normal'|'emphasis'\n * @param {number} highlightDigit\n */\n\n\nfunction elSetState(el, state, highlightDigit) {\n if (el) {\n el.trigger(state, highlightDigit);\n\n if (el.isGroup // Simple optimize.\n && !graphicUtil.isHighDownDispatcher(el)) {\n for (var i = 0, len = el.childCount(); i < len; i++) {\n elSetState(el.childAt(i), state, highlightDigit);\n }\n }\n }\n}\n/**\n * @param {module:echarts/data/List} data\n * @param {Object} payload\n * @param {string} state 'normal'|'emphasis'\n */\n\n\nfunction toggleHighlight(data, payload, state) {\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n var highlightDigit = payload && payload.highlightKey != null ? graphicUtil.getHighlightDigit(payload.highlightKey) : null;\n\n if (dataIndex != null) {\n each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\n });\n } else {\n data.eachItemGraphicEl(function (el) {\n elSetState(el, state, highlightDigit);\n });\n }\n} // Enable Chart.extend.\n\n\nclazzUtil.enableClassExtend(Chart, ['dispose']); // Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.\n\nclazzUtil.enableClassManagement(Chart, {\n registerWhenExtend: true\n});\n\nChart.markUpdateMethod = function (payload, methodName) {\n inner(payload).updateMethod = methodName;\n};\n\nfunction renderTaskPlan(context) {\n return renderPlanner(context.model);\n}\n\nfunction renderTaskReset(context) {\n var seriesModel = context.model;\n var ecModel = context.ecModel;\n var api = context.api;\n var payload = context.payload; // ???! remove updateView updateVisual\n\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\n var view = context.view;\n var updateMethod = payload && inner(payload).updateMethod;\n var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod // `appendData` is also supported when data amount\n // is less than progressive threshold.\n : 'render';\n\n if (methodName !== 'render') {\n view[methodName](seriesModel, ecModel, api, payload);\n }\n\n return progressMethodMap[methodName];\n}\n\nvar progressMethodMap = {\n incrementalPrepareRender: {\n progress: function (params, context) {\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\n }\n },\n render: {\n // Put view.render in `progress` to support appendData. But in this case\n // view.render should not be called in reset, otherwise it will be called\n // twise. Use `forceFirstProgress` to make sure that view.render is called\n // in any cases.\n forceFirstProgress: true,\n progress: function (params, context) {\n context.view.render(context.model, context.ecModel, context.api, context.payload);\n }\n }\n};\nvar _default = Chart;\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\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 ORIGIN_METHOD = '\\0__throttleOriginMethod';\nvar RATE = '\\0__throttleRate';\nvar THROTTLE_TYPE = '\\0__throttleType';\n/**\n * @public\n * @param {(Function)} fn\n * @param {number} [delay=0] Unit: ms.\n * @param {boolean} [debounce=false]\n * true: If call interval less than `delay`, only the last call works.\n * false: If call interval less than `delay, call works on fixed rate.\n * @return {(Function)} throttled fn.\n */\n\nfunction throttle(fn, delay, debounce) {\n var currCall;\n var lastCall = 0;\n var lastExec = 0;\n var timer = null;\n var diff;\n var scope;\n var args;\n var debounceNextCall;\n delay = delay || 0;\n\n function exec() {\n lastExec = new Date().getTime();\n timer = null;\n fn.apply(scope, args || []);\n }\n\n var cb = function () {\n currCall = new Date().getTime();\n scope = this;\n args = arguments;\n var thisDelay = debounceNextCall || delay;\n var thisDebounce = debounceNextCall || debounce;\n debounceNextCall = null;\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\n clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later\n // than a new call of `cb`, that is, preserving the command order. Consider\n // calculating \"scale rate\" when roaming as an example. When a call of `cb`\n // happens, either the `exec` is called dierectly, or the call is delayed.\n // But the delayed call should never be later than next call of `cb`. Under\n // this assurance, we can simply update view state each time `dispatchAction`\n // triggered by user roaming, but not need to add extra code to avoid the\n // state being \"rolled-back\".\n\n if (thisDebounce) {\n timer = setTimeout(exec, thisDelay);\n } else {\n if (diff >= 0) {\n exec();\n } else {\n timer = setTimeout(exec, -diff);\n }\n }\n\n lastCall = currCall;\n };\n /**\n * Clear throttle.\n * @public\n */\n\n\n cb.clear = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n };\n /**\n * Enable debounce once.\n */\n\n\n cb.debounceNextCall = function (debounceDelay) {\n debounceNextCall = debounceDelay;\n };\n\n return cb;\n}\n/**\n * Create throttle method or update throttle rate.\n *\n * @example\n * ComponentView.prototype.render = function () {\n * ...\n * throttle.createOrUpdate(\n * this,\n * '_dispatchAction',\n * this.model.get('throttle'),\n * 'fixRate'\n * );\n * };\n * ComponentView.prototype.remove = function () {\n * throttle.clear(this, '_dispatchAction');\n * };\n * ComponentView.prototype.dispose = function () {\n * throttle.clear(this, '_dispatchAction');\n * };\n *\n * @public\n * @param {Object} obj\n * @param {string} fnAttr\n * @param {number} [rate]\n * @param {string} [throttleType='fixRate'] 'fixRate' or 'debounce'\n * @return {Function} throttled function.\n */\n\n\nfunction createOrUpdate(obj, fnAttr, rate, throttleType) {\n var fn = obj[fnAttr];\n\n if (!fn) {\n return;\n }\n\n var originFn = fn[ORIGIN_METHOD] || fn;\n var lastThrottleType = fn[THROTTLE_TYPE];\n var lastRate = fn[RATE];\n\n if (lastRate !== rate || lastThrottleType !== throttleType) {\n if (rate == null || !throttleType) {\n return obj[fnAttr] = originFn;\n }\n\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\n fn[ORIGIN_METHOD] = originFn;\n fn[THROTTLE_TYPE] = throttleType;\n fn[RATE] = rate;\n }\n\n return fn;\n}\n/**\n * Clear throttle. Example see throttle.createOrUpdate.\n *\n * @public\n * @param {Object} obj\n * @param {string} fnAttr\n */\n\n\nfunction clear(obj, fnAttr) {\n var fn = obj[fnAttr];\n\n if (fn && fn[ORIGIN_METHOD]) {\n obj[fnAttr] = fn[ORIGIN_METHOD];\n }\n}\n\nexports.throttle = throttle;\nexports.createOrUpdate = createOrUpdate;\nexports.clear = clear;","\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 Gradient = require(\"zrender/lib/graphic/Gradient\");\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar isFunction = _util.isFunction;\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 _default = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var colorAccessPath = (seriesModel.visualColorAccessPath || 'itemStyle.color').split('.'); // Set in itemStyle\n\n var color = seriesModel.get(colorAccessPath);\n var colorCallback = isFunction(color) && !(color instanceof Gradient) ? color : null; // Default color\n\n if (!color || colorCallback) {\n color = seriesModel.getColorFromPalette( // TODO series count changed.\n seriesModel.name, null, ecModel.getSeriesCount());\n }\n\n data.setVisual('color', color);\n var borderColorAccessPath = (seriesModel.visualBorderColorAccessPath || 'itemStyle.borderColor').split('.');\n var borderColor = seriesModel.get(borderColorAccessPath);\n data.setVisual('borderColor', borderColor); // Only visible series has each data be visual encoded\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n if (colorCallback) {\n data.each(function (idx) {\n data.setItemVisual(idx, 'color', colorCallback(seriesModel.getDataParams(idx)));\n });\n } // itemStyle in each data item\n\n\n var dataEach = function (data, idx) {\n var itemModel = data.getItemModel(idx);\n var color = itemModel.get(colorAccessPath, true);\n var borderColor = itemModel.get(borderColorAccessPath, true);\n\n if (color != null) {\n data.setItemVisual(idx, 'color', color);\n }\n\n if (borderColor != null) {\n data.setItemVisual(idx, 'borderColor', borderColor);\n }\n };\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n }\n};\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\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 * Language: (Simplified) Chinese.\n */\nvar _default = {\n legend: {\n selector: {\n all: '全选',\n inverse: '反选'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: '矩形选择',\n polygon: '圈选',\n lineX: '横向选择',\n lineY: '纵向选择',\n keep: '保持选择',\n clear: '清除选择'\n }\n },\n dataView: {\n title: '数据视图',\n lang: ['数据视图', '关闭', '刷新']\n },\n dataZoom: {\n title: {\n zoom: '区域缩放',\n back: '区域缩放还原'\n }\n },\n magicType: {\n title: {\n line: '切换为折线图',\n bar: '切换为柱状图',\n stack: '切换为堆叠',\n tiled: '切换为平铺'\n }\n },\n restore: {\n title: '还原'\n },\n saveAsImage: {\n title: '保存为图片',\n lang: ['右键另存为图片']\n }\n },\n series: {\n typeNames: {\n pie: '饼图',\n bar: '柱状图',\n line: '折线图',\n scatter: '散点图',\n effectScatter: '涟漪散点图',\n radar: '雷达图',\n tree: '树图',\n treemap: '矩形树图',\n boxplot: '箱型图',\n candlestick: 'K线图',\n k: 'K线图',\n heatmap: '热力图',\n map: '地图',\n parallel: '平行坐标图',\n lines: '线图',\n graph: '关系图',\n sankey: '桑基图',\n funnel: '漏斗图',\n gauge: '仪表盘图',\n pictorialBar: '象形柱图',\n themeRiver: '主题河流图',\n sunburst: '旭日图'\n }\n },\n aria: {\n general: {\n withTitle: '这是一个关于“{title}”的图表。',\n withoutTitle: '这是一个图表,'\n },\n series: {\n single: {\n prefix: '',\n withName: '图表类型是{seriesType},表示{seriesName}。',\n withoutName: '图表类型是{seriesType}。'\n },\n multiple: {\n prefix: '它由{seriesCount}个图表系列组成。',\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\n withoutName: '第{seriesId}个系列是一个{seriesType},',\n separator: {\n middle: ';',\n end: '。'\n }\n }\n },\n data: {\n allData: '其数据是——',\n partialData: '其中,前{displayCnt}项是——',\n withName: '{name}的数据是{value}',\n withoutName: '{value}',\n separator: {\n middle: ',',\n end: ''\n }\n }\n }\n};\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 lang = require(\"../lang\");\n\nvar _dataProvider = require(\"../data/helper/dataProvider\");\n\nvar retrieveRawValue = _dataProvider.retrieveRawValue;\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 _default(dom, ecModel) {\n var ariaModel = ecModel.getModel('aria');\n\n if (!ariaModel.get('show')) {\n return;\n } else if (ariaModel.get('description')) {\n dom.setAttribute('aria-label', ariaModel.get('description'));\n return;\n }\n\n var seriesCnt = 0;\n ecModel.eachSeries(function (seriesModel, idx) {\n ++seriesCnt;\n }, this);\n var maxDataCnt = ariaModel.get('data.maxCount') || 10;\n var maxSeriesCnt = ariaModel.get('series.maxCount') || 10;\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\n var ariaLabel;\n\n if (seriesCnt < 1) {\n // No series, no aria label\n return;\n } else {\n var title = getTitle();\n\n if (title) {\n ariaLabel = replace(getConfig('general.withTitle'), {\n title: title\n });\n } else {\n ariaLabel = getConfig('general.withoutTitle');\n }\n\n var seriesLabels = [];\n var prefix = seriesCnt > 1 ? 'series.multiple.prefix' : 'series.single.prefix';\n ariaLabel += replace(getConfig(prefix), {\n seriesCount: seriesCnt\n });\n ecModel.eachSeries(function (seriesModel, idx) {\n if (idx < displaySeriesCnt) {\n var seriesLabel;\n var seriesName = seriesModel.get('name');\n var seriesTpl = 'series.' + (seriesCnt > 1 ? 'multiple' : 'single') + '.';\n seriesLabel = getConfig(seriesName ? seriesTpl + 'withName' : seriesTpl + 'withoutName');\n seriesLabel = replace(seriesLabel, {\n seriesId: seriesModel.seriesIndex,\n seriesName: seriesModel.get('name'),\n seriesType: getSeriesTypeName(seriesModel.subType)\n });\n var data = seriesModel.getData();\n window.data = data;\n\n if (data.count() > maxDataCnt) {\n // Show part of data\n seriesLabel += replace(getConfig('data.partialData'), {\n displayCnt: maxDataCnt\n });\n } else {\n seriesLabel += getConfig('data.allData');\n }\n\n var dataLabels = [];\n\n for (var i = 0; i < data.count(); i++) {\n if (i < maxDataCnt) {\n var name = data.getName(i);\n var value = retrieveRawValue(data, i);\n dataLabels.push(replace(name ? getConfig('data.withName') : getConfig('data.withoutName'), {\n name: name,\n value: value\n }));\n }\n }\n\n seriesLabel += dataLabels.join(getConfig('data.separator.middle')) + getConfig('data.separator.end');\n seriesLabels.push(seriesLabel);\n }\n });\n ariaLabel += seriesLabels.join(getConfig('series.multiple.separator.middle')) + getConfig('series.multiple.separator.end');\n dom.setAttribute('aria-label', ariaLabel);\n }\n\n function replace(str, keyValues) {\n if (typeof str !== 'string') {\n return str;\n }\n\n var result = str;\n zrUtil.each(keyValues, function (value, key) {\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\n });\n return result;\n }\n\n function getConfig(path) {\n var userConfig = ariaModel.get(path);\n\n if (userConfig == null) {\n var pathArr = path.split('.');\n var result = lang.aria;\n\n for (var i = 0; i < pathArr.length; ++i) {\n result = result[pathArr[i]];\n }\n\n return result;\n } else {\n return userConfig;\n }\n }\n\n function getTitle() {\n var title = ecModel.getModel('title').option;\n\n if (title && title.length) {\n title = title[0];\n }\n\n return title && title.text;\n }\n\n function getSeriesTypeName(type) {\n return lang.series.typeNames[type] || '自定义图';\n }\n}\n\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 graphic = require(\"../util/graphic\");\n\nvar textContain = require(\"zrender/lib/contain/text\");\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 PI = Math.PI;\n/**\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} [opts]\n * @param {string} [opts.text]\n * @param {string} [opts.color]\n * @param {string} [opts.textColor]\n * @return {module:zrender/Element}\n */\n\nfunction _default(api, opts) {\n opts = opts || {};\n zrUtil.defaults(opts, {\n text: 'loading',\n textColor: '#000',\n fontSize: '12px',\n maskColor: 'rgba(255, 255, 255, 0.8)',\n showSpinner: true,\n color: '#c23531',\n spinnerRadius: 10,\n lineWidth: 5,\n zlevel: 0\n });\n var group = new graphic.Group();\n var mask = new graphic.Rect({\n style: {\n fill: opts.maskColor\n },\n zlevel: opts.zlevel,\n z: 10000\n });\n group.add(mask);\n var font = opts.fontSize + ' sans-serif';\n var labelRect = new graphic.Rect({\n style: {\n fill: 'none',\n text: opts.text,\n font: font,\n textPosition: 'right',\n textDistance: 10,\n textFill: opts.textColor\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n group.add(labelRect);\n\n if (opts.showSpinner) {\n var arc = new graphic.Arc({\n shape: {\n startAngle: -PI / 2,\n endAngle: -PI / 2 + 0.1,\n r: opts.spinnerRadius\n },\n style: {\n stroke: opts.color,\n lineCap: 'round',\n lineWidth: opts.lineWidth\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n arc.animateShape(true).when(1000, {\n endAngle: PI * 3 / 2\n }).start('circularInOut');\n arc.animateShape(true).when(1000, {\n startAngle: PI * 3 / 2\n }).delay(300).start('circularInOut');\n group.add(arc);\n } // Inject resize\n\n\n group.resize = function () {\n var textWidth = textContain.getWidth(opts.text, font);\n var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n // textDistance needs to be calculated when both animation and text exist\n\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 // only show the text\n - (opts.showSpinner ? 0 : textWidth / 2);\n var cy = api.getHeight() / 2;\n opts.showSpinner && arc.setShape({\n cx: cx,\n cy: cy\n });\n labelRect.setShape({\n x: cx - r,\n y: cy - r,\n width: r * 2,\n height: r * 2\n });\n mask.setShape({\n x: 0,\n y: 0,\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n group.resize();\n return group;\n}\n\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar map = _util.map;\nvar isFunction = _util.isFunction;\nvar createHashMap = _util.createHashMap;\nvar noop = _util.noop;\n\nvar _task = require(\"./task\");\n\nvar createTask = _task.createTask;\n\nvar _component = require(\"../util/component\");\n\nvar getUID = _component.getUID;\n\nvar GlobalModel = require(\"../model/Global\");\n\nvar ExtensionAPI = require(\"../ExtensionAPI\");\n\nvar _model = require(\"../util/model\");\n\nvar normalizeToArray = _model.normalizeToArray;\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 * @module echarts/stream/Scheduler\n */\n\n/**\n * @constructor\n */\nfunction Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n this.ecInstance = ecInstance;\n this.api = api;\n this.unfinished; // Fix current processors in case that in some rear cases that\n // processors might be registered after echarts instance created.\n // Register processors incrementally for a echarts instance is\n // not supported by this stream architecture.\n\n var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n var visualHandlers = this._visualHandlers = visualHandlers.slice();\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n /**\n * @private\n * @type {\n * [handlerUID: string]: {\n * seriesTaskMap?: {\n * [seriesUID: string]: Task\n * },\n * overallTask?: Task\n * }\n * }\n */\n\n this._stageTaskMap = createHashMap();\n}\n\nvar proto = Scheduler.prototype;\n/**\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} payload\n */\n\nproto.restoreData = function (ecModel, payload) {\n // TODO: Only restore needed series and components, but not all components.\n // Currently `restoreData` of all of the series and component will be called.\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n // and some components like coordinate system, axes, dataZoom, visualMap only\n // need their target series refresh.\n // (1) If we are implementing this feature some day, we should consider these cases:\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\n // on the settings of `dataZoom`), it should be re-performed if the component\n // is modified by `setOption`.\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n // it should be re-performed when the result array of `getTargetSeries` changed.\n // We use `dependencies` to cover these issues.\n // (3) How to update target series when coordinate system related components modified.\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n // and this case all of the tasks will be set as dirty.\n ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also\n // depends on all of the series.\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n // probably cause state chaos (consider `dataZoomProcessor`).\n\n this._stageTaskMap.each(function (taskRecord) {\n var overallTask = taskRecord.overallTask;\n overallTask && overallTask.dirty();\n });\n}; // If seriesModel provided, incremental threshold is check by series data.\n\n\nproto.getPerformArgs = function (task, isBlock) {\n // For overall task\n if (!task.__pipeline) {\n return;\n }\n\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\n\n var pCtx = pipeline.context;\n var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n var step = incremental ? pipeline.step : null;\n var modDataCount = pCtx && pCtx.modDataCount;\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n return {\n step: step,\n modBy: modBy,\n modDataCount: modDataCount\n };\n};\n\nproto.getPipeline = function (pipelineId) {\n return this._pipelineMap.get(pipelineId);\n};\n/**\n * Current, progressive rendering starts from visual and layout.\n * Always detect render mode in the same stage, avoiding that incorrect\n * detection caused by data filtering.\n * Caution:\n * `updateStreamModes` use `seriesModel.getData()`.\n */\n\n\nproto.updateStreamModes = function (seriesModel, view) {\n var pipeline = this._pipelineMap.get(seriesModel.uid);\n\n var data = seriesModel.getData();\n var dataLen = data.count(); // `progressiveRender` means that can render progressively in each\n // animation frame. Note that some types of series do not provide\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\n // use the term `incremental` but not `progressive` to describe the\n // case that `chart.appendData`.\n\n var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n // see `test/candlestick-large3.html`\n\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n seriesModel.pipelineContext = pipeline.context = {\n progressiveRender: progressiveRender,\n modDataCount: modDataCount,\n large: large\n };\n};\n\nproto.restorePipelines = function (ecModel) {\n var scheduler = this;\n var pipelineMap = scheduler._pipelineMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var progressive = seriesModel.getProgressive();\n var pipelineId = seriesModel.uid;\n pipelineMap.set(pipelineId, {\n id: pipelineId,\n head: null,\n tail: null,\n threshold: seriesModel.getProgressiveThreshold(),\n progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n blockIndex: -1,\n step: Math.round(progressive || 700),\n count: 0\n });\n pipe(scheduler, seriesModel, seriesModel.dataTask);\n });\n};\n\nproto.prepareStageTasks = function () {\n var stageTaskMap = this._stageTaskMap;\n var ecModel = this.ecInstance.getModel();\n var api = this.api;\n each(this._allHandlers, function (handler) {\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, []);\n handler.reset && createSeriesStageTask(this, handler, record, ecModel, api);\n handler.overallReset && createOverallStageTask(this, handler, record, ecModel, api);\n }, this);\n};\n\nproto.prepareView = function (view, model, ecModel, api) {\n var renderTask = view.renderTask;\n var context = renderTask.context;\n context.model = model;\n context.ecModel = ecModel;\n context.api = api;\n renderTask.__block = !view.incrementalPrepareRender;\n pipe(this, model, renderTask);\n};\n\nproto.performDataProcessorTasks = function (ecModel, payload) {\n // If we do not use `block` here, it should be considered when to update modes.\n performStageTasks(this, this._dataProcessorHandlers, ecModel, payload, {\n block: true\n });\n}; // opt\n// opt.visualType: 'visual' or 'layout'\n// opt.setDirty\n\n\nproto.performVisualTasks = function (ecModel, payload, opt) {\n performStageTasks(this, this._visualHandlers, ecModel, payload, opt);\n};\n\nfunction performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) {\n opt = opt || {};\n var unfinished;\n each(stageHandlers, function (stageHandler, idx) {\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n return;\n }\n\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n var overallTask = stageHandlerRecord.overallTask;\n\n if (overallTask) {\n var overallNeedDirty;\n var agentStubMap = overallTask.agentStubMap;\n agentStubMap.each(function (stub) {\n if (needSetDirty(opt, stub)) {\n stub.dirty();\n overallNeedDirty = true;\n }\n });\n overallNeedDirty && overallTask.dirty();\n updatePayload(overallTask, payload);\n var performArgs = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty,\n // then execute the overall task. And stub will call seriesModel.setData,\n // which ensures that in the overallTask seriesModel.getData() will not\n // return incorrect data.\n\n agentStubMap.each(function (stub) {\n stub.perform(performArgs);\n });\n unfinished |= overallTask.perform(performArgs);\n } else if (seriesTaskMap) {\n seriesTaskMap.each(function (task, pipelineId) {\n if (needSetDirty(opt, task)) {\n task.dirty();\n }\n\n var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME\n // if intending to decalare `performRawSeries` in handlers, only\n // stream-independent (specifically, data item independent) operations can be\n // performed. Because is a series is filtered, most of the tasks will not\n // be performed. A stream-dependent operation probably cause wrong biz logic.\n // Perhaps we should not provide a separate callback for this case instead\n // of providing the config `performRawSeries`. The stream-dependent operaions\n // and stream-independent operations should better not be mixed.\n\n performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n updatePayload(task, payload);\n unfinished |= task.perform(performArgs);\n });\n }\n });\n\n function needSetDirty(opt, task) {\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n }\n\n scheduler.unfinished |= unfinished;\n}\n\nproto.performSeriesTasks = function (ecModel) {\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n // Progress to the end for dataInit and dataRestore.\n unfinished |= seriesModel.dataTask.perform();\n });\n this.unfinished |= unfinished;\n};\n\nproto.plan = function () {\n // Travel pipelines, check block.\n this._pipelineMap.each(function (pipeline) {\n var task = pipeline.tail;\n\n do {\n if (task.__block) {\n pipeline.blockIndex = task.__idxInPipeline;\n break;\n }\n\n task = task.getUpstream();\n } while (task);\n });\n};\n\nvar updatePayload = proto.updatePayload = function (task, payload) {\n payload !== 'remain' && (task.context.payload = payload);\n};\n\nfunction createSeriesStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) {\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap || (stageHandlerRecord.seriesTaskMap = createHashMap());\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n // it works but it may cause other irrelevant charts blocked.\n\n if (stageHandler.createOnAllSeries) {\n ecModel.eachRawSeries(create);\n } else if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, create);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(create);\n }\n\n function create(seriesModel) {\n var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once.\n // Reuse original task instance.\n\n var task = seriesTaskMap.get(pipelineId) || seriesTaskMap.set(pipelineId, createTask({\n plan: seriesTaskPlan,\n reset: seriesTaskReset,\n count: seriesTaskCount\n }));\n task.context = {\n model: seriesModel,\n ecModel: ecModel,\n api: api,\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n plan: stageHandler.plan,\n reset: stageHandler.reset,\n scheduler: scheduler\n };\n pipe(scheduler, seriesModel, task);\n } // Clear unused series tasks.\n\n\n var pipelineMap = scheduler._pipelineMap;\n seriesTaskMap.each(function (task, pipelineId) {\n if (!pipelineMap.get(pipelineId)) {\n task.dispose();\n seriesTaskMap.removeKey(pipelineId);\n }\n });\n}\n\nfunction createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) {\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage.\n || createTask({\n reset: overallTaskReset\n });\n overallTask.context = {\n ecModel: ecModel,\n api: api,\n overallReset: stageHandler.overallReset,\n scheduler: scheduler\n }; // Reuse orignal stubs.\n\n var agentStubMap = overallTask.agentStubMap = overallTask.agentStubMap || createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n var overallProgress = true;\n var modifyOutputEnd = stageHandler.modifyOutputEnd; // An overall task with seriesType detected or has `getTargetSeries`, we add\n // stub in each pipelines, it will set the overall task dirty when the pipeline\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\n // we set the pipeline block.\n\n if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, createStub);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(createStub);\n } // Otherwise, (usually it is legancy case), the overall task will only be\n // executed when upstream dirty. Otherwise the progressive rendering of all\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n // dirty info from upsteam.\n else {\n overallProgress = false;\n each(ecModel.getSeries(), createStub);\n }\n\n function createStub(seriesModel) {\n var pipelineId = seriesModel.uid;\n var stub = agentStubMap.get(pipelineId);\n\n if (!stub) {\n stub = agentStubMap.set(pipelineId, createTask({\n reset: stubReset,\n onDirty: stubOnDirty\n })); // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n\n overallTask.dirty();\n }\n\n stub.context = {\n model: seriesModel,\n overallProgress: overallProgress,\n modifyOutputEnd: modifyOutputEnd\n };\n stub.agent = overallTask;\n stub.__block = overallProgress;\n pipe(scheduler, seriesModel, stub);\n } // Clear unused stubs.\n\n\n var pipelineMap = scheduler._pipelineMap;\n agentStubMap.each(function (stub, pipelineId) {\n if (!pipelineMap.get(pipelineId)) {\n stub.dispose(); // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n\n overallTask.dirty();\n agentStubMap.removeKey(pipelineId);\n }\n });\n}\n\nfunction overallTaskReset(context) {\n context.overallReset(context.ecModel, context.api, context.payload);\n}\n\nfunction stubReset(context, upstreamContext) {\n return context.overallProgress && stubProgress;\n}\n\nfunction stubProgress() {\n this.agent.dirty();\n this.getDownstream().dirty();\n}\n\nfunction stubOnDirty() {\n this.agent && this.agent.dirty();\n}\n\nfunction seriesTaskPlan(context) {\n return context.plan && context.plan(context.model, context.ecModel, context.api, context.payload);\n}\n\nfunction seriesTaskReset(context) {\n if (context.useClearVisual) {\n context.data.clearAllVisual();\n }\n\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n return makeSeriesTaskProgress(idx);\n }) : singleSeriesTaskProgress;\n}\n\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\n\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n return function (params, context) {\n var data = context.data;\n var resetDefine = context.resetDefines[resetDefineIdx];\n\n if (resetDefine && resetDefine.dataEach) {\n for (var i = params.start; i < params.end; i++) {\n resetDefine.dataEach(data, i);\n }\n } else if (resetDefine && resetDefine.progress) {\n resetDefine.progress(params, data);\n }\n };\n}\n\nfunction seriesTaskCount(context) {\n return context.data.count();\n}\n\nfunction pipe(scheduler, seriesModel, task) {\n var pipelineId = seriesModel.uid;\n\n var pipeline = scheduler._pipelineMap.get(pipelineId);\n\n !pipeline.head && (pipeline.head = task);\n pipeline.tail && pipeline.tail.pipe(task);\n pipeline.tail = task;\n task.__idxInPipeline = pipeline.count++;\n task.__pipeline = pipeline;\n}\n\nScheduler.wrapStageHandler = function (stageHandler, visualType) {\n if (isFunction(stageHandler)) {\n stageHandler = {\n overallReset: stageHandler,\n seriesType: detectSeriseType(stageHandler)\n };\n }\n\n stageHandler.uid = getUID('stageHandler');\n visualType && (stageHandler.visualType = visualType);\n return stageHandler;\n};\n/**\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\n * To ensure that they can work normally, they should work in block mode, that is,\n * they should not be started util the previous tasks finished. So they cause the\n * progressive rendering disabled. We try to detect the series type, to narrow down\n * the block range to only the series type they concern, but not all series.\n */\n\n\nfunction detectSeriseType(legacyFunc) {\n seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return seriesType;\n}\n\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\n\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n seriesType = type;\n};\n\necModelMock.eachComponent = function (cond) {\n if (cond.mainType === 'series' && cond.subType) {\n seriesType = cond.subType;\n }\n};\n\nfunction mockMethods(target, Clz) {\n /* eslint-disable */\n for (var name in Clz.prototype) {\n // Do not use hasOwnProperty\n target[name] = noop;\n }\n /* eslint-enable */\n\n}\n\nvar _default = Scheduler;\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\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 colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'];\nvar _default = {\n color: colorAll,\n colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll]\n};\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\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 contrastColor = '#eee';\n\nvar axisCommon = function () {\n return {\n axisLine: {\n lineStyle: {\n color: contrastColor\n }\n },\n axisTick: {\n lineStyle: {\n color: contrastColor\n }\n },\n axisLabel: {\n textStyle: {\n color: contrastColor\n }\n },\n splitLine: {\n lineStyle: {\n type: 'dashed',\n color: '#aaa'\n }\n },\n splitArea: {\n areaStyle: {\n color: contrastColor\n }\n }\n };\n};\n\nvar colorPalette = ['#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42'];\nvar theme = {\n color: colorPalette,\n backgroundColor: '#333',\n tooltip: {\n axisPointer: {\n lineStyle: {\n color: contrastColor\n },\n crossStyle: {\n color: contrastColor\n },\n label: {\n color: '#000'\n }\n }\n },\n legend: {\n textStyle: {\n color: contrastColor\n }\n },\n textStyle: {\n color: contrastColor\n },\n title: {\n textStyle: {\n color: contrastColor\n }\n },\n toolbox: {\n iconStyle: {\n normal: {\n borderColor: contrastColor\n }\n }\n },\n dataZoom: {\n textStyle: {\n color: contrastColor\n }\n },\n visualMap: {\n textStyle: {\n color: contrastColor\n }\n },\n timeline: {\n lineStyle: {\n color: contrastColor\n },\n itemStyle: {\n normal: {\n color: colorPalette[1]\n }\n },\n label: {\n normal: {\n textStyle: {\n color: contrastColor\n }\n }\n },\n controlStyle: {\n normal: {\n color: contrastColor,\n borderColor: contrastColor\n }\n }\n },\n timeAxis: axisCommon(),\n logAxis: axisCommon(),\n valueAxis: axisCommon(),\n categoryAxis: axisCommon(),\n line: {\n symbol: 'circle'\n },\n graph: {\n color: colorPalette\n },\n gauge: {\n title: {\n textStyle: {\n color: contrastColor\n }\n }\n },\n candlestick: {\n itemStyle: {\n normal: {\n color: '#FD1050',\n color0: '#0CF49B',\n borderColor: '#FD1050',\n borderColor0: '#0CF49B'\n }\n }\n }\n};\ntheme.categoryAxis.splitLine.show = false;\nvar _default = theme;\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 ComponentModel = require(\"../model/Component\");\n\nvar ComponentView = require(\"../view/Component\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar detectSourceFormat = _sourceHelper.detectSourceFormat;\n\nvar _sourceType = require(\"../data/helper/sourceType\");\n\nvar SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN;\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 * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\nComponentModel.extend({\n type: 'dataset',\n\n /**\n * @protected\n */\n defaultOption: {\n // 'row', 'column'\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n // null/'auto': auto detect header, see \"module:echarts/data/helper/sourceHelper\"\n sourceHeader: null,\n dimensions: null,\n source: null\n },\n optionUpdated: function () {\n detectSourceFormat(this);\n }\n});\nComponentView.extend({\n type: 'dataset'\n});","var Path = require(\"../Path\");\n\n/**\n * 椭圆形状\n * @module zrender/graphic/shape/Ellipse\n */\nvar _default = Path.extend({\n type: 'ellipse',\n shape: {\n cx: 0,\n cy: 0,\n rx: 0,\n ry: 0\n },\n buildPath: function (ctx, shape) {\n var k = 0.5522848;\n var x = shape.cx;\n var y = shape.cy;\n var a = shape.rx;\n var b = shape.ry;\n var ox = a * k; // 水平控制点偏移量\n\n var oy = b * k; // 垂直控制点偏移量\n // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线\n\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n }\n});\n\nmodule.exports = _default;","var Group = require(\"../container/Group\");\n\nvar ZImage = require(\"../graphic/Image\");\n\nvar Text = require(\"../graphic/Text\");\n\nvar Circle = require(\"../graphic/shape/Circle\");\n\nvar Rect = require(\"../graphic/shape/Rect\");\n\nvar Ellipse = require(\"../graphic/shape/Ellipse\");\n\nvar Line = require(\"../graphic/shape/Line\");\n\nvar Path = require(\"../graphic/Path\");\n\nvar Polygon = require(\"../graphic/shape/Polygon\");\n\nvar Polyline = require(\"../graphic/shape/Polyline\");\n\nvar LinearGradient = require(\"../graphic/LinearGradient\");\n\nvar Style = require(\"../graphic/Style\");\n\nvar matrix = require(\"../core/matrix\");\n\nvar _path = require(\"./path\");\n\nvar createFromString = _path.createFromString;\n\nvar _util = require(\"../core/util\");\n\nvar isString = _util.isString;\nvar extend = _util.extend;\nvar defaults = _util.defaults;\nvar trim = _util.trim;\nvar each = _util.each;\n// import RadialGradient from '../graphic/RadialGradient';\n// import Pattern from '../graphic/Pattern';\n// import * as vector from '../core/vector';\n// Most of the values can be separated by comma and/or white space.\nvar DILIMITER_REG = /[\\s,]+/;\n/**\n * For big svg string, this method might be time consuming.\n *\n * @param {string} svg xml string\n * @return {Object} xml root.\n */\n\nfunction parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n } // Document node. If using $.get, doc node may be input.\n\n\n if (svg.nodeType === 9) {\n svg = svg.firstChild;\n } // nodeName of is also 'svg'.\n\n\n while (svg.nodeName.toLowerCase() !== 'svg' || svg.nodeType !== 1) {\n svg = svg.nextSibling;\n }\n\n return svg;\n}\n\nfunction SVGParser() {\n this._defs = {};\n this._root = null;\n this._isDefine = false;\n this._isText = false;\n}\n\nSVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n\n if (!svg) {\n throw new Error('Illegal svg');\n }\n\n var root = new Group();\n this._root = root; // parse view port\n\n var viewBox = svg.getAttribute('viewBox') || ''; // If width/height not specified, means \"100%\" of `opt.width/height`.\n // TODO: Other percent value not supported yet.\n\n var width = parseFloat(svg.getAttribute('width') || opt.width);\n var height = parseFloat(svg.getAttribute('height') || opt.height); // If width/height not specified, set as null for output.\n\n isNaN(width) && (width = null);\n isNaN(height) && (height = null); // Apply inline style on svg element.\n\n parseAttributes(svg, root, null, true);\n var child = svg.firstChild;\n\n while (child) {\n this._parseNode(child, root);\n\n child = child.nextSibling;\n }\n\n var viewBoxRect;\n var viewBoxTransform;\n\n if (viewBox) {\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG); // Some invalid case like viewBox: 'none'.\n\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat(viewBoxArr[0] || 0),\n y: parseFloat(viewBoxArr[1] || 0),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\n\n if (!opt.ignoreViewBox) {\n // If set transform on the output group, it probably bring trouble when\n // some users only intend to show the clipped content inside the viewBox,\n // but not intend to transform the output group. So we keep the output\n // group no transform. If the user intend to use the viewBox as a\n // camera, just set `opt.ignoreViewBox` as `true` and set transfrom\n // manually according to the viewBox info in the output of this method.\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scale = viewBoxTransform.scale.slice();\n elRoot.position = viewBoxTransform.position.slice();\n }\n } // Some shapes might be overflow the viewport, which should be\n // clipped despite whether the viewBox is used, as the SVG does.\n\n\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n }));\n } // Set width/height on group just for output the viewport size.\n\n\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform\n };\n};\n\nSVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\n var nodeName = xmlNode.nodeName.toLowerCase(); // TODO\n // support in svg, where nodeName is 'style',\n // CSS classes is defined globally wherever the style tags are declared.\n\n if (nodeName === 'defs') {\n // define flag\n this._isDefine = true;\n } else if (nodeName === 'text') {\n this._isText = true;\n }\n\n var el;\n\n if (this._isDefine) {\n var parser = defineParsers[nodeName];\n\n if (parser) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n\n if (id) {\n this._defs[id] = def;\n }\n }\n } else {\n var parser = nodeParsers[nodeName];\n\n if (parser) {\n el = parser.call(this, xmlNode, parentGroup);\n parentGroup.add(el);\n }\n }\n\n var child = xmlNode.firstChild;\n\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el);\n } // Is text\n\n\n if (child.nodeType === 3 && this._isText) {\n this._parseText(child, el);\n }\n\n child = child.nextSibling;\n } // Quit define\n\n\n if (nodeName === 'defs') {\n this._isDefine = false;\n } else if (nodeName === 'text') {\n this._isText = false;\n }\n};\n\nSVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n if (xmlNode.nodeType === 1) {\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n }\n\n var text = new Text({\n style: {\n text: xmlNode.textContent,\n transformText: true\n },\n position: [this._textX || 0, this._textY || 0]\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defs);\n var fontSize = text.style.fontSize;\n\n if (fontSize && fontSize < 9) {\n // PENDING\n text.style.fontSize = 9;\n text.scale = text.scale || [1, 1];\n text.scale[0] *= fontSize / 9;\n text.scale[1] *= fontSize / 9;\n }\n\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n};\n\nvar nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defs);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || 0),\n y: parseFloat(xmlNode.getAttribute('y') || 0),\n width: parseFloat(xmlNode.getAttribute('width') || 0),\n height: parseFloat(xmlNode.getAttribute('height') || 0)\n }); // console.log(xmlNode.getAttribute('transform'));\n // console.log(rect.transform);\n\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defs);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || 0),\n cy: parseFloat(xmlNode.getAttribute('cy') || 0),\n r: parseFloat(xmlNode.getAttribute('r') || 0)\n });\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defs);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || 0),\n y1: parseFloat(xmlNode.getAttribute('y1') || 0),\n x2: parseFloat(xmlNode.getAttribute('x2') || 0),\n y2: parseFloat(xmlNode.getAttribute('y2') || 0)\n });\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defs);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || 0),\n cy: parseFloat(xmlNode.getAttribute('cy') || 0),\n rx: parseFloat(xmlNode.getAttribute('rx') || 0),\n ry: parseFloat(xmlNode.getAttribute('ry') || 0)\n });\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var points = xmlNode.getAttribute('points');\n\n if (points) {\n points = parsePoints(points);\n }\n\n var polygon = new Polygon({\n shape: {\n points: points || []\n }\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defs);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var path = new Path();\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defs);\n var points = xmlNode.getAttribute('points');\n\n if (points) {\n points = parsePoints(points);\n }\n\n var polyline = new Polyline({\n shape: {\n points: points || []\n }\n });\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defs);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href'),\n x: xmlNode.getAttribute('x'),\n y: xmlNode.getAttribute('y'),\n width: xmlNode.getAttribute('width'),\n height: xmlNode.getAttribute('height')\n });\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || 0;\n var y = xmlNode.getAttribute('y') || 0;\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n\n if (x != null) {\n // new offset x\n this._textX = parseFloat(x);\n }\n\n if (y != null) {\n // new offset y\n this._textY = parseFloat(y);\n }\n\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n this._textX += dx;\n this._textY += dy;\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n // TODO svg fill rule\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n // path.style.globalCompositeOperation = 'xor';\n var d = xmlNode.getAttribute('d') || ''; // Performance sensitive.\n\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defs);\n return path;\n }\n};\nvar defineParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || 0, 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || 0, 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || 10, 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || 0, 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n\n _parseGradientColorStops(xmlNode, gradient);\n\n return gradient;\n },\n 'radialgradient': function (xmlNode) {}\n};\n\nfunction _parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n\n while (stop) {\n if (stop.nodeType === 1) {\n var offset = stop.getAttribute('offset');\n\n if (offset.indexOf('%') > 0) {\n // percentage\n offset = parseInt(offset, 10) / 100;\n } else if (offset) {\n // number from 0 to 1\n offset = parseFloat(offset);\n } else {\n offset = 0;\n }\n\n var stopColor = stop.getAttribute('stop-color') || '#000000';\n gradient.addColorStop(offset, stopColor);\n }\n\n stop = stop.nextSibling;\n }\n}\n\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\n\nfunction parsePoints(pointsString) {\n var list = trim(pointsString).split(DILIMITER_REG);\n var points = [];\n\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n\n return points;\n}\n\nvar attributesMap = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-align': 'textAlign',\n 'alignment-baseline': 'textBaseline'\n};\n\nfunction parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\n var zrStyle = el.__inheritedStyle || {};\n var isTextEl = el.type === 'text'; // TODO Shadow\n\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n extend(zrStyle, parseStyleAttribute(xmlNode));\n\n if (!onlyInlineStyle) {\n for (var svgAttrName in attributesMap) {\n if (attributesMap.hasOwnProperty(svgAttrName)) {\n var attrValue = xmlNode.getAttribute(svgAttrName);\n\n if (attrValue != null) {\n zrStyle[attributesMap[svgAttrName]] = attrValue;\n }\n }\n }\n }\n }\n\n var elFillProp = isTextEl ? 'textFill' : 'fill';\n var elStrokeProp = isTextEl ? 'textStroke' : 'stroke';\n el.style = el.style || new Style();\n var elStyle = el.style;\n zrStyle.fill != null && elStyle.set(elFillProp, getPaint(zrStyle.fill, defs));\n zrStyle.stroke != null && elStyle.set(elStrokeProp, getPaint(zrStyle.stroke, defs));\n each(['lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'], function (propName) {\n var elPropName = propName === 'lineWidth' && isTextEl ? 'textStrokeWidth' : propName;\n zrStyle[propName] != null && elStyle.set(elPropName, parseFloat(zrStyle[propName]));\n });\n\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\n zrStyle.textBaseline = 'alphabetic';\n }\n\n if (zrStyle.textBaseline === 'alphabetic') {\n zrStyle.textBaseline = 'bottom';\n }\n\n if (zrStyle.textAlign === 'start') {\n zrStyle.textAlign = 'left';\n }\n\n if (zrStyle.textAlign === 'end') {\n zrStyle.textAlign = 'right';\n }\n\n each(['lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'], function (propName) {\n zrStyle[propName] != null && elStyle.set(propName, zrStyle[propName]);\n });\n\n if (zrStyle.lineDash) {\n el.style.lineDash = trim(zrStyle.lineDash).split(DILIMITER_REG);\n }\n\n if (elStyle[elStrokeProp] && elStyle[elStrokeProp] !== 'none') {\n // enable stroke\n el[elStrokeProp] = true;\n }\n\n el.__inheritedStyle = zrStyle;\n}\n\nvar urlRegex = /url\\(\\s*#(.*?)\\)/;\n\nfunction getPaint(str, defs) {\n // if (str === 'none') {\n // return;\n // }\n var urlMatch = defs && str && str.match(urlRegex);\n\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n var def = defs[url];\n return def;\n }\n\n return str;\n}\n\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\n\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var m = null;\n var transformOps = [];\n transform.replace(transformRegex, function (str, type, value) {\n transformOps.push(type, value);\n });\n\n for (var i = transformOps.length - 1; i > 0; i -= 2) {\n var value = transformOps[i];\n var type = transformOps[i - 1];\n m = m || matrix.create();\n\n switch (type) {\n case 'translate':\n value = trim(value).split(DILIMITER_REG);\n matrix.translate(m, m, [parseFloat(value[0]), parseFloat(value[1] || 0)]);\n break;\n\n case 'scale':\n value = trim(value).split(DILIMITER_REG);\n matrix.scale(m, m, [parseFloat(value[0]), parseFloat(value[1] || value[0])]);\n break;\n\n case 'rotate':\n value = trim(value).split(DILIMITER_REG);\n matrix.rotate(m, m, parseFloat(value[0]));\n break;\n\n case 'skew':\n value = trim(value).split(DILIMITER_REG);\n console.warn('Skew transform is not supported yet');\n break;\n\n case 'matrix':\n var value = trim(value).split(DILIMITER_REG);\n m[0] = parseFloat(value[0]);\n m[1] = parseFloat(value[1]);\n m[2] = parseFloat(value[2]);\n m[3] = parseFloat(value[3]);\n m[4] = parseFloat(value[4]);\n m[5] = parseFloat(value[5]);\n break;\n }\n }\n\n node.setLocalTransform(m);\n }\n} // Value may contain space.\n\n\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\n\nfunction parseStyleAttribute(xmlNode) {\n var style = xmlNode.getAttribute('style');\n var result = {};\n\n if (!style) {\n return result;\n }\n\n var styleList = {};\n styleRegex.lastIndex = 0;\n var styleRegResult;\n\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n styleList[styleRegResult[1]] = styleRegResult[2];\n }\n\n for (var svgAttrName in attributesMap) {\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\n }\n }\n\n return result;\n}\n/**\n * @param {Array.} viewBoxRect\n * @param {number} width\n * @param {number} height\n * @return {Object} {scale, position}\n */\n\n\nfunction makeViewBoxTransform(viewBoxRect, width, height) {\n var scaleX = width / viewBoxRect.width;\n var scaleY = height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY); // preserveAspectRatio 'xMidYMid'\n\n var viewBoxScale = [scale, scale];\n var viewBoxPosition = [-(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2, -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2];\n return {\n scale: viewBoxScale,\n position: viewBoxPosition\n };\n}\n/**\n * @param {string|XMLElement} xml\n * @param {Object} [opt]\n * @param {number} [opt.width] Default width if svg width not specified or is a percent value.\n * @param {number} [opt.height] Default height if svg height not specified or is a percent value.\n * @param {boolean} [opt.ignoreViewBox]\n * @param {boolean} [opt.ignoreRootClip]\n * @return {Object} result:\n * {\n * root: Group, The root of the the result tree of zrender shapes,\n * width: number, the viewport width of the SVG,\n * height: number, the viewport height of the SVG,\n * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists,\n * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists.\n * }\n */\n\n\nfunction parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\n\nexports.parseXML = parseXML;\nexports.makeViewBoxTransform = makeViewBoxTransform;\nexports.parseSVG = parseSVG;","\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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar isString = _util.isString;\nvar isArray = _util.isArray;\nvar each = _util.each;\nvar assert = _util.assert;\n\nvar _parseSVG = require(\"zrender/lib/tool/parseSVG\");\n\nvar parseXML = _parseSVG.parseXML;\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 storage = createHashMap(); // For minimize the code size of common echarts package,\n// do not put too much logic in this module.\n\nvar _default = {\n // The format of record: see `echarts.registerMap`.\n // Compatible with previous `echarts.registerMap`.\n registerMap: function (mapName, rawGeoJson, rawSpecialAreas) {\n var records;\n\n if (isArray(rawGeoJson)) {\n records = rawGeoJson;\n } else if (rawGeoJson.svg) {\n records = [{\n type: 'svg',\n source: rawGeoJson.svg,\n specialAreas: rawGeoJson.specialAreas\n }];\n } else {\n // Backward compatibility.\n if (rawGeoJson.geoJson && !rawGeoJson.features) {\n rawSpecialAreas = rawGeoJson.specialAreas;\n rawGeoJson = rawGeoJson.geoJson;\n }\n\n records = [{\n type: 'geoJSON',\n source: rawGeoJson,\n specialAreas: rawSpecialAreas\n }];\n }\n\n each(records, function (record) {\n var type = record.type;\n type === 'geoJson' && (type = record.type = 'geoJSON');\n var parse = parsers[type];\n parse(record);\n });\n return storage.set(mapName, records);\n },\n retrieveMap: function (mapName) {\n return storage.get(mapName);\n }\n};\nvar parsers = {\n geoJSON: function (record) {\n var source = record.source;\n record.geoJSON = !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\n },\n // Only perform parse to XML object here, which might be time\n // consiming for large SVG.\n // Although convert XML to zrender element is also time consiming,\n // if we do it here, the clone of zrender elements has to be\n // required. So we do it once for each geo instance, util real\n // performance issues call for optimizing it.\n svg: function (record) {\n record.svgXML = parseXML(record.source);\n }\n};\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\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 defaultKeyGetter(item) {\n return item;\n}\n/**\n * @param {Array} oldArr\n * @param {Array} newArr\n * @param {Function} oldKeyGetter\n * @param {Function} newKeyGetter\n * @param {Object} [context] Can be visited by this.context in callback.\n */\n\n\nfunction DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\n this.context = context;\n}\n\nDataDiffer.prototype = {\n constructor: DataDiffer,\n\n /**\n * Callback function when add a data\n */\n add: function (func) {\n this._add = func;\n return this;\n },\n\n /**\n * Callback function when update a data\n */\n update: function (func) {\n this._update = func;\n return this;\n },\n\n /**\n * Callback function when remove a data\n */\n remove: function (func) {\n this._remove = func;\n return this;\n },\n execute: function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n var i;\n initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter', this);\n initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter', this);\n\n for (i = 0; i < oldArr.length; i++) {\n var key = oldDataKeyArr[i];\n var idx = newDataIndexMap[key]; // idx can never be empty array here. see 'set null' logic below.\n\n if (idx != null) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var len = idx.length;\n\n if (len) {\n len === 1 && (newDataIndexMap[key] = null);\n idx = idx.shift();\n } else {\n newDataIndexMap[key] = null;\n }\n\n this._update && this._update(idx, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var key = newDataKeyArr[i];\n\n if (newDataIndexMap.hasOwnProperty(key)) {\n var idx = newDataIndexMap[key];\n\n if (idx == null) {\n continue;\n } // idx can never be empty array here. see 'set null' logic above.\n\n\n if (!idx.length) {\n this._add && this._add(idx);\n } else {\n for (var j = 0, len = idx.length; j < len; j++) {\n this._add && this._add(idx[j]);\n }\n }\n }\n }\n }\n};\n\nfunction initIndexMap(arr, map, keyArr, keyGetterName, dataDiffer) {\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + dataDiffer[keyGetterName](arr[i], i);\n var existence = map[key];\n\n if (existence == null) {\n keyArr.push(key);\n map[key] = i;\n } else {\n if (!existence.length) {\n map[key] = existence = [existence];\n }\n\n existence.push(i);\n }\n }\n}\n\nvar _default = DataDiffer;\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\n\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\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 OTHER_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'seriesName']);\n\nfunction summarizeDimensions(data) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = []; // See the comment of `List.js#userOutput`.\n\n var userOutput = summary.userOutput = {\n dimensionNames: data.dimensions.slice(),\n encode: {}\n };\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n OTHER_DIMENSIONS.each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim]; // ??? FIXME extra coord should not be set in dataDimsOnCoord.\n // But should fix the case that radar axes: simplify the logic\n // of `completeDimension`, remove `extraPrefix`.\n\n encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set\n // in this way. Use label.formatter instead. May be remove this approach someday.\n\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n\n var encodeTooltip = encode.tooltip;\n\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n return summary;\n}\n\nfunction getOrCreateEncodeArr(encode, dim) {\n if (!encode.hasOwnProperty(dim)) {\n encode[dim] = [];\n }\n\n return encode[dim];\n}\n\nfunction getDimensionTypeByAxis(axisType) {\n return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';\n}\n\nfunction mayLabelDimType(dimType) {\n // In most cases, ordinal and time do not suitable for label.\n // Ordinal info can be displayed on axis. Time is too long.\n return !(dimType === 'ordinal' || dimType === 'time');\n} // function findTheLastDimMayLabel(data) {\n// // Get last value dim\n// var dimensions = data.dimensions.slice();\n// var valueType;\n// var valueDim;\n// while (dimensions.length && (\n// valueDim = dimensions.pop(),\n// valueType = data.getDimensionInfo(valueDim).type,\n// valueType === 'ordinal' || valueType === 'time'\n// )) {} // jshint ignore:line\n// return valueDim;\n// }\n\n\nexports.OTHER_DIMENSIONS = OTHER_DIMENSIONS;\nexports.summarizeDimensions = summarizeDimensions;\nexports.getDimensionTypeByAxis = getDimensionTypeByAxis;","\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\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 * @class\n * @param {Object|DataDimensionInfo} [opt] All of the fields will be shallow copied.\n */\nfunction DataDimensionInfo(opt) {\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n /**\n * Dimension name.\n * Mandatory.\n * @type {string}\n */\n // this.name;\n\n /**\n * The origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * Optional.\n * @type {string}\n */\n // this.displayName;\n\n /**\n * Which coordSys dimension this dimension mapped to.\n * A `coordDim` can be a \"coordSysDim\" that the coordSys required\n * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),\n * or an generated \"extra coord name\" if does not mapped to any \"coordSysDim\"\n * (That is determined by whether `isExtraCoord` is `true`).\n * Mandatory.\n * @type {string}\n */\n // this.coordDim;\n\n /**\n * The index of this dimension in `series.encode[coordDim]`.\n * Mandatory.\n * @type {number}\n */\n // this.coordDimIndex;\n\n /**\n * Dimension type. The enumerable values are the key of\n * `dataCtors` of `data/List`.\n * Optional.\n * @type {string}\n */\n // this.type;\n\n /**\n * This index of this dimension info in `data/List#_dimensionInfos`.\n * Mandatory after added to `data/List`.\n * @type {number}\n */\n // this.index;\n\n /**\n * The format of `otherDims` is:\n * ```js\n * {\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * }\n * ```\n *\n * A `series.encode` can specified these fields:\n * ```js\n * encode: {\n * // \"3, 1, 5\" is the index of data dimension.\n * tooltip: [3, 1, 5],\n * label: [0, 3],\n * ...\n * }\n * ```\n * `otherDims` is the parse result of the `series.encode` above, like:\n * ```js\n * // Suppose the index of this data dimension is `3`.\n * this.otherDims = {\n * // `3` is at the index `0` of the `encode.tooltip`\n * tooltip: 0,\n * // `3` is at the index `1` of the `encode.tooltip`\n * label: 1\n * };\n * ```\n *\n * This prop should never be `null`/`undefined` after initialized.\n * @type {Object}\n */\n\n\n this.otherDims = {};\n /**\n * Be `true` if this dimension is not mapped to any \"coordSysDim\" that the\n * \"coordSys\" required.\n * Mandatory.\n * @type {boolean}\n */\n // this.isExtraCoord;\n\n /**\n * @type {module:data/OrdinalMeta}\n */\n // this.ordinalMeta;\n\n /**\n * Whether to create inverted indices.\n * @type {boolean}\n */\n // this.createInvertedIndices;\n}\n\n;\nvar _default = DataDimensionInfo;\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 Model = require(\"../model/Model\");\n\nvar DataDiffer = require(\"./DataDiffer\");\n\nvar Source = require(\"./Source\");\n\nvar _dataProvider = require(\"./helper/dataProvider\");\n\nvar defaultDimValueGetters = _dataProvider.defaultDimValueGetters;\nvar DefaultDataProvider = _dataProvider.DefaultDataProvider;\n\nvar _dimensionHelper = require(\"./helper/dimensionHelper\");\n\nvar summarizeDimensions = _dimensionHelper.summarizeDimensions;\n\nvar DataDimensionInfo = require(\"./DataDimensionInfo\");\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/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n\n/**\n * List for data storage\n * @module echarts/data/List\n */\nvar isObject = zrUtil.isObject;\nvar UNDEFINED = 'undefined';\nvar INDEX_NOT_FOUND = -1; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird udpate animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar dataCtors = {\n 'float': typeof Float64Array === UNDEFINED ? Array : Float64Array,\n 'int': typeof Int32Array === UNDEFINED ? Array : Int32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': Array\n}; // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\n\nvar CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nvar CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nvar CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\n\nfunction getIndicesCtor(list) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n}\n\nfunction cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array.\n\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n}\n\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx'];\nvar CLONE_PROPERTIES = ['_extent', '_approximateExtent', '_rawExtent'];\n\nfunction transferProperties(target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend(source._calculationInfo);\n}\n/**\n * @constructor\n * @alias module:echarts/data/List\n *\n * @param {Array.} dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n * @param {module:echarts/model/Model} hostModel\n */\n\n\nvar List = function (dimensions, hostModel) {\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimensionInfo = dimensions[i];\n\n if (zrUtil.isString(dimensionInfo)) {\n dimensionInfo = new DataDimensionInfo({\n name: dimensionInfo\n });\n } else if (!(dimensionInfo instanceof DataDimensionInfo)) {\n dimensionInfo = new DataDimensionInfo(dimensionInfo);\n }\n\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n dimensionInfo.index = i;\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n }\n /**\n * @readOnly\n * @type {Array.}\n */\n\n\n this.dimensions = dimensionNames;\n /**\n * Infomation of each data dimension, like data type.\n * @type {Object}\n */\n\n this._dimensionInfos = dimensionInfos;\n /**\n * @type {module:echarts/model/Model}\n */\n\n this.hostModel = hostModel;\n /**\n * @type {module:echarts/model/Model}\n */\n\n this.dataType;\n /**\n * Indices stores the indices of data subset after filtered.\n * This data subset will be used in chart.\n * @type {Array.}\n * @readOnly\n */\n\n this._indices = null;\n this._count = 0;\n this._rawCount = 0;\n /**\n * Data storage\n * @type {Object.>}\n * @private\n */\n\n this._storage = {};\n /**\n * @type {Array.}\n */\n\n this._nameList = [];\n /**\n * @type {Array.}\n */\n\n this._idList = [];\n /**\n * Models of data option is stored sparse for optimizing memory cost\n * @type {Array.}\n * @private\n */\n\n this._optionModels = [];\n /**\n * Global visual properties after visual coding\n * @type {Object}\n * @private\n */\n\n this._visual = {};\n /**\n * Globel layout properties.\n * @type {Object}\n * @private\n */\n\n this._layout = {};\n /**\n * Item visual properties after visual coding\n * @type {Array.}\n * @private\n */\n\n this._itemVisuals = [];\n /**\n * Key: visual type, Value: boolean\n * @type {Object}\n * @readOnly\n */\n\n this.hasItemVisual = {};\n /**\n * Item layout properties after layout\n * @type {Array.}\n * @private\n */\n\n this._itemLayouts = [];\n /**\n * Graphic elemnents\n * @type {Array.}\n * @private\n */\n\n this._graphicEls = [];\n /**\n * Max size of each chunk.\n * @type {number}\n * @private\n */\n\n this._chunkSize = 1e5;\n /**\n * @type {number}\n * @private\n */\n\n this._chunkCount = 0;\n /**\n * @type {Array.}\n * @private\n */\n\n this._rawData;\n /**\n * Raw extent will not be cloned, but only transfered.\n * It will not be calculated util needed.\n * key: dim,\n * value: {end: number, extent: Array.}\n * @type {Object}\n * @private\n */\n\n this._rawExtent = {};\n /**\n * @type {Object}\n * @private\n */\n\n this._extent = {};\n /**\n * key: dim\n * value: extent\n * @type {Object}\n * @private\n */\n\n this._approximateExtent = {};\n /**\n * Cache summary info for fast visit. See \"dimensionHelper\".\n * @type {Object}\n * @private\n */\n\n this._dimensionsSummary = summarizeDimensions(this);\n /**\n * @type {Object.}\n * @private\n */\n\n this._invertedIndicesMap = invertedIndicesMap;\n /**\n * @type {Object}\n * @private\n */\n\n this._calculationInfo = {};\n /**\n * User output info of this data.\n * DO NOT use it in other places!\n *\n * When preparing user params for user callbacks, we have\n * to clone these inner data structures to prevent users\n * from modifying them to effect built-in logic. And for\n * performance consideration we make this `userOutput` to\n * avoid clone them too many times.\n *\n * @type {Object}\n * @readOnly\n */\n\n this.userOutput = this._dimensionsSummary.userOutput;\n};\n\nvar listProto = List.prototype;\nlistProto.type = 'list';\n/**\n * If each data item has it's own option\n * @type {boolean}\n */\n\nlistProto.hasItemOption = true;\n/**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatbility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * Get dimension name\n * @param {string|number} dim See above.\n * @return {string} Concrete dim name.\n */\n\nlistProto.getDimension = function (dim) {\n if (typeof dim === 'number' // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim)) {\n dim = this.dimensions[dim];\n }\n\n return dim;\n};\n/**\n * Get type and calculation info of particular dimension\n * @param {string|number} dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */\n\n\nlistProto.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._dimensionInfos[this.getDimension(dim)];\n};\n/**\n * @return {Array.} concrete dimension name list on coord.\n */\n\n\nlistProto.getDimensionsOnCoord = function () {\n return this._dimensionsSummary.dataDimsOnCoord.slice();\n};\n/**\n * @param {string} coordDim\n * @param {number} [idx] A coordDim may map to more than one data dim.\n * If idx is `true`, return a array of all mapped dims.\n * If idx is not specified, return the first dim not extra.\n * @return {string|Array.} concrete data dim.\n * If idx is number, and not found, return null/undefined.\n * If idx is `true`, and not found, return empty array (always return array).\n */\n\n\nlistProto.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimensionsSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return idx === true // always return array if idx is `true`\n ? (dims || []).slice() : dims && dims[idx];\n};\n/**\n * Initialize from data\n * @param {Array.} data source or data or data provider.\n * @param {Array.} [nameLIst] The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n * @param {Function} [dimValueGetter] (dataItem, dimName, dataIndex, dimIndex) => number\n */\n\n\nlistProto.initData = function (data, nameList, dimValueGetter) {\n var notProvider = Source.isInstance(data) || zrUtil.isArrayLike(data);\n\n if (notProvider) {\n data = new DefaultDataProvider(data, this.dimensions.length);\n }\n\n this._rawData = data; // Clear\n\n this._storage = {};\n this._indices = null;\n this._nameList = nameList || [];\n this._idList = [];\n this._nameRepeatCount = {};\n\n if (!dimValueGetter) {\n this.hasItemOption = false;\n }\n /**\n * @readOnly\n */\n\n\n this.defaultDimValueGetter = defaultDimValueGetters[this._rawData.getSource().sourceFormat]; // Default dim value getter\n\n this._dimValueGetter = dimValueGetter = dimValueGetter || this.defaultDimValueGetter;\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows; // Reset raw extent.\n\n this._rawExtent = {};\n\n this._initDataFromProvider(0, data.count()); // If data has no item option.\n\n\n if (data.pure) {\n this.hasItemOption = false;\n }\n};\n\nlistProto.getProvider = function () {\n return this._rawData;\n};\n/**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n\n\nlistProto.appendData = function (data) {\n var rawData = this._rawData;\n var start = this.count();\n rawData.appendData(data);\n var end = rawData.count();\n\n if (!rawData.persistent) {\n end += start;\n }\n\n this._initDataFromProvider(start, end);\n};\n/**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to storage.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param {Array.>} values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exaclty cooresponding to a dimension.\n * @param {Array.} [names]\n */\n\n\nlistProto.appendValues = function (values, names) {\n var chunkSize = this._chunkSize;\n var storage = this._storage;\n var dimensions = this.dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, names ? names.length : 0);\n var originalChunkCount = this._chunkCount;\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[dim]) {\n rawExtent[dim] = getInitialExtent();\n }\n\n if (!storage[dim]) {\n storage[dim] = [];\n }\n\n prepareChunks(storage, this._dimensionInfos[dim], chunkSize, originalChunkCount, end);\n this._chunkCount = storage[dim].length;\n }\n\n var emptyDataItem = new Array(dimLen);\n\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n var chunkIndex = Math.floor(idx / chunkSize);\n var chunkOffset = idx % chunkSize; // Store the data by dimensions\n\n for (var k = 0; k < dimLen; k++) {\n var dim = dimensions[k];\n\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, k);\n\n storage[dim][chunkIndex][chunkOffset] = val;\n var dimRawExtent = rawExtent[dim];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n\n if (names) {\n this._nameList[idx] = names[sourceIdx];\n }\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = {};\n prepareInvertedIndex(this);\n};\n\nlistProto._initDataFromProvider = function (start, end) {\n // Optimize.\n if (start >= end) {\n return;\n }\n\n var chunkSize = this._chunkSize;\n var rawData = this._rawData;\n var storage = this._storage;\n var dimensions = this.dimensions;\n var dimLen = dimensions.length;\n var dimensionInfoMap = this._dimensionInfos;\n var nameList = this._nameList;\n var idList = this._idList;\n var rawExtent = this._rawExtent;\n var nameRepeatCount = this._nameRepeatCount = {};\n var nameDimIdx;\n var originalChunkCount = this._chunkCount;\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[dim]) {\n rawExtent[dim] = getInitialExtent();\n }\n\n var dimInfo = dimensionInfoMap[dim];\n\n if (dimInfo.otherDims.itemName === 0) {\n nameDimIdx = this._nameDimIdx = i;\n }\n\n if (dimInfo.otherDims.itemId === 0) {\n this._idDimIdx = i;\n }\n\n if (!storage[dim]) {\n storage[dim] = [];\n }\n\n prepareChunks(storage, dimInfo, chunkSize, originalChunkCount, end);\n this._chunkCount = storage[dim].length;\n }\n\n var dataItem = new Array(dimLen);\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = rawData.getItem(idx, dataItem); // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n\n var chunkIndex = Math.floor(idx / chunkSize);\n var chunkOffset = idx % chunkSize; // Store the data by dimensions\n\n for (var k = 0; k < dimLen; k++) {\n var dim = dimensions[k];\n var dimStorage = storage[dim][chunkIndex]; // PENDING NULL is empty or zero\n\n var val = this._dimValueGetter(dataItem, dim, idx, k);\n\n dimStorage[chunkOffset] = val;\n var dimRawExtent = rawExtent[dim];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n } // ??? FIXME not check by pure but sourceFormat?\n // TODO refactor these logic.\n\n\n if (!rawData.pure) {\n var name = nameList[idx];\n\n if (dataItem && name == null) {\n // If dataItem is {name: ...}, it has highest priority.\n // That is appropriate for many common cases.\n if (dataItem.name != null) {\n // There is no other place to persistent dataItem.name,\n // so save it to nameList.\n nameList[idx] = name = dataItem.name;\n } else if (nameDimIdx != null) {\n var nameDim = dimensions[nameDimIdx];\n var nameDimChunk = storage[nameDim][chunkIndex];\n\n if (nameDimChunk) {\n name = nameDimChunk[chunkOffset];\n var ordinalMeta = dimensionInfoMap[nameDim].ordinalMeta;\n\n if (ordinalMeta && ordinalMeta.categories.length) {\n name = ordinalMeta.categories[name];\n }\n }\n }\n } // Try using the id in option\n // id or name is used on dynamical data, mapping old and new items.\n\n\n var id = dataItem == null ? null : dataItem.id;\n\n if (id == null && name != null) {\n // Use name as id and add counter to avoid same name\n nameRepeatCount[name] = nameRepeatCount[name] || 0;\n id = name;\n\n if (nameRepeatCount[name] > 0) {\n id += '__ec__' + nameRepeatCount[name];\n }\n\n nameRepeatCount[name]++;\n }\n\n id != null && (idList[idx] = id);\n }\n }\n\n if (!rawData.persistent && rawData.clean) {\n // Clean unused data if data source is typed array.\n rawData.clean();\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = {};\n prepareInvertedIndex(this);\n};\n\nfunction prepareChunks(storage, dimInfo, chunkSize, chunkCount, end) {\n var DataCtor = dataCtors[dimInfo.type];\n var lastChunkIndex = chunkCount - 1;\n var dim = dimInfo.name;\n var resizeChunkArray = storage[dim][lastChunkIndex];\n\n if (resizeChunkArray && resizeChunkArray.length < chunkSize) {\n var newStore = new DataCtor(Math.min(end - lastChunkIndex * chunkSize, chunkSize)); // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n\n for (var j = 0; j < resizeChunkArray.length; j++) {\n newStore[j] = resizeChunkArray[j];\n }\n\n storage[dim][lastChunkIndex] = newStore;\n } // Create new chunks.\n\n\n for (var k = chunkCount * chunkSize; k < end; k += chunkSize) {\n storage[dim].push(new DataCtor(Math.min(end - k, chunkSize)));\n }\n}\n\nfunction prepareInvertedIndex(list) {\n var invertedIndicesMap = list._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = list._dimensionInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < list._count; i++) {\n // Only support the case that all values are distinct.\n invertedIndices[list.get(dim, i)] = i;\n }\n }\n });\n}\n\nfunction getRawValueFromStore(list, dimIndex, rawIndex) {\n var val;\n\n if (dimIndex != null) {\n var chunkSize = list._chunkSize;\n var chunkIndex = Math.floor(rawIndex / chunkSize);\n var chunkOffset = rawIndex % chunkSize;\n var dim = list.dimensions[dimIndex];\n var chunk = list._storage[dim][chunkIndex];\n\n if (chunk) {\n val = chunk[chunkOffset];\n var ordinalMeta = list._dimensionInfos[dim].ordinalMeta;\n\n if (ordinalMeta && ordinalMeta.categories.length) {\n val = ordinalMeta.categories[val];\n }\n }\n }\n\n return val;\n}\n/**\n * @return {number}\n */\n\n\nlistProto.count = function () {\n return this._count;\n};\n\nlistProto.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(this.count());\n\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n\n return newIndices;\n};\n/**\n * Get value. Return NaN if idx is out of range.\n * @param {string} dim Dim must be concrete name.\n * @param {number} idx\n * @param {boolean} stack\n * @return {number}\n */\n\n\nlistProto.get = function (dim, idx\n/*, stack */\n) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var storage = this._storage;\n\n if (!storage[dim]) {\n // TODO Warn ?\n return NaN;\n }\n\n idx = this.getRawIndex(idx);\n var chunkIndex = Math.floor(idx / this._chunkSize);\n var chunkOffset = idx % this._chunkSize;\n var chunkStore = storage[dim][chunkIndex];\n var value = chunkStore[chunkOffset]; // FIXME ordinal data type is not stackable\n // if (stack) {\n // var dimensionInfo = this._dimensionInfos[dim];\n // if (dimensionInfo && dimensionInfo.stackable) {\n // var stackedOn = this.stackedOn;\n // while (stackedOn) {\n // // Get no stacked data of stacked on\n // var stackedValue = stackedOn.get(dim, idx);\n // // Considering positive stack, negative stack and empty data\n // if ((value >= 0 && stackedValue > 0) // Positive stack\n // || (value <= 0 && stackedValue < 0) // Negative stack\n // ) {\n // value += stackedValue;\n // }\n // stackedOn = stackedOn.stackedOn;\n // }\n // }\n // }\n\n return value;\n};\n/**\n * @param {string} dim concrete dim\n * @param {number} rawIndex\n * @return {number|string}\n */\n\n\nlistProto.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n\n var dimStore = this._storage[dim];\n\n if (!dimStore) {\n // TODO Warn ?\n return NaN;\n }\n\n var chunkIndex = Math.floor(rawIdx / this._chunkSize);\n var chunkOffset = rawIdx % this._chunkSize;\n var chunkStore = dimStore[chunkIndex];\n return chunkStore[chunkOffset];\n};\n/**\n * FIXME Use `get` on chrome maybe slow(in filterSelf and selectRange).\n * Hack a much simpler _getFast\n * @private\n */\n\n\nlistProto._getFast = function (dim, rawIdx) {\n var chunkIndex = Math.floor(rawIdx / this._chunkSize);\n var chunkOffset = rawIdx % this._chunkSize;\n var chunkStore = this._storage[dim][chunkIndex];\n return chunkStore[chunkOffset];\n};\n/**\n * Get value for multi dimensions.\n * @param {Array.} [dimensions] If ignored, using all dimensions.\n * @param {number} idx\n * @return {number}\n */\n\n\nlistProto.getValues = function (dimensions, idx\n/*, stack */\n) {\n var values = [];\n\n if (!zrUtil.isArray(dimensions)) {\n // stack = idx;\n idx = dimensions;\n dimensions = this.dimensions;\n }\n\n for (var i = 0, len = dimensions.length; i < len; i++) {\n values.push(this.get(dimensions[i], idx\n /*, stack */\n ));\n }\n\n return values;\n};\n/**\n * If value is NaN. Inlcuding '-'\n * Only check the coord dimensions.\n * @param {string} dim\n * @param {number} idx\n * @return {number}\n */\n\n\nlistProto.hasValue = function (idx) {\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\n\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n};\n/**\n * Get extent of data in one dimension\n * @param {string} dim\n * @param {boolean} stack\n */\n\n\nlistProto.getDataExtent = function (dim\n/*, stack */\n) {\n // Make sure use concrete dim as cache name.\n dim = this.getDimension(dim);\n var dimData = this._storage[dim];\n var initialExtent = getInitialExtent(); // stack = !!((stack || false) && this.getCalculationInfo(dim));\n\n if (!dimData) {\n return initialExtent;\n } // Make more strict checkings to ensure hitting cache.\n\n\n var currEnd = this.count(); // var cacheName = [dim, !!stack].join('_');\n // var cacheName = dim;\n // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n\n var useRaw = !this._indices; // && !stack;\n\n var dimExtent;\n\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n\n dimExtent = this._extent[dim];\n\n if (dimExtent) {\n return dimExtent.slice();\n }\n\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n\n for (var i = 0; i < currEnd; i++) {\n // var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i));\n var value = this._getFast(dim, this.getRawIndex(i));\n\n value < min && (min = value);\n value > max && (max = value);\n }\n\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n};\n/**\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */\n\n\nlistProto.getApproximateExtent = function (dim\n/*, stack */\n) {\n dim = this.getDimension(dim);\n return this._approximateExtent[dim] || this.getDataExtent(dim\n /*, stack */\n );\n};\n\nlistProto.setApproximateExtent = function (extent, dim\n/*, stack */\n) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n};\n/**\n * @param {string} key\n * @return {*}\n */\n\n\nlistProto.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n};\n/**\n * @param {string|Object} key or k-v object\n * @param {*} [value]\n */\n\n\nlistProto.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n};\n/**\n * Get sum of data in one dimension\n * @param {string} dim\n */\n\n\nlistProto.getSum = function (dim\n/*, stack */\n) {\n var dimData = this._storage[dim];\n var sum = 0;\n\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i\n /*, stack */\n );\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n\n return sum;\n};\n/**\n * Get median of data in one dimension\n * @param {string} dim\n */\n\n\nlistProto.getMedian = function (dim\n/*, stack */\n) {\n var dimDataArray = []; // map all data of one dimension\n\n this.each(dim, function (val, idx) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n }); // TODO\n // Use quick select?\n // immutability & sort\n\n var sortedDimDataArray = [].concat(dimDataArray).sort(function (a, b) {\n return a - b;\n });\n var len = this.count(); // calculate median\n\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n}; // /**\n// * Retreive the index with given value\n// * @param {string} dim Concrete dimension.\n// * @param {number} value\n// * @return {number}\n// */\n// Currently incorrect: should return dataIndex but not rawIndex.\n// Do not fix it until this method is to be used somewhere.\n// FIXME Precision of float value\n// listProto.indexOf = function (dim, value) {\n// var storage = this._storage;\n// var dimData = storage[dim];\n// var chunkSize = this._chunkSize;\n// if (dimData) {\n// for (var i = 0, len = this.count(); i < len; i++) {\n// var chunkIndex = Math.floor(i / chunkSize);\n// var chunkOffset = i % chunkSize;\n// if (dimData[chunkIndex][chunkOffset] === value) {\n// return i;\n// }\n// }\n// }\n// return -1;\n// };\n\n/**\n * Only support the dimension which inverted index created.\n * Do not support other cases until required.\n * @param {string} concrete dim\n * @param {number|string} value\n * @return {number} rawIndex\n */\n\n\nlistProto.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n};\n/**\n * Retreive the index with given name\n * @param {number} idx\n * @param {number} name\n * @return {number}\n */\n\n\nlistProto.indexOfName = function (name) {\n for (var i = 0, len = this.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n};\n/**\n * Retreive the index with given raw data index\n * @param {number} idx\n * @param {number} name\n * @return {number}\n */\n\n\nlistProto.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n\n if (!this._indices) {\n return rawIndex;\n } // Indices are ascending\n\n\n var indices = this._indices; // If rawIndex === dataIndex\n\n var rawDataIndex = indices[rawIndex];\n\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n\n var left = 0;\n var right = this._count - 1;\n\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n\n return -1;\n};\n/**\n * Retreive the index of nearest value\n * @param {string} dim\n * @param {number} value\n * @param {number} [maxDistance=Infinity]\n * @return {Array.} If and only if multiple indices has\n * the same value, they are put to the result.\n */\n\n\nlistProto.indicesOfNearest = function (dim, value, maxDistance) {\n var storage = this._storage;\n var dimData = storage[dim];\n var nearestIndices = [];\n\n if (!dimData) {\n return nearestIndices;\n }\n\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/List.js`.\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var diff = value - this.get(dim, i);\n var dist = Math.abs(diff);\n\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we chose the one that `diff >= 0` in this csae.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n};\n/**\n * Get raw data index\n * @param {number} idx\n * @return {number}\n */\n\n\nlistProto.getRawIndex = getRawIndexWithoutIndices;\n\nfunction getRawIndexWithoutIndices(idx) {\n return idx;\n}\n\nfunction getRawIndexWithIndices(idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n\n return -1;\n}\n/**\n * Get raw data item\n * @param {number} idx\n * @return {number}\n */\n\n\nlistProto.getRawDataItem = function (idx) {\n if (!this._rawData.persistent) {\n var val = [];\n\n for (var i = 0; i < this.dimensions.length; i++) {\n var dim = this.dimensions[i];\n val.push(this.get(dim, idx));\n }\n\n return val;\n } else {\n return this._rawData.getItem(this.getRawIndex(idx));\n }\n};\n/**\n * @param {number} idx\n * @param {boolean} [notDefaultIdx=false]\n * @return {string}\n */\n\n\nlistProto.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n return this._nameList[rawIndex] || getRawValueFromStore(this, this._nameDimIdx, rawIndex) || '';\n};\n/**\n * @param {number} idx\n * @param {boolean} [notDefaultIdx=false]\n * @return {string}\n */\n\n\nlistProto.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n};\n\nfunction getId(list, rawIndex) {\n var id = list._idList[rawIndex];\n\n if (id == null) {\n id = getRawValueFromStore(list, list._idDimIdx, rawIndex);\n }\n\n if (id == null) {\n // FIXME Check the usage in graph, should not use prefix.\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n}\n\nfunction normalizeDimensions(dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = [dimensions];\n }\n\n return dimensions;\n}\n\nfunction validateDimensions(list, dims) {\n for (var i = 0; i < dims.length; i++) {\n // stroage may be empty when no data, so use\n // dimensionInfos to check.\n if (!list._dimensionInfos[dims[i]]) {\n console.error('Unkown dimension ' + dims[i]);\n }\n }\n}\n/**\n * Data iteration\n * @param {string|Array.}\n * @param {Function} cb\n * @param {*} [context=this]\n *\n * @example\n * list.each('x', function (x, idx) {});\n * list.each(['x', 'y'], function (x, y, idx) {});\n * list.each(function (idx) {})\n */\n\n\nlistProto.each = function (dims, cb, context, contextCompat) {\n 'use strict';\n\n if (!this._count) {\n return;\n }\n\n if (typeof dims === 'function') {\n contextCompat = context;\n context = cb;\n cb = dims;\n dims = [];\n } // contextCompat just for compat echarts3\n\n\n context = context || contextCompat || this;\n dims = zrUtil.map(normalizeDimensions(dims), this.getDimension, this);\n var dimSize = dims.length;\n\n for (var i = 0; i < this.count(); i++) {\n // Simple optimization\n switch (dimSize) {\n case 0:\n cb.call(context, i);\n break;\n\n case 1:\n cb.call(context, this.get(dims[0], i), i);\n break;\n\n case 2:\n cb.call(context, this.get(dims[0], i), this.get(dims[1], i), i);\n break;\n\n default:\n var k = 0;\n var value = [];\n\n for (; k < dimSize; k++) {\n value[k] = this.get(dims[k], i);\n } // Index\n\n\n value[k] = i;\n cb.apply(context, value);\n }\n }\n};\n/**\n * Data filter\n * @param {string|Array.}\n * @param {Function} cb\n * @param {*} [context=this]\n */\n\n\nlistProto.filterSelf = function (dimensions, cb, context, contextCompat) {\n 'use strict';\n\n if (!this._count) {\n return;\n }\n\n if (typeof dimensions === 'function') {\n contextCompat = context;\n context = cb;\n cb = dimensions;\n dimensions = [];\n } // contextCompat just for compat echarts3\n\n\n context = context || contextCompat || this;\n dimensions = zrUtil.map(normalizeDimensions(dimensions), this.getDimension, this);\n var count = this.count();\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dimensions.length;\n var offset = 0;\n var dim0 = dimensions[0];\n\n for (var i = 0; i < count; i++) {\n var keep;\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n if (dimSize === 0) {\n keep = cb.call(context, i);\n } else if (dimSize === 1) {\n var val = this._getFast(dim0, rawIdx);\n\n keep = cb.call(context, val, i);\n } else {\n for (var k = 0; k < dimSize; k++) {\n value[k] = this._getFast(dim0, rawIdx);\n }\n\n value[k] = i;\n keep = cb.apply(context, value);\n }\n\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n } // Set indices after filtered.\n\n\n if (offset < count) {\n this._indices = newIndices;\n }\n\n this._count = offset; // Reset data extent\n\n this._extent = {};\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return this;\n};\n/**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n\n\nlistProto.selectRange = function (range) {\n 'use strict';\n\n if (!this._count) {\n return;\n }\n\n var dimensions = [];\n\n for (var dim in range) {\n if (range.hasOwnProperty(dim)) {\n dimensions.push(dim);\n }\n }\n\n var dimSize = dimensions.length;\n\n if (!dimSize) {\n return;\n }\n\n var originalCount = this.count();\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dimensions[0];\n var min = range[dim0][0];\n var max = range[dim0][1];\n var quickFinished = false;\n\n if (!this._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n\n if (dimSize === 1) {\n var dimStorage = this._storage[dimensions[0]];\n\n for (var k = 0; k < this._chunkCount; k++) {\n var chunkStorage = dimStorage[k];\n var len = Math.min(this._count - k * this._chunkSize, this._chunkSize);\n\n for (var i = 0; i < len; i++) {\n var val = chunkStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n }\n\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = this._storage[dim0];\n var dimStorage2 = this._storage[dimensions[1]];\n var min2 = range[dimensions[1]][0];\n var max2 = range[dimensions[1]][1];\n\n for (var k = 0; k < this._chunkCount; k++) {\n var chunkStorage = dimStorage[k];\n var chunkStorage2 = dimStorage2[k];\n var len = Math.min(this._count - k * this._chunkSize, this._chunkSize);\n\n for (var i = 0; i < len; i++) {\n var val = chunkStorage[i];\n var val2 = chunkStorage2[i]; // Do not filter NaN, see comment above.\n\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n }\n\n quickFinished = true;\n }\n }\n\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = this.getRawIndex(i);\n\n var val = this._getFast(dim0, rawIndex); // Do not filter NaN, see comment above.\n\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = this.getRawIndex(i);\n\n for (var k = 0; k < dimSize; k++) {\n var dimk = dimensions[k];\n\n var val = this._getFast(dim, rawIndex); // Do not filter NaN, see comment above.\n\n\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n\n if (keep) {\n newIndices[offset++] = this.getRawIndex(i);\n }\n }\n }\n } // Set indices after filtered.\n\n\n if (offset < originalCount) {\n this._indices = newIndices;\n }\n\n this._count = offset; // Reset data extent\n\n this._extent = {};\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return this;\n};\n/**\n * Data mapping to a plain array\n * @param {string|Array.} [dimensions]\n * @param {Function} cb\n * @param {*} [context=this]\n * @return {Array}\n */\n\n\nlistProto.mapArray = function (dimensions, cb, context, contextCompat) {\n 'use strict';\n\n if (typeof dimensions === 'function') {\n contextCompat = context;\n context = cb;\n cb = dimensions;\n dimensions = [];\n } // contextCompat just for compat echarts3\n\n\n context = context || contextCompat || this;\n var result = [];\n this.each(dimensions, function () {\n result.push(cb && cb.apply(this, arguments));\n }, context);\n return result;\n}; // Data in excludeDimensions is copied, otherwise transfered.\n\n\nfunction cloneListForMapAndSample(original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(zrUtil.map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneDimStore(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n }\n }\n\n return list;\n}\n\nfunction cloneDimStore(originalDimStore) {\n var newDimStore = new Array(originalDimStore.length);\n\n for (var j = 0; j < originalDimStore.length; j++) {\n newDimStore[j] = cloneChunk(originalDimStore[j]);\n }\n\n return newDimStore;\n}\n\nfunction getInitialExtent() {\n return [Infinity, -Infinity];\n}\n/**\n * Data mapping to a new List with given dimensions\n * @param {string|Array.} dimensions\n * @param {Function} cb\n * @param {*} [context=this]\n * @return {Array}\n */\n\n\nlistProto.map = function (dimensions, cb, context, contextCompat) {\n 'use strict'; // contextCompat just for compat echarts3\n\n context = context || contextCompat || this;\n dimensions = zrUtil.map(normalizeDimensions(dimensions), this.getDimension, this);\n var list = cloneListForMapAndSample(this, dimensions); // Following properties are all immutable.\n // So we can reference to the same value\n\n list._indices = this._indices;\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n var storage = list._storage;\n var tmpRetValue = [];\n var chunkSize = this._chunkSize;\n var dimSize = dimensions.length;\n var dataCount = this.count();\n var values = [];\n var rawExtent = list._rawExtent;\n\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\n values[dimIndex] = this.get(dimensions[dimIndex], dataIndex\n /*, stack */\n );\n }\n\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(context, values);\n\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n\n var rawIndex = this.getRawIndex(dataIndex);\n var chunkIndex = Math.floor(rawIndex / chunkSize);\n var chunkOffset = rawIndex % chunkSize;\n\n for (var i = 0; i < retValue.length; i++) {\n var dim = dimensions[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = storage[dim];\n\n if (dimStore) {\n dimStore[chunkIndex][chunkOffset] = val;\n }\n\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n\n return list;\n};\n/**\n * Large data down sampling on given dimension\n * @param {string} dimension\n * @param {number} rate\n * @param {Function} sampleValue\n * @param {Function} sampleIndex Sample index for name and id\n */\n\n\nlistProto.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this, [dimension]);\n var targetStorage = list._storage;\n var frameValues = [];\n var frameSize = Math.floor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var chunkSize = this._chunkSize;\n var rawExtentOnDim = list._rawExtent[dimension];\n var newIndices = new (getIndicesCtor(this))(len);\n var offset = 0;\n\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n var originalChunkIndex = Math.floor(dataIdx / chunkSize);\n var originalChunkOffset = dataIdx % chunkSize;\n frameValues[k] = dimStore[originalChunkIndex][originalChunkOffset];\n }\n\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\n var sampleChunkIndex = Math.floor(sampleFrameIdx / chunkSize);\n var sampleChunkOffset = sampleFrameIdx % chunkSize; // Only write value on the filtered data\n\n dimStore[sampleChunkIndex][sampleChunkOffset] = value;\n\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n\n newIndices[offset++] = sampleFrameIdx;\n }\n\n list._count = offset;\n list._indices = newIndices;\n list.getRawIndex = getRawIndexWithIndices;\n return list;\n};\n/**\n * Get model of one data item.\n *\n * @param {number} idx\n */\n// FIXME Model proxy ?\n\n\nlistProto.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n return new Model(this.getRawDataItem(idx), hostModel, hostModel && hostModel.ecModel);\n};\n/**\n * Create a data differ\n * @param {module:echarts/data/List} otherList\n * @return {module:echarts/data/DataDiffer}\n */\n\n\nlistProto.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n};\n/**\n * Get visual property.\n * @param {string} key\n */\n\n\nlistProto.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n};\n/**\n * Set visual property\n * @param {string|Object} key\n * @param {*} [value]\n *\n * @example\n * setVisual('color', color);\n * setVisual({\n * 'color': color\n * });\n */\n\n\nlistProto.setVisual = function (key, val) {\n if (isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n this.setVisual(name, key[name]);\n }\n }\n\n return;\n }\n\n this._visual = this._visual || {};\n this._visual[key] = val;\n};\n/**\n * Set layout property.\n * @param {string|Object} key\n * @param {*} [val]\n */\n\n\nlistProto.setLayout = function (key, val) {\n if (isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n this.setLayout(name, key[name]);\n }\n }\n\n return;\n }\n\n this._layout[key] = val;\n};\n/**\n * Get layout property.\n * @param {string} key.\n * @return {*}\n */\n\n\nlistProto.getLayout = function (key) {\n return this._layout[key];\n};\n/**\n * Get layout of single data item\n * @param {number} idx\n */\n\n\nlistProto.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n};\n/**\n * Set layout of single data item\n * @param {number} idx\n * @param {Object} layout\n * @param {boolean=} [merge=false]\n */\n\n\nlistProto.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n};\n/**\n * Clear all layout of single data item\n */\n\n\nlistProto.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n};\n/**\n * Get visual property of single data item\n * @param {number} idx\n * @param {string} key\n * @param {boolean} [ignoreParent=false]\n */\n\n\nlistProto.getItemVisual = function (idx, key, ignoreParent) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null && !ignoreParent) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n};\n/**\n * Set visual property of single data item\n *\n * @param {number} idx\n * @param {string|Object} key\n * @param {*} [value]\n *\n * @example\n * setItemVisual(0, 'color', color);\n * setItemVisual(0, {\n * 'color': color\n * });\n */\n\n\nlistProto.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n var hasItemVisual = this.hasItemVisual;\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n itemVisual[name] = key[name];\n hasItemVisual[name] = true;\n }\n }\n\n return;\n }\n\n itemVisual[key] = value;\n hasItemVisual[key] = true;\n};\n/**\n * Clear itemVisuals and list visual.\n */\n\n\nlistProto.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n this.hasItemVisual = {};\n};\n\nvar setItemDataAndSeriesIndex = function (child) {\n child.seriesIndex = this.seriesIndex;\n child.dataIndex = this.dataIndex;\n child.dataType = this.dataType;\n};\n/**\n * Set graphic element relative to data. It can be set as null\n * @param {number} idx\n * @param {module:zrender/Element} [el]\n */\n\n\nlistProto.setItemGraphicEl = function (idx, el) {\n var hostModel = this.hostModel;\n\n if (el) {\n // Add data index and series index for indexing the data by element\n // Useful in tooltip\n el.dataIndex = idx;\n el.dataType = this.dataType;\n el.seriesIndex = hostModel && hostModel.seriesIndex;\n\n if (el.type === 'group') {\n el.traverse(setItemDataAndSeriesIndex, el);\n }\n }\n\n this._graphicEls[idx] = el;\n};\n/**\n * @param {number} idx\n * @return {module:zrender/Element}\n */\n\n\nlistProto.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n};\n/**\n * @param {Function} cb\n * @param {*} context\n */\n\n\nlistProto.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n};\n/**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */\n\n\nlistProto.cloneShallow = function (list) {\n if (!list) {\n var dimensionInfoList = zrUtil.map(this.dimensions, this.getDimensionInfo, this);\n list = new List(dimensionInfoList, this.hostModel);\n } // FIXME\n\n\n list._storage = this._storage;\n transferProperties(list, this); // Clone will not change the data extent and indices\n\n if (this._indices) {\n var Ctor = this._indices.constructor;\n list._indices = new Ctor(this._indices);\n } else {\n list._indices = null;\n }\n\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return list;\n};\n/**\n * Wrap some method to add more feature\n * @param {string} methodName\n * @param {Function} injectFunction\n */\n\n\nlistProto.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (typeof originalMethod !== 'function') {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n}; // Methods that create a new list based on this list should be listed here.\n// Notice that those method should `RETURN` the new list.\n\n\nlistProto.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'map']; // Methods that change indices of this list should be listed here.\n\nlistProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\nvar _default = List;\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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\nvar isString = _util.isString;\nvar defaults = _util.defaults;\nvar extend = _util.extend;\nvar isObject = _util.isObject;\nvar clone = _util.clone;\n\nvar _model = require(\"../../util/model\");\n\nvar normalizeToArray = _model.normalizeToArray;\n\nvar _sourceHelper = require(\"./sourceHelper\");\n\nvar guessOrdinal = _sourceHelper.guessOrdinal;\nvar BE_ORDINAL = _sourceHelper.BE_ORDINAL;\n\nvar Source = require(\"../Source\");\n\nvar _dimensionHelper = require(\"./dimensionHelper\");\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\n\nvar DataDimensionInfo = require(\"../DataDimensionInfo\");\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 * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */\n\n/**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `sysDims`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists.\n * If not specified, auto find the next available data dim.\n * param source {module:data/Source}\n * param dimCount {number}\n * return {Object} encode Never be `null/undefined`.\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @return {Array.}\n */\nfunction completeDimensions(sysDims, source, opt) {\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n opt = opt || {};\n sysDims = (sysDims || []).slice();\n var dimsDef = (opt.dimsDef || []).slice();\n var dataDimNameMap = createHashMap();\n var coordDimNameMap = createHashMap(); // var valueCandidate;\n\n var result = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result.\n\n for (var i = 0; i < dimCount; i++) {\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimsDef[i]) ? dimsDef[i] : {\n name: dimsDef[i]\n });\n var userDimName = dimDefItem.name;\n var resultItem = result[i] = new DataDimensionInfo(); // Name will be applied later for avoiding duplication.\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n dataDimNameMap.set(userDimName, i);\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n }\n\n var encodeDef = opt.encodeDef;\n\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n\n encodeDef = createHashMap(encodeDef); // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\n encodeDef.each(function (dataDims, coordDim) {\n dataDims = normalizeToArray(dataDims).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDef.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDef.set(coordDim, []);\n each(dataDims, function (resultDimIdx, idx) {\n // The input resultDimIdx can be dim name or index.\n isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx));\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(result[resultDimIdx], coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItem, sysDimIndex) {\n var coordDim;\n var sysDimItem;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n\n if (isString(sysDimItem)) {\n coordDim = sysDimItem;\n sysDimItem = {};\n } else {\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = clone(sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDef.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n var dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < result.length && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = result[resultDimIdx];\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (OTHER_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props.\n\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap));\n\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx, resultItem.name) === BE_ORDINAL.Must // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first colum should better be treated as a \"ordinal\" although it\n // might not able to be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n\n return result;\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in storage?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length));\n });\n return dimCount;\n}\n\nfunction genName(name, map, fromZero) {\n if (fromZero || map.get(name) != null) {\n var i = 0;\n\n while (map.get(name + i) != null) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}\n\nvar _default = completeDimensions;\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 completeDimensions = require(\"./completeDimensions\");\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 * Substitute `completeDimensions`.\n * `completeDimensions` is to be deprecated.\n */\n\n/**\n * @param {module:echarts/data/Source|module:echarts/data/List} source or data.\n * @param {Object|Array} [opt]\n * @param {Array.} [opt.coordDimensions=[]]\n * @param {number} [opt.dimensionsCount]\n * @param {string} [opt.generateCoord]\n * @param {string} [opt.generateCoordCount]\n * @param {Array.} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define.\n * @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define.\n * @param {Function} [opt.encodeDefaulter] Make default encode if user not specified.\n * @return {Array.} dimensionsInfo\n */\nfunction _default(source, opt) {\n opt = opt || {};\n return completeDimensions(opt.coordDimensions || [], source, {\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\n encodeDef: opt.encodeDefine || source.encodeDefine,\n dimCount: opt.dimensionsCount,\n encodeDefaulter: opt.encodeDefaulter,\n generateCoord: opt.generateCoord,\n generateCoordCount: opt.generateCoordCount\n });\n}\n\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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar retrieve = _util.retrieve;\nvar each = _util.each;\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 * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\n\n/**\n * @class\n * For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // The index of the first category axis in `coordSysDims`.\n * // `null/undefined` means no category axis exists.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction CoordSysInfo(coordSysName) {\n /**\n * @type {string}\n */\n this.coordSysName = coordSysName;\n /**\n * @type {Array.}\n */\n\n this.coordSysDims = [];\n /**\n * @type {module:zrender/core/util#HashMap}\n */\n\n this.axisMap = createHashMap();\n /**\n * @type {module:zrender/core/util#HashMap}\n */\n\n this.categoryAxisMap = createHashMap();\n /**\n * @type {number}\n */\n\n this.firstCategoryDimIndex = null;\n}\n/**\n * @return {module:model/referHelper#CoordSysInfo}\n */\n\n\nfunction getCoordSysInfoBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = new CoordSysInfo(coordSysName);\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\n\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis')[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis')[0];\n result.coordSysDims = ['x', 'y'];\n axisMap.set('x', xAxisModel);\n axisMap.set('y', yAxisModel);\n\n if (isCategory(xAxisModel)) {\n categoryAxisMap.set('x', xAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(yAxisModel)) {\n categoryAxisMap.set('y', yAxisModel);\n result.firstCategoryDimIndex == null & (result.firstCategoryDimIndex = 1);\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0];\n result.coordSysDims = ['single'];\n axisMap.set('single', singleAxisModel);\n\n if (isCategory(singleAxisModel)) {\n categoryAxisMap.set('single', singleAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n },\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n var polarModel = seriesModel.getReferringComponents('polar')[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n result.coordSysDims = ['radius', 'angle'];\n axisMap.set('radius', radiusAxisModel);\n axisMap.set('angle', angleAxisModel);\n\n if (isCategory(radiusAxisModel)) {\n categoryAxisMap.set('radius', radiusAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(angleAxisModel)) {\n categoryAxisMap.set('angle', angleAxisModel);\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n }\n },\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n result.coordSysDims = ['lng', 'lat'];\n },\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n var ecModel = seriesModel.ecModel;\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axisDim = coordSysDims[index];\n axisMap.set(axisDim, axisModel);\n\n if (isCategory(axisModel) && result.firstCategoryDimIndex == null) {\n categoryAxisMap.set(axisDim, axisModel);\n result.firstCategoryDimIndex = index;\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\n}\n\nexports.getCoordSysInfoBySeries = getCoordSysInfoBySeries;","\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar isString = _util.isString;\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 * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param {module:echarts/model/Series} seriesModel\n * @param {Array.} dimensionInfoList The same as the input of .\n * The input dimensionInfoList will be modified.\n * @param {Object} [opt]\n * @param {boolean} [opt.stackedCoordDimension=''] Specify a coord dimension if needed.\n * @param {boolean} [opt.byIndex=false]\n * @return {Object} calculationInfo\n * {\n * stackedDimension: string\n * stackedByDimension: string\n * isStackedByIndex: boolean\n * stackedOverDimension: string\n * stackResultDimension: string\n * }\n */\nfunction enableDataStack(seriesModel, dimensionInfoList, opt) {\n opt = opt || {};\n var byIndex = opt.byIndex;\n var stackedCoordDimension = opt.stackedCoordDimension; // Compatibal: when `stack` is set as '', do not stack.\n\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\n var stackedByDimInfo;\n var stackedDimInfo;\n var stackResultDimension;\n var stackedOverDimension;\n each(dimensionInfoList, function (dimensionInfo, index) {\n if (isString(dimensionInfo)) {\n dimensionInfoList[index] = dimensionInfo = {\n name: dimensionInfo\n };\n }\n\n if (mayStack && !dimensionInfo.isExtraCoord) {\n // Find the first ordinal dimension as the stackedByDimInfo.\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n stackedByDimInfo = dimensionInfo;\n } // Find the first stackable dimension as the stackedDimInfo.\n\n\n if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n stackedDimInfo = dimensionInfo;\n }\n }\n });\n\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n // Compatible with previous design, value axis (time axis) only stack by index.\n // It may make sense if the user provides elaborately constructed data.\n byIndex = true;\n } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n // That put stack logic in List is for using conveniently in echarts extensions, but it\n // might not be a good way.\n\n\n if (stackedDimInfo) {\n // Use a weird name that not duplicated with other names.\n stackResultDimension = '__\\0ecstackresult';\n stackedOverDimension = '__\\0ecstackedover'; // Create inverted index to fast query index by value.\n\n if (stackedByDimInfo) {\n stackedByDimInfo.createInvertedIndices = true;\n }\n\n var stackedDimCoordDim = stackedDimInfo.coordDim;\n var stackedDimType = stackedDimInfo.type;\n var stackedDimCoordIndex = 0;\n each(dimensionInfoList, function (dimensionInfo) {\n if (dimensionInfo.coordDim === stackedDimCoordDim) {\n stackedDimCoordIndex++;\n }\n });\n dimensionInfoList.push({\n name: stackResultDimension,\n coordDim: stackedDimCoordDim,\n coordDimIndex: stackedDimCoordIndex,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true\n });\n stackedDimCoordIndex++;\n dimensionInfoList.push({\n name: stackedOverDimension,\n // This dimension contains stack base (generally, 0), so do not set it as\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n coordDim: stackedOverDimension,\n coordDimIndex: stackedDimCoordIndex,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true\n });\n }\n\n return {\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n isStackedByIndex: byIndex,\n stackedOverDimension: stackedOverDimension,\n stackResultDimension: stackResultDimension\n };\n}\n/**\n * @param {module:echarts/data/List} data\n * @param {string} stackedDim\n */\n\n\nfunction isDimensionStacked(data, stackedDim\n/*, stackedByDim*/\n) {\n // Each single series only maps to one pair of axis. So we do not need to\n // check stackByDim, whatever stacked by a dimension or stacked by index.\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); // && (\n // stackedByDim != null\n // ? stackedByDim === data.getCalculationInfo('stackedByDimension')\n // : data.getCalculationInfo('isStackedByIndex')\n // );\n}\n/**\n * @param {module:echarts/data/List} data\n * @param {string} targetDim\n * @param {string} [stackedByDim] If not input this parameter, check whether\n * stacked by index.\n * @return {string} dimension\n */\n\n\nfunction getStackedDimension(data, targetDim) {\n return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\n}\n\nexports.enableDataStack = enableDataStack;\nexports.isDimensionStacked = isDimensionStacked;\nexports.getStackedDimension = getStackedDimension;","\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 List = require(\"../../data/List\");\n\nvar createDimensions = require(\"../../data/helper/createDimensions\");\n\nvar _sourceType = require(\"../../data/helper/sourceType\");\n\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\n\nvar _dimensionHelper = require(\"../../data/helper/dimensionHelper\");\n\nvar getDimensionTypeByAxis = _dimensionHelper.getDimensionTypeByAxis;\n\nvar _model = require(\"../../util/model\");\n\nvar getDataItemValue = _model.getDataItemValue;\n\nvar CoordinateSystem = require(\"../../CoordinateSystem\");\n\nvar _referHelper = require(\"../../model/referHelper\");\n\nvar getCoordSysInfoBySeries = _referHelper.getCoordSysInfoBySeries;\n\nvar Source = require(\"../../data/Source\");\n\nvar _dataStackHelper = require(\"../../data/helper/dataStackHelper\");\n\nvar enableDataStack = _dataStackHelper.enableDataStack;\n\nvar _sourceHelper = require(\"../../data/helper/sourceHelper\");\n\nvar makeSeriesEncodeForAxisCoordSys = _sourceHelper.makeSeriesEncodeForAxisCoordSys;\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 * @param {module:echarts/data/Source|Array} source Or raw data.\n * @param {module:echarts/model/Series} seriesModel\n * @param {Object} [opt]\n * @param {string} [opt.generateCoord]\n * @param {boolean} [opt.useEncodeDefaulter]\n */\nfunction createListFromArray(source, seriesModel, opt) {\n opt = opt || {};\n\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem.get(coordSysName);\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs;\n\n if (coordSysInfo) {\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType); // dimInfo.stackable = isStackable(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n var dimInfoList = createDimensions(source, {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefaulter: opt.useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null\n });\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\n var list = new List(dimInfoList, seriesModel);\n list.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n list.hasItemOption = false;\n list.initData(source, null, dimValueGetter);\n return list;\n}\n\nfunction isNeedCompleteOrdinalData(source) {\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var sampleItem = firstDataNotNull(source.data || []);\n return sampleItem != null && !zrUtil.isArray(getDataItemValue(sampleItem));\n }\n}\n\nfunction firstDataNotNull(data) {\n var i = 0;\n\n while (i < data.length && data[i] == null) {\n i++;\n }\n\n return data[i];\n}\n\nvar _default = createListFromArray;\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 clazzUtil = require(\"../util/clazz\");\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 * // Scale class management\n * @module echarts/scale/Scale\n */\n\n/**\n * @param {Object} [setting]\n */\nfunction Scale(setting) {\n this._setting = setting || {};\n /**\n * Extent\n * @type {Array.}\n * @protected\n */\n\n this._extent = [Infinity, -Infinity];\n /**\n * Step is calculated in adjustExtent\n * @type {Array.}\n * @protected\n */\n\n this._interval = 0;\n this.init && this.init.apply(this, arguments);\n}\n/**\n * Parse input val to valid inner number.\n * @param {*} val\n * @return {number}\n */\n\n\nScale.prototype.parse = function (val) {\n // Notice: This would be a trap here, If the implementation\n // of this method depends on extent, and this method is used\n // before extent set (like in dataZoom), it would be wrong.\n // Nevertheless, parse does not depend on extent generally.\n return val;\n};\n\nScale.prototype.getSetting = function (name) {\n return this._setting[name];\n};\n\nScale.prototype.contain = function (val) {\n var extent = this._extent;\n return val >= extent[0] && val <= extent[1];\n};\n/**\n * Normalize value to linear [0, 1], return 0.5 if extent span is 0\n * @param {number} val\n * @return {number}\n */\n\n\nScale.prototype.normalize = function (val) {\n var extent = this._extent;\n\n if (extent[1] === extent[0]) {\n return 0.5;\n }\n\n return (val - extent[0]) / (extent[1] - extent[0]);\n};\n/**\n * Scale normalized value\n * @param {number} val\n * @return {number}\n */\n\n\nScale.prototype.scale = function (val) {\n var extent = this._extent;\n return val * (extent[1] - extent[0]) + extent[0];\n};\n/**\n * Set extent from data\n * @param {Array.} other\n */\n\n\nScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power\n // this.setExtent(extent[0], extent[1]);\n};\n/**\n * Set extent from data\n * @param {module:echarts/data/List} data\n * @param {string} dim\n */\n\n\nScale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n};\n/**\n * Get extent\n * @return {Array.}\n */\n\n\nScale.prototype.getExtent = function () {\n return this._extent.slice();\n};\n/**\n * Set extent\n * @param {number} start\n * @param {number} end\n */\n\n\nScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent;\n\n if (!isNaN(start)) {\n thisExtent[0] = start;\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = end;\n }\n};\n/**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */\n\n\nScale.prototype.isBlank = function () {\n return this._isBlank;\n},\n/**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */\nScale.prototype.setBlank = function (isBlank) {\n this._isBlank = isBlank;\n};\n/**\n * @abstract\n * @param {*} tick\n * @return {string} label of the tick.\n */\n\nScale.prototype.getLabel = null;\nclazzUtil.enableClassExtend(Scale);\nclazzUtil.enableClassManagement(Scale, {\n registerWhenExtend: true\n});\nvar _default = Scale;\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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar isObject = _util.isObject;\nvar map = _util.map;\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 * @constructor\n * @param {Object} [opt]\n * @param {Object} [opt.categories=[]]\n * @param {Object} [opt.needCollect=false]\n * @param {Object} [opt.deduplication=false]\n */\nfunction OrdinalMeta(opt) {\n /**\n * @readOnly\n * @type {Array.}\n */\n this.categories = opt.categories || [];\n /**\n * @private\n * @type {boolean}\n */\n\n this._needCollect = opt.needCollect;\n /**\n * @private\n * @type {boolean}\n */\n\n this._deduplication = opt.deduplication;\n /**\n * @private\n * @type {boolean}\n */\n\n this._map;\n}\n/**\n * @param {module:echarts/model/Model} axisModel\n * @return {module:echarts/data/OrdinalMeta}\n */\n\n\nOrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n};\n\nvar proto = OrdinalMeta.prototype;\n/**\n * @param {string} category\n * @return {number} ordinal\n */\n\nproto.getOrdinal = function (category) {\n return getOrCreateMap(this).get(category);\n};\n/**\n * @param {*} category\n * @return {number} The ordinal. If not found, return NaN.\n */\n\n\nproto.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (typeof category !== 'string' && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = getOrCreateMap(this);\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category;\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n}; // Consider big data, do not create map until needed.\n\n\nfunction getOrCreateMap(ordinalMeta) {\n return ordinalMeta._map || (ordinalMeta._map = createHashMap(ordinalMeta.categories));\n}\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nvar _default = OrdinalMeta;\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 Scale = require(\"./Scale\");\n\nvar OrdinalMeta = require(\"../data/OrdinalMeta\");\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 * Linear continuous scale\n * @module echarts/coord/scale/Ordinal\n *\n * http://en.wikipedia.org/wiki/Level_of_measurement\n */\n// FIXME only one data\nvar scaleProto = Scale.prototype;\nvar OrdinalScale = Scale.extend({\n type: 'ordinal',\n\n /**\n * @param {module:echarts/data/OrdianlMeta|Array.} ordinalMeta\n */\n init: function (ordinalMeta, extent) {\n // Caution: Should not use instanceof, consider ec-extensions using\n // import approach to get OrdinalMeta class.\n if (!ordinalMeta || zrUtil.isArray(ordinalMeta)) {\n ordinalMeta = new OrdinalMeta({\n categories: ordinalMeta\n });\n }\n\n this._ordinalMeta = ordinalMeta;\n this._extent = extent || [0, ordinalMeta.categories.length - 1];\n },\n parse: function (val) {\n return typeof val === 'string' ? this._ordinalMeta.getOrdinal(val) // val might be float.\n : Math.round(val);\n },\n contain: function (rank) {\n rank = this.parse(rank);\n return scaleProto.contain.call(this, rank) && this._ordinalMeta.categories[rank] != null;\n },\n\n /**\n * Normalize given rank or name to linear [0, 1]\n * @param {number|string} [val]\n * @return {number}\n */\n normalize: function (val) {\n return scaleProto.normalize.call(this, this.parse(val));\n },\n scale: function (val) {\n return Math.round(scaleProto.scale.call(this, val));\n },\n\n /**\n * @return {Array}\n */\n getTicks: function () {\n var ticks = [];\n var extent = this._extent;\n var rank = extent[0];\n\n while (rank <= extent[1]) {\n ticks.push(rank);\n rank++;\n }\n\n return ticks;\n },\n\n /**\n * Get item on rank n\n * @param {number} n\n * @return {string}\n */\n getLabel: function (n) {\n if (!this.isBlank()) {\n // Note that if no data, ordinalMeta.categories is an empty array.\n return this._ordinalMeta.categories[n];\n }\n },\n\n /**\n * @return {number}\n */\n count: function () {\n return this._extent[1] - this._extent[0] + 1;\n },\n\n /**\n * @override\n */\n unionExtentFromData: function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n },\n getOrdinalMeta: function () {\n return this._ordinalMeta;\n },\n niceTicks: zrUtil.noop,\n niceExtent: zrUtil.noop\n});\n/**\n * @return {module:echarts/scale/Time}\n */\n\nOrdinalScale.create = function () {\n return new OrdinalScale();\n};\n\nvar _default = OrdinalScale;\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 numberUtil = require(\"../util/number\");\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 testable.\n */\nvar roundNumber = numberUtil.round;\n/**\n * @param {Array.} extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param {number} splitNumber splitNumber should be >= 1.\n * @param {number} [minInterval]\n * @param {number} [maxInterval]\n * @return {Object} {interval, intervalPrecision, niceTickExtent}\n */\n\nfunction intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = numberUtil.nice(span / splitNumber, true);\n\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n } // Tow more digital for tick.\n\n\n var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent\n\n var niceTickExtent = result.niceTickExtent = [roundNumber(Math.ceil(extent[0] / interval) * interval, precision), roundNumber(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\n/**\n * @param {number} interval\n * @return {number} interval precision\n */\n\n\nfunction getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return numberUtil.getPrecisionSafe(interval) + 2;\n}\n\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n} // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\n\n\nfunction fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\n\nexports.intervalScaleNiceTicks = intervalScaleNiceTicks;\nexports.getIntervalPrecision = getIntervalPrecision;\nexports.fixExtent = fixExtent;","\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 numberUtil = require(\"../util/number\");\n\nvar formatUtil = require(\"../util/format\");\n\nvar Scale = require(\"./Scale\");\n\nvar helper = require(\"./helper\");\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 * Interval scale\n * @module echarts/scale/Interval\n */\nvar roundNumber = numberUtil.round;\n/**\n * @alias module:echarts/coord/scale/Interval\n * @constructor\n */\n\nvar IntervalScale = Scale.extend({\n type: 'interval',\n _interval: 0,\n _intervalPrecision: 2,\n setExtent: function (start, end) {\n var thisExtent = this._extent; //start,end may be a Number like '25',so...\n\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n },\n unionExtent: function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes\n\n IntervalScale.prototype.setExtent.call(this, extent[0], extent[1]);\n },\n\n /**\n * Get interval\n */\n getInterval: function () {\n return this._interval;\n },\n\n /**\n * Set interval\n */\n setInterval: function (interval) {\n this._interval = interval; // Dropped auto calculated niceExtent and use user setted extent\n // We assume user wan't to set both interval, min, max to get a better result\n\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n },\n\n /**\n * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.\n * @return {Array.}\n */\n getTicks: function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push(roundNumber(niceTickExtent[0] - interval, intervalPrecision));\n } else {\n ticks.push(extent[0]);\n }\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push(tick); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1]) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1];\n\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push(roundNumber(lastNiceTick + interval, intervalPrecision));\n } else {\n ticks.push(extent[1]);\n }\n }\n\n return ticks;\n },\n\n /**\n * @param {number} [splitNumber=5]\n * @return {Array.>}\n */\n getMinorTicks: function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick - prevTick;\n var minorInterval = interval / splitNumber;\n\n while (count < splitNumber - 1) {\n var minorTick = numberUtil.round(prevTick + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber.\n\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n\n count++;\n }\n\n minorTicks.push(minorTicksGroup);\n }\n\n return minorTicks;\n },\n\n /**\n * @param {number} data\n * @param {Object} [opt]\n * @param {number|string} [opt.precision] If 'auto', use nice presision.\n * @param {boolean} [opt.pad] returns 1.50 but not 1.5 if precision is 2.\n * @return {string}\n */\n getLabel: function (data, opt) {\n if (data == null) {\n return '';\n }\n\n var precision = opt && opt.precision;\n\n if (precision == null) {\n precision = numberUtil.getPrecisionSafe(data) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n } // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n\n\n data = roundNumber(data, precision, true);\n return formatUtil.addCommas(data);\n },\n\n /**\n * Update interval and extent of intervals for nice ticks\n *\n * @param {number} [splitNumber = 5] Desired number of ticks\n * @param {number} [minInterval]\n * @param {number} [maxInterval]\n */\n niceTicks: function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (!isFinite(span)) {\n return;\n } // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n\n\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n },\n\n /**\n * Nice extent.\n * @param {Object} opt\n * @param {number} [opt.splitNumber = 5] Given approx tick number\n * @param {boolean} [opt.fixMin=false]\n * @param {boolean} [opt.fixMax=false]\n * @param {boolean} [opt.minInterval]\n * @param {boolean} [opt.maxInterval]\n */\n niceExtent: function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n var expandSize = extent[0]; // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n\n var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity]\n\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // var extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n }\n});\n/**\n * @return {module:echarts/scale/Time}\n */\n\nIntervalScale.create = function () {\n return new IntervalScale();\n};\n\nvar _default = IntervalScale;\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 _number = require(\"../util/number\");\n\nvar parsePercent = _number.parsePercent;\n\nvar _dataStackHelper = require(\"../data/helper/dataStackHelper\");\n\nvar isDimensionStacked = _dataStackHelper.isDimensionStacked;\n\nvar createRenderPlanner = require(\"../chart/helper/createRenderPlanner\");\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/* global Float32Array */\nvar STACK_PREFIX = '__ec_stack_';\nvar LARGE_BAR_MIN_WIDTH = 0.5;\nvar LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(axis) {\n return axis.dim + axis.index;\n}\n/**\n * @param {Object} opt\n * @param {module:echarts/coord/Axis} opt.axis Only support category axis currently.\n * @param {number} opt.count Positive interger.\n * @param {number} [opt.barWidth]\n * @param {number} [opt.barMaxWidth]\n * @param {number} [opt.barMinWidth]\n * @param {number} [opt.barGap]\n * @param {number} [opt.barCategoryGap]\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\n */\n\n\nfunction getLayoutOnAxis(opt) {\n var params = [];\n var baseAxis = opt.axis;\n var axisKey = 'axis0';\n\n if (baseAxis.type !== 'category') {\n return;\n }\n\n var bandWidth = baseAxis.getBandWidth();\n\n for (var i = 0; i < opt.count || 0; i++) {\n params.push(zrUtil.defaults({\n bandWidth: bandWidth,\n axisKey: axisKey,\n stackId: STACK_PREFIX + i\n }, opt));\n }\n\n var widthAndOffsets = doCalBarWidthAndOffset(params);\n var result = [];\n\n for (var i = 0; i < opt.count; i++) {\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\n item.offsetCenter = item.offset + item.width / 2;\n result.push(item);\n }\n\n return result;\n}\n\nfunction prepareLayoutBarSeries(seriesType, ecModel) {\n var seriesModels = [];\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for cartesian2d only\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\n seriesModels.push(seriesModel);\n }\n });\n return seriesModels;\n}\n/**\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\n * values.\n * This works for time axes, value axes, and log axes.\n * For a single time axis, return value is in the form like\n * {'x_0': [1000000]}.\n * The value of 1000000 is in milliseconds.\n */\n\n\nfunction getValueAxesMinGaps(barSeries) {\n /**\n * Map from axis.index to values.\n * For a single time axis, axisValues is in the form like\n * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\n * Items in axisValues[x], e.g. 1495555200000, are time values of all\n * series.\n */\n var axisValues = {};\n zrUtil.each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\n return;\n }\n\n var data = seriesModel.getData();\n var key = baseAxis.dim + '_' + baseAxis.index;\n var dim = data.mapDimension(baseAxis.dim);\n\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\n var value = data.get(dim, i);\n\n if (!axisValues[key]) {\n // No previous data for the axis\n axisValues[key] = [value];\n } else {\n // No value in previous series\n axisValues[key].push(value);\n } // Ignore duplicated time values in the same axis\n\n }\n });\n var axisMinGaps = [];\n\n for (var key in axisValues) {\n if (axisValues.hasOwnProperty(key)) {\n var valuesInAxis = axisValues[key];\n\n if (valuesInAxis) {\n // Sort axis values into ascending order to calculate gaps\n valuesInAxis.sort(function (a, b) {\n return a - b;\n });\n var min = null;\n\n for (var j = 1; j < valuesInAxis.length; ++j) {\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\n\n if (delta > 0) {\n // Ignore 0 delta because they are of the same axis value\n min = min === null ? delta : Math.min(min, delta);\n }\n } // Set to null if only have one data\n\n\n axisMinGaps[key] = min;\n }\n }\n }\n\n return axisMinGaps;\n}\n\nfunction makeColumnLayout(barSeries) {\n var axisMinGaps = getValueAxesMinGaps(barSeries);\n var seriesInfoList = [];\n zrUtil.each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n var minGap = axisMinGaps[key];\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\n var scale = baseAxis.scale.getExtent();\n var scaleSpan = Math.abs(scale[1] - scale[0]);\n bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value\n } else {\n var data = seriesModel.getData();\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n }\n\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barMinWidth = parsePercent( // barMinWidth by default is 1 in cartesian. Because in value axis,\n // the auto-calculated bar width might be less than 1.\n seriesModel.get('barMinWidth') || 1, bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n seriesInfoList.push({\n bandWidth: bandWidth,\n barWidth: barWidth,\n barMaxWidth: barMaxWidth,\n barMinWidth: barMinWidth,\n barGap: barGap,\n barCategoryGap: barCategoryGap,\n axisKey: getAxisKey(baseAxis),\n stackId: getSeriesStackId(seriesModel)\n });\n });\n return doCalBarWidthAndOffset(seriesInfoList);\n}\n\nfunction doCalBarWidthAndOffset(seriesInfoList) {\n // Columns info on each category axis. Key is cartesian name\n var columnsMap = {};\n zrUtil.each(seriesInfoList, function (seriesInfo, idx) {\n var axisKey = seriesInfo.axisKey;\n var bandWidth = seriesInfo.bandWidth;\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = seriesInfo.stackId;\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n }; // Caution: In a single coordinate system, these barGrid attributes\n // will be shared by series. Consider that they have default values,\n // only the attributes set on the last series will work.\n // Do not change this fact unless there will be a break change.\n\n var barWidth = seriesInfo.barWidth;\n\n if (barWidth && !stacks[stackId].width) {\n // See #6312, do not restrict width.\n stacks[stackId].width = barWidth;\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n var barMaxWidth = seriesInfo.barMaxWidth;\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n var barMinWidth = seriesInfo.barMinWidth;\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\n var barGap = seriesInfo.barGap;\n barGap != null && (columnsOnAxis.gap = barGap);\n var barCategoryGap = seriesInfo.barCategoryGap;\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column) {\n var maxWidth = column.maxWidth;\n var minWidth = column.minWidth;\n\n if (!column.width) {\n var finalWidth = autoWidth;\n\n if (maxWidth && maxWidth < finalWidth) {\n finalWidth = Math.min(maxWidth, remainedWidth);\n } // `minWidth` has higher priority. `minWidth` decide that wheter the\n // bar is able to be visible. So `minWidth` should not be restricted\n // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\n // the extreme cases for `value` axis, bars are allowed to overlap\n // with each other if `minWidth` specified.\n\n\n if (minWidth && minWidth > finalWidth) {\n finalWidth = minWidth;\n }\n\n if (finalWidth !== autoWidth) {\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n } else {\n // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n // CSS does. Becuase barWidth can be a percent value, where\n // `barMaxWidth` can be used to restrict the final width.\n var finalWidth = column.width;\n\n if (maxWidth) {\n finalWidth = Math.min(finalWidth, maxWidth);\n } // `minWidth` has higher priority, as described above\n\n\n if (minWidth) {\n finalWidth = Math.max(finalWidth, minWidth);\n }\n\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n bandWidth: bandWidth,\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n/**\n * @param {Object} barWidthAndOffset The result of makeColumnLayout\n * @param {module:echarts/coord/Axis} axis\n * @param {module:echarts/model/Series} [seriesModel] If not provided, return all.\n * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided.\n */\n\n\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\n if (barWidthAndOffset && axis) {\n var result = barWidthAndOffset[getAxisKey(axis)];\n\n if (result != null && seriesModel != null) {\n result = result[getSeriesStackId(seriesModel)];\n }\n\n return result;\n }\n}\n/**\n * @param {string} seriesType\n * @param {module:echarts/model/Global} ecModel\n */\n\n\nfunction layout(seriesType, ecModel) {\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\n var barWidthAndOffset = makeColumnLayout(seriesModels);\n var lastStackCoords = {};\n var lastStackCoordsOrigin = {};\n zrUtil.each(seriesModels, function (seriesModel) {\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n lastStackCoordsOrigin[stackId] = lastStackCoordsOrigin[stackId] || []; // Fix #4243\n\n data.setLayout({\n bandWidth: columnLayoutInfo.bandWidth,\n offset: columnOffset,\n size: columnWidth\n });\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var stacked = isDimensionStacked(data, valueDim\n /*, baseDim*/\n );\n var isValueAxisH = valueAxis.isHorizontal();\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis, stacked);\n\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n var value = data.get(valueDim, idx);\n var baseValue = data.get(baseDim, idx);\n var sign = value >= 0 ? 'p' : 'n';\n var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n\n if (stacked) {\n // Only ordinal axis can be stacked.\n if (!lastStackCoords[stackId][baseValue]) {\n lastStackCoords[stackId][baseValue] = {\n p: valueAxisStart,\n // Positive stack\n n: valueAxisStart // Negative stack\n\n };\n } // Should also consider #4243\n\n\n baseCoord = lastStackCoords[stackId][baseValue][sign];\n }\n\n var x;\n var y;\n var width;\n var height;\n\n if (isValueAxisH) {\n var coord = cartesian.dataToPoint([value, baseValue]);\n x = baseCoord;\n y = coord[1] + columnOffset;\n width = coord[0] - valueAxisStart;\n height = columnWidth;\n\n if (Math.abs(width) < barMinHeight) {\n width = (width < 0 ? -1 : 1) * barMinHeight;\n } // Ignore stack from NaN value\n\n\n if (!isNaN(width)) {\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\n }\n } else {\n var coord = cartesian.dataToPoint([baseValue, value]);\n x = coord[0] + columnOffset;\n y = baseCoord;\n width = columnWidth;\n height = coord[1] - valueAxisStart;\n\n if (Math.abs(height) < barMinHeight) {\n // Include zero to has a positive bar\n height = (height <= 0 ? -1 : 1) * barMinHeight;\n } // Ignore stack from NaN value\n\n\n if (!isNaN(height)) {\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\n }\n }\n\n data.setItemLayout(idx, {\n x: x,\n y: y,\n width: width,\n height: height\n });\n }\n }, this);\n} // TODO: Do not support stack in large mode yet.\n\n\nvar largeLayout = {\n seriesType: 'bar',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var coordLayout = cartesian.grid.getRect();\n var baseAxis = cartesian.getBaseAxis();\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var valueAxisHorizontal = valueAxis.isHorizontal();\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\n\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\n // jshint ignore:line\n barWidth = LARGE_BAR_MIN_WIDTH;\n }\n\n return {\n progress: progress\n };\n\n function progress(params, data) {\n var count = params.count;\n var largePoints = new LargeArr(count * 2);\n var largeBackgroundPoints = new LargeArr(count * 2);\n var largeDataIndices = new LargeArr(count);\n var dataIndex;\n var coord = [];\n var valuePair = [];\n var pointsOffset = 0;\n var idxOffset = 0;\n\n while ((dataIndex = params.next()) != null) {\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\n coord = cartesian.dataToPoint(valuePair, null, coord); // Data index might not be in order, depends on `progressiveChunkMode`.\n\n largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\n largePoints[pointsOffset++] = coord[0];\n largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\n largePoints[pointsOffset++] = coord[1];\n largeDataIndices[idxOffset++] = dataIndex;\n }\n\n data.setLayout({\n largePoints: largePoints,\n largeDataIndices: largeDataIndices,\n largeBackgroundPoints: largeBackgroundPoints,\n barWidth: barWidth,\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\n valueAxisHorizontal: valueAxisHorizontal\n });\n }\n }\n};\n\nfunction isOnCartesian(seriesModel) {\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\n\nfunction isInLargeMode(seriesModel) {\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\n} // See cases in `test/bar-start.html` and `#7412`, `#8747`.\n\n\nfunction getValueAxisStart(baseAxis, valueAxis, stacked) {\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\n}\n\nexports.getLayoutOnAxis = getLayoutOnAxis;\nexports.prepareLayoutBarSeries = prepareLayoutBarSeries;\nexports.makeColumnLayout = makeColumnLayout;\nexports.retrieveColumnLayout = retrieveColumnLayout;\nexports.layout = layout;\nexports.largeLayout = largeLayout;","\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 numberUtil = require(\"../util/number\");\n\nvar formatUtil = require(\"../util/format\");\n\nvar scaleHelper = require(\"./helper\");\n\nvar IntervalScale = require(\"./Interval\");\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* A third-party license is embeded for some of the code in this file:\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\n// [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design have\n// concidered these common case:\n// (1) Time that is persistent in server is in UTC, but it is needed to be diplayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\nvar intervalScaleProto = IntervalScale.prototype;\nvar mathCeil = Math.ceil;\nvar mathFloor = Math.floor;\nvar ONE_SECOND = 1000;\nvar ONE_MINUTE = ONE_SECOND * 60;\nvar ONE_HOUR = ONE_MINUTE * 60;\nvar ONE_DAY = ONE_HOUR * 24; // FIXME 公用?\n\nvar bisect = function (a, x, lo, hi) {\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n\n if (a[mid][1] < x) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n\n return lo;\n};\n/**\n * @alias module:echarts/coord/scale/Time\n * @constructor\n */\n\n\nvar TimeScale = IntervalScale.extend({\n type: 'time',\n\n /**\n * @override\n */\n getLabel: function (val) {\n var stepLvl = this._stepLvl;\n var date = new Date(val);\n return formatUtil.formatTime(stepLvl[0], date, this.getSetting('useUTC'));\n },\n\n /**\n * @override\n */\n niceExtent: function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n // Expand extent\n extent[0] -= ONE_DAY;\n extent[1] += ONE_DAY;\n } // If there are no data and extent are [Infinity, -Infinity]\n\n\n if (extent[1] === -Infinity && extent[0] === Infinity) {\n var d = new Date();\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\n extent[0] = extent[1] - ONE_DAY;\n }\n\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // var extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = numberUtil.round(mathFloor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = numberUtil.round(mathCeil(extent[1] / interval) * interval);\n }\n },\n\n /**\n * @override\n */\n niceTicks: function (approxTickNum, minInterval, maxInterval) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n var approxInterval = span / approxTickNum;\n\n if (minInterval != null && approxInterval < minInterval) {\n approxInterval = minInterval;\n }\n\n if (maxInterval != null && approxInterval > maxInterval) {\n approxInterval = maxInterval;\n }\n\n var scaleLevelsLen = scaleLevels.length;\n var idx = bisect(scaleLevels, approxInterval, 0, scaleLevelsLen);\n var level = scaleLevels[Math.min(idx, scaleLevelsLen - 1)];\n var interval = level[1]; // Same with interval scale if span is much larger than 1 year\n\n if (level[0] === 'year') {\n var yearSpan = span / interval; // From \"Nice Numbers for Graph Labels\" of Graphic Gems\n // var niceYearSpan = numberUtil.nice(yearSpan, false);\n\n var yearStep = numberUtil.nice(yearSpan / approxTickNum, true);\n interval *= yearStep;\n }\n\n var timezoneOffset = this.getSetting('useUTC') ? 0 : new Date(+extent[0] || +extent[1]).getTimezoneOffset() * 60 * 1000;\n var niceExtent = [Math.round(mathCeil((extent[0] - timezoneOffset) / interval) * interval + timezoneOffset), Math.round(mathFloor((extent[1] - timezoneOffset) / interval) * interval + timezoneOffset)];\n scaleHelper.fixExtent(niceExtent, extent);\n this._stepLvl = level; // Interval will be used in getTicks\n\n this._interval = interval;\n this._niceExtent = niceExtent;\n },\n parse: function (val) {\n // val might be float.\n return +numberUtil.parseDate(val);\n }\n});\nzrUtil.each(['contain', 'normalize'], function (methodName) {\n TimeScale.prototype[methodName] = function (val) {\n return intervalScaleProto[methodName].call(this, this.parse(val));\n };\n});\n/**\n * This implementation was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\n\nvar scaleLevels = [// Format interval\n['hh:mm:ss', ONE_SECOND], // 1s\n['hh:mm:ss', ONE_SECOND * 5], // 5s\n['hh:mm:ss', ONE_SECOND * 10], // 10s\n['hh:mm:ss', ONE_SECOND * 15], // 15s\n['hh:mm:ss', ONE_SECOND * 30], // 30s\n['hh:mm\\nMM-dd', ONE_MINUTE], // 1m\n['hh:mm\\nMM-dd', ONE_MINUTE * 5], // 5m\n['hh:mm\\nMM-dd', ONE_MINUTE * 10], // 10m\n['hh:mm\\nMM-dd', ONE_MINUTE * 15], // 15m\n['hh:mm\\nMM-dd', ONE_MINUTE * 30], // 30m\n['hh:mm\\nMM-dd', ONE_HOUR], // 1h\n['hh:mm\\nMM-dd', ONE_HOUR * 2], // 2h\n['hh:mm\\nMM-dd', ONE_HOUR * 6], // 6h\n['hh:mm\\nMM-dd', ONE_HOUR * 12], // 12h\n['MM-dd\\nyyyy', ONE_DAY], // 1d\n['MM-dd\\nyyyy', ONE_DAY * 2], // 2d\n['MM-dd\\nyyyy', ONE_DAY * 3], // 3d\n['MM-dd\\nyyyy', ONE_DAY * 4], // 4d\n['MM-dd\\nyyyy', ONE_DAY * 5], // 5d\n['MM-dd\\nyyyy', ONE_DAY * 6], // 6d\n['week', ONE_DAY * 7], // 7d\n['MM-dd\\nyyyy', ONE_DAY * 10], // 10d\n['week', ONE_DAY * 14], // 2w\n['week', ONE_DAY * 21], // 3w\n['month', ONE_DAY * 31], // 1M\n['week', ONE_DAY * 42], // 6w\n['month', ONE_DAY * 62], // 2M\n['week', ONE_DAY * 70], // 10w\n['quarter', ONE_DAY * 95], // 3M\n['month', ONE_DAY * 31 * 4], // 4M\n['month', ONE_DAY * 31 * 5], // 5M\n['half-year', ONE_DAY * 380 / 2], // 6M\n['month', ONE_DAY * 31 * 8], // 8M\n['month', ONE_DAY * 31 * 10], // 10M\n['year', ONE_DAY * 380] // 1Y\n];\n/**\n * @param {module:echarts/model/Model}\n * @return {module:echarts/scale/Time}\n */\n\nTimeScale.create = function (model) {\n return new TimeScale({\n useUTC: model.ecModel.get('useUTC')\n });\n};\n\nvar _default = TimeScale;\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 Scale = require(\"./Scale\");\n\nvar numberUtil = require(\"../util/number\");\n\nvar IntervalScale = require(\"./Interval\");\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 * Log scale\n * @module echarts/scale/Log\n */\n// Use some method of IntervalScale\nvar scaleProto = Scale.prototype;\nvar intervalScaleProto = IntervalScale.prototype;\nvar getPrecisionSafe = numberUtil.getPrecisionSafe;\nvar roundingErrorFix = numberUtil.round;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar mathPow = Math.pow;\nvar mathLog = Math.log;\nvar LogScale = Scale.extend({\n type: 'log',\n base: 10,\n $constructor: function () {\n Scale.apply(this, arguments);\n this._originalScale = new IntervalScale();\n },\n\n /**\n * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.\n * @return {Array.}\n */\n getTicks: function (expandToNicedExtent) {\n var originalScale = this._originalScale;\n var extent = this._extent;\n var originalExtent = originalScale.getExtent();\n return zrUtil.map(intervalScaleProto.getTicks.call(this, expandToNicedExtent), function (val) {\n var powVal = numberUtil.round(mathPow(this.base, val)); // Fix #4158\n\n powVal = val === extent[0] && originalScale.__fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal;\n powVal = val === extent[1] && originalScale.__fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal;\n return powVal;\n }, this);\n },\n\n /**\n * @param {number} splitNumber\n * @return {Array.>}\n */\n getMinorTicks: intervalScaleProto.getMinorTicks,\n\n /**\n * @param {number} val\n * @return {string}\n */\n getLabel: intervalScaleProto.getLabel,\n\n /**\n * @param {number} val\n * @return {number}\n */\n scale: function (val) {\n val = scaleProto.scale.call(this, val);\n return mathPow(this.base, val);\n },\n\n /**\n * @param {number} start\n * @param {number} end\n */\n setExtent: function (start, end) {\n var base = this.base;\n start = mathLog(start) / mathLog(base);\n end = mathLog(end) / mathLog(base);\n intervalScaleProto.setExtent.call(this, start, end);\n },\n\n /**\n * @return {number} end\n */\n getExtent: function () {\n var base = this.base;\n var extent = scaleProto.getExtent.call(this);\n extent[0] = mathPow(base, extent[0]);\n extent[1] = mathPow(base, extent[1]); // Fix #4158\n\n var originalScale = this._originalScale;\n var originalExtent = originalScale.getExtent();\n originalScale.__fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\n originalScale.__fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\n return extent;\n },\n\n /**\n * @param {Array.} extent\n */\n unionExtent: function (extent) {\n this._originalScale.unionExtent(extent);\n\n var base = this.base;\n extent[0] = mathLog(extent[0]) / mathLog(base);\n extent[1] = mathLog(extent[1]) / mathLog(base);\n scaleProto.unionExtent.call(this, extent);\n },\n\n /**\n * @override\n */\n unionExtentFromData: function (data, dim) {\n // TODO\n // filter value that <= 0\n this.unionExtent(data.getApproximateExtent(dim));\n },\n\n /**\n * Update interval and extent of intervals for nice ticks\n * @param {number} [approxTickNum = 10] Given approx tick number\n */\n niceTicks: function (approxTickNum) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (span === Infinity || span <= 0) {\n return;\n }\n\n var interval = numberUtil.quantity(span);\n var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count.\n\n if (err <= 0.5) {\n interval *= 10;\n } // Interval should be integer\n\n\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\n interval *= 10;\n }\n\n var niceExtent = [numberUtil.round(mathCeil(extent[0] / interval) * interval), numberUtil.round(mathFloor(extent[1] / interval) * interval)];\n this._interval = interval;\n this._niceExtent = niceExtent;\n },\n\n /**\n * Nice extent.\n * @override\n */\n niceExtent: function (opt) {\n intervalScaleProto.niceExtent.call(this, opt);\n var originalScale = this._originalScale;\n originalScale.__fixMin = opt.fixMin;\n originalScale.__fixMax = opt.fixMax;\n }\n});\nzrUtil.each(['contain', 'normalize'], function (methodName) {\n LogScale.prototype[methodName] = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleProto[methodName].call(this, val);\n };\n});\n\nLogScale.create = function () {\n return new LogScale();\n};\n\nfunction fixRoundingError(val, originalVal) {\n return roundingErrorFix(val, getPrecisionSafe(originalVal));\n}\n\nvar _default = LogScale;\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 OrdinalScale = require(\"../scale/Ordinal\");\n\nvar IntervalScale = require(\"../scale/Interval\");\n\nvar Scale = require(\"../scale/Scale\");\n\nvar numberUtil = require(\"../util/number\");\n\nvar _barGrid = require(\"../layout/barGrid\");\n\nvar prepareLayoutBarSeries = _barGrid.prepareLayoutBarSeries;\nvar makeColumnLayout = _barGrid.makeColumnLayout;\nvar retrieveColumnLayout = _barGrid.retrieveColumnLayout;\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nrequire(\"../scale/Time\");\n\nrequire(\"../scale/Log\");\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 * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n */\nfunction getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n var fixMin = min != null;\n var fixMax = max != null;\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: fixMin,\n fixMax: fixMax\n };\n}\n\nfunction adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\n // Get Axis Length\n var axisExtent = model.axis.getExtent();\n var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow\n\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n\n if (barsOnCurrentAxis === undefined) {\n return {\n min: min,\n max: max\n };\n }\n\n var minOverflow = Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n minOverflow = Math.min(item.offset, minOverflow);\n });\n var maxOverflow = -Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n });\n minOverflow = Math.abs(minOverflow);\n maxOverflow = Math.abs(maxOverflow);\n var totalOverFlow = minOverflow + maxOverflow; // Calulate required buffer based on old range and overflow\n\n var oldRange = max - min;\n var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n max += overflowBuffer * (maxOverflow / totalOverFlow);\n min -= overflowBuffer * (minOverflow / totalOverFlow);\n return {\n min: min,\n max: max\n };\n}\n\nfunction niceScaleExtent(scale, model) {\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale.type === 'log') {\n scale.base = model.get('logBase');\n }\n\n var scaleType = scale.type;\n scale.setExtent(extent[0], extent[1]);\n scale.niceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('minInterval') : null,\n maxInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('maxInterval') : null\n }); // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n\n var interval = model.get('interval');\n\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}\n/**\n * @param {module:echarts/model/Model} model\n * @param {string} [axisType] Default retrieve from model.type\n * @return {module:echarts/scale/*}\n */\n\n\nfunction createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale(model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), [Infinity, -Infinity]);\n\n case 'value':\n return new IntervalScale();\n // Extended scale, like time and log\n\n default:\n return (Scale.getClass(axisType) || IntervalScale).create(model);\n }\n }\n}\n/**\n * Check if the axis corss 0\n */\n\n\nfunction ifAxisCrossZero(axis) {\n var dataExtent = axis.scale.getExtent();\n var min = dataExtent[0];\n var max = dataExtent[1];\n return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\n * @param {module:echarts/coord/Axis} axis\n * @return {Function} Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not requied.\n * return: {string} label string.\n */\n\n\nfunction makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n\n if (typeof labelFormatter === 'string') {\n labelFormatter = function (tpl) {\n return function (val) {\n // For category axis, get raw value; for numeric axis,\n // get foramtted label like '1,333,444'.\n val = axis.scale.getLabel(val);\n return tpl.replace('{value}', val != null ? val : '');\n };\n }(labelFormatter); // Consider empty array\n\n\n return labelFormatter;\n } else if (typeof labelFormatter === 'function') {\n return function (tickValue, idx) {\n // The original intention of `idx` is \"the index of the tick in all ticks\".\n // But the previous implementation of category axis do not consider the\n // `axisLabel.interval`, which cause that, for example, the `interval` is\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n // the definition here for back compatibility.\n if (categoryTickStart != null) {\n idx = tickValue - categoryTickStart;\n }\n\n return labelFormatter(getAxisRawValue(axis, tickValue), idx);\n };\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\n\nfunction getAxisRawValue(axis, value) {\n // In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n return axis.type === 'category' ? axis.scale.getLabel(value) : value;\n}\n/**\n * @param {module:echarts/coord/Axis} axis\n * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels.\n */\n\n\nfunction estimateLabelUnionRect(axis) {\n var axisModel = axis.model;\n var scale = axis.scale;\n\n if (!axisModel.get('axisLabel.show') || scale.isBlank()) {\n return;\n }\n\n var isCategory = axis.type === 'category';\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`.\n\n if (isCategory) {\n tickCount = scale.count();\n } else {\n realNumberScaleTicks = scale.getTicks();\n tickCount = realNumberScaleTicks.length;\n }\n\n var axisLabelModel = axis.getLabelModel();\n var labelFormatter = makeLabelFormatter(axis);\n var rect;\n var step = 1; // Simple optimization for large amount of labels\n\n if (tickCount > 40) {\n step = Math.ceil(tickCount / 40);\n }\n\n for (var i = 0; i < tickCount; i += step) {\n var tickValue = realNumberScaleTicks ? realNumberScaleTicks[i] : categoryScaleExtent[0] + i;\n var label = labelFormatter(tickValue);\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n rect ? rect.union(singleRect) : rect = singleRect;\n }\n\n return rect;\n}\n\nfunction rotateTextRect(textRect, rotate) {\n var rotateRadians = rotate * Math.PI / 180;\n var boundingBox = textRect.plain();\n var beforeWidth = boundingBox.width;\n var beforeHeight = boundingBox.height;\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\n * @param {module:echarts/src/model/Model} model axisLabelModel or axisTickModel\n * @return {number|String} Can be null|'auto'|number|function\n */\n\n\nfunction getOptionCategoryInterval(model) {\n var interval = model.get('interval');\n return interval == null ? 'auto' : interval;\n}\n/**\n * Set `categoryInterval` as 0 implicitly indicates that\n * show all labels reguardless of overlap.\n * @param {Object} axis axisModel.axis\n * @return {boolean}\n */\n\n\nfunction shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\n\nexports.getScaleExtent = getScaleExtent;\nexports.niceScaleExtent = niceScaleExtent;\nexports.createScaleByModel = createScaleByModel;\nexports.ifAxisCrossZero = ifAxisCrossZero;\nexports.makeLabelFormatter = makeLabelFormatter;\nexports.getAxisRawValue = getAxisRawValue;\nexports.estimateLabelUnionRect = estimateLabelUnionRect;\nexports.getOptionCategoryInterval = getOptionCategoryInterval;\nexports.shouldShowAllLabels = shouldShowAllLabels;","\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\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// import * as axisHelper from './axisHelper';\nvar _default = {\n /**\n * @param {boolean} origin\n * @return {number|string} min value or 'dataMin' or null/undefined (means auto) or NaN\n */\n getMin: function (origin) {\n var option = this.option;\n var min = !origin && option.rangeStart != null ? option.rangeStart : option.min;\n\n if (this.axis && min != null && min !== 'dataMin' && typeof min !== 'function' && !zrUtil.eqNaN(min)) {\n min = this.axis.scale.parse(min);\n }\n\n return min;\n },\n\n /**\n * @param {boolean} origin\n * @return {number|string} max value or 'dataMax' or null/undefined (means auto) or NaN\n */\n getMax: function (origin) {\n var option = this.option;\n var max = !origin && option.rangeEnd != null ? option.rangeEnd : option.max;\n\n if (this.axis && max != null && max !== 'dataMax' && typeof max !== 'function' && !zrUtil.eqNaN(max)) {\n max = this.axis.scale.parse(max);\n }\n\n return max;\n },\n\n /**\n * @return {boolean}\n */\n getNeedCrossZero: function () {\n var option = this.option;\n return option.rangeStart != null || option.rangeEnd != null ? false : !option.scale;\n },\n\n /**\n * Should be implemented by each axis model if necessary.\n * @return {module:echarts/model/Component} coordinate system model\n */\n getCoordSysModel: zrUtil.noop,\n\n /**\n * @param {number} rangeStart Can only be finite number or null/undefined or NaN.\n * @param {number} rangeEnd Can only be finite number or null/undefined or NaN.\n */\n setRange: function (rangeStart, rangeEnd) {\n this.option.rangeStart = rangeStart;\n this.option.rangeEnd = rangeEnd;\n },\n\n /**\n * Reset range\n */\n resetRange: function () {\n // rangeStart and rangeEnd is readonly.\n this.option.rangeStart = this.option.rangeEnd = null;\n }\n};\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 graphic = require(\"./graphic\");\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar _text = require(\"zrender/lib/contain/text\");\n\nvar calculateTextPosition = _text.calculateTextPosition;\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// Symbol factory\n\n/**\n * Triangle shape\n * @inner\n */\nvar Triangle = graphic.extendShape({\n type: 'triangle',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy + height);\n path.lineTo(cx - width, cy + height);\n path.closePath();\n }\n});\n/**\n * Diamond shape\n * @inner\n */\n\nvar Diamond = graphic.extendShape({\n type: 'diamond',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy);\n path.lineTo(cx, cy + height);\n path.lineTo(cx - width, cy);\n path.closePath();\n }\n});\n/**\n * Pin shape\n * @inner\n */\n\nvar Pin = graphic.extendShape({\n type: 'pin',\n shape: {\n // x, y on the cusp\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var x = shape.x;\n var y = shape.y;\n var w = shape.width / 5 * 3; // Height must be larger than width\n\n var h = Math.max(w, shape.height);\n var r = w / 2; // Dist on y with tangent point and circle center\n\n var dy = r * r / (h - r);\n var cy = y - h + r + dy;\n var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center\n\n var dx = Math.cos(angle) * r;\n var tanX = Math.sin(angle);\n var tanY = Math.cos(angle);\n var cpLen = r * 0.6;\n var cpLen2 = r * 0.7;\n path.moveTo(x - dx, cy + dy);\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\n path.closePath();\n }\n});\n/**\n * Arrow shape\n * @inner\n */\n\nvar Arrow = graphic.extendShape({\n type: 'arrow',\n shape: {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var height = shape.height;\n var width = shape.width;\n var x = shape.x;\n var y = shape.y;\n var dx = width / 3 * 2;\n ctx.moveTo(x, y);\n ctx.lineTo(x + dx, y + height);\n ctx.lineTo(x, y + height / 4 * 3);\n ctx.lineTo(x - dx, y + height);\n ctx.lineTo(x, y);\n ctx.closePath();\n }\n});\n/**\n * Map of path contructors\n * @type {Object.}\n */\n\nvar symbolCtors = {\n line: graphic.Line,\n rect: graphic.Rect,\n roundRect: graphic.Rect,\n square: graphic.Rect,\n circle: graphic.Circle,\n diamond: Diamond,\n pin: Pin,\n arrow: Arrow,\n triangle: Triangle\n};\nvar symbolShapeMakers = {\n line: function (x, y, w, h, shape) {\n // FIXME\n shape.x1 = x;\n shape.y1 = y + h / 2;\n shape.x2 = x + w;\n shape.y2 = y + h / 2;\n },\n rect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n },\n roundRect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n shape.r = Math.min(w, h) / 4;\n },\n square: function (x, y, w, h, shape) {\n var size = Math.min(w, h);\n shape.x = x;\n shape.y = y;\n shape.width = size;\n shape.height = size;\n },\n circle: function (x, y, w, h, shape) {\n // Put circle in the center of square\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.r = Math.min(w, h) / 2;\n },\n diamond: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n pin: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n arrow: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n triangle: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n }\n};\nvar symbolBuildProxies = {};\nzrUtil.each(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.extendShape({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n calculateTextPosition: function (out, style, rect) {\n var res = calculateTextPosition(out, style, rect);\n var shape = this.shape;\n\n if (shape && shape.symbolType === 'pin' && style.textPosition === 'inside') {\n res.y = rect.y + rect.height * 0.4;\n }\n\n return res;\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n\n if (symbolType !== 'none') {\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (!proxySymbol) {\n // Default rect\n symbolType = 'rect';\n proxySymbol = symbolBuildProxies[symbolType];\n }\n\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\n }\n }\n}); // Provide setColor helper method to avoid determine if set the fill or stroke outside\n\nfunction symbolPathSetColor(color, innerColor) {\n if (this.type !== 'image') {\n var symbolStyle = this.style;\n var symbolShape = this.shape;\n\n if (symbolShape && symbolShape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff';\n } else {\n // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ?\n symbolStyle.fill && (symbolStyle.fill = color);\n symbolStyle.stroke && (symbolStyle.stroke = color);\n }\n\n this.dirty(false);\n }\n}\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolType\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h,\n * for path and image only.\n */\n\n\nfunction createSymbol(symbolType, x, y, w, h, color, keepAspect) {\n // TODO Support image object, DynamicImage.\n var isEmpty = symbolType.indexOf('empty') === 0;\n\n if (isEmpty) {\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n }\n\n var symbolPath;\n\n if (symbolType.indexOf('image://') === 0) {\n symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else if (symbolType.indexOf('path://') === 0) {\n symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else {\n symbolPath = new SymbolClz({\n shape: {\n symbolType: symbolType,\n x: x,\n y: y,\n width: w,\n height: h\n }\n });\n }\n\n symbolPath.__isEmptyBrush = isEmpty;\n symbolPath.setColor = symbolPathSetColor;\n symbolPath.setColor(color);\n return symbolPath;\n}\n\nexports.createSymbol = createSymbol;","\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 createListFromArray = require(\"./chart/helper/createListFromArray\");\n\nvar axisHelper = require(\"./coord/axisHelper\");\n\nvar axisModelCommonMixin = require(\"./coord/axisModelCommonMixin\");\n\nvar Model = require(\"./model/Model\");\n\nvar _layout = require(\"./util/layout\");\n\nvar getLayoutRect = _layout.getLayoutRect;\nexports.getLayoutRect = _layout.getLayoutRect;\n\nvar _dataStackHelper = require(\"./data/helper/dataStackHelper\");\n\nvar enableDataStack = _dataStackHelper.enableDataStack;\nvar isDimensionStacked = _dataStackHelper.isDimensionStacked;\nvar getStackedDimension = _dataStackHelper.getStackedDimension;\n\nvar _completeDimensions = require(\"./data/helper/completeDimensions\");\n\nexports.completeDimensions = _completeDimensions;\n\nvar _createDimensions = require(\"./data/helper/createDimensions\");\n\nexports.createDimensions = _createDimensions;\n\nvar _symbol = require(\"./util/symbol\");\n\nexports.createSymbol = _symbol.createSymbol;\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// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge';\n\n/**\n * Create a muti dimension List structure from seriesModel.\n * @param {module:echarts/model/Model} seriesModel\n * @return {module:echarts/data/List} list\n */\nfunction createList(seriesModel) {\n return createListFromArray(seriesModel.getSource(), seriesModel);\n} // export function createGraph(seriesModel) {\n// var nodes = seriesModel.get('data');\n// var links = seriesModel.get('links');\n// return createGraphFromNodeEdge(nodes, links, seriesModel);\n// }\n\n\nvar dataStack = {\n isDimensionStacked: isDimensionStacked,\n enableDataStack: enableDataStack,\n getStackedDimension: getStackedDimension\n};\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolDesc\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n */\n\n/**\n * Create scale\n * @param {Array.} dataExtent\n * @param {Object|module:echarts/Model} option\n */\nfunction createScale(dataExtent, option) {\n var axisModel = option;\n\n if (!Model.isInstance(option)) {\n axisModel = new Model(option);\n zrUtil.mixin(axisModel, axisModelCommonMixin);\n }\n\n var scale = axisHelper.createScaleByModel(axisModel);\n scale.setExtent(dataExtent[0], dataExtent[1]);\n axisHelper.niceScaleExtent(scale, axisModel);\n return scale;\n}\n/**\n * Mixin common methods to axis model,\n *\n * Inlcude methods\n * `getFormattedLabels() => Array.`\n * `getCategories() => Array.`\n * `getMin(origin: boolean) => number`\n * `getMax(origin: boolean) => number`\n * `getNeedCrossZero() => boolean`\n * `setRange(start: number, end: number)`\n * `resetRange()`\n */\n\n\nfunction mixinAxisModelCommonMethods(Model) {\n zrUtil.mixin(Model, axisModelCommonMixin);\n}\n\nexports.createList = createList;\nexports.dataStack = dataStack;\nexports.createScale = createScale;\nexports.mixinAxisModelCommonMethods = mixinAxisModelCommonMethods;","var windingLine = require(\"./windingLine\");\n\nvar EPSILON = 1e-8;\n\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\n\nfunction contain(points, x, y) {\n var w = 0;\n var p = points[0];\n\n if (!p) {\n return false;\n }\n\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n } // Close polygon\n\n\n var p0 = points[0];\n\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n\n return w !== 0;\n}\n\nexports.contain = contain;","\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 bbox = require(\"zrender/lib/core/bbox\");\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar polygonContain = require(\"zrender/lib/contain/polygon\");\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 * @module echarts/coord/geo/Region\n */\n\n/**\n * @param {string|Region} name\n * @param {Array} geometries\n * @param {Array.} cp\n */\nfunction Region(name, geometries, cp) {\n /**\n * @type {string}\n * @readOnly\n */\n this.name = name;\n /**\n * @type {Array.}\n * @readOnly\n */\n\n this.geometries = geometries;\n\n if (!cp) {\n var rect = this.getBoundingRect();\n cp = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n } else {\n cp = [cp[0], cp[1]];\n }\n /**\n * @type {Array.}\n */\n\n\n this.center = cp;\n}\n\nRegion.prototype = {\n constructor: Region,\n properties: null,\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function () {\n var rect = this._rect;\n\n if (rect) {\n return rect;\n }\n\n var MAX_NUMBER = Number.MAX_VALUE;\n var min = [MAX_NUMBER, MAX_NUMBER];\n var max = [-MAX_NUMBER, -MAX_NUMBER];\n var min2 = [];\n var max2 = [];\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon\n if (geometries[i].type !== 'polygon') {\n continue;\n } // Doesn't consider hole\n\n\n var exterior = geometries[i].exterior;\n bbox.fromPoints(exterior, min2, max2);\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return this._rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n },\n\n /**\n * @param {} coord\n * @return {boolean}\n */\n contain: function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n },\n transformTo: function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n for (var p = 0; p < exterior.length; p++) {\n vec2.applyTransform(exterior[p], exterior[p], transform);\n }\n\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\n for (var p = 0; p < interiors[h].length; p++) {\n vec2.applyTransform(interiors[h][p], interiors[h][p], transform);\n }\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this.center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n },\n cloneShallow: function (name) {\n name == null && (name = this.name);\n var newRegion = new Region(name, this.geometries, this.center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n }\n};\nvar _default = Region;\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 Region = require(\"./Region\");\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 * Parse and decode geo json\n * @module echarts/coord/geo/parseGeoJson\n */\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var encodeScale = json.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = json.features;\n\n for (var f = 0; f < features.length; f++) {\n var feature = features[f];\n var geometry = feature.geometry;\n var coordinates = geometry.coordinates;\n var encodeOffsets = geometry.encodeOffsets;\n\n for (var c = 0; c < coordinates.length; c++) {\n var coordinate = coordinates[c];\n\n if (geometry.type === 'Polygon') {\n coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale);\n } else if (geometry.type === 'MultiPolygon') {\n for (var c2 = 0; c2 < coordinate.length; c2++) {\n var polygon = coordinate[c2];\n coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale);\n }\n }\n }\n } // Has been decoded\n\n\n json.UTF8Encoding = false;\n return json;\n}\n\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n/**\n * @alias module:echarts/coord/geo/parseGeoJson\n * @param {Object} geoJson\n * @param {string} nameProperty\n * @return {module:zrender/container/Group}\n */\n\n\nfunction _default(geoJson, nameProperty) {\n decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var coordinates = geo.coordinates;\n var geometries = [];\n\n if (geo.type === 'Polygon') {\n geometries.push({\n type: 'polygon',\n // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n exterior: coordinates[0],\n interiors: coordinates.slice(1)\n });\n }\n\n if (geo.type === 'MultiPolygon') {\n zrUtil.each(coordinates, function (item) {\n if (item[0]) {\n geometries.push({\n type: 'polygon',\n exterior: item[0],\n interiors: item.slice(1)\n });\n }\n });\n }\n\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}\n\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 textContain = require(\"zrender/lib/contain/text\");\n\nvar _model = require(\"../util/model\");\n\nvar makeInner = _model.makeInner;\n\nvar _axisHelper = require(\"./axisHelper\");\n\nvar makeLabelFormatter = _axisHelper.makeLabelFormatter;\nvar getOptionCategoryInterval = _axisHelper.getOptionCategoryInterval;\nvar shouldShowAllLabels = _axisHelper.shouldShowAllLabels;\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 inner = makeInner();\n/**\n * @param {module:echats/coord/Axis} axis\n * @return {Object} {\n * labels: [{\n * formattedLabel: string,\n * rawLabel: string,\n * tickValue: number\n * }, ...],\n * labelCategoryInterval: number\n * }\n */\n\nfunction createAxisLabels(axis) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);\n}\n/**\n * @param {module:echats/coord/Axis} axis\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\n * @return {Object} {\n * ticks: Array.\n * tickCategoryInterval: number\n * }\n */\n\n\nfunction createAxisTicks(axis, tickModel) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: axis.scale.getTicks()\n };\n}\n\nfunction makeCategoryLabels(axis) {\n var labelModel = axis.getLabelModel();\n var result = makeCategoryLabelsActually(axis, labelModel);\n return !labelModel.get('show') || axis.scale.isBlank() ? {\n labels: [],\n labelCategoryInterval: result.labelCategoryInterval\n } : result;\n}\n\nfunction makeCategoryLabelsActually(axis, labelModel) {\n var labelsCache = getListCache(axis, 'labels');\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\n var result = listCacheGet(labelsCache, optionLabelInterval);\n\n if (result) {\n return result;\n }\n\n var labels;\n var numericLabelInterval;\n\n if (zrUtil.isFunction(optionLabelInterval)) {\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n } else {\n numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval;\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n } // Cache to avoid calling interval function repeatly.\n\n\n return listCacheSet(labelsCache, optionLabelInterval, {\n labels: labels,\n labelCategoryInterval: numericLabelInterval\n });\n}\n\nfunction makeCategoryTicks(axis, tickModel) {\n var ticksCache = getListCache(axis, 'ticks');\n var optionTickInterval = getOptionCategoryInterval(tickModel);\n var result = listCacheGet(ticksCache, optionTickInterval);\n\n if (result) {\n return result;\n }\n\n var ticks;\n var tickCategoryInterval; // Optimize for the case that large category data and no label displayed,\n // we should not return all ticks.\n\n if (!tickModel.get('show') || axis.scale.isBlank()) {\n ticks = [];\n }\n\n if (zrUtil.isFunction(optionTickInterval)) {\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n } // Always use label interval by default despite label show. Consider this\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n // labels. `splitLine` and `axisTick` should be consistent in this case.\n else if (optionTickInterval === 'auto') {\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\n tickCategoryInterval = labelsResult.labelCategoryInterval;\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n return labelItem.tickValue;\n });\n } else {\n tickCategoryInterval = optionTickInterval;\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n } // Cache to avoid calling interval function repeatly.\n\n\n return listCacheSet(ticksCache, optionTickInterval, {\n ticks: ticks,\n tickCategoryInterval: tickCategoryInterval\n });\n}\n\nfunction makeRealNumberLabels(axis) {\n var ticks = axis.scale.getTicks();\n var labelFormatter = makeLabelFormatter(axis);\n return {\n labels: zrUtil.map(ticks, function (tickValue, idx) {\n return {\n formattedLabel: labelFormatter(tickValue, idx),\n rawLabel: axis.scale.getLabel(tickValue),\n tickValue: tickValue\n };\n })\n };\n} // Large category data calculation is performence sensitive, and ticks and label\n// probably be fetched by multiple times. So we cache the result.\n// axis is created each time during a ec process, so we do not need to clear cache.\n\n\nfunction getListCache(axis, prop) {\n // Because key can be funciton, and cache size always be small, we use array cache.\n return inner(axis)[prop] || (inner(axis)[prop] = []);\n}\n\nfunction listCacheGet(cache, key) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].key === key) {\n return cache[i].value;\n }\n }\n}\n\nfunction listCacheSet(cache, key, value) {\n cache.push({\n key: key,\n value: value\n });\n return value;\n}\n\nfunction makeAutoCategoryInterval(axis) {\n var result = inner(axis).autoInterval;\n return result != null ? result : inner(axis).autoInterval = axis.calculateCategoryInterval();\n}\n/**\n * Calculate interval for category axis ticks and labels.\n * To get precise result, at least one of `getRotate` and `isHorizontal`\n * should be implemented in axis.\n */\n\n\nfunction calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtend0 === axisExtent[0] && cache.axisExtend1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtend0 = axisExtent[0];\n cache.axisExtend1 = axisExtent[1];\n }\n\n return interval;\n}\n\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n var labelModel = axis.getLabelModel();\n return {\n axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n labelRotate: labelModel.get('rotate') || 0,\n font: labelModel.getFont()\n };\n}\n\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n var labelFormatter = makeLabelFormatter(axis);\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n var labelModel = axis.getLabelModel();\n var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n\n var step = Math.max((categoryInterval || 0) + 1, 1);\n var startTick = ordinalExtent[0];\n var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent\n // while zooming and moving while interval > 0. Otherwise the selection\n // of displayable ticks and symbols probably keep changing.\n // 3 is empirical value.\n\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n startTick = Math.round(Math.ceil(startTick / step) * step);\n } // (1) Only add min max label here but leave overlap checking\n // to render stage, which also ensure the returned list\n // suitable for splitLine and splitArea rendering.\n // (2) Scales except category always contain min max label so\n // do not need to perform this process.\n\n\n var showAllLabel = shouldShowAllLabels(axis);\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\n addItem(ordinalExtent[0]);\n } // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n\n\n var tickValue = startTick;\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n addItem(tickValue);\n }\n\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n addItem(ordinalExtent[1]);\n }\n\n function addItem(tVal) {\n result.push(onlyTick ? tVal : {\n formattedLabel: labelFormatter(tVal),\n rawLabel: ordinalScale.getLabel(tVal),\n tickValue: tVal\n });\n }\n\n return result;\n} // When interval is function, the result `false` means ignore the tick.\n// It is time consuming for large category data.\n\n\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}\n\nexports.createAxisLabels = createAxisLabels;\nexports.createAxisTicks = createAxisTicks;\nexports.calculateCategoryInterval = calculateCategoryInterval;","\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 _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar map = _util.map;\n\nvar _number = require(\"../util/number\");\n\nvar linearMap = _number.linearMap;\nvar getPixelPrecision = _number.getPixelPrecision;\nvar round = _number.round;\n\nvar _axisTickLabelBuilder = require(\"./axisTickLabelBuilder\");\n\nvar createAxisTicks = _axisTickLabelBuilder.createAxisTicks;\nvar createAxisLabels = _axisTickLabelBuilder.createAxisLabels;\nvar calculateCategoryInterval = _axisTickLabelBuilder.calculateCategoryInterval;\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 NORMALIZED_EXTENT = [0, 1];\n/**\n * Base class of Axis.\n * @constructor\n */\n\nvar Axis = function (dim, scale, extent) {\n /**\n * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'.\n * @type {string}\n */\n this.dim = dim;\n /**\n * Axis scale\n * @type {module:echarts/coord/scale/*}\n */\n\n this.scale = scale;\n /**\n * @type {Array.}\n * @private\n */\n\n this._extent = extent || [0, 0];\n /**\n * @type {boolean}\n */\n\n this.inverse = false;\n /**\n * Usually true when axis has a ordinal scale\n * @type {boolean}\n */\n\n this.onBand = false;\n};\n\nAxis.prototype = {\n constructor: Axis,\n\n /**\n * If axis extent contain given coord\n * @param {number} coord\n * @return {boolean}\n */\n contain: function (coord) {\n var extent = this._extent;\n var min = Math.min(extent[0], extent[1]);\n var max = Math.max(extent[0], extent[1]);\n return coord >= min && coord <= max;\n },\n\n /**\n * If axis extent contain given data\n * @param {number} data\n * @return {boolean}\n */\n containData: function (data) {\n return this.scale.contain(data);\n },\n\n /**\n * Get coord extent.\n * @return {Array.}\n */\n getExtent: function () {\n return this._extent.slice();\n },\n\n /**\n * Get precision used for formatting\n * @param {Array.} [dataExtent]\n * @return {number}\n */\n getPixelPrecision: function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n },\n\n /**\n * Set coord extent\n * @param {number} start\n * @param {number} end\n */\n setExtent: function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n },\n\n /**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n * @param {number} data\n * @param {boolean} clamp\n * @return {number}\n */\n dataToCoord: function (data, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n data = scale.normalize(data);\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n },\n\n /**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n * @param {number} coord\n * @param {boolean} clamp\n * @return {number}\n */\n coordToData: function (coord, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n return this.scale.scale(t);\n },\n\n /**\n * Convert pixel point to data in axis\n * @param {Array.} point\n * @param {boolean} clamp\n * @return {number} data\n */\n pointToData: function (point, clamp) {// Should be implemented in derived class if necessary.\n },\n\n /**\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n * `axis.getTicksCoords` considers `onBand`, which is used by\n * `boundaryGap:true` of category axis and splitLine and splitArea.\n * @param {Object} [opt]\n * @param {Model} [opt.tickModel=axis.model.getModel('axisTick')]\n * @param {boolean} [opt.clamp] If `true`, the first and the last\n * tick must be at the axis end points. Otherwise, clip ticks\n * that outside the axis extent.\n * @return {Array.} [{\n * coord: ...,\n * tickValue: ...\n * }, ...]\n */\n getTicksCoords: function (opt) {\n opt = opt || {};\n var tickModel = opt.tickModel || this.getTickModel();\n var result = createAxisTicks(this, tickModel);\n var ticks = result.ticks;\n var ticksCoords = map(ticks, function (tickValue) {\n return {\n coord: this.dataToCoord(tickValue),\n tickValue: tickValue\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n },\n\n /**\n * @return {Array.>} [{ coord: ..., tickValue: ...}]\n */\n getMinorTicksCoords: function () {\n if (this.scale.type === 'ordinal') {\n // Category axis doesn't support minor ticks\n return [];\n }\n\n var minorTickModel = this.model.getModel('minorTick');\n var splitNumber = minorTickModel.get('splitNumber'); // Protection.\n\n if (!(splitNumber > 0 && splitNumber < 100)) {\n splitNumber = 5;\n }\n\n var minorTicks = this.scale.getMinorTicks(splitNumber);\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n return map(minorTicksGroup, function (minorTick) {\n return {\n coord: this.dataToCoord(minorTick),\n tickValue: minorTick\n };\n }, this);\n }, this);\n return minorTicksCoords;\n },\n\n /**\n * @return {Array.} [{\n * formattedLabel: string,\n * rawLabel: axis.scale.getLabel(tickValue)\n * tickValue: number\n * }, ...]\n */\n getViewLabels: function () {\n return createAxisLabels(this).labels;\n },\n\n /**\n * @return {module:echarts/coord/model/Model}\n */\n getLabelModel: function () {\n return this.model.getModel('axisLabel');\n },\n\n /**\n * Notice here we only get the default tick model. For splitLine\n * or splitArea, we should pass the splitLineModel or splitAreaModel\n * manually when calling `getTicksCoords`.\n * In GL, this method may be overrided to:\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n * @return {module:echarts/coord/model/Model}\n */\n getTickModel: function () {\n return this.model.getModel('axisTick');\n },\n\n /**\n * Get width of band\n * @return {number}\n */\n getBandWidth: function () {\n var axisExtent = this._extent;\n var dataExtent = this.scale.getExtent();\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data.\n\n len === 0 && (len = 1);\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\n return Math.abs(size) / len;\n },\n\n /**\n * @abstract\n * @return {boolean} Is horizontal\n */\n isHorizontal: null,\n\n /**\n * @abstract\n * @return {number} Get axis rotate, by degree.\n */\n getRotate: null,\n\n /**\n * Only be called in category axis.\n * Can be overrided, consider other axes like in 3D.\n * @return {number} Auto interval for cateogry axis tick and label\n */\n calculateCategoryInterval: function () {\n return calculateCategoryInterval(this);\n }\n};\n\nfunction fixExtentWithBands(extent, nTick) {\n var size = extent[1] - extent[0];\n var len = nTick;\n var margin = size / len / 2;\n extent[0] += margin;\n extent[1] -= margin;\n} // If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\n\n\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}\n\nvar _default = Axis;\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 zrender = require(\"zrender/lib/zrender\");\n\nexports.zrender = zrender;\n\nvar matrix = require(\"zrender/lib/core/matrix\");\n\nexports.matrix = matrix;\n\nvar vector = require(\"zrender/lib/core/vector\");\n\nexports.vector = vector;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar colorTool = require(\"zrender/lib/tool/color\");\n\nexports.color = colorTool;\n\nvar graphicUtil = require(\"./util/graphic\");\n\nvar numberUtil = require(\"./util/number\");\n\nexports.number = numberUtil;\n\nvar formatUtil = require(\"./util/format\");\n\nexports.format = formatUtil;\n\nvar _throttle = require(\"./util/throttle\");\n\nvar throttle = _throttle.throttle;\nexports.throttle = _throttle.throttle;\n\nvar ecHelper = require(\"./helper\");\n\nexports.helper = ecHelper;\n\nvar parseGeoJSON = require(\"./coord/geo/parseGeoJson\");\n\nexports.parseGeoJSON = parseGeoJSON;\n\nvar _List = require(\"./data/List\");\n\nexports.List = _List;\n\nvar _Model = require(\"./model/Model\");\n\nexports.Model = _Model;\n\nvar _Axis = require(\"./coord/Axis\");\n\nexports.Axis = _Axis;\n\nvar _env = require(\"zrender/lib/core/env\");\n\nexports.env = _env;\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 * Do not mount those modules on 'src/echarts' for better tree shaking.\n */\nvar parseGeoJson = parseGeoJSON;\nvar ecUtil = {};\nzrUtil.each(['map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter', 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction', 'extend', 'defaults', 'clone', 'merge'], function (name) {\n ecUtil[name] = zrUtil[name];\n});\nvar graphic = {};\nzrUtil.each(['extendShape', 'extendPath', 'makePath', 'makeImage', 'mergePath', 'resizePath', 'createIcon', 'setHoverStyle', 'setLabelStyle', 'setTextStyle', 'setText', 'getFont', 'updateProps', 'initProps', 'getTransform', 'clipPointsByRect', 'clipRectByRect', 'registerShape', 'getShapeClass', 'Group', 'Image', 'Text', 'Circle', 'Sector', 'Ring', 'Polygon', 'Polyline', 'Rect', 'Line', 'BezierCurve', 'Arc', 'IncrementalDisplayable', 'CompoundPath', 'LinearGradient', 'RadialGradient', 'BoundingRect'], function (name) {\n graphic[name] = graphicUtil[name];\n});\nexports.parseGeoJson = parseGeoJson;\nexports.util = ecUtil;\nexports.graphic = graphic;","\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 zrender = require(\"zrender/lib/zrender\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar colorTool = require(\"zrender/lib/tool/color\");\n\nvar env = require(\"zrender/lib/core/env\");\n\nvar timsort = require(\"zrender/lib/core/timsort\");\n\nvar Eventful = require(\"zrender/lib/mixin/Eventful\");\n\nvar GlobalModel = require(\"./model/Global\");\n\nvar ExtensionAPI = require(\"./ExtensionAPI\");\n\nvar CoordinateSystemManager = require(\"./CoordinateSystem\");\n\nvar OptionManager = require(\"./model/OptionManager\");\n\nvar backwardCompat = require(\"./preprocessor/backwardCompat\");\n\nvar dataStack = require(\"./processor/dataStack\");\n\nvar ComponentModel = require(\"./model/Component\");\n\nvar SeriesModel = require(\"./model/Series\");\n\nvar ComponentView = require(\"./view/Component\");\n\nvar ChartView = require(\"./view/Chart\");\n\nvar graphic = require(\"./util/graphic\");\n\nvar modelUtil = require(\"./util/model\");\n\nvar _throttle = require(\"./util/throttle\");\n\nvar throttle = _throttle.throttle;\n\nvar seriesColor = require(\"./visual/seriesColor\");\n\nvar aria = require(\"./visual/aria\");\n\nvar loadingDefault = require(\"./loading/default\");\n\nvar Scheduler = require(\"./stream/Scheduler\");\n\nvar lightTheme = require(\"./theme/light\");\n\nvar darkTheme = require(\"./theme/dark\");\n\nrequire(\"./component/dataset\");\n\nvar mapDataStorage = require(\"./coord/geo/mapDataStorage\");\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 assert = zrUtil.assert;\nvar each = zrUtil.each;\nvar isFunction = zrUtil.isFunction;\nvar isObject = zrUtil.isObject;\nvar parseClassType = ComponentModel.parseClassType;\nvar version = '4.9.0';\nvar dependencies = {\n zrender: '4.3.2'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800;\nvar PRIORITY_PROCESSOR_DATASTACK = 900;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 3500;\nvar PRIORITY_VISUAL_COMPONENT = 4000; // FIXME\n// necessary?\n\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY = {\n PROCESSOR: {\n FILTER: PRIORITY_PROCESSOR_FILTER,\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n },\n VISUAL: {\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\n CHART: PRIORITY_VISUAL_CHART,\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\n BRUSH: PRIORITY_VISUAL_BRUSH\n }\n}; // Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\n\nvar IN_MAIN_PROCESS = '__flagInMainProcess';\nvar OPTION_UPDATED = '__optionUpdated';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\n\nfunction createRegisterEventWithLowercaseName(method, ignoreDisposed) {\n return function (eventName, handler, context) {\n if (!ignoreDisposed && this._disposed) {\n disposedWarning(this.id);\n return;\n } // Event name is all lowercase\n\n\n eventName = eventName && eventName.toLowerCase();\n Eventful.prototype[method].call(this, eventName, handler, context);\n };\n}\n/**\n * @module echarts~MessageCenter\n */\n\n\nfunction MessageCenter() {\n Eventful.call(this);\n}\n\nMessageCenter.prototype.on = createRegisterEventWithLowercaseName('on', true);\nMessageCenter.prototype.off = createRegisterEventWithLowercaseName('off', true);\nMessageCenter.prototype.one = createRegisterEventWithLowercaseName('one', true);\nzrUtil.mixin(MessageCenter, Eventful);\n/**\n * @module echarts~ECharts\n */\n\nfunction ECharts(dom, theme, opts) {\n opts = opts || {}; // Get theme by name\n\n if (typeof theme === 'string') {\n theme = themeStorage[theme];\n }\n /**\n * @type {string}\n */\n\n\n this.id;\n /**\n * Group id\n * @type {string}\n */\n\n this.group;\n /**\n * @type {HTMLElement}\n * @private\n */\n\n this._dom = dom;\n var defaultRenderer = 'canvas';\n\n /**\n * @type {module:zrender/ZRender}\n * @private\n */\n var zr = this._zr = zrender.init(dom, {\n renderer: opts.renderer || defaultRenderer,\n devicePixelRatio: opts.devicePixelRatio,\n width: opts.width,\n height: opts.height\n });\n /**\n * Expect 60 fps.\n * @type {Function}\n * @private\n */\n\n this._throttledZrFlush = throttle(zrUtil.bind(zr.flush, zr), 17);\n var theme = zrUtil.clone(theme);\n theme && backwardCompat(theme, true);\n /**\n * @type {Object}\n * @private\n */\n\n this._theme = theme;\n /**\n * @type {Array.}\n * @private\n */\n\n this._chartsViews = [];\n /**\n * @type {Object.}\n * @private\n */\n\n this._chartsMap = {};\n /**\n * @type {Array.}\n * @private\n */\n\n this._componentsViews = [];\n /**\n * @type {Object.}\n * @private\n */\n\n this._componentsMap = {};\n /**\n * @type {module:echarts/CoordinateSystem}\n * @private\n */\n\n this._coordSysMgr = new CoordinateSystemManager();\n /**\n * @type {module:echarts/ExtensionAPI}\n * @private\n */\n\n var api = this._api = createExtensionAPI(this); // Sort on demand\n\n function prioritySortFunc(a, b) {\n return a.__prio - b.__prio;\n }\n\n timsort(visualFuncs, prioritySortFunc);\n timsort(dataProcessorFuncs, prioritySortFunc);\n /**\n * @type {module:echarts/stream/Scheduler}\n */\n\n this._scheduler = new Scheduler(this, api, dataProcessorFuncs, visualFuncs);\n Eventful.call(this, this._ecEventProcessor = new EventProcessor());\n /**\n * @type {module:echarts~MessageCenter}\n * @private\n */\n\n this._messageCenter = new MessageCenter(); // Init mouse events\n\n this._initEvents(); // In case some people write `window.onresize = chart.resize`\n\n\n this.resize = zrUtil.bind(this.resize, this); // Can't dispatch action during rendering procedure\n\n this._pendingActions = [];\n zr.animation.on('frame', this._onframe, this);\n bindRenderedEvent(zr, this); // ECharts instance can be used as value.\n\n zrUtil.setAsPrimitive(this);\n}\n\nvar echartsProto = ECharts.prototype;\n\nechartsProto._onframe = function () {\n if (this._disposed) {\n return;\n }\n\n var scheduler = this._scheduler; // Lazy update\n\n if (this[OPTION_UPDATED]) {\n var silent = this[OPTION_UPDATED].silent;\n this[IN_MAIN_PROCESS] = true;\n prepare(this);\n updateMethods.update.call(this);\n this[IN_MAIN_PROCESS] = false;\n this[OPTION_UPDATED] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n } // Avoid do both lazy update and progress in one frame.\n else if (scheduler.unfinished) {\n // Stream progress.\n var remainTime = TEST_FRAME_REMAIN_TIME;\n var ecModel = this._model;\n var api = this._api;\n scheduler.unfinished = false;\n\n do {\n var startTime = +new Date();\n scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold.\n\n scheduler.performDataProcessorTasks(ecModel);\n updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in\n // each frame is not a good user experience. So we follow the rule that\n // the extent of the coordinate system is determin in the first frame (the\n // frame is executed immedietely after task reset.\n // this._coordSysMgr.update(ecModel, api);\n // console.log('--- ec frame visual ---', remainTime);\n\n scheduler.performVisualTasks(ecModel);\n renderSeries(this, this._model, api, 'remain');\n remainTime -= +new Date() - startTime;\n } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event.\n\n\n if (!scheduler.unfinished) {\n this._zr.flush();\n } // Else, zr flushing be ensue within the same frame,\n // because zr flushing is after onframe event.\n\n }\n};\n/**\n * @return {HTMLElement}\n */\n\n\nechartsProto.getDom = function () {\n return this._dom;\n};\n/**\n * @return {module:zrender~ZRender}\n */\n\n\nechartsProto.getZr = function () {\n return this._zr;\n};\n/**\n * Usage:\n * chart.setOption(option, notMerge, lazyUpdate);\n * chart.setOption(option, {\n * notMerge: ...,\n * lazyUpdate: ...,\n * silent: ...\n * });\n *\n * @param {Object} option\n * @param {Object|boolean} [opts] opts or notMerge.\n * @param {boolean} [opts.notMerge=false]\n * @param {boolean} [opts.lazyUpdate=false] Useful when setOption frequently.\n */\n\n\nechartsProto.setOption = function (option, notMerge, lazyUpdate) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var silent;\n\n if (isObject(notMerge)) {\n lazyUpdate = notMerge.lazyUpdate;\n silent = notMerge.silent;\n notMerge = notMerge.notMerge;\n }\n\n this[IN_MAIN_PROCESS] = true;\n\n if (!this._model || notMerge) {\n var optionManager = new OptionManager(this._api);\n var theme = this._theme;\n var ecModel = this._model = new GlobalModel();\n ecModel.scheduler = this._scheduler;\n ecModel.init(null, null, theme, optionManager);\n }\n\n this._model.setOption(option, optionPreprocessorFuncs);\n\n if (lazyUpdate) {\n this[OPTION_UPDATED] = {\n silent: silent\n };\n this[IN_MAIN_PROCESS] = false;\n } else {\n prepare(this);\n updateMethods.update.call(this); // Ensure zr refresh sychronously, and then pixel in canvas can be\n // fetched after `setOption`.\n\n this._zr.flush();\n\n this[OPTION_UPDATED] = false;\n this[IN_MAIN_PROCESS] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n};\n/**\n * @DEPRECATED\n */\n\n\nechartsProto.setTheme = function () {\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\n};\n/**\n * @return {module:echarts/model/Global}\n */\n\n\nechartsProto.getModel = function () {\n return this._model;\n};\n/**\n * @return {Object}\n */\n\n\nechartsProto.getOption = function () {\n return this._model && this._model.getOption();\n};\n/**\n * @return {number}\n */\n\n\nechartsProto.getWidth = function () {\n return this._zr.getWidth();\n};\n/**\n * @return {number}\n */\n\n\nechartsProto.getHeight = function () {\n return this._zr.getHeight();\n};\n/**\n * @return {number}\n */\n\n\nechartsProto.getDevicePixelRatio = function () {\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\n};\n/**\n * Get canvas which has all thing rendered\n * @param {Object} opts\n * @param {string} [opts.backgroundColor]\n * @return {string}\n */\n\n\nechartsProto.getRenderedCanvas = function (opts) {\n if (!env.canvasSupported) {\n return;\n }\n\n opts = opts || {};\n opts.pixelRatio = opts.pixelRatio || 1;\n opts.backgroundColor = opts.backgroundColor || this._model.get('backgroundColor');\n var zr = this._zr; // var list = zr.storage.getDisplayList();\n // Stop animations\n // Never works before in init animation, so remove it.\n // zrUtil.each(list, function (el) {\n // el.stopAnimation(true);\n // });\n\n return zr.painter.getRenderedCanvas(opts);\n};\n/**\n * Get svg data url\n * @return {string}\n */\n\n\nechartsProto.getSvgDataURL = function () {\n if (!env.svgSupported) {\n return;\n }\n\n var zr = this._zr;\n var list = zr.storage.getDisplayList(); // Stop animations\n\n zrUtil.each(list, function (el) {\n el.stopAnimation(true);\n });\n return zr.painter.toDataURL();\n};\n/**\n * @return {string}\n * @param {Object} opts\n * @param {string} [opts.type='png']\n * @param {string} [opts.pixelRatio=1]\n * @param {string} [opts.backgroundColor]\n * @param {string} [opts.excludeComponents]\n */\n\n\nechartsProto.getDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n opts = opts || {};\n var excludeComponents = opts.excludeComponents;\n var ecModel = this._model;\n var excludesComponentViews = [];\n var self = this;\n each(excludeComponents, function (componentType) {\n ecModel.eachComponent({\n mainType: componentType\n }, function (component) {\n var view = self._componentsMap[component.__viewId];\n\n if (!view.group.ignore) {\n excludesComponentViews.push(view);\n view.group.ignore = true;\n }\n });\n });\n var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n each(excludesComponentViews, function (view) {\n view.group.ignore = false;\n });\n return url;\n};\n/**\n * @return {string}\n * @param {Object} opts\n * @param {string} [opts.type='png']\n * @param {string} [opts.pixelRatio=1]\n * @param {string} [opts.backgroundColor]\n */\n\n\nechartsProto.getConnectedDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!env.canvasSupported) {\n return;\n }\n\n var isSvg = opts.type === 'svg';\n var groupId = this.group;\n var mathMin = Math.min;\n var mathMax = Math.max;\n var MAX_NUMBER = Infinity;\n\n if (connectedGroups[groupId]) {\n var left = MAX_NUMBER;\n var top = MAX_NUMBER;\n var right = -MAX_NUMBER;\n var bottom = -MAX_NUMBER;\n var canvasList = [];\n var dpr = opts && opts.pixelRatio || 1;\n zrUtil.each(instances, function (chart, id) {\n if (chart.group === groupId) {\n var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.getRenderedCanvas(zrUtil.clone(opts));\n var boundingRect = chart.getDom().getBoundingClientRect();\n left = mathMin(boundingRect.left, left);\n top = mathMin(boundingRect.top, top);\n right = mathMax(boundingRect.right, right);\n bottom = mathMax(boundingRect.bottom, bottom);\n canvasList.push({\n dom: canvas,\n left: boundingRect.left,\n top: boundingRect.top\n });\n }\n });\n left *= dpr;\n top *= dpr;\n right *= dpr;\n bottom *= dpr;\n var width = right - left;\n var height = bottom - top;\n var targetCanvas = zrUtil.createCanvas();\n var zr = zrender.init(targetCanvas, {\n renderer: isSvg ? 'svg' : 'canvas'\n });\n zr.resize({\n width: width,\n height: height\n });\n\n if (isSvg) {\n var content = '';\n each(canvasList, function (item) {\n var x = item.left - left;\n var y = item.top - top;\n content += '' + item.dom + '';\n });\n zr.painter.getSvgRoot().innerHTML = content;\n\n if (opts.connectedBackgroundColor) {\n zr.painter.setBackgroundColor(opts.connectedBackgroundColor);\n }\n\n zr.refreshImmediately();\n return zr.painter.toDataURL();\n } else {\n // Background between the charts\n if (opts.connectedBackgroundColor) {\n zr.add(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n style: {\n fill: opts.connectedBackgroundColor\n }\n }));\n }\n\n each(canvasList, function (item) {\n var img = new graphic.Image({\n style: {\n x: item.left * dpr - left,\n y: item.top * dpr - top,\n image: item.dom\n }\n });\n zr.add(img);\n });\n zr.refreshImmediately();\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n }\n } else {\n return this.getDataURL(opts);\n }\n};\n/**\n * Convert from logical coordinate system to pixel coordinate system.\n * See CoordinateSystem#convertToPixel.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId, geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName,\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {Array|number} result\n */\n\n\nechartsProto.convertToPixel = zrUtil.curry(doConvertPixel, 'convertToPixel');\n/**\n * Convert from pixel coordinate system to logical coordinate system.\n * See CoordinateSystem#convertFromPixel.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId / geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {Array|number} result\n */\n\nechartsProto.convertFromPixel = zrUtil.curry(doConvertPixel, 'convertFromPixel');\n\nfunction doConvertPixel(methodName, finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var ecModel = this._model;\n\n var coordSysList = this._coordSysMgr.getCoordinateSystems();\n\n var result;\n finder = modelUtil.parseFinder(ecModel, finder);\n\n for (var i = 0; i < coordSysList.length; i++) {\n var coordSys = coordSysList[i];\n\n if (coordSys[methodName] && (result = coordSys[methodName](ecModel, finder, value)) != null) {\n return result;\n }\n }\n}\n/**\n * Is the specified coordinate systems or components contain the given pixel point.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId / geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName,\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {boolean} result\n */\n\n\nechartsProto.containPixel = function (finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var ecModel = this._model;\n var result;\n finder = modelUtil.parseFinder(ecModel, finder);\n zrUtil.each(finder, function (models, key) {\n key.indexOf('Models') >= 0 && zrUtil.each(models, function (model) {\n var coordSys = model.coordinateSystem;\n\n if (coordSys && coordSys.containPoint) {\n result |= !!coordSys.containPoint(value);\n } else if (key === 'seriesModels') {\n var view = this._chartsMap[model.__viewId];\n\n if (view && view.containPoint) {\n result |= view.containPoint(value, model);\n } else {}\n } else {}\n }, this);\n }, this);\n return !!result;\n};\n/**\n * Get visual from series or data.\n * @param {string|Object} finder\n * If string, e.g., 'series', means {seriesIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * dataIndex / dataIndexInside\n * }\n * If dataIndex is not specified, series visual will be fetched,\n * but not data item visual.\n * If all of seriesIndex, seriesId, seriesName are not specified,\n * visual will be fetched from first series.\n * @param {string} visualType 'color', 'symbol', 'symbolSize'\n */\n\n\nechartsProto.getVisual = function (finder, visualType) {\n var ecModel = this._model;\n finder = modelUtil.parseFinder(ecModel, finder, {\n defaultMainType: 'series'\n });\n var seriesModel = finder.seriesModel;\n var data = seriesModel.getData();\n var dataIndexInside = finder.hasOwnProperty('dataIndexInside') ? finder.dataIndexInside : finder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(finder.dataIndex) : null;\n return dataIndexInside != null ? data.getItemVisual(dataIndexInside, visualType) : data.getVisual(visualType);\n};\n/**\n * Get view of corresponding component model\n * @param {module:echarts/model/Component} componentModel\n * @return {module:echarts/view/Component}\n */\n\n\nechartsProto.getViewOfComponentModel = function (componentModel) {\n return this._componentsMap[componentModel.__viewId];\n};\n/**\n * Get view of corresponding series model\n * @param {module:echarts/model/Series} seriesModel\n * @return {module:echarts/view/Chart}\n */\n\n\nechartsProto.getViewOfSeriesModel = function (seriesModel) {\n return this._chartsMap[seriesModel.__viewId];\n};\n\nvar updateMethods = {\n prepareAndUpdate: function (payload) {\n prepare(this);\n updateMethods.update.call(this, payload);\n },\n\n /**\n * @param {Object} payload\n * @private\n */\n update: function (payload) {\n // console.profile && console.profile('update');\n var ecModel = this._model;\n var api = this._api;\n var zr = this._zr;\n var coordSysMgr = this._coordSysMgr;\n var scheduler = this._scheduler; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n scheduler.restoreData(ecModel, payload);\n scheduler.performSeriesTasks(ecModel); // TODO\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n // Create new coordinate system each update\n // In LineView may save the old coordinate system and use it to get the orignal point\n\n coordSysMgr.create(ecModel, api);\n scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update\n // stream modes after data processing, where the filtered data is used to\n // deteming whether use progressive rendering.\n\n updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\n // the drawback is the full coord info can not be fetched. Fortunately this full\n // coord is not requied in stream mode updater currently.\n\n coordSysMgr.update(ecModel, api);\n clearColorPalette(ecModel);\n scheduler.performVisualTasks(ecModel, payload);\n render(this, ecModel, api, payload); // Set background\n\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent'; // In IE8\n\n if (!env.canvasSupported) {\n var colorArr = colorTool.parse(backgroundColor);\n backgroundColor = colorTool.stringify(colorArr, 'rgb');\n\n if (colorArr[3] === 0) {\n backgroundColor = 'transparent';\n }\n } else {\n zr.setBackgroundColor(backgroundColor);\n }\n\n performPostUpdateFuncs(ecModel, api); // console.profile && console.profileEnd('update');\n },\n\n /**\n * @param {Object} payload\n * @private\n */\n updateTransform: function (payload) {\n var ecModel = this._model;\n var ecIns = this;\n var api = this._api; // update before setOption\n\n if (!ecModel) {\n return;\n } // ChartView.markUpdateMethod(payload, 'updateTransform');\n\n\n var componentDirtyList = [];\n ecModel.eachComponent(function (componentType, componentModel) {\n var componentView = ecIns.getViewOfComponentModel(componentModel);\n\n if (componentView && componentView.__alive) {\n if (componentView.updateTransform) {\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n result && result.update && componentDirtyList.push(componentView);\n } else {\n componentDirtyList.push(componentView);\n }\n }\n });\n var seriesDirtyMap = zrUtil.createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n\n if (chartView.updateTransform) {\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n } else {\n seriesDirtyMap.set(seriesModel.uid, 1);\n }\n });\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true,\n dirtyMap: seriesDirtyMap\n }); // Currently, not call render of components. Geo render cost a lot.\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n\n\n renderSeries(ecIns, ecModel, api, payload, seriesDirtyMap);\n performPostUpdateFuncs(ecModel, this._api);\n },\n\n /**\n * @param {Object} payload\n * @private\n */\n updateView: function (payload) {\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ChartView.markUpdateMethod(payload, 'updateView');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true\n });\n\n render(this, this._model, this._api, payload);\n performPostUpdateFuncs(ecModel, this._api);\n },\n\n /**\n * @param {Object} payload\n * @private\n */\n updateVisual: function (payload) {\n updateMethods.update.call(this, payload); // var ecModel = this._model;\n // // update before setOption\n // if (!ecModel) {\n // return;\n // }\n // ChartView.markUpdateMethod(payload, 'updateVisual');\n // clearColorPalette(ecModel);\n // // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, {visualType: 'visual', setDirty: true});\n // render(this, this._model, this._api, payload);\n // performPostUpdateFuncs(ecModel, this._api);\n },\n\n /**\n * @param {Object} payload\n * @private\n */\n updateLayout: function (payload) {\n updateMethods.update.call(this, payload); // var ecModel = this._model;\n // // update before setOption\n // if (!ecModel) {\n // return;\n // }\n // ChartView.markUpdateMethod(payload, 'updateLayout');\n // // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n // this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true});\n // render(this, this._model, this._api, payload);\n // performPostUpdateFuncs(ecModel, this._api);\n }\n};\n\nfunction prepare(ecIns) {\n var ecModel = ecIns._model;\n var scheduler = ecIns._scheduler;\n scheduler.restorePipelines(ecModel);\n scheduler.prepareStageTasks();\n prepareView(ecIns, 'component', ecModel, scheduler);\n prepareView(ecIns, 'chart', ecModel, scheduler);\n scheduler.plan();\n}\n/**\n * @private\n */\n\n\nfunction updateDirectly(ecIns, method, payload, mainType, subType) {\n var ecModel = ecIns._model; // broadcast\n\n if (!mainType) {\n // FIXME\n // Chart will not be update directly here, except set dirty.\n // But there is no such scenario now.\n each(ecIns._componentsViews.concat(ecIns._chartsViews), callView);\n return;\n }\n\n var query = {};\n query[mainType + 'Id'] = payload[mainType + 'Id'];\n query[mainType + 'Index'] = payload[mainType + 'Index'];\n query[mainType + 'Name'] = payload[mainType + 'Name'];\n var condition = {\n mainType: mainType,\n query: query\n };\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\n\n var excludeSeriesId = payload.excludeSeriesId;\n\n if (excludeSeriesId != null) {\n excludeSeriesId = zrUtil.createHashMap(modelUtil.normalizeToArray(excludeSeriesId));\n } // If dispatchAction before setOption, do nothing.\n\n\n ecModel && ecModel.eachComponent(condition, function (model) {\n if (!excludeSeriesId || excludeSeriesId.get(model.id) == null) {\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n }\n }, ecIns);\n\n function callView(view) {\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n }\n}\n/**\n * Resize the chart\n * @param {Object} opts\n * @param {number} [opts.width] Can be 'auto' (the same as null/undefined)\n * @param {number} [opts.height] Can be 'auto' (the same as null/undefined)\n * @param {boolean} [opts.silent=false]\n */\n\n\nechartsProto.resize = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._zr.resize(opts);\n\n var ecModel = this._model; // Resize loading effect\n\n this._loadingFX && this._loadingFX.resize();\n\n if (!ecModel) {\n return;\n }\n\n var optionChanged = ecModel.resetOption('media');\n var silent = opts && opts.silent;\n this[IN_MAIN_PROCESS] = true;\n optionChanged && prepare(this);\n updateMethods.update.call(this);\n this[IN_MAIN_PROCESS] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n};\n\nfunction updateStreamModes(ecIns, ecModel) {\n var chartsMap = ecIns._chartsMap;\n var scheduler = ecIns._scheduler;\n ecModel.eachSeries(function (seriesModel) {\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n });\n}\n/**\n * Show loading effect\n * @param {string} [name='default']\n * @param {Object} [cfg]\n */\n\n\nechartsProto.showLoading = function (name, cfg) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (isObject(name)) {\n cfg = name;\n name = '';\n }\n\n name = name || 'default';\n this.hideLoading();\n\n if (!loadingEffects[name]) {\n return;\n }\n\n var el = loadingEffects[name](this._api, cfg);\n var zr = this._zr;\n this._loadingFX = el;\n zr.add(el);\n};\n/**\n * Hide loading effect\n */\n\n\nechartsProto.hideLoading = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._loadingFX && this._zr.remove(this._loadingFX);\n this._loadingFX = null;\n};\n/**\n * @param {Object} eventObj\n * @return {Object}\n */\n\n\nechartsProto.makeActionFromEvent = function (eventObj) {\n var payload = zrUtil.extend({}, eventObj);\n payload.type = eventActionMap[eventObj.type];\n return payload;\n};\n/**\n * @pubilc\n * @param {Object} payload\n * @param {string} [payload.type] Action type\n * @param {Object|boolean} [opt] If pass boolean, means opt.silent\n * @param {boolean} [opt.silent=false] Whether trigger events.\n * @param {boolean} [opt.flush=undefined]\n * true: Flush immediately, and then pixel in canvas can be fetched\n * immediately. Caution: it might affect performance.\n * false: Not flush.\n * undefined: Auto decide whether perform flush.\n */\n\n\nechartsProto.dispatchAction = function (payload, opt) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!isObject(opt)) {\n opt = {\n silent: !!opt\n };\n }\n\n if (!actions[payload.type]) {\n return;\n } // Avoid dispatch action before setOption. Especially in `connect`.\n\n\n if (!this._model) {\n return;\n } // May dispatchAction in rendering procedure\n\n\n if (this[IN_MAIN_PROCESS]) {\n this._pendingActions.push(payload);\n\n return;\n }\n\n doDispatchAction.call(this, payload, opt.silent);\n\n if (opt.flush) {\n this._zr.flush(true);\n } else if (opt.flush !== false && env.browser.weChat) {\n // In WeChat embeded browser, `requestAnimationFrame` and `setInterval`\n // hang when sliding page (on touch event), which cause that zr does not\n // refresh util user interaction finished, which is not expected.\n // But `dispatchAction` may be called too frequently when pan on touch\n // screen, which impacts performance if do not throttle them.\n this._throttledZrFlush();\n }\n\n flushPendingActions.call(this, opt.silent);\n triggerUpdatedEvent.call(this, opt.silent);\n};\n\nfunction doDispatchAction(payload, silent) {\n var payloadType = payload.type;\n var escapeConnect = payload.escapeConnect;\n var actionWrap = actions[payloadType];\n var actionInfo = actionWrap.actionInfo;\n var cptType = (actionInfo.update || 'update').split(':');\n var updateMethod = cptType.pop();\n cptType = cptType[0] != null && parseClassType(cptType[0]);\n this[IN_MAIN_PROCESS] = true;\n var payloads = [payload];\n var batched = false; // Batch action\n\n if (payload.batch) {\n batched = true;\n payloads = zrUtil.map(payload.batch, function (item) {\n item = zrUtil.defaults(zrUtil.extend({}, item), payload);\n item.batch = null;\n return item;\n });\n }\n\n var eventObjBatch = [];\n var eventObj;\n var isHighDown = payloadType === 'highlight' || payloadType === 'downplay';\n each(payloads, function (batchItem) {\n // Action can specify the event by return it.\n eventObj = actionWrap.action(batchItem, this._model, this._api); // Emit event outside\n\n eventObj = eventObj || zrUtil.extend({}, batchItem); // Convert type to eventType\n\n eventObj.type = actionInfo.event || eventObj.type;\n eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual.\n\n if (isHighDown) {\n // method, payload, mainType, subType\n updateDirectly(this, updateMethod, batchItem, 'series');\n } else if (cptType) {\n updateDirectly(this, updateMethod, batchItem, cptType.main, cptType.sub);\n }\n }, this);\n\n if (updateMethod !== 'none' && !isHighDown && !cptType) {\n // Still dirty\n if (this[OPTION_UPDATED]) {\n // FIXME Pass payload ?\n prepare(this);\n updateMethods.update.call(this, payload);\n this[OPTION_UPDATED] = false;\n } else {\n updateMethods[updateMethod].call(this, payload);\n }\n } // Follow the rule of action batch\n\n\n if (batched) {\n eventObj = {\n type: actionInfo.event || payloadType,\n escapeConnect: escapeConnect,\n batch: eventObjBatch\n };\n } else {\n eventObj = eventObjBatch[0];\n }\n\n this[IN_MAIN_PROCESS] = false;\n !silent && this._messageCenter.trigger(eventObj.type, eventObj);\n}\n\nfunction flushPendingActions(silent) {\n var pendingActions = this._pendingActions;\n\n while (pendingActions.length) {\n var payload = pendingActions.shift();\n doDispatchAction.call(this, payload, silent);\n }\n}\n\nfunction triggerUpdatedEvent(silent) {\n !silent && this.trigger('updated');\n}\n/**\n * Event `rendered` is triggered when zr\n * rendered. It is useful for realtime\n * snapshot (reflect animation).\n *\n * Event `finished` is triggered when:\n * (1) zrender rendering finished.\n * (2) initial animation finished.\n * (3) progressive rendering finished.\n * (4) no pending action.\n * (5) no delayed setOption needs to be processed.\n */\n\n\nfunction bindRenderedEvent(zr, ecIns) {\n zr.on('rendered', function () {\n ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n}\n/**\n * @param {Object} params\n * @param {number} params.seriesIndex\n * @param {Array|TypedArray} params.data\n */\n\n\nechartsProto.appendData = function (params) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var seriesIndex = params.seriesIndex;\n var ecModel = this.getModel();\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate\n // system, util some scenario require that. In the expected usage of\n // `appendData`, the initial extent of coordinate system should better\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\n // the extent changed while `appendData`, the location of the painted\n // graphic elements have to be changed, which make the usage of\n // `appendData` meaningless.\n\n this._scheduler.unfinished = true;\n};\n/**\n * Register event\n * @method\n */\n\n\nechartsProto.on = createRegisterEventWithLowercaseName('on', false);\nechartsProto.off = createRegisterEventWithLowercaseName('off', false);\nechartsProto.one = createRegisterEventWithLowercaseName('one', false);\n/**\n * Prepare view instances of charts and components\n * @param {module:echarts/model/Global} ecModel\n * @private\n */\n\nfunction prepareView(ecIns, type, ecModel, scheduler) {\n var isComponent = type === 'component';\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n var zr = ecIns._zr;\n var api = ecIns._api;\n\n for (var i = 0; i < viewList.length; i++) {\n viewList[i].__alive = false;\n }\n\n isComponent ? ecModel.eachComponent(function (componentType, model) {\n componentType !== 'series' && doPrepare(model);\n }) : ecModel.eachSeries(doPrepare);\n\n function doPrepare(model) {\n // Consider: id same and type changed.\n var viewId = '_ec_' + model.id + '_' + model.type;\n var view = viewMap[viewId];\n\n if (!view) {\n var classType = parseClassType(model.type);\n var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : ChartView.getClass(classType.sub);\n view = new Clazz();\n view.init(ecModel, api);\n viewMap[viewId] = view;\n viewList.push(view);\n zr.add(view.group);\n }\n\n model.__viewId = view.__id = viewId;\n view.__alive = true;\n view.__model = model;\n view.group.__ecComponentInfo = {\n mainType: model.mainType,\n index: model.componentIndex\n };\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\n }\n\n for (var i = 0; i < viewList.length;) {\n var view = viewList[i];\n\n if (!view.__alive) {\n !isComponent && view.renderTask.dispose();\n zr.remove(view.group);\n view.dispose(ecModel, api);\n viewList.splice(i, 1);\n delete viewMap[view.__id];\n view.__id = view.group.__ecComponentInfo = null;\n } else {\n i++;\n }\n }\n} // /**\n// * Encode visual infomation from data after data processing\n// *\n// * @param {module:echarts/model/Global} ecModel\n// * @param {object} layout\n// * @param {boolean} [layoutFilter] `true`: only layout,\n// * `false`: only not layout,\n// * `null`/`undefined`: all.\n// * @param {string} taskBaseTag\n// * @private\n// */\n// function startVisualEncoding(ecIns, ecModel, api, payload, layoutFilter) {\n// each(visualFuncs, function (visual, index) {\n// var isLayout = visual.isLayout;\n// if (layoutFilter == null\n// || (layoutFilter === false && !isLayout)\n// || (layoutFilter === true && isLayout)\n// ) {\n// visual.func(ecModel, api, payload);\n// }\n// });\n// }\n\n\nfunction clearColorPalette(ecModel) {\n ecModel.clearColorPalette();\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.clearColorPalette();\n });\n}\n\nfunction render(ecIns, ecModel, api, payload) {\n renderComponents(ecIns, ecModel, api, payload);\n each(ecIns._chartsViews, function (chart) {\n chart.__alive = false;\n });\n renderSeries(ecIns, ecModel, api, payload); // Remove groups of unrendered charts\n\n each(ecIns._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n });\n}\n\nfunction renderComponents(ecIns, ecModel, api, payload, dirtyList) {\n each(dirtyList || ecIns._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n });\n}\n/**\n * Render each chart and component\n * @private\n */\n\n\nfunction renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}\n\nfunction performPostUpdateFuncs(ecModel, api) {\n each(postUpdateFuncs, function (func) {\n func(ecModel, api);\n });\n}\n\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\n/**\n * @private\n */\n\nechartsProto._initEvents = function () {\n each(MOUSE_EVENT_NAMES, function (eveName) {\n var handler = function (e) {\n var ecModel = this.getModel();\n var el = e.target;\n var params;\n var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'.\n\n if (isGlobalOut) {\n params = {};\n } else if (el && el.dataIndex != null) {\n var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);\n params = dataModel && dataModel.getDataParams(el.dataIndex, el.dataType, el) || {};\n } // If element has custom eventData of components\n else if (el && el.eventData) {\n params = zrUtil.extend({}, el.eventData);\n } // Contract: if params prepared in mouse event,\n // these properties must be specified:\n // {\n // componentType: string (component main type)\n // componentIndex: number\n // }\n // Otherwise event query can not work.\n\n\n if (params) {\n var componentType = params.componentType;\n var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by\n // markLine/markPoint/markArea, the componentType is\n // 'markLine'/'markPoint'/'markArea', but we should better\n // enable them to be queried by seriesIndex, since their\n // option is set in each series.\n\n if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n componentType = 'series';\n componentIndex = params.seriesIndex;\n }\n\n var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n var view = model && this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n params.event = e;\n params.type = eveName;\n this._ecEventProcessor.eventInfo = {\n targetEl: el,\n packedEvent: params,\n model: model,\n view: view\n };\n this.trigger(eveName, params);\n }\n }; // Consider that some component (like tooltip, brush, ...)\n // register zr event handler, but user event handler might\n // do anything, such as call `setOption` or `dispatchAction`,\n // which probably update any of the content and probably\n // cause problem if it is called previous other inner handlers.\n\n\n handler.zrEventfulCallAtLast = true;\n\n this._zr.on(eveName, handler, this);\n }, this);\n each(eventActionMap, function (actionType, eventType) {\n this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, this);\n }, this);\n};\n/**\n * @return {boolean}\n */\n\n\nechartsProto.isDisposed = function () {\n return this._disposed;\n};\n/**\n * Clear\n */\n\n\nechartsProto.clear = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this.setOption({\n series: []\n }, true);\n};\n/**\n * Dispose instance\n */\n\n\nechartsProto.dispose = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._disposed = true;\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n var api = this._api;\n var ecModel = this._model;\n each(this._componentsViews, function (component) {\n component.dispose(ecModel, api);\n });\n each(this._chartsViews, function (chart) {\n chart.dispose(ecModel, api);\n }); // Dispose after all views disposed\n\n this._zr.dispose();\n\n delete instances[this.id];\n};\n\nzrUtil.mixin(ECharts, Eventful);\n\nfunction disposedWarning(id) {}\n\nfunction updateHoverLayerStatus(ecIns, ecModel) {\n var zr = ecIns._zr;\n var storage = zr.storage;\n var elCount = 0;\n storage.traverse(function (el) {\n elCount++;\n });\n\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.preventUsingHoverLayer) {\n return;\n }\n\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n\n if (chartView.__alive) {\n chartView.group.traverse(function (el) {\n // Don't switch back.\n el.useHoverLayer = true;\n });\n }\n });\n }\n}\n/**\n * Update chart progressive and blend.\n * @param {module:echarts/model/Series|module:echarts/model/Component} model\n * @param {module:echarts/view/Component|module:echarts/view/Chart} view\n */\n\n\nfunction updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n chartView.group.traverse(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // Only set if blendMode is changed. In case element is incremental and don't wan't to rerender.\n if (el.style.blend !== blendMode) {\n el.setStyle('blend', blendMode);\n }\n }\n\n if (el.eachPendingDisplayable) {\n el.eachPendingDisplayable(function (displayable) {\n displayable.setStyle('blend', blendMode);\n });\n }\n });\n}\n/**\n * @param {module:echarts/model/Series|module:echarts/model/Component} model\n * @param {module:echarts/view/Component|module:echarts/view/Chart} view\n */\n\n\nfunction updateZ(model, view) {\n var z = model.get('z');\n var zlevel = model.get('zlevel'); // Set z and zlevel\n\n view.group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n }\n });\n}\n\nfunction createExtensionAPI(ecInstance) {\n var coordSysMgr = ecInstance._coordSysMgr;\n return zrUtil.extend(new ExtensionAPI(ecInstance), {\n // Inject methods\n getCoordinateSystems: zrUtil.bind(coordSysMgr.getCoordinateSystems, coordSysMgr),\n getComponentByElement: function (el) {\n while (el) {\n var modelInfo = el.__ecComponentInfo;\n\n if (modelInfo != null) {\n return ecInstance._model.getComponent(modelInfo.mainType, modelInfo.index);\n }\n\n el = el.parent;\n }\n }\n });\n}\n/**\n * @class\n * Usage of query:\n * `chart.on('click', query, handler);`\n * The `query` can be:\n * + The component type query string, only `mainType` or `mainType.subType`,\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\n * + The component query object, like:\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\n * + The data query object, like:\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\n * + The other query object (cmponent customized query), like:\n * `{element: 'some'}` (only available in custom series).\n *\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\n * same as there is no such prop in the `query` object.\n */\n\n\nfunction EventProcessor() {\n // These info required: targetEl, packedEvent, model, view\n this.eventInfo;\n}\n\nEventProcessor.prototype = {\n constructor: EventProcessor,\n normalizeQuery: function (query) {\n var cptQuery = {};\n var dataQuery = {};\n var otherQuery = {}; // `query` is `mainType` or `mainType.subType` of component.\n\n if (zrUtil.isString(query)) {\n var condCptType = parseClassType(query); // `.main` and `.sub` may be ''.\n\n cptQuery.mainType = condCptType.main || null;\n cptQuery.subType = condCptType.sub || null;\n } // `query` is an object, convert to {mainType, index, name, id}.\n else {\n // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n // can not be used in `compomentModel.filterForExposedEvent`.\n var suffixes = ['Index', 'Name', 'Id'];\n var dataKeys = {\n name: 1,\n dataIndex: 1,\n dataType: 1\n };\n zrUtil.each(query, function (val, key) {\n var reserved = false;\n\n for (var i = 0; i < suffixes.length; i++) {\n var propSuffix = suffixes[i];\n var suffixPos = key.lastIndexOf(propSuffix);\n\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\n var mainType = key.slice(0, suffixPos); // Consider `dataIndex`.\n\n if (mainType !== 'data') {\n cptQuery.mainType = mainType;\n cptQuery[propSuffix.toLowerCase()] = val;\n reserved = true;\n }\n }\n }\n\n if (dataKeys.hasOwnProperty(key)) {\n dataQuery[key] = val;\n reserved = true;\n }\n\n if (!reserved) {\n otherQuery[key] = val;\n }\n });\n }\n\n return {\n cptQuery: cptQuery,\n dataQuery: dataQuery,\n otherQuery: otherQuery\n };\n },\n filter: function (eventType, query, args) {\n // They should be assigned before each trigger call.\n var eventInfo = this.eventInfo;\n\n if (!eventInfo) {\n return true;\n }\n\n var targetEl = eventInfo.targetEl;\n var packedEvent = eventInfo.packedEvent;\n var model = eventInfo.model;\n var view = eventInfo.view; // For event like 'globalout'.\n\n if (!model || !view) {\n return true;\n }\n\n var cptQuery = query.cptQuery;\n var dataQuery = query.dataQuery;\n return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\n\n function check(query, host, prop, propOnHost) {\n return query[prop] == null || host[propOnHost || prop] === query[prop];\n }\n },\n afterTrigger: function () {\n // Make sure the eventInfo wont be used in next trigger.\n this.eventInfo = null;\n }\n};\n/**\n * @type {Object} key: actionType.\n * @inner\n */\n\nvar actions = {};\n/**\n * Map eventType to actionType\n * @type {Object}\n */\n\nvar eventActionMap = {};\n/**\n * Data processor functions of each stage\n * @type {Array.>}\n * @inner\n */\n\nvar dataProcessorFuncs = [];\n/**\n * @type {Array.}\n * @inner\n */\n\nvar optionPreprocessorFuncs = [];\n/**\n * @type {Array.}\n * @inner\n */\n\nvar postUpdateFuncs = [];\n/**\n * Visual encoding functions of each stage\n * @type {Array.>}\n */\n\nvar visualFuncs = [];\n/**\n * Theme storage\n * @type {Object.}\n */\n\nvar themeStorage = {};\n/**\n * Loading effects\n */\n\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = new Date() - 0;\nvar groupIdBase = new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n\nfunction enableConnect(chart) {\n var STATUS_PENDING = 0;\n var STATUS_UPDATING = 1;\n var STATUS_UPDATED = 2;\n var STATUS_KEY = '__connectUpdateStatus';\n\n function updateConnectedChartsStatus(charts, status) {\n for (var i = 0; i < charts.length; i++) {\n var otherChart = charts[i];\n otherChart[STATUS_KEY] = status;\n }\n }\n\n each(eventActionMap, function (actionType, eventType) {\n chart._messageCenter.on(eventType, function (event) {\n if (connectedGroups[chart.group] && chart[STATUS_KEY] !== STATUS_PENDING) {\n if (event && event.escapeConnect) {\n return;\n }\n\n var action = chart.makeActionFromEvent(event);\n var otherCharts = [];\n each(instances, function (otherChart) {\n if (otherChart !== chart && otherChart.group === chart.group) {\n otherCharts.push(otherChart);\n }\n });\n updateConnectedChartsStatus(otherCharts, STATUS_PENDING);\n each(otherCharts, function (otherChart) {\n if (otherChart[STATUS_KEY] !== STATUS_UPDATING) {\n otherChart.dispatchAction(action);\n }\n });\n updateConnectedChartsStatus(otherCharts, STATUS_UPDATED);\n }\n });\n });\n}\n/**\n * @param {HTMLElement} dom\n * @param {Object} [theme]\n * @param {Object} opts\n * @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default\n * @param {string} [opts.renderer] Can choose 'canvas' or 'svg' to render the chart.\n * @param {number} [opts.width] Use clientWidth of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n * @param {number} [opts.height] Use clientHeight of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n */\n\n\nfunction init(dom, theme, opts) {\n var existInstance = getInstanceByDom(dom);\n\n if (existInstance) {\n return existInstance;\n }\n\n var chart = new ECharts(dom, theme, opts);\n chart.id = 'ec_' + idBase++;\n instances[chart.id] = chart;\n modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n enableConnect(chart);\n return chart;\n}\n/**\n * @return {string|Array.} groupId\n */\n\n\nfunction connect(groupId) {\n // Is array of charts\n if (zrUtil.isArray(groupId)) {\n var charts = groupId;\n groupId = null; // If any chart has group\n\n each(charts, function (chart) {\n if (chart.group != null) {\n groupId = chart.group;\n }\n });\n groupId = groupId || 'g_' + groupIdBase++;\n each(charts, function (chart) {\n chart.group = groupId;\n });\n }\n\n connectedGroups[groupId] = true;\n return groupId;\n}\n/**\n * @DEPRECATED\n * @return {string} groupId\n */\n\n\nfunction disConnect(groupId) {\n connectedGroups[groupId] = false;\n}\n/**\n * @return {string} groupId\n */\n\n\nvar disconnect = disConnect;\n/**\n * Dispose a chart instance\n * @param {module:echarts~ECharts|HTMLDomElement|string} chart\n */\n\nfunction dispose(chart) {\n if (typeof chart === 'string') {\n chart = instances[chart];\n } else if (!(chart instanceof ECharts)) {\n // Try to treat as dom\n chart = getInstanceByDom(chart);\n }\n\n if (chart instanceof ECharts && !chart.isDisposed()) {\n chart.dispose();\n }\n}\n/**\n * @param {HTMLElement} dom\n * @return {echarts~ECharts}\n */\n\n\nfunction getInstanceByDom(dom) {\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\n/**\n * @param {string} key\n * @return {echarts~ECharts}\n */\n\n\nfunction getInstanceById(key) {\n return instances[key];\n}\n/**\n * Register theme\n */\n\n\nfunction registerTheme(name, theme) {\n themeStorage[name] = theme;\n}\n/**\n * Register option preprocessor\n * @param {Function} preprocessorFunc\n */\n\n\nfunction registerPreprocessor(preprocessorFunc) {\n optionPreprocessorFuncs.push(preprocessorFunc);\n}\n/**\n * @param {number} [priority=1000]\n * @param {Object|Function} processor\n */\n\n\nfunction registerProcessor(priority, processor) {\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_FILTER);\n}\n/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */\n\n\nfunction registerPostUpdate(postUpdateFunc) {\n postUpdateFuncs.push(postUpdateFunc);\n}\n/**\n * Usage:\n * registerAction('someAction', 'someEvent', function () { ... });\n * registerAction('someAction', function () { ... });\n * registerAction(\n * {type: 'someAction', event: 'someEvent', update: 'updateView'},\n * function () { ... }\n * );\n *\n * @param {(string|Object)} actionInfo\n * @param {string} actionInfo.type\n * @param {string} [actionInfo.event]\n * @param {string} [actionInfo.update]\n * @param {string} [eventName]\n * @param {Function} action\n */\n\n\nfunction registerAction(actionInfo, eventName, action) {\n if (typeof eventName === 'function') {\n action = eventName;\n eventName = '';\n }\n\n var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = {\n event: eventName\n }][0]; // Event name is all lowercase\n\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\n eventName = actionInfo.event; // Validate action type and event name.\n\n assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\n\n if (!actions[actionType]) {\n actions[actionType] = {\n action: action,\n actionInfo: actionInfo\n };\n }\n\n eventActionMap[eventName] = actionType;\n}\n/**\n * @param {string} type\n * @param {*} CoordinateSystem\n */\n\n\nfunction registerCoordinateSystem(type, CoordinateSystem) {\n CoordinateSystemManager.register(type, CoordinateSystem);\n}\n/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.}\n */\n\n\nfunction getCoordinateSystemDimensions(type) {\n var coordSysCreator = CoordinateSystemManager.get(type);\n\n if (coordSysCreator) {\n return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n }\n}\n/**\n * Layout is a special stage of visual encoding\n * Most visual encoding like color are common for different chart\n * But each chart has it's own layout algorithm\n *\n * @param {number} [priority=1000]\n * @param {Function} layoutTask\n */\n\n\nfunction registerLayout(priority, layoutTask) {\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\n/**\n * @param {number} [priority=3000]\n * @param {module:echarts/stream/Task} visualTask\n */\n\n\nfunction registerVisual(priority, visualTask) {\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\n/**\n * @param {Object|Function} fn: {seriesType, createOnAllSeries, performRawSeries, reset}\n */\n\n\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n if (isFunction(priority) || isObject(priority)) {\n fn = priority;\n priority = defaultPriority;\n }\n\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n stageHandler.__prio = priority;\n stageHandler.__raw = fn;\n targetList.push(stageHandler);\n return stageHandler;\n}\n/**\n * @param {string} name\n */\n\n\nfunction registerLoading(name, loadingFx) {\n loadingEffects[name] = loadingFx;\n}\n/**\n * @param {Object} opts\n * @param {string} [superClass]\n */\n\n\nfunction extendComponentModel(opts\n/*, superClass*/\n) {\n // var Clazz = ComponentModel;\n // if (superClass) {\n // var classType = parseClassType(superClass);\n // Clazz = ComponentModel.getClass(classType.main, classType.sub, true);\n // }\n return ComponentModel.extend(opts);\n}\n/**\n * @param {Object} opts\n * @param {string} [superClass]\n */\n\n\nfunction extendComponentView(opts\n/*, superClass*/\n) {\n // var Clazz = ComponentView;\n // if (superClass) {\n // var classType = parseClassType(superClass);\n // Clazz = ComponentView.getClass(classType.main, classType.sub, true);\n // }\n return ComponentView.extend(opts);\n}\n/**\n * @param {Object} opts\n * @param {string} [superClass]\n */\n\n\nfunction extendSeriesModel(opts\n/*, superClass*/\n) {\n // var Clazz = SeriesModel;\n // if (superClass) {\n // superClass = 'series.' + superClass.replace('series.', '');\n // var classType = parseClassType(superClass);\n // Clazz = ComponentModel.getClass(classType.main, classType.sub, true);\n // }\n return SeriesModel.extend(opts);\n}\n/**\n * @param {Object} opts\n * @param {string} [superClass]\n */\n\n\nfunction extendChartView(opts\n/*, superClass*/\n) {\n // var Clazz = ChartView;\n // if (superClass) {\n // superClass = superClass.replace('series.', '');\n // var classType = parseClassType(superClass);\n // Clazz = ChartView.getClass(classType.main, true);\n // }\n return ChartView.extend(opts);\n}\n/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n * Be careful of using it in the browser.\n *\n * @param {Function} creator\n * @example\n * var Canvas = require('canvas');\n * var echarts = require('echarts');\n * echarts.setCanvasCreator(function () {\n * // Small size is enough.\n * return new Canvas(32, 32);\n * });\n */\n\n\nfunction setCanvasCreator(creator) {\n zrUtil.$override('createCanvas', creator);\n}\n/**\n * @param {string} mapName\n * @param {Array.|Object|string} geoJson\n * @param {Object} [specialAreas]\n *\n * @example GeoJSON\n * $.get('USA.json', function (geoJson) {\n * echarts.registerMap('USA', geoJson);\n * // Or\n * echarts.registerMap('USA', {\n * geoJson: geoJson,\n * specialAreas: {}\n * })\n * });\n *\n * $.get('airport.svg', function (svg) {\n * echarts.registerMap('airport', {\n * svg: svg\n * }\n * });\n *\n * echarts.registerMap('eu', [\n * {svg: eu-topographic.svg},\n * {geoJSON: eu.json}\n * ])\n */\n\n\nfunction registerMap(mapName, geoJson, specialAreas) {\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\n}\n/**\n * @param {string} mapName\n * @return {Object}\n */\n\n\nfunction getMap(mapName) {\n // For backward compatibility, only return the first one.\n var records = mapDataStorage.retrieveMap(mapName);\n return records && records[0] && {\n geoJson: records[0].geoJSON,\n specialAreas: records[0].specialAreas\n };\n}\n\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesColor);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault); // Default actions\n\nregisterAction({\n type: 'highlight',\n event: 'highlight',\n update: 'highlight'\n}, zrUtil.noop);\nregisterAction({\n type: 'downplay',\n event: 'downplay',\n update: 'downplay'\n}, zrUtil.noop); // Default theme\n\nregisterTheme('light', lightTheme);\nregisterTheme('dark', darkTheme); // For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\n\nvar dataTool = {};\nexports.version = version;\nexports.dependencies = dependencies;\nexports.PRIORITY = PRIORITY;\nexports.init = init;\nexports.connect = connect;\nexports.disConnect = disConnect;\nexports.disconnect = disconnect;\nexports.dispose = dispose;\nexports.getInstanceByDom = getInstanceByDom;\nexports.getInstanceById = getInstanceById;\nexports.registerTheme = registerTheme;\nexports.registerPreprocessor = registerPreprocessor;\nexports.registerProcessor = registerProcessor;\nexports.registerPostUpdate = registerPostUpdate;\nexports.registerAction = registerAction;\nexports.registerCoordinateSystem = registerCoordinateSystem;\nexports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\nexports.registerLayout = registerLayout;\nexports.registerVisual = registerVisual;\nexports.registerLoading = registerLoading;\nexports.extendComponentModel = extendComponentModel;\nexports.extendComponentView = extendComponentView;\nexports.extendSeriesModel = extendSeriesModel;\nexports.extendChartView = extendChartView;\nexports.setCanvasCreator = setCanvasCreator;\nexports.registerMap = registerMap;\nexports.getMap = getMap;\nexports.dataTool = dataTool;\nvar ___ec_export = require(\"./export\");\n(function () {\n for (var key in ___ec_export) {\n if (___ec_export.hasOwnProperty(key)) {\n exports[key] = ___ec_export[key];\n }\n }\n})();"],"names":["global","idStart","_default","guid","env","detect","ua","os","browser","firefox","ie","edge","weChat","env_1","BUILTIN_OBJECT","TYPED_ARRAY","objToString","arrayProto","nativeForEach","nativeFilter","nativeSlice","nativeMap","nativeReduce","methods","$override","name","fn","_ctx","clone","source","result","typeStr","isPrimitive","i","len","Ctor","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","createCanvas","getContext","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","mixin","isArrayLike","data","each","obj","cb","context","map","reduce","memo","filter","find","bind","func","args","curry","isFunction","isString","type","isTypedArray","eqNaN","retrieve","values","retrieve2","value0","value1","retrieve3","value2","slice","normalizeCssArray","val","assert","condition","message","trim","str","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","createHashMap","concatArray","a","b","newArray","offset","noop","util","ArrayCtor","create","x","y","out","copy","v","set","add","v1","v2","scaleAndAdd","sub","lenSquare","length","lengthSquare","mul","div","dot","scale","s","normalize","d","distance","dist","distanceSquare","distSquare","negate","lerp","t","applyTransform","m","min","max","vector","Draggable","draggingTarget","param","dx","dy","dropTarget","lastDropTarget","e","Draggable_1","arrySlice","Eventful","eventProcessor","event","query","handler","on","_h","newList","l","argLen","hItem","ctx","normalizeQuery","host","eventful","isOnce","wrap","lastIndex","lastWrap","Eventful_1","LN2","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","subRowMask","subRowStart","sum","j","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","fourPointsTransform","require$$0","_fourPointsTransform","require$$1","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","idxLR","idxTB","transformerName","oldSrcCoords","oldCoordTheSame","srcCoords","destCoords","rect","ii","dom","_dom","require$$2","isDomLevel2","MOUSE_EVENT_REG","clientToLocal","calculate","calculateZrXY","ex","ey","box","getNativeEvent","normalizeEvent","eventType","isTouch","touch","button","addEventListener","opt","removeEventListener","stop","isMiddleOrRightButtonOnMouseUpDown","notLeftMouse","eventUtil","GestureMgr","root","touches","trackItem","pos","eventName","recognizers","gestureInfo","pointPair","center","track","trackLen","pinchEnd","pinchPre","pinchScale","pinchCenter","GestureMgr_1","vec2","require$$3","eventTool","require$$4","require$$5","SILENT","makeEventPacket","eveType","targetInfo","stopEvent","EmptyProxy","handlerNames","Handler","storage","painter","proxy","painterRoot","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","hovered","hoveredTarget","eventControl","zrIsToLocalDOM","eventArgs","cursorStyle","eventHandler","eventPacket","layer","exclude","list","hoverCheckResult","isHover","stage","gestureMgr","displayable","isSilent","handlerInstance","Handler_1","identity","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","ct","vx","vy","invert","matrix","mIdentity","EPSILON","isNotAroundZero","Transformable","opts","transformableProto","scaleTmp","parent","parentHasTransform","needLocalTransform","globalScaleRatio","relX","relY","sx","sy","dpr","tmpTransform","originTransform","position","origin","invTransform","transform","rotation","Transformable_1","easing","k","p","easing_1","easingFuncs","Clip","options","globalTime","deltaTime","percent","easingFunc","schedule","remainder","arg","Clip_1","LinkedList","linkedListProto","entry","Entry","prev","next","LRU","maxSize","LRUProto","removed","leastUsedEntry","LRU_1","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","parseCssFloat","cssHueToRgb","h","lerpNumber","setRgba","r","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","iv","op","ep","fname","params","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","delta","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","rightIndex","leftColor","rightColor","dv","fastMapToColor","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","_util","arraySlice","defaultGetter","defaultSetter","interpolateNumber","p0","p1","interpolateString","interpolateArray","arrDim","len2","fillArr","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isArraySame","catmullRomInterpolateArray","p2","p3","t2","t3","catmullRomInterpolate","v0","cloneValue","ret","rgba2String","getArrayDim","keyframes","lastValue","createTrackClip","animator","oneTrackDone","propName","forceAnimate","getter","setter","useSpline","firstVal","isValueArray","isValueColor","isValueString","trackMaxTime","kfPercents","kfValues","prevValue","isAllValueEqual","colorArray","lastFrame","lastFramePercent","start","w","onframe","frame","range","clip","Animator","loop","time","props","tracks","callback","doneList","self","clipCount","lastClip","oldOnFrame","forwardToLast","clipList","animation","Animator_1","debugMode","devicePixelRatio","config","_config","logError","log","Animatable","path","animatingShape","zr","pathSplitted","animators","delay","animateTo","animatable","reverse","animateToShallow","count","done","objShallow","propertyCount","setAttrByPath","Animatable_1","zrUtil","Element","clipPath","Element_1","v2ApplyTransform","mathMin","mathMax","BoundingRect","width","height","other","lt","rb","lb","rt","maxX","maxY","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","BoundingRect_1","Group","idx","children","child","nextSibling","includeChildren","tmpRect","tmpMat","childRect","Group_1","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","n","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","left","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","sort","remaining","ts","minRun","force","timsort","shapeCompareFunc","Storage","update","includeIgnore","roots","displayList","clipPaths","userSetClipPath","currentClipPath","parentClipPath","Storage_1","SHADOW_PROPS","fixShadow","ContextCachedBy","WILL_BE_RESTORED","constant","_constant","STYLE_COMMON_PROPS","Style","createLinearGradient","x2","y2","canvasGradient","createRadialGradient","prevEl","style","prevStyle","notCheckCache","styleName","lineWidth","fill","stroke","otherStyle","newStyle","method","colorStops","styleProto","Style_1","Pattern","image","repeat","Pattern_1","returnFalse","createDom","id","newDom","newDomStyle","Layer","domStyle","domBack","clearAll","clearColor","haveMotionBLur","lastFrameAlpha","clearColorGradientOrPattern","Layer_1","requestAnimationFrame","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","hostEl","cbPayload","pendingWrap","isImageReady","imageOnLoad","imageHelper","textWidthCache","textWidthCacheCounter","TEXT_CACHE_MAX","STYLE_REG","DEFAULT_FONT","getWidth","text","font","textLines","measureText","getBoundingRect","textAlign","textVerticalAlign","textPadding","textLineHeight","rich","truncate","getRichTextRect","getPlainTextRect","contentBlock","parsePlainText","outerWidth","outerHeight","adjustTextX","adjustTextY","parseRichText","calculateTextPosition","textPosition","halfHeight","adjustTextPositionOnRect","dummyStyle","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","minChar","ascCharWidth","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","cnCharWidth","charCode","getLineHeight","padding","lineHeight","lines","canCacheByTextString","truncOuterHeight","truncOuterWidth","matchedIndex","pushTokens","contentHeight","pendingList","stlPadding","truncateWidth","truncateHeight","line","token","tokenStyle","tokenHeight","tokenWidth","tokenWidthNotSpecified","textBackgroundColor","bgImg","paddingW","remianTruncWidth","percentWidth","block","isEmptyStr","strs","tokens","tokensLen","makeFont","buildPath","shape","r1","r2","r3","r4","total","roundRect","textContain","roundRectHelper","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","SHADOW_STYLE_COMMON_PROPS","_tmpTextPositionResult","_tmpBoxPositionResult","normalizeTextStyle","normalizeStyle","renderText","renderRichText","renderPlainText","needDrawBg","needDrawBackground","checkCache","cachedByMe","styleFont","computedFont","boxPos","getBoxPosition","baseX","baseY","applyTextRotation","boxY","textX","textY","textWidth","boxX","drawBackground","getTextXForPadding","propItem","styleProp","ctxProp","textStrokeWidth","textStrokeWidthPrev","strokeWidthChanged","strokeChanged","textStroke","getStroke","textFill","getFill","drawRichText","xLeft","lineTop","xRight","tokenCount","usedWidth","lineXLeft","lineXRight","placeToken","setCtx","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","originalGlobalAlpha","onBgImageLoaded","parsePercent","res","textOffset","maxValue","needDrawText","textHelper","RectText","RectText_1","Displayable","coord","Displayable_1","ZImage","aspect","sWidth","sHeight","Image","require$$6","require$$7","require$$8","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","viewRect","isDisplayableCulled","isClipPathChanged","prevClipPaths","doClip","createRoot","domRoot","Painter","singleCanvas","rootStyle","zlevelList","layers","mainLayer","viewportRoot","paintAll","z","hoverStyle","elMirror","hoverElements","from","hoverLayer","scope","originalEl","redrawId","finished","layerList","zi","zlevel","useTimer","startTime","firstEl","dTime","currentLayer","forcePaint","prevElClipPaths","virtual","layersMap","prevLayer","prevDom","updatePrevLayer","incrementalLayerCount","prevZlevel","backgroundColor","layerConfig","_zlevel","imageLayer","whIdx","wh","cwh","plt","prb","canvas","shadowBlurSize","shadowOffsetX","shadowOffsetY","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","ImageShape","imgShape","Painter_1","_event","Dispatcher","Animation","clips","deferredEvents","deferredClips","step","Animation_1","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerHandlerNames","nm","globalNativeListenerNames","eventNameFix","isPointerFromTouch","pointerType","setTouchTimer","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","isLocal","fakeGlobalEventProto","localDOMHandlers","downPoint","togglePointerCapture","element","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","listener","unmountDOMEventListeners","mounted","isPointerCapturing","globalHandlerScope","DOMHandlerScope","domTarget","HandlerDomProxy","handlerDomProxyProto","HandlerProxy","useVML","painterCtors","instances","version","init","ZRender","dispose","getInstance","registerPainter","delInstance","rendererType","handerProxy","oldDelFromStorage","oldAddToStorage","zLevel","triggerRendered","zrender","DUMMY_COMPONENT_NAME_PREFIX","normalizeToArray","defaultEmphasis","subOpts","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","exists","newCptOptions","index","cptOption","exist","isIdInner","makeIdAndName","mapResult","idMap","item","existCpt","keyInfo","idNum","isNameSpecified","componentModel","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","otherDataIndices","lenj","dataIndex","isData","queryDataIndex","payload","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finder","defaultMainType","has","parsedKey","mainType","queryType","queryParam","models","setAttribute","getAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","keys","model","TYPE_DELIMITER","IS_CONTAINER","parseClassType","componentType","checkClassType","enableClassExtend","RootClass","mandatoryMethods","proto","superClass","ExtendedClass","superCall","superApply","classBase","enableClassCheck","Clz","classAttr","methodName","enableClassManagement","entity","Clazz","container","makeContainer","componentMainType","subType","throwWhenNotFound","o","types","originalExtend","setReadOnly","properties","excludes","includes","makeStyleMapper","getLineStyle","lineType","dotSize","dashSize","lineStyle","getAreaStyle","areaStyle","_vector","v2Create","v2DistSquare","mathPow","mathSqrt","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","cubicAt","onet","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x3","y3","interval","d1","d2","_t","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","curve","mathSin","mathCos","PI2","end","extremity","fromPoints","points","top","bottom","fromLine","xDim","yDim","fromCubic","fromQuadratic","tx","ty","fromArc","rx","ry","startAngle","endAngle","anticlockwise","vec2Min","vec2Max","diff","angle","bbox","CMD","min2","max2","mathAbs","hasTypedArray","PathProxy","notSaveData","segmentIgnoreThreshold","exceedUnit","cx","cy","radius","lineDash","lineDashSum","appendSize","appendPathData","cmd","newData","dashSum","dash","nDash","bezierLen","tmpLen","xi","yi","ux","uy","dTheta","psi","fs","scaleX","scaleY","isEllipse","PathProxy_1","containStroke","_l","_a","_b","_s","cubic","_curve","quadratic","normalizeRadian","arc","windingLine","dir","x_","windingLine_1","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","containPath","isStroke","_x","contain","pathData","pathContain","getCanvasPattern","abs","pathProxyForDraw","Path","hasStroke","hasFill","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","lineDashOffset","ctxLineDash","shapeCfg","inBundle","needsUpdateRect","rectWithStroke","lineScale","localPos","dirtyPath","Sub","defaultShape","thisShape","Path_1","mathAtan2","nPoint","M","Q","transformPath","PI","vMag","vRatio","u","vAngle","processArc","fa","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","off","ctlPtx","ctlPty","createPathOptions","pathProxy","createFromString","extendFromString","mergePath","pathEls","pathList","pathEl","pathBundle","Text","Text_1","Circle","shadowTemp","orignalBrush","modified","fixClipWithShadow","r0","clockwise","unitX","unitY","Sector","Ring","v2Distance","interpolate","isLoop","segs","w2","w3","smoothSpline","v2Min","v2Max","v2Scale","v2Add","v2Clone","v2Sub","smooth","constraint","cps","prevPoint","nextPoint","point","d0","cp0","cp1","smoothBezier","closePath","controlPoints","cp2","poly","polyHelper","Polygon","Polyline","round","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimize","subPixelOptimizeRect","originX","originY","originWidth","originHeight","positiveOrNegative","doubledPosition","subPixelOptimize_1","_subPixelOptimize","subPixelOptimizeOutputShape","Rect","Line","someVectorAt","isTangent","cpx2","cpy2","cpx1","cpy1","BezierCurve","Arc","paths","CompoundPath","Gradient","Gradient_1","LinearGradient","globalCoord","LinearGradient_1","RadialGradient","RadialGradient_1","Displayble","IncrementalDisplayble","notPersistent","displayables","IncrementalDisplayable","pathTool","colorTool","graphic","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","require$$22","require$$23","subPixelOptimizeUtil","require$$24","EMPTY_OBJ","Z2_EMPHASIS_LIFT","CACHED_LABEL_STYLE_PROPERTIES","EMPHASIS","NORMAL","_highlightNextDigit","_highlightKeyMap","_customShapeMap","extendShape","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","img","boundingRect","pathRect","hasFillOrStroke","fillOrStroke","liftedColorMap","liftedColorCount","liftColor","liftedColor","cacheElementStl","normalStyle","elStyle","singleEnterEmphasis","hoverStl","useHoverLayer","targetStyle","rollbackDefaultTextStyle","setDefaultHoverFillStroke","applyDefaultTextStyle","singleEnterNormal","highlighted","normalStl","normalZ2","traverseUpdate","updater","commonParam","fromState","toState","trigger","setElementHoverStyle","onElementMouseOver","shouldSilent","onElementMouseOut","onElementEmphasisEvent","highlightDigit","onElementNormalEvent","setHoverStyle","setAsHighDownDispatcher","asDispatcher","disable","isHighDownDispatcher","getHighlightDigit","highlightKey","setLabelStyle","emphasisStyle","normalModel","emphasisModel","normalSpecified","emphasisSpecified","labelFetcher","labelDataIndex","labelDimIndex","labelProp","showNormal","showEmphasis","baseText","normalStyleText","emphasisStyleText","setTextStyle","modifyLabelStyle","normalStyleProps","emphasisStyleProps","textStyle","textStyleModel","specifiedTextStyle","isEmphasis","setTextStyleCommon","setText","labelModel","defaultColor","labelRotate","globalTextStyle","richItemNames","getRichItemNames","richResult","richTextStyle","setTokenTextStyle","richItemNameMap","isBlock","getAutoColor","insideRollback","autoColor","isRectText","useInsideStyle","useInsideStyleCache","useAutoColorCache","getFont","gTextStyleModel","animateOrSetProps","isUpdate","animatableModel","animationEnabled","postfix","duration","animationEasing","animationDelay","updateProps","initProps","getTransform","ancestor","mat","transformDirection","direction","hBase","vBase","vertex","groupTransition","g1","g2","getElMap","elMap","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphicUtil","PATH_COLOR","getItemStyle","itemStyle","_model","_clazz","lineStyleMixin","areaStyleMixin","textStyleMixin","itemStyleMixin","inner","Model","option","parentModel","ignoreParent","doGet","getParent","thisParentModel","getParentMethod","pathArr","Model_1","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","defaulter","componentTypeMain","enableTopologicalTravel","dependencyGetter","targetNameList","fullNameList","makeDepndencyGraph","graph","stack","targetNameSet","currComponentType","currVertex","isInTargetNameSet","removeEdgeAndAdd","removeEdge","succComponentType","noEntryList","thisItem","createDependencyGraphItem","originalDeps","availableDeps","getAvailableDependencies","dependentName","thatItem","dep","component","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","all","precision","returnStr","asc","arr","getPrecision","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","maxId","MAX_SAFE_INTEGER","remRadian","radian","pi2","isRadianAroundZero","TIME_REG","parseDate","match","hour","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close","lg","isNumeric","number","numberUtil","addCommas","toCamelCase","upperCaseFirst","group1","replaceReg","replaceMap","encodeHTML","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","extraCssText","renderMode","markerId","pad","formatTime","isUTC","date","utc","capitalFirst","getTextBoundingRect","getTextRect","windowOpen","link","blank","format","_number","formatUtil","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","group","gap","maxWidth","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","moveY","vbox","hbox","getAvailableSize","positionInfo","containerRect","margin","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","positionElement","boundingMode","elPos","sizeCalculable","hvIdx","mergeLayoutParam","targetOption","newOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","componentUtil","boxLayoutMixin","ComponentModel","extraOpt","layoutMode","inputPositionParams","themeModel","newCptOption","isInit","fields","optList","Class","defaultOption","getDependencies","deps","Component","platform","globalDefault","getNearestColorPalette","requestColorNum","paletteNum","scopeFields","colorIdx","colorNameMap","defaultColorPalette","layeredColorPalette","colorPalette","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_UNKNOWN","SOURCE_FORMAT_TYPED_ARRAY","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","sourceType","_sourceType","Source","Source_1","BE_ORDINAL","detectSourceFormat","datasetModel","sourceFormat","getSource","seriesModel","resetSourceDefaulter","prepareSource","seriesOption","fromDataset","seriesLayoutBy","sourceHeader","dimensionsDefine","getDatasetModel","datasetOption","completeResult","completeBySourceData","normalizeDimensionsDefine","dimensionsDetectCount","startIndex","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","nameMap","maxLoop","firstIndex","dimensions","makeSeriesEncodeForAxisCoordSys","coordDimensions","encodeItemName","encodeSeriesName","datasetMap","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfo","coordDimIdx","getDataDimCountOnCoordDim","datasetRecord","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","makeSeriesEncodeForNameBased","dimCount","potentialNameDimIndex","dim","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","guessOrdinal","dimIndex","dimName","dimType","dimDefItem","sample","detectValue","row","beStr","sourceHelper","modelUtil","colorPaletteMixin","_sourceHelper","OPTION_INNER_KEY","GlobalModel","theme","optionManager","optionPreprocessorFuncs","optionChanged","baseOption","initBase","timelineOption","mediaOptions","mediaOption","componentsMap","newCptTypes","componentOption","visitComponent","dependencies","newCptOptionList","determineSubType","dependentModels","getComponentsByTypes","resultItem","ComponentModelClass","createSeriesIndices","cpts","isIdArray","cpt","isNameArray","filterBySubType","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","components","queryResult","series","oneSeries","seriesIndex","rawSeriesIndex","filteredSeries","componentTypes","isNotTargetSeries","mergeTheme","notMergeColorLayer","themeItem","existComponent","seriesModels","Global","echartsAPIList","ExtensionAPI","chartInstance","ExtensionAPI_1","coordinateSystemCreators","CoordinateSystemManager","api","coordinateSystems","creater","coordSys","coordinateSystemCreator","CoordinateSystem","QUERY_REG","OptionManager","rawOption","oldOptionBackup","newParsedOption","parseRawOption","mergeOption","isRecreate","optionBackup","timelineOptions","timelineModel","ecWidth","ecHeight","mediaList","mediaDefault","indices","applyMediaQuery","indicesEquals","isNew","timelineOpt","media","singleMedia","preProcess","realMap","applicatable","attr","matched","operator","realAttr","real","expect","indices1","indices2","oldOption","newCptOpt","oldCptOpt","OptionManager_1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","edgeData","mpData","mlData","toArr","toObj","isTheme","axes","axisName","axisOpt","parallelOpt","parallelAxisDefault","calendarOpt","radarOpt","geoOpt","regionObj","toolboxOpt","featureOpt","compatStyle","get","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","seriesType","pointerColor","componentName","backwardCompat","stackInfoMap","stackInfoList","stackInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","isStackedByIndex","byValue","stackedDataRawIndex","stackedOver","dataStack","DefaultDataProvider","dimSize","providerMethods","providerProto","appendDataSimply","countSimply","getItemSimply","col","newCol","oldCol","rawValueGetters","getRawValueSimply","defaultDimValueGetters","getDimValueSimply","converDataValue","dimInfo","ordinalMeta","retrieveRawValue","retrieveRawAttr","dataProvider","_dataProvider","_format","DIMENSION_LABEL_REG","dataType","rawValue","rawDataIndex","itemOpt","borderColor","tooltipModel","isSeries","userOutput","status","itemModel","formatter","dataFormat","createTask","define","Task","taskProto","performArgs","upTask","skip","planResult","lastModBy","normalizeModBy","lastModDataCount","modBy","modDataCount","forceFirstProgress","reset","progress","doProgress","outputDueEnd","iterator","current","winCount","it","sStep","sCount","modNext","sequentialNext","taskIns","downstream","downTask","task","dataFormatMixin","_layout","_task","SeriesModel","dataTaskCount","dataTaskReset","wrapData","autoSeriesName","themeSubType","newSeriesOption","getCurrentTask","multipleSeries","newLine","isRichText","formatArrayValue","vertially","dimItem","tooltipDims","setEachItem","markName","dimHead","dimHeadStr","valStr","content","formatSingleValue","tooltipDimLen","isValueArr","formattedValue","colorEl","seriesName","html","coordDim","getSeriesAutoName","dataDims","nameArr","dataDim","dataTaskProgress","onDataSelfChange","scheduler","pipeline","agentStubMap","Series","clazzUtil","componentProto","Component_1","pipelineContext","originalLarge","originalProgressive","large","progressive","createRenderPlanner","renderPlanner","Chart","renderTaskPlan","renderTaskReset","toggleHighlight","chartProto","elSetState","state","dataIdx","progressiveRender","view","updateMethod","progressMethodMap","Chart_1","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","exec","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","clear","throttle_1","colorAccessPath","colorCallback","borderColorAccessPath","dataEach","seriesColor","lang","ariaModel","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","title","getTitle","replace","getConfig","seriesLabels","prefix","seriesLabel","seriesTpl","getSeriesTypeName","dataLabels","keyValues","userConfig","aria","mask","labelRect","_default_1","_component","Scheduler","ecInstance","dataProcessorHandlers","visualHandlers","taskRecord","overallTask","pCtx","incremental","pipelineId","dataLen","pipelineMap","pipe","stageTaskMap","record","createSeriesStageTask","createOverallStageTask","renderTask","performStageTasks","stageHandlers","unfinished","stageHandler","stageHandlerRecord","seriesTaskMap","overallNeedDirty","stub","needSetDirty","updatePayload","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","overallTaskReset","overallProgress","modifyOutputEnd","createStub","stubReset","stubOnDirty","upstreamContext","stubProgress","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","visualType","detectSeriseType","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Scheduler_1","colorAll","light","contrastColor","axisCommon","dark","ComponentView","ox","oy","Ellipse","_path","DILIMITER_REG","parseXML","svg","parser","SVGParser","xml","viewBox","parseAttributes","viewBoxRect","viewBoxTransform","viewBoxArr","makeViewBoxTransform","elRoot","xmlNode","parentGroup","nodeName","defineParsers","def","nodeParsers","inheritStyle","fontSize","circle","ellipse","parsePoints","polygon","polyline","gradient","_parseGradientColorStops","stopColor","pointsString","attributesMap","defs","onlyInlineStyle","zrStyle","isTextEl","parseTransformAttribute","parseStyleAttribute","svgAttrName","attrValue","elFillProp","elStrokeProp","getPaint","elPropName","urlRegex","urlMatch","url","transformRegex","node","transformOps","styleRegex","styleList","styleRegResult","viewBoxScale","viewBoxPosition","parseSVG","parseSVG_1","_parseSVG","mapName","rawGeoJson","rawSpecialAreas","records","parsers","mapDataStorage","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","oldDataIndexMap","newDataIndexMap","oldDataKeyArr","newDataKeyArr","initIndexMap","keyArr","keyGetterName","dataDiffer","existence","DataDiffer_1","OTHER_DIMENSIONS","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","mayLabelDimType","otherDim","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","dimensionHelper","DataDimensionInfo","DataDimensionInfo_1","_dimensionHelper","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","CtorUint32Array","CtorInt32Array","CtorUint16Array","getIndicesCtor","cloneChunk","originalChunk","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","transferProperties","List","hostModel","dimensionInfos","dimensionNames","invertedIndicesMap","dimensionInfo","dimensionName","listProto","dimensionsSummary","nameList","dimValueGetter","notProvider","rawData","chunkSize","dimLen","rawExtent","originalChunkCount","getInitialExtent","prepareChunks","emptyDataItem","sourceIdx","chunkIndex","chunkOffset","dimRawExtent","prepareInvertedIndex","dimensionInfoMap","idList","nameRepeatCount","nameDimIdx","dimStorage","nameDim","nameDimChunk","chunkCount","DataCtor","lastChunkIndex","resizeChunkArray","newStore","invertedIndices","getRawValueFromStore","rawIndex","chunk","newIndices","thisCount","chunkStore","rawIdx","dimStore","dimData","initialExtent","currEnd","useRaw","dimExtent","extent","dimDataArray","sortedDimDataArray","maxDistance","nearestIndices","minDist","minDiff","nearestIndicesLen","getRawIndexWithoutIndices","getRawIndexWithIndices","getId","normalizeDimensions","contextCompat","dim0","keep","originalCount","quickFinished","chunkStorage","dimStorage2","chunkStorage2","val2","dimk","cloneListForMapAndSample","original","excludeDimensions","allDimensions","originalStorage","cloneDimStore","originalDimStore","newDimStore","tmpRetValue","dataCount","retValue","rawExtentOnDim","dimension","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","originalChunkIndex","originalChunkOffset","sampleFrameIdx","sampleChunkIndex","sampleChunkOffset","otherList","thisList","visual","itemVisual","hasItemVisual","setItemDataAndSeriesIndex","dimensionInfoList","injectFunction","originalMethod","List_1","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","userDimName","encodeDef","validDataDims","resultDimIdx","applyDim","availDimIdx","sysDimItem","sysDimIndex","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","extra","genName","optDimCount","completeDimensions_1","createDimensions","CoordSysInfo","coordSysName","getCoordSysInfoBySeries","fetch","fetchers","axisMap","categoryAxisMap","xAxisModel","yAxisModel","isCategory","singleAxisModel","polarModel","radiusAxisModel","angleAxisModel","parallelModel","coordSysDims","axisIndex","axisModel","axisDim","referHelper","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackResultDimension","stackedOverDimension","stackedDimCoordDim","stackedDimType","stackedDimCoordIndex","isDimensionStacked","stackedDim","getStackedDimension","targetDim","dataStackHelper","_referHelper","_dataStackHelper","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","dimInfoList","firstCategoryDimIndex","hasNameEncode","categoryAxisModel","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","createListFromArray_1","Scale","setting","thisExtent","isBlank","Scale_1","OrdinalMeta","categories","getName","category","getOrCreateMap","needCollect","OrdinalMeta_1","scaleProto","OrdinalScale","ticks","Ordinal","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","getIntervalPrecision","niceTickExtent","fixExtent","helper","IntervalScale","expandToNicedExtent","intervalPrecision","safeLimit","tick","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","expandSize","Interval","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","axis","getLayoutOnAxis","baseAxis","axisKey","bandWidth","widthAndOffsets","doCalBarWidthAndOffset","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","minGap","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","stacks","stackId","categoryGap","barGapPercent","remainedWidth","autoWidthCount","autoWidth","column","minWidth","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","valueAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","valueAxisStart","getValueAxisStart","baseValue","sign","baseCoord","largeLayout","coordLayout","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","barGrid","scaleHelper","intervalScaleProto","mathCeil","mathFloor","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","bisect","TimeScale","stepLvl","approxTickNum","approxInterval","scaleLevelsLen","scaleLevels","yearSpan","yearStep","timezoneOffset","niceExtent","roundingErrorFix","mathLog","LogScale","originalScale","originalExtent","powVal","fixRoundingError","err","originalVal","Log","_barGrid","getScaleExtent","scaleType","axisDataLen","boundaryGap","fixMin","fixMax","barSeriesModels","isBaseAxisAndHasBarSeries","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","labelFormatter","categoryTickStart","tickValue","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","tickCount","categoryScaleExtent","axisLabelModel","label","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","boundingBox","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","axisHelper","rangeStart","rangeEnd","axisModelCommonMixin","_text","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","symbolShapeMakers","size","symbolBuildProxies","SymbolClz","symbolType","proxySymbol","symbolPathSetColor","innerColor","symbolStyle","symbolShape","createSymbol","keepAspect","isEmpty","symbolPath","symbol","_completeDimensions","_createDimensions","_symbol","createList","createScale","mixinAxisModelCommonMethods","polygonContain","Region","geometries","cp","MAX_NUMBER","exterior","loopGeo","interiors","newRegion","Region_1","decode","json","encodeScale","features","feature","geometry","coordinates","encodeOffsets","coordinate","decodePolygon","c2","prevX","prevY","geoJson","nameProperty","featureObj","geo","region","parseGeoJson","_axisHelper","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","makeCategoryLabelsActually","labelsCache","getListCache","optionLabelInterval","listCacheGet","labels","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","labelItem","cache","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","categoryInterval","onlyTick","startTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tVal","rawLabel","axisTickLabelBuilder","_axisTickLabelBuilder","NORMALIZED_EXTENT","Axis","fixExtentWithBands","ticksCoords","alignWithLabel","fixOnBandTicksCoords","minorTickModel","minorTicksCoords","nTick","ticksLen","last","diffSize","crossLen","shift","ticksItem","Axis_1","_export","_throttle","ecHelper","parseGeoJSON","_List","_Model","_Axis","_env","ecUtil","ChartView","loadingDefault","lightTheme","darkTheme","require$$25","require$$27","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_BRUSH","PRIORITY","IN_MAIN_PROCESS","OPTION_UPDATED","ACTION_REG","createRegisterEventWithLowercaseName","ignoreDisposed","MessageCenter","ECharts","themeStorage","defaultRenderer","createExtensionAPI","prioritySortFunc","visualFuncs","dataProcessorFuncs","EventProcessor","bindRenderedEvent","echartsProto","silent","prepare","updateMethods","flushPendingActions","triggerUpdatedEvent","remainTime","updateStreamModes","renderSeries","notMerge","lazyUpdate","excludeComponents","excludesComponentViews","isSvg","groupId","connectedGroups","canvasList","chart","targetCanvas","doConvertPixel","coordSysList","dataIndexInside","coordSysMgr","clearColorPalette","render","performPostUpdateFuncs","ecIns","componentDirtyList","componentView","seriesDirtyMap","chartView","prepareView","updateDirectly","callView","excludeSeriesId","chartsMap","cfg","loadingEffects","eventObj","eventActionMap","actions","doDispatchAction","payloadType","escapeConnect","actionWrap","actionInfo","cptType","payloads","batched","eventObjBatch","isHighDown","batchItem","pendingActions","isComponent","viewList","viewMap","doPrepare","viewId","classType","renderComponents","dirtyList","updateZ","dirtyMap","updateBlend","updateHoverLayerStatus","postUpdateFuncs","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","componentIndex","actionType","DOM_ATTRIBUTE_KEY","disposedWarning","elCount","blendMode","modelInfo","cptQuery","dataQuery","otherQuery","condCptType","suffixes","dataKeys","reserved","propSuffix","suffixPos","eventInfo","targetEl","packedEvent","check","propOnHost","idBase","groupIdBase","enableConnect","STATUS_PENDING","STATUS_UPDATING","STATUS_UPDATED","STATUS_KEY","updateConnectedChartsStatus","charts","otherChart","action","otherCharts","existInstance","getInstanceByDom","connect","disConnect","disconnect","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","priority","processor","normalizeRegister","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","getCoordinateSystemDimensions","coordSysCreator","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","creator","registerMap","specialAreas","getMap","dataTool","exports","___ec_export","require$$28"],"mappings":"6DA6CI,OAAO,OAAW,KAGb,OAAOA,GAAW,KACjBA,GAAO,kBC5CbC,GAAU,KAEd,SAASC,IAAW,CAClB,OAAOD,IACT,CAEA,IAAAE,GAAiBD,GCFbE,GAAM,CAAE,EAER,OAAO,IAAO,UAAY,OAAO,GAAG,mBAAsB,WAE5DA,GAAM,CACJ,QAAS,CAAE,EACX,GAAI,CAAE,EACN,KAAM,GACN,IAAK,GAEL,gBAAiB,GACjB,aAAc,GACd,qBAAsB,GACtB,aAAc,EACf,EACQ,OAAO,SAAa,KAAe,OAAO,KAAS,IAE5DA,GAAM,CACJ,QAAS,CAAE,EACX,GAAI,CAAE,EACN,KAAM,GACN,OAAQ,GACR,gBAAiB,GACjB,aAAc,EACf,EACQ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E,EAAA,SAAmBD,GACnB,IAAIE,GAAeC,GAAmB,GACrC,UAAY,CACT,QAAS3+F,KAAO0+F,GACRA,GAAa,eAAe1+F,CAAG,IAC/By+F,EAAQz+F,CAAG,EAAI0+F,GAAa1+F,CAAG,EAG3C","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150]}