diff --git a/README.md b/README.md index fed6653..383f69d 100644 --- a/README.md +++ b/README.md @@ -28,22 +28,25 @@ npm install echarts-liquidfill npm will warn you that you have to install peer dependencies by yourself: ``` -npm WARN echarts-liquidfill@2.0.4 requires a peer of echarts@^4.2.1 but none is installed. You must install peer dependencies yourself. -npm WARN echarts-liquidfill@2.0.4 requires a peer of zrender@^4.0.7 but none is installed. You must install peer dependencies yourself. +npm WARN echarts-liquidfill@2.0.6 requires a peer of echarts@^4.8.0 but none is installed. You must install peer dependencies yourself. +npm WARN echarts-liquidfill@2.0.6 requires a peer of zrender@^4.3.1 but none is installed. You must install peer dependencies yourself. ``` -Note that the version number may change in your case. Install will the version it shows. +**Note that the version numbers may not be exactly the same with the above message. Use the version numbers in the warning or refer to package.json for echarts and zrender version numbers.** ``` -npm i echarts@^4.2.1 zrender@^4.0.7 +npm i echarts@^4.8.0 zrender@^4.3.1 ``` +Remember to install echarts and zrender manually with the above command. + ## Download echarts-liquidfill from GitHub -You may download the lastest ECharts files on [ECharts official site](http://echarts.baidu.com/download.html) and download this plugin in [dist directory](https://github.com/ecomfe/echarts-liquidfill/tree/master/dist). Note that if you need tooltip for Liquid Fill Chart, you need the complete ECharts version. Otherwise, simple version will do. +You may download the lastest ECharts files on [ECharts official site](http://echarts.baidu.com/download.html) and download this plugin in [dist directory](https://github.com/ecomfe/echarts-liquidfill/tree/master/dist). +**Note that if you need tooltip for Liquid Fill Chart, you need the complete ECharts version. Otherwise, the simple version will be competent.** -## Notes +## Important Notes ### Omitted `normal` diff --git a/dist/echarts-liquidfill.js b/dist/echarts-liquidfill.js index 90d1fb6..e503adc 100644 --- a/dist/echarts-liquidfill.js +++ b/dist/echarts-liquidfill.js @@ -96,17 +96,6 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ({ -/***/ "../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi4vLi4vLi4vLi4vVXNlcnMvemhhbmd3ZW5saTAxLy5udm0vdmVyc2lvbnMvbm9kZS92MTAuMTAuMC9saWIvbm9kZV9tb2R1bGVzL3dlYnBhY2svYnVpbGRpbi9nbG9iYWwuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvKHdlYnBhY2spL2J1aWxkaW4vZ2xvYmFsLmpzP2NkMDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGc7XHJcblxyXG4vLyBUaGlzIHdvcmtzIGluIG5vbi1zdHJpY3QgbW9kZVxyXG5nID0gKGZ1bmN0aW9uKCkge1xyXG5cdHJldHVybiB0aGlzO1xyXG59KSgpO1xyXG5cclxudHJ5IHtcclxuXHQvLyBUaGlzIHdvcmtzIGlmIGV2YWwgaXMgYWxsb3dlZCAoc2VlIENTUClcclxuXHRnID0gZyB8fCBGdW5jdGlvbihcInJldHVybiB0aGlzXCIpKCkgfHwgKDEsIGV2YWwpKFwidGhpc1wiKTtcclxufSBjYXRjaCAoZSkge1xyXG5cdC8vIFRoaXMgd29ya3MgaWYgdGhlIHdpbmRvdyByZWZlcmVuY2UgaXMgYXZhaWxhYmxlXHJcblx0aWYgKHR5cGVvZiB3aW5kb3cgPT09IFwib2JqZWN0XCIpIGcgPSB3aW5kb3c7XHJcbn1cclxuXHJcbi8vIGcgY2FuIHN0aWxsIGJlIHVuZGVmaW5lZCwgYnV0IG5vdGhpbmcgdG8gZG8gYWJvdXQgaXQuLi5cclxuLy8gV2UgcmV0dXJuIHVuZGVmaW5lZCwgaW5zdGVhZCBvZiBub3RoaW5nIGhlcmUsIHNvIGl0J3NcclxuLy8gZWFzaWVyIHRvIGhhbmRsZSB0aGlzIGNhc2UuIGlmKCFnbG9iYWwpIHsgLi4ufVxyXG5cclxubW9kdWxlLmV4cG9ydHMgPSBnO1xyXG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js\n"); - -/***/ }), - /***/ "./index.js": /*!******************!*\ !*** ./index.js ***! @@ -114,7 +103,8 @@ eval("var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\tr /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./src/liquidFill */ \"./src/liquidFill.js\");\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9pbmRleC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL2luZGV4LmpzPzQxZjUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL3NyYy9saXF1aWRGaWxsJyk7XG4iXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./index.js\n"); +module.exports = __webpack_require__(/*! ./src/liquidFill */ "./src/liquidFill.js"); + /***/ }), @@ -125,854 +115,17705 @@ eval("module.exports = __webpack_require__(/*! ./src/liquidFill */ \"./src/liqui /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("/* WEBPACK VAR INJECTION */(function(global) {\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/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js */ \"../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js\")))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvY29uZmlnLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL2NvbmZpZy5qcz80ZTA4Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50cy4gIFNlZSB0aGUgTk9USUNFIGZpbGVcbiogZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHdvcmsgZm9yIGFkZGl0aW9uYWwgaW5mb3JtYXRpb25cbiogcmVnYXJkaW5nIGNvcHlyaWdodCBvd25lcnNoaXAuICBUaGUgQVNGIGxpY2Vuc2VzIHRoaXMgZmlsZVxuKiB0byB5b3UgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlXG4qIFwiTGljZW5zZVwiKTsgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZVxuKiB3aXRoIHRoZSBMaWNlbnNlLiAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0XG4qXG4qICA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3dzZXJcblxuaWYgKHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnKSB7XG4gIGRldiA9IHdpbmRvdy5fX0RFVl9fO1xufSAvLyBJbiBub2RlXG5lbHNlIGlmICh0eXBlb2YgZ2xvYmFsICE9PSAndW5kZWZpbmVkJykge1xuICAgIGRldiA9IGdsb2JhbC5fX0RFVl9fO1xuICB9XG5cbmlmICh0eXBlb2YgZGV2ID09PSAndW5kZWZpbmVkJykge1xuICBkZXYgPSB0cnVlO1xufVxuXG52YXIgX19ERVZfXyA9IGRldjtcbmV4cG9ydHMuX19ERVZfXyA9IF9fREVWX187Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/config.js\n"); +/* WEBPACK VAR INJECTION */(function(global) { +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ }), +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +// (1) The code `if (__DEV__) ...` can be removed by build tool. +// (2) If intend to use `__DEV__`, this module should be imported. Use a global +// variable `__DEV__` may cause that miss the declaration (see #6535), or the +// declaration is behind of the using position (for example in `Model.extent`, +// And tools like rollup can not analysis the dependency if not import). +var dev; // In browser -/***/ "./node_modules/echarts/lib/data/Source.js": -/*!*************************************************!*\ - !*** ./node_modules/echarts/lib/data/Source.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +if (typeof window !== 'undefined') { + dev = window.__DEV__; +} // In node +else if (typeof global !== 'undefined') { + dev = global.__DEV__; + } + +if (typeof dev === 'undefined') { + dev = true; +} -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\nvar isTypedArray = _util.isTypedArray;\n\nvar _clazz = __webpack_require__(/*! ../util/clazz */ \"./node_modules/echarts/lib/util/clazz.js\");\n\nvar enableClassCheck = _clazz.enableClassCheck;\n\nvar _sourceType = __webpack_require__(/*! ./helper/sourceType */ \"./node_modules/echarts/lib/data/helper/sourceType.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9Tb3VyY2UuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9Tb3VyY2UuanM/ZWM2ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJcbi8qXG4qIExpY2Vuc2VkIHRvIHRoZSBBcGFjaGUgU29mdHdhcmUgRm91bmRhdGlvbiAoQVNGKSB1bmRlciBvbmVcbiogb3IgbW9yZSBjb250cmlidXRvciBsaWNlbnNlIGFncmVlbWVudHMuICBTZWUgdGhlIE5PVElDRSBmaWxlXG4qIGRpc3RyaWJ1dGVkIHdpdGggdGhpcyB3b3JrIGZvciBhZGRpdGlvbmFsIGluZm9ybWF0aW9uXG4qIHJlZ2FyZGluZyBjb3B5cmlnaHQgb3duZXJzaGlwLiAgVGhlIEFTRiBsaWNlbnNlcyB0aGlzIGZpbGVcbiogdG8geW91IHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZVxuKiBcIkxpY2Vuc2VcIik7IHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Vcbiogd2l0aCB0aGUgTGljZW5zZS4gIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuKlx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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/Source.js\n"); +var __DEV__ = dev; +exports.__DEV__ = __DEV__; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) /***/ }), -/***/ "./node_modules/echarts/lib/data/helper/completeDimensions.js": -/*!********************************************************************!*\ - !*** ./node_modules/echarts/lib/data/helper/completeDimensions.js ***! - \********************************************************************/ +/***/ "./node_modules/echarts/lib/data/DataDimensionInfo.js": +/*!************************************************************!*\ + !*** ./node_modules/echarts/lib/data/DataDimensionInfo.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 = __webpack_require__(/*! ../../util/model */ \"./node_modules/echarts/lib/util/model.js\");\n\nvar normalizeToArray = _model.normalizeToArray;\n\nvar _sourceHelper = __webpack_require__(/*! ./sourceHelper */ \"./node_modules/echarts/lib/data/helper/sourceHelper.js\");\n\nvar guessOrdinal = _sourceHelper.guessOrdinal;\n\nvar Source = __webpack_require__(/*! ../Source */ \"./node_modules/echarts/lib/data/Source.js\");\n\nvar _dimensionHelper = __webpack_require__(/*! ./dimensionHelper */ \"./node_modules/echarts/lib/data/helper/dimensionHelper.js\");\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\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 * Complete the dimensions array, by user defined `dimension` and `encode`,\n * and guessing from the data structure.\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 {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 * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.\n * @return {Array.} [{\n * name: string mandatory,\n * displayName: string, the origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * coordDim: string mandatory,\n * coordDimIndex: number mandatory,\n * type: string optional,\n * otherDims: { never null/undefined\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * },\n * isExtraCoord: boolean true if coord is generated\n * (not specified in encode and not series specified)\n * other props ...\n * }]\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 encodeDef = createHashMap(opt.encodeDef);\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] = {\n otherDims: {}\n }; // 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 } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\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 && 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] || {};\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)) {\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9oZWxwZXIvY29tcGxldGVEaW1lbnNpb25zLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL2RhdGEvaGVscGVyL2NvbXBsZXRlRGltZW5zaW9ucy5qcz84NjJkIl0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50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ic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/completeDimensions.js\n"); -/***/ }), +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ "./node_modules/echarts/lib/data/helper/dimensionHelper.js": -/*!*****************************************************************!*\ - !*** ./node_modules/echarts/lib/data/helper/dimensionHelper.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var zrUtil = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar each = _util.each;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\n\nvar _config = __webpack_require__(/*! ../../config */ \"./node_modules/echarts/lib/config.js\");\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 = [];\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n var coordDimArr = encode[coordDim];\n\n if (!encode.hasOwnProperty(coordDim)) {\n coordDimArr = encode[coordDim] = [];\n }\n\n coordDimArr[dimItem.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 }\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n OTHER_DIMENSIONS.each(function (v, otherDim) {\n var otherDimArr = encode[otherDim];\n\n if (!encode.hasOwnProperty(otherDim)) {\n otherDimArr = encode[otherDim] = [];\n }\n\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n otherDimArr[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 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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,e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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/dimensionHelper.js\n"); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ }), +/** + * @class + * @param {Object|DataDimensionInfo} [opt] All of the fields will be shallow copied. + */ +function DataDimensionInfo(opt) { + if (opt != null) { + zrUtil.extend(this, opt); + } + /** + * Dimension name. + * Mandatory. + * @type {string} + */ + // this.name; -/***/ "./node_modules/echarts/lib/data/helper/sourceHelper.js": -/*!**************************************************************!*\ - !*** ./node_modules/echarts/lib/data/helper/sourceHelper.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + /** + * The origin name in dimsDef, see source helper. + * If displayName given, the tooltip will displayed vertically. + * Optional. + * @type {string} + */ + // this.displayName; -eval("\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 = __webpack_require__(/*! ../../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _model = __webpack_require__(/*! ../../util/model */ \"./node_modules/echarts/lib/util/model.js\");\n\nvar makeInner = _model.makeInner;\nvar getDataItemValue = _model.getDataItemValue;\n\nvar _referHelper = __webpack_require__(/*! ../../model/referHelper */ \"./node_modules/echarts/lib/model/referHelper.js\");\n\nvar getCoordSysDefineBySeries = _referHelper.getCoordSysDefineBySeries;\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 = __webpack_require__(/*! ../Source */ \"./node_modules/echarts/lib/data/Source.js\");\n\nvar _sourceType = __webpack_require__(/*! ./sourceType */ \"./node_modules/echarts/lib/data/helper/sourceType.js\");\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*/\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); // Note: dataset option does not have `encode`.\n\n var encodeDefine = seriesOption.encode;\n\n if (!encodeDefine && datasetModel) {\n encodeDefine = makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult);\n }\n\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 encodeDefine: encodeDefine\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 var findPotentialName;\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 findPotentialName = true;\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n findPotentialName = true;\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 var potentialNameDimIndex;\n\n if (findPotentialName) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine),\n dimensionsDetectCount: dimensionsDetectCount,\n potentialNameDimIndex: potentialNameDimIndex // TODO: potentialIdDimIdx\n\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} // ??? TODO merge to completedimensions, where also has\n// default encode making logic. And the default rule\n// should depends on series? consider 'map'.\n\n\nfunction makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult) {\n var coordSysDefine = getCoordSysDefineBySeries(seriesModel);\n var encode = {}; // var encodeTooltip = [];\n // var encodeLabel = [];\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var seriesType = seriesModel.subType; // ??? TODO refactor: provide by series itself.\n // Consider the case: 'map' series is based on geo coordSys,\n // 'graph', 'heatmap' can be based on cartesian. But can not\n // give default rule simply here.\n\n var nSeriesMap = createHashMap(['pie', 'map', 'funnel']);\n var cSeriesMap = createHashMap(['line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot']); // Usually in this case series will use the first data\n // dimension as the \"value\" dimension, or other default\n // processes respectively.\n\n if (coordSysDefine && cSeriesMap.get(seriesType) != null) {\n var ecModel = seriesModel.ecModel;\n var datasetMap = inner(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + seriesLayoutBy;\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: 1,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordSysDefine.coordSysDims, function (coordDim) {\n // In value way.\n if (coordSysDefine.firstCategoryDimIndex == null) {\n var dataDim = datasetRecord.valueWayDim++;\n encode[coordDim] = dataDim; // ??? 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\n encodeSeriesName.push(dataDim); // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n } // In category way, category axis.\n else if (coordSysDefine.categoryAxisMap.get(coordDim)) {\n encode[coordDim] = 0;\n encodeItemName.push(0);\n } // In category way, non-category axis.\n else {\n var dataDim = datasetRecord.categoryWayDim++;\n encode[coordDim] = dataDim; // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n\n encodeSeriesName.push(dataDim);\n }\n });\n } // Do not make a complex rule! Hard to code maintain and not necessary.\n // ??? TODO refactor: provide by series itself.\n // [{name: ..., value: ...}, ...] like:\n else if (nSeriesMap.get(seriesType) != null) {\n // Find the first not ordinal. (5 is an experience value)\n var firstNotOrdinal;\n\n for (var i = 0; i < 5 && firstNotOrdinal == null; i++) {\n if (!doGuessOrdinal(data, sourceFormat, seriesLayoutBy, completeResult.dimensionsDefine, completeResult.startIndex, i)) {\n firstNotOrdinal = i;\n }\n }\n\n if (firstNotOrdinal != null) {\n encode.value = firstNotOrdinal;\n var nameDimIndex = completeResult.potentialNameDimIndex || Math.max(firstNotOrdinal - 1, 0); // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encodeSeriesName.push(nameDimIndex);\n encodeItemName.push(nameDimIndex); // encodeTooltip.push(firstNotOrdinal);\n }\n } // encodeTooltip.length && (encode.tooltip = encodeTooltip);\n // encodeLabel.length && (encode.label = encodeLabel);\n\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\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 {boolean} Whether ordinal.\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\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 false;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n\n if (dimensionsDefine) {\n dimName = dimensionsDefine[dimIndex];\n dimName = isObject(dimName) ? dimName.name : dimName;\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;\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;\n }\n\n var sample = data[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return false;\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 false;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n if (val != null && isFinite(val) && val !== '') {\n return false;\n } else if (isString(val) && val !== '-') {\n return true;\n }\n }\n\n return false;\n}\n\nexports.detectSourceFormat = detectSourceFormat;\nexports.getSource = getSource;\nexports.resetSourceDefaulter = resetSourceDefaulter;\nexports.prepareSource = prepareSource;\nexports.guessOrdinal = guessOrdinal;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9oZWxwZXIvc291cmNlSGVscGVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL2RhdGEvaGVscGVyL3NvdXJjZUhlbHBlci5qcz8wZjk5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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/sourceHelper.js\n"); + /** + * Which coordSys dimension this dimension mapped to. + * A `coordDim` can be a "coordSysDim" that the coordSys required + * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`), + * or an generated "extra coord name" if does not mapped to any "coordSysDim" + * (That is determined by whether `isExtraCoord` is `true`). + * Mandatory. + * @type {string} + */ + // this.coordDim; -/***/ }), + /** + * The index of this dimension in `series.encode[coordDim]`. + * Mandatory. + * @type {number} + */ + // this.coordDimIndex; -/***/ "./node_modules/echarts/lib/data/helper/sourceType.js": -/*!************************************************************!*\ - !*** ./node_modules/echarts/lib/data/helper/sourceType.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + /** + * Dimension type. The enumerable values are the key of + * `dataCtors` of `data/List`. + * Optional. + * @type {string} + */ + // this.type; -eval("\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9oZWxwZXIvc291cmNlVHlwZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy9lY2hhcnRzL2xpYi9kYXRhL2hlbHBlci9zb3VyY2VUeXBlLmpzPzkzZDAiXSwic291cmNlc0NvbnRlbnQiOlsiXG4vKlxuKiBMaWNlbnNlZCB0byB0aGUgQXBhY2hlIFNvZnR3YXJlIEZvdW5kYXRpb24gKEFTRikgdW5kZXIgb25lXG4qIG9yIG1vcmUgY29udHJpYnV0b3IgbGljZW5zZSBhZ3JlZW1lbnRzLiAgU2VlIHRoZSBOT1RJQ0UgZmlsZVxuKiBkaXN0cmlidXRlZCB3aXRoIHRoaXMgd29yayBmb3IgYWRkaXRpb25hbCBpbmZvcm1hdGlvblxuKiByZWdhcmRpbmcgY29weXJpZ2h0IG93bmVyc2hpcC4gIFRoZSBBU0YgbGljZW5zZXMgdGhpcyBmaWxlXG4qIHRvIHlvdSB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGVcbiogXCJMaWNlbnNlXCIpOyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBma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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/sourceType.js\n"); + /** + * This index of this dimension info in `data/List#_dimensionInfos`. + * Mandatory after added to `data/List`. + * @type {number} + */ + // this.index; -/***/ }), + /** + * The format of `otherDims` is: + * ```js + * { + * tooltip: number optional, + * label: number optional, + * itemName: number optional, + * seriesName: number optional, + * } + * ``` + * + * A `series.encode` can specified these fields: + * ```js + * encode: { + * // "3, 1, 5" is the index of data dimension. + * tooltip: [3, 1, 5], + * label: [0, 3], + * ... + * } + * ``` + * `otherDims` is the parse result of the `series.encode` above, like: + * ```js + * // Suppose the index of this data dimension is `3`. + * this.otherDims = { + * // `3` is at the index `0` of the `encode.tooltip` + * tooltip: 0, + * // `3` is at the index `1` of the `encode.tooltip` + * label: 1 + * }; + * ``` + * + * This prop should never be `null`/`undefined` after initialized. + * @type {Object} + */ -/***/ "./node_modules/echarts/lib/model/referHelper.js": -/*!*******************************************************!*\ - !*** ./node_modules/echarts/lib/model/referHelper.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -eval("\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 = __webpack_require__(/*! ../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 * @return {Object} 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 * // It also indicate that whether there is category axis.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction getCoordSysDefineBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = {\n coordSysName: coordSysName,\n coordSysDims: [],\n axisMap: createHashMap(),\n categoryAxisMap: createHashMap()\n };\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 = 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 = 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.getCoordSysDefineBySeries = getCoordSysDefineBySeries;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvbW9kZWwvcmVmZXJIZWxwZXIuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvbW9kZWwvcmVmZXJIZWxwZXIuanM/OGI3ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJcbi8qXG4qIExpY2Vuc2VkIHRvIHRoZSBBcGFjaGUgU29mdHdhcmUgRm91bmRhdGlvbiAoQVNGKSB1bmRlciBvbmVcbiogb3IgbW9yZSBjb250cmlidXRvciBsaWNlbnNlIGFncmVlbWVudHMuICBTZWUgdGhlIE5PVElDRSBmaWxlXG4qIGRpc3RyaWJ1dGVkIHdpdGggdGhpcyB3b3JrIGZvciBhZGRpdGlvbmFsIGluZm9ybWF0aW9uXG4qIHJlZ2FyZGluZyBjb3B5cmlnaHQgb3duZXJzaGlwLiAgVGhlIEFTRiBsaWNlbnNlcyB0aGlzIGZpbGVcbiogdG8geW91IHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZVxuKiBcIkxpY2Vuc2VcIik7IHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Vcbiogd2l0aCB0aGUgTGljZW5zZS4gIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuKlxuKiAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuKlxuKiBVbmxlc3MgcmVxdW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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/model/referHelper.js\n"); + this.otherDims = {}; + /** + * Be `true` if this dimension is not mapped to any "coordSysDim" that the + * "coordSys" required. + * Mandatory. + * @type {boolean} + */ + // this.isExtraCoord; -/***/ }), + /** + * @type {module:data/OrdinalMeta} + */ + // this.ordinalMeta; -/***/ "./node_modules/echarts/lib/util/clazz.js": -/*!************************************************!*\ - !*** ./node_modules/echarts/lib/util/clazz.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Whether to create inverted indices. + * @type {boolean} + */ + // this.createInvertedIndices; +} -eval("\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 = __webpack_require__(/*! ../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9jbGF6ei5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy9lY2hhcnRzL2xpYi91dGlsL2NsYXp6LmpzPzYyNWUiXSwic291cmNlc0NvbnRlbnQiOlsiXG4vKlxuKiBMaWNlbnNlZCB0byB0aGUgQXBhY2hlIFNvZnR3YXJlIEZvdW5kYXRpb24gKEFTRikgdW5kZXIgb25lXG4qIG9yIG1vcmUgY29udHJpYnV0b3IgbGljZW5zZSBhZ3JlZW1lbnRzLiAgU2VlIHRoZSBOT1RJQ0UgZmlsZVxuKiBkaXN0cmlidXRlZCB3aXRoIHRoaXMgd29yayBmb3IgYWRkaXRpb25hbCBpbmZvcm1hdGlvblxuKiByZWdhcmRpbmcgY29weXJpZ2h0IG93bmVyc2hpcC4gIFRoZSBBU0YgbGljZW5zZXMgdGhpcyBmaWxlXG4qIHRvIHlvdSB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGVcbiogXCJMaWNlbnNlXCIpOyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlXG4qIHdpdGggdGhlIExpY2Vuc2UuICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjBcbipcbiogVW5sZXNzIHJlcXVpcmVkIGJ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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/clazz.js\n"); +; +var _default = DataDimensionInfo; +module.exports = _default; /***/ }), -/***/ "./node_modules/echarts/lib/util/graphic.js": -/*!**************************************************!*\ - !*** ./node_modules/echarts/lib/util/graphic.js ***! - \**************************************************/ +/***/ "./node_modules/echarts/lib/data/Source.js": +/*!*************************************************!*\ + !*** ./node_modules/echarts/lib/data/Source.js ***! + \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar pathTool = __webpack_require__(/*! zrender/lib/tool/path */ \"./node_modules/zrender/lib/tool/path.js\");\n\nvar colorTool = __webpack_require__(/*! zrender/lib/tool/color */ \"./node_modules/zrender/lib/tool/color.js\");\n\nvar matrix = __webpack_require__(/*! zrender/lib/core/matrix */ \"./node_modules/zrender/lib/core/matrix.js\");\n\nvar vector = __webpack_require__(/*! zrender/lib/core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar Path = __webpack_require__(/*! zrender/lib/graphic/Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar Transformable = __webpack_require__(/*! zrender/lib/mixin/Transformable */ \"./node_modules/zrender/lib/mixin/Transformable.js\");\n\nvar ZImage = __webpack_require__(/*! zrender/lib/graphic/Image */ \"./node_modules/zrender/lib/graphic/Image.js\");\n\nexports.Image = ZImage;\n\nvar Group = __webpack_require__(/*! zrender/lib/container/Group */ \"./node_modules/zrender/lib/container/Group.js\");\n\nexports.Group = Group;\n\nvar Text = __webpack_require__(/*! zrender/lib/graphic/Text */ \"./node_modules/zrender/lib/graphic/Text.js\");\n\nexports.Text = Text;\n\nvar Circle = __webpack_require__(/*! zrender/lib/graphic/shape/Circle */ \"./node_modules/zrender/lib/graphic/shape/Circle.js\");\n\nexports.Circle = Circle;\n\nvar Sector = __webpack_require__(/*! zrender/lib/graphic/shape/Sector */ \"./node_modules/zrender/lib/graphic/shape/Sector.js\");\n\nexports.Sector = Sector;\n\nvar Ring = __webpack_require__(/*! zrender/lib/graphic/shape/Ring */ \"./node_modules/zrender/lib/graphic/shape/Ring.js\");\n\nexports.Ring = Ring;\n\nvar Polygon = __webpack_require__(/*! zrender/lib/graphic/shape/Polygon */ \"./node_modules/zrender/lib/graphic/shape/Polygon.js\");\n\nexports.Polygon = Polygon;\n\nvar Polyline = __webpack_require__(/*! zrender/lib/graphic/shape/Polyline */ \"./node_modules/zrender/lib/graphic/shape/Polyline.js\");\n\nexports.Polyline = Polyline;\n\nvar Rect = __webpack_require__(/*! zrender/lib/graphic/shape/Rect */ \"./node_modules/zrender/lib/graphic/shape/Rect.js\");\n\nexports.Rect = Rect;\n\nvar Line = __webpack_require__(/*! zrender/lib/graphic/shape/Line */ \"./node_modules/zrender/lib/graphic/shape/Line.js\");\n\nexports.Line = Line;\n\nvar BezierCurve = __webpack_require__(/*! zrender/lib/graphic/shape/BezierCurve */ \"./node_modules/zrender/lib/graphic/shape/BezierCurve.js\");\n\nexports.BezierCurve = BezierCurve;\n\nvar Arc = __webpack_require__(/*! zrender/lib/graphic/shape/Arc */ \"./node_modules/zrender/lib/graphic/shape/Arc.js\");\n\nexports.Arc = Arc;\n\nvar CompoundPath = __webpack_require__(/*! zrender/lib/graphic/CompoundPath */ \"./node_modules/zrender/lib/graphic/CompoundPath.js\");\n\nexports.CompoundPath = CompoundPath;\n\nvar LinearGradient = __webpack_require__(/*! zrender/lib/graphic/LinearGradient */ \"./node_modules/zrender/lib/graphic/LinearGradient.js\");\n\nexports.LinearGradient = LinearGradient;\n\nvar RadialGradient = __webpack_require__(/*! zrender/lib/graphic/RadialGradient */ \"./node_modules/zrender/lib/graphic/RadialGradient.js\");\n\nexports.RadialGradient = RadialGradient;\n\nvar BoundingRect = __webpack_require__(/*! zrender/lib/core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nexports.BoundingRect = BoundingRect;\n\nvar IncrementalDisplayable = __webpack_require__(/*! zrender/lib/graphic/IncrementalDisplayable */ \"./node_modules/zrender/lib/graphic/IncrementalDisplayable.js\");\n\nexports.IncrementalDisplayable = IncrementalDisplayable;\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 round = Math.round;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar EMPTY_OBJ = {};\nvar Z2_EMPHASIS_LIFT = 1;\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 * 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 var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n\n if (round(shape.x1 * 2) === round(shape.x2 * 2)) {\n shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);\n }\n\n if (round(shape.y1 * 2) === round(shape.y2 * 2)) {\n shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);\n }\n\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 var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n var originX = shape.x;\n var originY = shape.y;\n var originWidth = shape.width;\n var originHeight = shape.height;\n shape.x = subPixelOptimize(shape.x, lineWidth, true);\n shape.y = subPixelOptimize(shape.y, lineWidth, true);\n shape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, originWidth === 0 ? 0 : 1);\n shape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, originHeight === 0 ? 0 : 1);\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\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\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 `doSingleEnterHover`.\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 doSingleEnterHover(el) {\n var hoverStl = el.__hoverStl;\n\n if (!hoverStl || el.__highlighted) {\n return;\n }\n\n var useHoverLayer = el.useHoverLayer;\n el.__highlighted = useHoverLayer ? 'layer' : 'plain';\n var zr = el.__zr;\n\n if (!zr && 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, where\n // only properties that is not `null/undefined` can be set. The disadventage:\n // null/undefined can not be used to remove style any more in `emphasis`.\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 doSingleLeaveHover(el) {\n var highlighted = el.__highlighted;\n\n if (!highlighted) {\n return;\n }\n\n el.__highlighted = false;\n\n if (highlighted === 'layer') {\n el.__zr && el.__zr.removeHover(el);\n } else if (highlighted) {\n var style = el.style;\n var normalStl = el.__cachedNormalStl;\n\n if (normalStl) {\n rollbackDefaultTextStyle(style); // Consider null/undefined value, should use\n // `setStyle` but not `extendFrom(stl, true)`.\n\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 traverseCall(el, method) {\n el.isGroup ? el.traverse(function (child) {\n !child.isGroup && method(child);\n }) : method(el);\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|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 * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`\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 && (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 doSingleLeaveHover(el);\n doSingleEnterHover(el);\n }\n}\n/**\n * Emphasis (called by API) has higher priority than `mouseover`.\n * When element has been called to be entered emphasis, mouse over\n * should not trigger the highlight effect (for example, animation\n * scale) again, and `mouseout` should not downplay the highlight\n * effect. So the listener of `mouseover` and `mouseout` should\n * check `isInEmphasis`.\n *\n * @param {module:zrender/Element} el\n * @return {boolean}\n */\n\n\nfunction isInEmphasis(el) {\n return el && el.__isEmphasisEntered;\n}\n\nfunction onElementMouseOver(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleEnterHover);\n}\n\nfunction onElementMouseOut(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleLeaveHover);\n}\n\nfunction enterEmphasis() {\n this.__isEmphasisEntered = true;\n traverseCall(this, doSingleEnterHover);\n}\n\nfunction leaveEmphasis() {\n this.__isEmphasisEntered = false;\n traverseCall(this, doSingleLeaveHover);\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 * @param {module:zrender/Element} el\n * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.\n * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`.\n */\n\n\nfunction setHoverStyle(el, hoverStyle, opt) {\n el.isGroup ? el.traverse(function (child) {\n // If element has sepcified hoverStyle, then use it instead of given hoverStyle\n // Often used when item group has a label element and it's hoverStyle is different\n !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle);\n }) : setElementHoverStyle(el, el.hoverStyle || hoverStyle);\n setAsHoverStyleTrigger(el, opt);\n}\n/**\n * @param {Object|boolean} [opt] If `false`, means disable trigger.\n * @param {boolean} [opt.hoverSilentOnTouch=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, hoverSilentOnTouch should be used to disable hover-highlight\n * on touch device.\n */\n\n\nfunction setAsHoverStyleTrigger(el, opt) {\n var disable = opt === false;\n el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n if (!disable || el.__hoverStyleTrigger) {\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\n\n el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis);\n el.__hoverStyleTrigger = !disable;\n }\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)`\n * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\n * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\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; // 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);\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) : 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 * 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 = 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 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\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); // Save original textPosition, because style.textPosition will be repalced by\n // real location (like [10, 30]) in zrender.\n\n textStyle.insideRawTextPosition = textStyle.textPosition;\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 opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`),\n // applyDefaultTextStyle works.\n\n if (!opt || textStyle.textFill != null) {\n return;\n }\n\n var useInsideStyle = opt.useInsideStyle;\n var textPosition = textStyle.insideRawTextPosition;\n var insideRollback;\n var autoColor = opt.autoColor;\n\n if (useInsideStyle !== false && (useInsideStyle === true || opt.isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0)) {\n insideRollback = {\n textFill: null,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\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 } else if (autoColor != null) {\n insideRollback = {\n textFill: null\n };\n textStyle.textFill = autoColor;\n } // Always set `insideRollback`, for clearing previous.\n\n\n if (insideRollback) {\n textStyle.insideRollback = insideRollback;\n }\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 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 // ecModel or default text style model.\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 if 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 if 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\nexports.Z2_EMPHASIS_LIFT = Z2_EMPHASIS_LIFT;\nexports.extendShape = extendShape;\nexports.extendPath = extendPath;\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.isInEmphasis = isInEmphasis;\nexports.setHoverStyle = setHoverStyle;\nexports.setAsHoverStyleTrigger = setAsHoverStyleTrigger;\nexports.setLabelStyle = setLabelStyle;\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9ncmFwaGljLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL3V0aWwvZ3JhcGhpYy5qcz8yMzA2Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50cy4gIFNlZSB0aGUgTk9USUNFIGZpbGVcbiogZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHdvcmsgZm9yIGFkZGl0aW9uYWwgaW5mb3Jt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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/graphic.js\n"); -/***/ }), +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ "./node_modules/echarts/lib/util/model.js": -/*!************************************************!*\ - !*** ./node_modules/echarts/lib/util/model.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var _util = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar env = __webpack_require__(/*! zrender/lib/core/env */ \"./node_modules/zrender/lib/core/env.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9tb2RlbC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy9lY2hhcnRzL2xpYi91dGlsL21vZGVsLmpzP2UwZDMiXSwic291cmNlc0NvbnRlbnQiOlsiXG4vKlxuK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gICAgdmFyIHNlcmllc0lkID0gc291cmNlQmF0Y2hbaV0uc2VyaWVzSWQ7XG4gICAgICB2YXIgZGF0YUluZGljZXMgPSBub3JtYWxpemVUb0FycmF5KHNvdXJjZUJhdGNoW2ldLmRhdGFJbmRleCk7XG4gICAgICB2YXIgb3RoZXJEYXRhSW5kaWNlcyA9IG90aGVyTWFwICYmIG90aGVyTWFwW3Nlcmllc0lkXTtcblxuICAgICAgZm9yICh2YXIgaiA9IDAsIGxlbmogPSBkYXRhSW5kaWNlcy5sZW5ndGg7IGogPCBsZW5qOyBqKyspIHtcbiAgICAgICAgdmFyIGRhdGFJbmRleCA9IGRhdGFJbmRpY2VzW2pdO1xuXG4gICAgICAgIGlmIChvdGhlckRhdGFJbmRpY2VzICYmIG90aGVyRGF0YUluZGljZXNbZGF0YUluZGV4XSkge1xuICAgICAgICAgIG90aGVyRGF0YUluZGljZXNbZGF0YUluZGV4XSA9IG51bGw7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgKG1hcFtzZXJpZXNJZF0gfHwgKG1hcFtzZXJpZXNJZF0gPSB7fSkpW2RhdGFJbmRleF0gPSAxO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gbWFwVG9BcnJheShtYXAsIGlzRGF0YSkge1xuICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgIGZvciAodmFyIGkgaW4gbWFwKSB7XG4gICAgICBpZiAobWFwLmhhc093blByb3BlcnR5KGkpICYmIG1hcFtpXSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChpc0RhdGEpIHtcbiAgICAgICAgICByZXN1bHQucHVzaCgraSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdmFyIGRhdGFJbmRpY2VzID0gbWFwVG9BcnJheShtYXBbaV0sIHRydWUpO1xuICAgICAgICAgIGRhdGFJbmRpY2VzLmxlbmd0aCAmJiByZXN1bHQucHVzaCh7XG4gICAgICAgICAgICBzZX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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/model.js\n"); +var createHashMap = _util.createHashMap; +var isTypedArray = _util.isTypedArray; -/***/ }), +var _clazz = __webpack_require__(/*! ../util/clazz */ "./node_modules/echarts/lib/util/clazz.js"); -/***/ "./node_modules/echarts/lib/util/symbol.js": -/*!*************************************************!*\ - !*** ./node_modules/echarts/lib/util/symbol.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var enableClassCheck = _clazz.enableClassCheck; -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar graphic = __webpack_require__(/*! ./graphic */ \"./node_modules/echarts/lib/util/graphic.js\");\n\nvar BoundingRect = __webpack_require__(/*! zrender/lib/core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\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 beforeBrush: function () {\n var style = this.style;\n var shape = this.shape; // FIXME\n\n if (shape.symbolType === 'pin' && style.textPosition === 'inside') {\n style.textPosition = ['50%', '40%'];\n style.textAlign = 'center';\n style.textVerticalAlign = 'middle';\n }\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (shape.symbolType !== 'none') {\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxl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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/symbol.js\n"); +var _sourceType = __webpack_require__(/*! ./helper/sourceType */ "./node_modules/echarts/lib/data/helper/sourceType.js"); -/***/ }), +var SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL; +var SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN; +var SOURCE_FORMAT_UNKNOWN = _sourceType.SOURCE_FORMAT_UNKNOWN; +var SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY; +var SOURCE_FORMAT_KEYED_COLUMNS = _sourceType.SOURCE_FORMAT_KEYED_COLUMNS; -/***/ "./node_modules/echarts/lib/visual/dataColor.js": -/*!******************************************************!*\ - !*** ./node_modules/echarts/lib/visual/dataColor.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -eval("\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 = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\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// Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nfunction _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdmlzdWFsL2RhdGFDb2xvci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy9lY2hhcnRzL2xpYi92aXN1YWwvZGF0YUNvbG9yLmpzPzk4ZTciXSwic291cmNlc0NvbnRlbnQiOlsiXG4vKlxuKiBMaWNlbnNlZCB0byB0aGUgQXBhY2hlIFNvZnR3YXJlIEZvdW5kYXRpb24gKEFTRikgdW5kZXIgb25lXG4qIG9yIG1vcmUgY29udHJpYnV0b3IgbGljZW5zZSBhZ3JlZW1lbnRzLiAgU2VlIHRoZSBOT1RJQ0UgZmlsZVxuKiBkaXN0cmlidXRlZCB3aXRoIHRoaXMgd29yayBmb3IgYWRkaXRpb25hbCBpbmZvcm1hdGlvblxuKiByZWdhcmRpbmcgY29weXJpZ2h0IG93bmVyc2hpcC4gIFRoZSBBU0YgbGljZW5zZXMgdGhpcyBmaWxlXG4qIHRvIHlvdSB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGVcbiogXCJMaWNlbnNlXCIpOyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlXG4qIHdpdGggdGhlIExpY2Vuc2UuICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXR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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/visual/dataColor.js\n"); +/** + * [sourceFormat] + * + * + "original": + * This format is only used in series.data, where + * itemStyle can be specified in data item. + * + * + "arrayRows": + * [ + * ['product', 'score', 'amount'], + * ['Matcha Latte', 89.3, 95.8], + * ['Milk Tea', 92.1, 89.4], + * ['Cheese Cocoa', 94.4, 91.2], + * ['Walnut Brownie', 85.4, 76.9] + * ] + * + * + "objectRows": + * [ + * {product: 'Matcha Latte', score: 89.3, amount: 95.8}, + * {product: 'Milk Tea', score: 92.1, amount: 89.4}, + * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2}, + * {product: 'Walnut Brownie', score: 85.4, amount: 76.9} + * ] + * + * + "keyedColumns": + * { + * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'], + * 'count': [823, 235, 1042, 988], + * 'score': [95.8, 81.4, 91.2, 76.9] + * } + * + * + "typedArray" + * + * + "unknown" + */ -/***/ }), +/** + * @constructor + * @param {Object} fields + * @param {string} fields.sourceFormat + * @param {Array|Object} fields.fromDataset + * @param {Array|Object} [fields.data] + * @param {string} [seriesLayoutBy='column'] + * @param {Array.} [dimensionsDefine] + * @param {Objet|HashMap} [encodeDefine] + * @param {number} [startIndex=0] + * @param {number} [dimensionsDetectCount] + */ +function Source(fields) { + /** + * @type {boolean} + */ + this.fromDataset = fields.fromDataset; + /** + * Not null/undefined. + * @type {Array|Object} + */ -/***/ "./node_modules/zrender/lib/Element.js": -/*!*********************************************!*\ - !*** ./node_modules/zrender/lib/Element.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []); + /** + * See also "detectSourceFormat". + * Not null/undefined. + * @type {string} + */ -eval("var guid = __webpack_require__(/*! ./core/guid */ \"./node_modules/zrender/lib/core/guid.js\");\n\nvar Eventful = __webpack_require__(/*! ./mixin/Eventful */ \"./node_modules/zrender/lib/mixin/Eventful.js\");\n\nvar Transformable = __webpack_require__(/*! ./mixin/Transformable */ \"./node_modules/zrender/lib/mixin/Transformable.js\");\n\nvar Animatable = __webpack_require__(/*! ./mixin/Animatable */ \"./node_modules/zrender/lib/mixin/Animatable.js\");\n\nvar zrUtil = __webpack_require__(/*! ./core/util */ \"./node_modules/zrender/lib/core/util.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvRWxlbWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9FbGVtZW50LmpzP2Q1YjciXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGd1aWQgPSByZXF1aXJlKFwiLi9jb3JlL2d1aWRcIik7XG5cbnZhciBFdmVudGZ1bCA9IHJlcXVpcmUoXCIuL21peGluL0V2ZW50ZnVsXCIpO1xuXG52YXIgVHJhbnNmb3JtYWJsZSA9IHJlcXVpcmUoXCIuL21peGluL1RyYW5zZm9ybWFibGVcIik7XG5cbnZhciBBbmltYXRhYmxlID0gcmVxdWlyZShcIi4vbWl4aW4vQW5pbWF0YWJsZVwiKTtcblxudmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuL2NvcmUvdXRpbFwiKTtcblxuLyoqXG4gKiBAYWxpYXMgbW9kdWxlOnpyZW5kZXIvRWxlbWVudFxuICogQGNvbnN0cnVjdG9yXG4gKiBAZXh0ZW5kcyB7bW9kdWxlOnpyZW5kZXIvbWl4aW4vQW5pbWF0YWJsZX1cbiAqIEBleHRlbmRzIHttb2R1bGU6enJlbmRlci9taXhpbi9UcmFuc2Zvcm1hYmxlfVxuICogQGV4dGVuZHMge21vZHVsZTp6cmVuZGVyL21peGluL0V2ZW50ZnVsfVxuICovXG52YXIgRWxlbWVudCA9IGZ1bmN0aW9uIChvcHRzKSB7XG4gIC8vIGpzaGludCBpZ25vcmU6bGluZVxuICBUcmFuc2Zvcm1hYmxlLmNhbGwodGhpcywgb3B0cyk7XG4gIEV2ZW50ZnVsLmNhbGwodGhpcywgb3B0cyk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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/Element.js\n"); + this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; + /** + * 'row' or 'column' + * Not null/undefined. + * @type {string} seriesLayoutBy + */ -/***/ }), + this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; + /** + * dimensions definition in option. + * can be null/undefined. + * @type {Array.} + */ + + this.dimensionsDefine = fields.dimensionsDefine; + /** + * encode definition in option. + * can be null/undefined. + * @type {Objet|HashMap} + */ + + this.encodeDefine = fields.encodeDefine && createHashMap(fields.encodeDefine); + /** + * Not null/undefined, uint. + * @type {number} + */ + + this.startIndex = fields.startIndex || 0; + /** + * Can be null/undefined (when unknown), uint. + * @type {number} + */ + + this.dimensionsDetectCount = fields.dimensionsDetectCount; +} +/** + * Wrap original series data for some compatibility cases. + */ -/***/ "./node_modules/zrender/lib/animation/Animator.js": -/*!********************************************************!*\ - !*** ./node_modules/zrender/lib/animation/Animator.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -eval("var Clip = __webpack_require__(/*! ./Clip */ \"./node_modules/zrender/lib/animation/Clip.js\");\n\nvar color = __webpack_require__(/*! ../tool/color */ \"./node_modules/zrender/lib/tool/color.js\");\n\nvar _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 * 设置动画关键帧\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 * 开始执行动画\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 * 停止动画\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 * 设置动画延迟开始的时间\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 * 添加动画结束的回调\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvYW5pbWF0aW9uL0FuaW1hdG9yLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2FuaW1hdGlvbi9BbmltYXRvci5qcz8wNmFkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBDbGlwID0gcmVxdWlyZShcIi4vQ2xpcFwiKTtcblxudmFyIGNvbG9yID0gcmVxdWlyZShcIi4uL3Rvb2wvY29sb3JcIik7XG5cbnZhciBfdXRpbCA9IHJlcXVpcmUoXCIuLi9jb3JlL3V0aWxcIik7XG5cbnZhciBpc0FycmF5TGlrZSA9IF91dGlsLmlzQXJyYXlMaWtlO1xuXG4vKipcbiAqIEBtb2R1bGUgZWNoYXJ0cy9hbmltYXRpb24vQW5pbWF0b3JcbiAqL1xudmFyIGFycmF5U2xpY2UgPSBBcnJheS5wcm90b3R5cGUuc2xpY2U7XG5cbmZ1bmN0aW9uIGRlZmF1bHRHZXR0ZXIodGFyZ2V0LCBrZXkpIHtcbiAgcmV0dXJuIHRhcmdldFtrZXldO1xufVxuXG5mdW5jdGlvbiBkZWZhdW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=webpack-internal:///./node_modules/zrender/lib/animation/Animator.js\n"); +Source.seriesDataToSource = function (data) { + return new Source({ + data: data, + sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL, + fromDataset: false + }); +}; + +enableClassCheck(Source); +var _default = Source; +module.exports = _default; /***/ }), -/***/ "./node_modules/zrender/lib/animation/Clip.js": -/*!****************************************************!*\ - !*** ./node_modules/zrender/lib/animation/Clip.js ***! - \****************************************************/ +/***/ "./node_modules/echarts/lib/data/helper/completeDimensions.js": +/*!********************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/completeDimensions.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var easingFuncs = __webpack_require__(/*! ./easing */ \"./node_modules/zrender/lib/animation/easing.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvYW5pbWF0aW9uL0NsaXAuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvYW5pbWF0aW9uL0NsaXAuanM/NDQzNiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZWFzaW5nRnVuY3MgPSByZXF1aXJlKFwiLi9lYXNpbmdcIik7XG5cbi8qKlxuICog5Yqo55S75Li75o6n5Yi25ZmoXG4gKiBAY29uZmlnIHRhcmdldCDliqjnlLvlr7nosaHvvIzlj6/ku6XmmK/mlbDnu4TvvIzlpoLmnpzmmK/mlbDnu4TnmoTor53kvJrmibnph4/liIblj5FvbmZyY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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/animation/Clip.js\n"); -/***/ }), +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ "./node_modules/zrender/lib/animation/easing.js": -/*!******************************************************!*\ - !*** ./node_modules/zrender/lib/animation/easing.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +var _util = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); -eval("/**\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaW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ChrICo9IDIpIDwgMSkge1xuICAgICAgcmV0dXJuIDAuNSAqIGsgKiBrO1xuICAgIH1cblxuICAgIHJldHVybiAtMC41ICogKC0tayAqIChrIC0gMikgLSAxKTtcbiAgfSxcbiAgLy8g5LiJ5qyh5pa555qE57yT5Yqo77yIdF4z77yJXG5cbiAgLyoqXG4gICogQHBhcmFtIHtudW1iZXJ9IGtcbiAgKiBAcmV0dXJuIHtudW1iZXJ9XG4gICovXG4gIGN1YmljSW46IGZ1bmN0aW9uIChrKSB7XG4gICAgcmV0dXJuIGsgKiBrICogaztcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgY3ViaWNPdXQ6IGZ1bmN0aW9uIChrKSB7XG4gICAgcmV0dXJuIC0tayAqIGsgKiBrICsgMTtcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgY3ViaWNJbk91dDogZnVuY3Rpb24gKGspIHtcbiAgICBpZiAoKGsgKj0gMikgPCAxKSB7XG4gICAgICByZXR1cm4gMC41ICogayAqIGsgKiBrO1xuICAgIH1cblxuICAgIHJldHVybiAwLjUgKiAoKGsgLT0gMikgKiBrICogayArIDIpO1xuICB9LFxuICAvLyDlm5vmrKHmlrnnmoTnvJPliqjvvIh0XjTvvIlcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgcXVhcnRpY0luOiBmdW5jdGlvbiAoaykge1xuICAgIHJldHVybiBrICogayAqIGsgKiBrO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBxdWFydGljT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHJldHVybiAxIC0gLS1rICogayAqIGsgK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ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgZWxhc3RpY0luOiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzO1xuICAgIHZhciBhID0gMC4xO1xuICAgIHZhciBwID0gMC40O1xuXG4gICAgaWYgKGsgPT09IDApIHtcbiAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChrID09PSAxKSB7XG4gICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICBpZiAoIWEgfHwgYSA8IDEpIHtcbiAgICAgIGEgPSAxO1xuICAgICAgcyA9IHAgLyA0O1xuICAgIH0gZWxzZSB7XG4gICAgICBzID0gcCAqIE1hdGguYXNpbigxIC8gYSkgLyAoMiAqIE1hdGguUEkpO1xuICAgIH1cblxuICAgIHJldHVybiAtKGEgKiBNYXRoLnBvdygyLCAxMCAqIChrIC09IDEpKSAqIE1hdGguc2luKChrIC0gcykgKiAoMiAqIE1hdGguUEkpIC8gcCkpO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBlbGFzdGljT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzO1xuICAgIHZhciBhID0gMC4xO1xuICAgIHZhciBwID0gMC40O1xuXG4gICAgaWYgKGsgPT09IDApIHtcbiAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChrID09PSAxKSB7XG4gICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICBpZiAoIWEgfHwgYSA8IDEpIHtcbiAgICAgIGEgPSAxO1xuICAgICAgcyA9IHAgLyA0O1xuICAgIH0gZWxzZSB7XG4gICAgICBzID0gcCAqIE1hdGguYXNpbigxIC8gYSkgLyAoMiAqIE1hdGguUEkpO1xuICAgIH1cblxuICAgIHJldHVybiBhICogTWF0aC5wb3coMiwgLTEwICogaykgKiBNYXRoLnNpbigoayAtIHMpICogKDIgKiBNYXRoLlBJKSAvIHApICsgMTtcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgZWxhc3RpY0luT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzO1xuICAgIHZhciBhID0gMC4xO1xuICAgIHZhciBwID0gMC40O1xuXG4gICAgaWYgKGsgPT09IDApIHtcbiAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChrID09PSAxKSB7XG4gICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICBpZiAoIWEgfHwgYSA8IDEpIHtcbiAgICAgIGEgPSAxO1xuICAgICAgcyA9IHAgLyA0O1xuICAgIH0gZWxzZSB7XG4gICAgICBzID0gcCAqIE1hdGguYXNpbigxIC8gYSkgLyAoMiAqIE1hdGguUEkpO1xuICAgIH1cblxuICAgIGlmICgoayAqPSAyKSA8IDEpIHtcbiAgICAgIHJldHVybiAtMC41ICogKGEgKiBNYXRoLnBvdygyLCAxMCAqIChrIC09IDEpKSAqIE1hdGguc2luKChrIC0gcykgKiAoMiAqIE1hdGguUEkpIC8gcCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhICogTWF0aC5wb3coMiwgLTEwICogKGsgLT0gMSkpICogTWF0aC5zaW4oKGsgLSBzKSAqICgyICogTWF0aC5QSSkgLyBwKSAqIDAuNSArIDE7XG4gIH0sXG4gIC8vIOWcqOafkOS4gOWKqOeUu+W8gOWni+ayv+aMh+ekuueahOi3r+W+hOi/m+ihjOWKqOeUu+WkhOeQhuWJjeeojeeojeaUtuWbnuivpeWKqOeUu+eahOenu+WKqFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBiYWNrSW46IGZ1bmN0aW9uIChrKSB7XG4gICAgdmFyIHMgPSAxLjcwMTU4O1xuICAgIHJldHVybiBrICogayAqICgocyArIDEpICogayAtIHMpO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBiYWNrT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzID0gMS43MDE1ODtcbiAgICByZXR1cm4gLS1rICogayAqICgocyArIDEpICogayArIHMpICsgMTtcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgYmFja0luT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzID0gMS43MDE1OCAqIDEuNTI1O1xuXG4gICAgaWYgKChrICo9IDIpIDwgMSkge1xuICAgICAgcmV0dXJuIDAuNSAqIChrICogayAqICgocyArIDEpICogayAtIHMpKTtcbiAgICB9XG5cbiAgICByZXR1cm4gMC41ICogKChrIC09IDIpICogayAqICgocyArIDEpICogayArIHMpICsgMik7XG4gIH0sXG4gIC8vIOWIm+W7uuW8uei3s+aViOaenFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBib3VuY2VJbjogZnVuY3Rpb24gKGspIHtcbiAgICByZXR1cm4gMSAtIGVhc2luZy5ib3VuY2VPdXQoMSAtIGspO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBib3VuY2VPdXQ6IGZ1bmN0aW9uIChrKSB7XG4gICAgaWYgKGsgPCAxIC8gMi43NSkge1xuICAgICAgcmV0dXJuIDcuNTYyNSAqIGsgKiBrO1xuICAgIH0gZWxzZSBpZiAoayA8IDIgLyAyLjc1KSB7XG4gICAgICByZXR1cm4gNy41NjI1ICogKGsgLT0gMS41IC8gMi43NSkgKiBrICsgMC43NTtcbiAgICB9IGVsc2UgaWYgKGsgPCAyLjUgLyAyLjc1KSB7XG4gICAgICBy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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/animation/easing.js\n"); +var createHashMap = _util.createHashMap; +var each = _util.each; +var isString = _util.isString; +var defaults = _util.defaults; +var extend = _util.extend; +var isObject = _util.isObject; +var clone = _util.clone; -/***/ }), +var _model = __webpack_require__(/*! ../../util/model */ "./node_modules/echarts/lib/util/model.js"); -/***/ "./node_modules/zrender/lib/config.js": -/*!********************************************!*\ - !*** ./node_modules/zrender/lib/config.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +var normalizeToArray = _model.normalizeToArray; -eval("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日志选项:catchBrushException为true下有效\n * 0 : 不生成debug数据,发布用\n * 1 : 异常抛出,调试用\n * 2 : 控制台输出,调试用\n */\n\n\nvar debugMode = 0; // retina 屏幕优化\n\nvar devicePixelRatio = dpr;\nexports.debugMode = debugMode;\nexports.devicePixelRatio = devicePixelRatio;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29uZmlnLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbmZpZy5qcz8yY2Y0Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkcHIgPSAxOyAvLyBJZiBpbiBicm93c2VyIGVudmlyb25tZW50XG5cbmlmICh0eXBlb2Ygd2luZG93ICE9PSAndW5kZWZpbmVkJykge1xuICBkcHIgPSBNYXRoLm1heCh3aW5kb3cuZGV2aWNlUGl4ZWxSYXRpbyB8fCAxLCAxKTtcbn1cbi8qKlxuICogY29uZmln6buY6K6k6YWN572u6aG5XG4gKiBAZXhwb3J0cyB6cmVuZGVyL2NvbmZpZ1xuICogQGF1dGhvciBLZW5lciAoQEtlbmVyLeael+WzsCwga2VuZXIubGluZmVuZ0BnbWFpbC5jb20pXG4gKi9cblxuLyoqXG4gKiBkZWJ1Z+aXpeW/l+mAiemhue+8mmNhdGNoQnJ1c2hFeGNlcHRpb27kuLp0cnVl5LiL5pyJ5pWIXG4gKiAwIDog5LiN55Sf5oiQZGVidWfmlbDmja7vvIzlj5HluIPnlKhcbiAqIDEgOiDlvILluLjmipvlh7rvvIzosIPor5XnlKhcbiAqIDIgOiDmjqfliLblj7DovpPlh7rvvIzosIPor5XnlKhcbiAqL1xuXG5cbnZhciBkZWJ1Z01vZGUgPSAwOyAvLyByZXRpbmEg5bGP5bmV5LyY5YyWXG5cbnZhciBkZXZpY2VQaXhlbFJhdGlvID0gZHByO1xuZXhwb3J0cy5kZWJ1Z01vZGUgPSBkZWJ1Z01vZGU7XG5leHBvcnRzLmRldmljZVBpeGVsUmF0aW8gPSBkZXZpY2VQaXhlbFJhdGlvOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/config.js\n"); +var _sourceHelper = __webpack_require__(/*! ./sourceHelper */ "./node_modules/echarts/lib/data/helper/sourceHelper.js"); -/***/ }), +var guessOrdinal = _sourceHelper.guessOrdinal; +var BE_ORDINAL = _sourceHelper.BE_ORDINAL; -/***/ "./node_modules/zrender/lib/contain/arc.js": -/*!*************************************************!*\ - !*** ./node_modules/zrender/lib/contain/arc.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var Source = __webpack_require__(/*! ../Source */ "./node_modules/echarts/lib/data/Source.js"); -eval("var _util = __webpack_require__(/*! ./util */ \"./node_modules/zrender/lib/contain/util.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9hcmMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnR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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/arc.js\n"); +var _dimensionHelper = __webpack_require__(/*! ./dimensionHelper */ "./node_modules/echarts/lib/data/helper/dimensionHelper.js"); -/***/ }), +var OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS; -/***/ "./node_modules/zrender/lib/contain/cubic.js": -/*!***************************************************!*\ - !*** ./node_modules/zrender/lib/contain/cubic.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var DataDimensionInfo = __webpack_require__(/*! ../DataDimensionInfo */ "./node_modules/echarts/lib/data/DataDimensionInfo.js"); -eval("var curve = __webpack_require__(/*! ../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9jdWJpYy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9jb250YWluL2N1YmljLmpzP2U3ZDIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGN1cnZlID0gcmVxdWlyZShcIi4uL2NvcmUvY3VydmVcIik7XG5cbi8qKlxuICog5LiJ5qyh6LSd5aGe5bCU5puy57q/5o+P6L655YyF5ZCr5Yik5patXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4MFxuICogQHBhcmFtICB7bnVtYmVyfSAgeTBcbiAqIEBwYXJhbSAge251bWJlcn0gIHgxXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB5MVxuICogQHBhcmFtICB7bnVtYmVyfSAgeDJcbiAqIEBwYXJhbSAge251bWJlcn0gIHkyXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4M1xuICogQHBhcmFtICB7bnVtYmVyfSAgeTNcbiAqIEBwYXJhbSAge251bWJlcn0gIGxpbmVXaWR0aFxuICogQHBhcmFtICB7bnVtYmVyfSAgeFxuICogQHBhcmFtICB7bnVtYmVyfSAgeVxuICogQHJldHVybiB7Ym9vbGVhbn1cbiAqL1xuZnVuY3Rpb24gY29udGFpblN0cm9rZSh4MCwgeTAsIHgxLCB5MSwgeDIsIHkyLCB4MywgeTMsIGxpbmVXaWR0aCwgeCwgeSkge1xuICBpZiAobGluZVdpZHRoID09PSAwKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFyIF9sID0gbGluZVdpZHRoOyAvLyBRdWljayByZWplY3RcblxuICBpZiAoeSA+IHkwICsgX2wgJiYgeSA+IHkxICsgX2wgJiYgeSA+IHkyICsgX2wgJiYgeSA+IHkzICsgX2wgfHwgeSA8IHkwIC0gX2wgJiYgeSA8IHkxIC0gX2wgJiYgeSA8IHkyIC0gX2wgJiYgeSA8IHkzIC0gX2wgfHwgeCA+IHgwICsgX2wgJiYgeCA+IHgxICsgX2wgJiYgeCA+IHgyICsgX2wgJiYgeCA+IHgzICsgX2wgfHwgeCA8IHgwIC0gX2wgJiYgeCA8IHgxIC0gX2wgJiYgeCA8IHgyIC0gX2wgJiYgeCA8IHgzIC0gX2wpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICB2YXIgZCA9IGN1cnZlLmN1YmljUHJvamVjdFBvaW50KHgwLCB5MCwgeDEsIHkxLCB4MiwgeTIsIHgzLCB5MywgeCwgeSwgbnVsbCk7XG4gIHJldHVybiBkIDw9IF9sIC8gMjtcbn1cblxuZXhwb3J0cy5jb250YWluU3Ryb2tlID0gY29udGFpblN0cm9rZTsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/cubic.js\n"); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ }), +/** + * @deprecated + * Use `echarts/data/helper/createDimensions` instead. + */ -/***/ "./node_modules/zrender/lib/contain/line.js": -/*!**************************************************!*\ - !*** ./node_modules/zrender/lib/contain/line.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/** + * @see {module:echarts/test/ut/spec/data/completeDimensions} + * + * This method builds the relationship between: + * + "what the coord sys or series requires (see `sysDims`)", + * + "what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)" + * + "what the data source provids (see `source`)". + * + * Some guess strategy will be adapted if user does not define something. + * If no 'value' dimension specified, the first no-named dimension will be + * named as 'value'. + * + * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which + * provides not only dim template, but also default order. + * properties: 'name', 'type', 'displayName'. + * `name` of each item provides default coord name. + * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and + * provide dims count that the sysDim required. + * [{ordinalMeta}] can be specified. + * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious) + * @param {Object} [opt] + * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions + * For example: ['asdf', {name, type}, ...]. + * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3} + * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists. + * If not specified, auto find the next available data dim. + * param source {module:data/Source} + * param dimCount {number} + * return {Object} encode Never be `null/undefined`. + * @param {string} [opt.generateCoord] Generate coord dim with the given name. + * If not specified, extra dim names will be: + * 'value', 'value0', 'value1', ... + * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`. + * If `generateCoordCount` specified, the generated dim names will be: + * `generateCoord` + 0, `generateCoord` + 1, ... + * can be Infinity, indicate that use all of the remain columns. + * @param {number} [opt.dimCount] If not specified, guess by the first data item. + * @return {Array.} + */ +function completeDimensions(sysDims, source, opt) { + if (!Source.isInstance(source)) { + source = Source.seriesDataToSource(source); + } -eval("/**\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9saW5lLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW4vbGluZS5qcz85NjgwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICog57q/5q615YyF5ZCr5Yik5patXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4MFxuICogQHBhcmFtICB7bnVtYmVyfSAgeTBcbiAqIEBwYXJhbSAge251bWJlcn0gIHgxXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB5MVxuICogQHBhcmFtICB7bnVtYmVyfSAgbGluZVdpZHRoXG4gKiBAcGFyYW0gIH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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/line.js\n"); + opt = opt || {}; + sysDims = (sysDims || []).slice(); + var dimsDef = (opt.dimsDef || []).slice(); + var dataDimNameMap = createHashMap(); + var coordDimNameMap = createHashMap(); // var valueCandidate; -/***/ }), + var result = []; + var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result. -/***/ "./node_modules/zrender/lib/contain/path.js": -/*!**************************************************!*\ - !*** ./node_modules/zrender/lib/contain/path.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + for (var i = 0; i < dimCount; i++) { + var dimDefItem = dimsDef[i] = extend({}, isObject(dimsDef[i]) ? dimsDef[i] : { + name: dimsDef[i] + }); + var userDimName = dimDefItem.name; + var resultItem = result[i] = new DataDimensionInfo(); // Name will be applied later for avoiding duplication. -eval("var PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar line = __webpack_require__(/*! ./line */ \"./node_modules/zrender/lib/contain/line.js\");\n\nvar cubic = __webpack_require__(/*! ./cubic */ \"./node_modules/zrender/lib/contain/cubic.js\");\n\nvar quadratic = __webpack_require__(/*! ./quadratic */ \"./node_modules/zrender/lib/contain/quadratic.js\");\n\nvar arc = __webpack_require__(/*! ./arc */ \"./node_modules/zrender/lib/contain/arc.js\");\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/zrender/lib/contain/util.js\");\n\nvar normalizeRadian = _util.normalizeRadian;\n\nvar curve = __webpack_require__(/*! ../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\nvar windingLine = __webpack_require__(/*! ./windingLine */ \"./node_modules/zrender/lib/contain/windingLine.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9wYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW4vcGF0aC5qcz9kODMzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoUHJveHkgPSByZXF1aXJlKFwiLi4vY29yZS9QYXRoUHJveHlcIik7XG5cbnZhciBsaW5lID0gcmVxdWlyZShcIi4vbGluZVwiKTtcblxudmFyIGN1YmljID0gcmVxdWlyZShcIi4vY3ViaWNcIik7XG5cbnZhciBxdWFkcmF0aWMgPSByZXF1aXJlKFwiLi9xdWFkcmF0aWNcIik7XG5cbnZhciBhcmMgPSByZXF1aXJlKFwiLi9hcmNcIik7XG5cbnZhciBfdXRpbCA9IHJlcXVpcmUoXCIuL3V0aWxcIik7XG5cbnZhciBub3JtYWxpemVSYWRpYW4gPSBfdXRpbC5ub3JtYWxpemVSYW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BuUm9vdHM7IGkrKykge1xuICAgICAgICAvLyBSZW1vdmUgb25lIGVuZHBvaW50LlxuICAgICAgICB2YXIgdW5pdCA9IHJvb3RzW2ldID09PSAwIHx8IHJvb3RzW2ldID09PSAxID8gMC41IDogMTtcbiAgICAgICAgdmFyIHhfID0gY3VydmUucXVhZHJhdGljQXQoeDAsIHgxLCB4Miwgcm9vdHNbaV0pO1xuXG4gICAgICAgIGlmICh4XyA8IHgpIHtcbiAgICAgICAgICAvLyBRdWljayByZWplY3RcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyb290c1tpXSA8IHQpIHtcbiAgICAgICAgICB3ICs9IHlfIDwgeTAgPyB1bml0IDogLXVuaXQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdyArPSB5MiA8IHlfID8gdW5pdCA6IC11bml0O1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB3O1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBSZW1vdmUgb25lIGVuZHBvaW50LlxuICAgICAgdmFyIHVuaXQgPSByb290c1swXSA9PT0gMCB8fCByb290c1swXSA9PT0gMSA/IDAuNSA6IDE7XG4gICAgICB2YXIgeF8gPSBjdXJ2ZS5xdWFkcmF0aWNBdCh4MCwgeDEsIHgyLCByb290c1swXSk7XG5cbiAgICAgIGlmICh4XyA8IHgpIHtcbiAgICAgICAgLy8gUXVpY2sgcmVqZWN0XG4gICAgICAgIHJldHVybiAwO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4geTIgPCB5MCA/IHVuaXQgOiAtdW5pdDtcbiAgICB9XG4gIH1cbn0gLy8gVE9ET1xuLy8gQXJjIOaXi+i9rFxuXG5cbmZ1bmN0aW9uIHdpbmRpbmdBcmMoY3gsIGN5LCByLCBzdGFydEFuZ2xlLCBlbmRBbmdsZSwgYW50aWNsb2Nrd2lzZSwgeCwgeSkge1xuICB5IC09IGN5O1xuXG4gIGlmICh5ID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O1xuICAgICAgfSAvLyDlpoLmnpzooqvku7vkvZXkuIDkuKogc3VicGF0aCDljIXlkKtcbiAgICAgIC8vIGlmICh3ICE9PSAwKSB7XG4gICAgICAvLyAgICAgcmV0dXJuIHRydWU7XG4gICAgICAvLyB9XG5cbiAgICB9XG5cbiAgICBpZiAoaSA9PT0gMSkge1xuICAgICAgLy8g5aaC5p6c56ys5LiA5Liq5ZG95Luk5pivIEwsIEMsIFFcbiAgICAgIC8vIOWImSBwcmV2aW91cyBwb2ludCDlkIznu5jliLblkb3ku6TnmoTnrKzkuIDkuKogcG9pbnRcbiAgICAgIC8vXG4gICAgICAvLyDnrKzkuIDkuKrlkb3ku6TkuLogQXJjIOeahOaDheWGteS4i+S8muWcqOWQjumdoueJueauiuWkhOeQhlxuICAgICAgeGkgPSBkYXRhW2ldO1xuICAgICAgeWkgPSBkYXRhW2kgKyAxXTtcbiAgICAgIHgwID0geGk7XG4gICAgICB5MCA9IHlpO1xuICAgIH1cblxuICAgIHN3aXRjaCAoY21kKSB7XG4gICAgICBjYXNlIENNRC5NOlxuICAgICAgICAvLyBtb3ZlVG8g5ZG95Luk6YeN5paw5Yib5bu65LiA5Liq5paw55qEIHN1YnBhdGgsIOW5tuS4lOabtOaWsOaWsOeahOi1t+eCuVxuICAgICAgICAvLyDlnKggY2xvc2VQYXRoIOeahOaXtuWAmeS9v+eUqFxuICAgICAgICB4MCA9IGRhdGFbaSsrXTtcbiAgICAgICAgeTAgPSBkYXRhW2krK107XG4gICAgICAgIHhpID0geDA7XG4gICAgICAgIHlpID0geTA7XG4gICAgICAgIGJyZWFrO1xuXG4gICAgICBjYXNlIENNRC5MOlxuICAgICAgICBpZiAoaXNTdHJva2UpIHtcbiAgICAgICAgICBpZiAobGluZS5jb250YWluU3Ryb2tlKHhpLCB5aSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIGxpbmVXaWR0aCwgeCwgeSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAg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HJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB3ICs9IHdpbmRpbmdRdWFkcmF0aWMoeGksIHlpLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIHgsIHkpIHx8IDA7XG4gICAgICAgIH1cblxuICAgICAgICB4aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgeWkgPSBkYXRhW2krK107XG4gICAgICAgIGJyZWFrO1xuXG4gICAgICBjYXNlIENNRC5BOlxuICAgICAgICAvLyBUT0RPIEFyYyDliKTmlq3nmoTlvIDplIDmr5TovoPlpKdcbiAgICAgICAgdmFyIGN4ID0gZGF0YVtpKytdO1xuICAgICAgICB2YXIgY3kgPSBkYXRhW2krK107XG4gICAgICAgIHZhciByeCA9IGRhdGFbaSsrXTtcbiAgICAgICAgdmFyIHJ5ID0gZGF0YVtpKytdO1xuICAgICAgICB2YXIgdGhldGEgPSBkYXRhW2krK107XG4gICAgICAgIHZhciBkVGhldGEgPSBkYXRhW2krK107IC8vIFRPRE8gQXJjIOaXi+i9rFxuXG4gICAgICAgIGkgKz0gMTtcbiAgICAgICAgdmFyIGFudGljbG9ja3dpc2UgPSAxIC0gZGF0YVtpKytdO1xuICAgICAgICB2YXIgeDEgPSBNYXRoLmNvcyh0aGV0YSkgKiByeCArIGN4O1xuICAgICAgICB2YXIgeTEgPSBNYXRoLnNpbih0aGV0YSkgKiByeSArIGN5OyAvLyDkuI3mmK/nm7TmjqXkvb/nlKggYXJjIOWRveS7pFxuXG4gICAgICAgIGlmIChpID4gMSkge1xuICAgICAgICAgIHcgKz0gd2luZGluZ0xpbmUoeGksIHlpLCB4MSwgeTEsIHgsIHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIOesrOS4gOS4quWRveS7pOi1t+eCuei/mOacquWumuS5iVxuICAgICAgICAgIHgwID0geDE7XG4gICAgICAgICAgeTAgPSB5MTtcb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bnRhaW5TdHJva2UoeDEsIHkwLCB4MSwgeTEsIGxpbmVXaWR0aCwgeCwgeSkgfHwgbGluZS5jb250YWluU3Ryb2tlKHgxLCB5MSwgeDAsIHkxLCBsaW5lV2lkdGgsIHgsIHkpIHx8IGxpbmUuY29udGFpblN0cm9rZSh4MCwgeTEsIHgwLCB5MCwgbGluZVdpZHRoLCB4LCB5KSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIEZJWE1FIENsb2Nrd2lzZSA/XG4gICAgICAgICAgdyArPSB3aW5kaW5nTGluZSh4MSwgeTAsIHgxLCB5MSwgeCwgeSk7XG4gICAgICAgICAgdyArPSB3aW5kaW5nTGluZSh4MCwgeTEsIHgwLCB5MCwgeCwgeSk7XG4gICAgICAgIH1cblxuICAgICAgICBicmVhaztcblxuICAgICAgY2FzZSBDTUQuWjpcbiAgICAgICAgaWYgKGlzU3Ryb2tlKSB7XG4gICAgICAgICAgaWYgKGxpbmUuY29udGFpblN0cm9rZSh4aSwgeWksIHgwLCB5MCwgbGluZVdpZHRoLCB4LCB5KSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIENsb3NlIGEgc3VicGF0aFxuICAgICAgICAgIHcgKz0gd2luZGluZ0xpbmUoeGksIHlpLCB4MCwgeTAsIHgsIHkpOyAvLyDlpoLmnpzooqvku7vkvZXkuIDkuKogc3VicGF0aCDljIXlkKtcbiAgICAgICAgICAvLyBGSVhNRSBzdWJwYXRocyBtYXkgb3ZlcmxhcFxuICAgICAgICAgIC8vIGlmICh3ICE9PSAwKSB7XG4gICAgICAgICAgLy8gICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIC8vIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHhpID0geDA7XG4gICAgICAgIHlpID0geTA7XG4gICAgICAgIGJy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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/path.js\n"); + if (userDimName != null && dataDimNameMap.get(userDimName) == null) { + // Only if `series.dimensions` is defined in option + // displayName, will be set, and dimension will be diplayed vertically in + // tooltip by default. + resultItem.name = resultItem.displayName = userDimName; + dataDimNameMap.set(userDimName, i); + } -/***/ }), + dimDefItem.type != null && (resultItem.type = dimDefItem.type); + dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); + } -/***/ "./node_modules/zrender/lib/contain/quadratic.js": -/*!*******************************************************!*\ - !*** ./node_modules/zrender/lib/contain/quadratic.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var encodeDef = opt.encodeDef; -eval("var _curve = __webpack_require__(/*! ../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9xdWFkcmF0aWMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9xdWFkcmF0aWMuanM/NjhhYiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX2N1cnZlID0gcmVxdWlyZShcIi4uL2NvcmUvY3VydmVcIik7XG5cbnZhciBxdWFkcmF0aWNQcm9qZWN0UG9pbnQgPSBfY3VydmUucXVhZHJhdGljUHJvamVjdFBvaW50O1xuXG4vKipcbiAqIOS6jOasoei0neWhnuWwlOabsue6v+aPj+i+ueWMheWQq+WIpOaWrVxuICogQHBhcmFtICB7bnVtYmVyfSAgeDBcbiAqIEBwYXJhbSAge251bWJlcn0gIHkwXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4MVxuICogQHBhcmFtICB7bnVtYmVyfSAgeTFcbiAqIEBwYXJhbSAge251bWJlcn0gIHgyXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB5MlxuICogQHBhcmFtICB7bnVtYmVyfSAgbGluZVdpZHRoXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4XG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB5XG4gKiBAcmV0dXJuIHtib29sZWFufVxuICovXG5mdW5jdGlvbiBjb250YWluU3Ryb2tlKHgwLCB5MCwgeDEsIHkxLCB4MiwgeTIsIGxpbmVXaWR0aCwgeCwgeSkge1xuICBpZiAobGluZVdpZHRoID09PSAwKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFyIF9sID0gbGluZVdpZHRoOyAvLyBRdWljayByZWplY3RcblxuICBpZiAoeSA+IHkwICsgX2wgJiYgeSA+IHkxICsgX2wgJiYgeSA+IHkyICsgX2wgfHwgeSA8IHkwIC0gX2wgJiYgeSA8IHkxIC0gX2wgJiYgeSA8IHkyIC0gX2wgfHwgeCA+IHgwICsgX2wgJiYgeCA+IHgxICsgX2wgJiYgeCA+IHgyICsgX2wgfHwgeCA8IHgwIC0gX2wgJiYgeCA8IHgxIC0gX2wgJiYgeCA8IHgyIC0gX2wpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICB2YXIgZCA9IHF1YWRyYXRpY1Byb2plY3RQb2ludCh4MCwgeTAsIHgxLCB5MSwgeDIsIHkyLCB4LCB5LCBudWxsKTtcbiAgcmV0dXJuIGQgPD0gX2wgLyAyO1xufVxuXG5leHBvcnRzLmNvbnRhaW5TdHJva2UgPSBjb250YWluU3Ryb2tlOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/quadratic.js\n"); + if (!encodeDef && opt.encodeDefaulter) { + encodeDef = opt.encodeDefaulter(source, dimCount); + } -/***/ }), + encodeDef = createHashMap(encodeDef); // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`. -/***/ "./node_modules/zrender/lib/contain/text.js": -/*!**************************************************!*\ - !*** ./node_modules/zrender/lib/contain/text.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + encodeDef.each(function (dataDims, coordDim) { + dataDims = normalizeToArray(dataDims).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is + // `{encode: {x: -1, y: 1}}`. Should not filter anything in + // this case. -eval("var BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar imageHelper = __webpack_require__(/*! ../graphic/helper/image */ \"./node_modules/zrender/lib/graphic/helper/image.js\");\n\nvar _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 * @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 x = rect.x;\n var y = rect.y;\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 return {\n x: x,\n y: y,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\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}\n * Notice: for performance, do not calculate outerWidth util needed.\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\n if (padding) {\n outerHeight += padding[0] + padding[2];\n }\n\n if (text && truncate) {\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 };\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.adjustTextPositionOnRect = adjustTextPositionOnRect;\nexports.truncateText = truncateText;\nexports.getLineHeight = getLineHeight;\nexports.measureText = measureText;\nexports.parsePlainText = parsePlainText;\nexports.parseRichText = parseRichText;\nexports.makeFont = makeFont;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi90ZXh0LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW4vdGV4dC5qcz9lODZhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBCb3VuZGluZ1JlY3QgPSByZXF1aXJlKFwiLi4vY29yZS9Cb3VuZGluZ1JlY3RcIik7XG5cbnZhciBpbWFnZUhlbHBlciA9IHJlcXVpcmUoXCIuLi9ncmFwaGljL2hlbHBlci9pbWFnZVwiKTtcblxudmFyIF91dGlsID0gcmVxdWlyZShcIi4uL2NvcmUvdXRpbFwiKTtcblxudmFyIGdldENvbnRleHQgPSBfdXRpbC5nZXRDb250ZXh0O1xudmFyIGV4dGVuZCA9IF91dGlsLmV4dGVuZDtcbnZhciByZXRyaWV2ZTIgPSBfdXRpbC5yZXRyaWV2ZTI7XG52YXIgcmV0cmlldmUzID0gX3V0aWwucmV0cmlldmUzO1xudmFyIHRyaW0gPSBfdXRpbC50cmltO1xudmFyIHRleHRXaWR0aENhY2hlID0ge307XG52YXIgdGV4dFdpZHRoQ2FjaGVDb3VudGVyID0gMDtcbnZhciBURVhUX0NBQ0hFX01BWCA9IDUwMDA7XG52YXIgU1RZTEVfUkVHID0gL1xceyhbYS16QS1aMC05X10rKVxcfChbXn1dKilcXH0vZztcbnZhciBERUZBVUxUX0ZPTlQgPSAnMTJweCBzYW5zLXNlcmlmJzsgLy8gQXZvaWQgYXNzaWduIHRvIGFuIGV4cG9ydGVkIHZhcmlhYmxlLCBmb3IgdHJhbnNmb3JtaW5nIHRvIGNqcy5cblxudmFyIG1ldGhvZHMgPSB7fTtcblxuZn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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/text.js\n"); + if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) { + encodeDef.set(coordDim, false); + return; + } -/***/ }), + var validDataDims = encodeDef.set(coordDim, []); + each(dataDims, function (resultDimIdx, idx) { + // The input resultDimIdx can be dim name or index. + isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx)); -/***/ "./node_modules/zrender/lib/contain/util.js": -/*!**************************************************!*\ - !*** ./node_modules/zrender/lib/contain/util.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + if (resultDimIdx != null && resultDimIdx < dimCount) { + validDataDims[idx] = resultDimIdx; + applyDim(result[resultDimIdx], coordDim, idx); + } + }); + }); // Apply templetes and default order from `sysDims`. -eval("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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi91dGlsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW4vdXRpbC5qcz84NTdkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQSTIgPSBNYXRoLlBJICogMjtcblxuZnVuY3Rpb24gbm9ybWFsaXplUmFkaWFuKGFuZ2xlKSB7XG4gIGFuZ2xlICU9IFBJMjtcblxuICBpZiAoYW5nbGUgPCAwKSB7XG4gICAgYW5nbGUgKz0gUEkyO1xuICB9XG5cbiAgcmV0dXJuIGFuZ2xlO1xufVxuXG5leHBvcnRzLm5vcm1hbGl6ZVJhZGlhbiA9IG5vcm1hbGl6ZVJhZGlhbjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/util.js\n"); + var availDimIdx = 0; + each(sysDims, function (sysDimItem, sysDimIndex) { + var coordDim; + var sysDimItem; + var sysDimItemDimsDef; + var sysDimItemOtherDims; -/***/ }), + if (isString(sysDimItem)) { + coordDim = sysDimItem; + sysDimItem = {}; + } else { + coordDim = sysDimItem.name; + var ordinalMeta = sysDimItem.ordinalMeta; + sysDimItem.ordinalMeta = null; + sysDimItem = clone(sysDimItem); + sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly. -/***/ "./node_modules/zrender/lib/contain/windingLine.js": -/*!*********************************************************!*\ - !*** ./node_modules/zrender/lib/contain/windingLine.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + sysDimItemDimsDef = sysDimItem.dimsDef; + sysDimItemOtherDims = sysDimItem.otherDims; + sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null; + } -eval("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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi93aW5kaW5nTGluZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9jb250YWluL3dpbmRpbmdMaW5lLmpzPzg3MjgiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gd2luZGluZ0xpbmUoeDAsIHkwLCB4MSwgeTEsIHgsIHkpIHtcbiAgaWYgKHkgPiB5MCAmJiB5ID4geTEgfHwgeSA8IHkwICYmIHkgPCB5MSkge1xuICAgIHJldHVybiAwO1xuICB9IC8vIElnbm9yZSBob3Jpem9udGFsIGxpbmVcblxuXG4gIGlmICh5MSA9PT0geTApIHtcbiAgICByZXR1cm4gMDtcbiAgfVxuXG4gIHZhciBkaXIgPSB5MSA8IHkwID8gMSA6IC0xO1xuICB2YXIgdCA9ICh5IC0geTApIC8gKHkxIC0geTApOyAvLyBBdm9pZCB3aW5kaW5nIGVycm9yIHdoZW4gaW50ZXJzZWN0aW9uIHBvaW50IGlzIHRoZSBjb25uZWN0IHBvaW50IG9mIHR3byBsaW5lIG9mIHBvbHlnb25cblxuICBpZiAodCA9PT0gMSB8fCB0ID09PSAwKSB7XG4gICAgZGlyID0geTEgPCB5MCA/IDAuNSA6IC0wLjU7XG4gIH1cblxuICB2YXIgeF8gPSB0ICogKHgxIC0geDApICsgeDA7IC8vIElmICh4LCB5KSBvbiB0aGUgbGluZSwgY29uc2lkZXJlZCBhcyBcImNvbnRhaW5cIi5cblxuICByZXR1cm4geF8gPT09IHggPyBJbmZpbml0eSA6IHhfID4geCA/IGRpciA6IDA7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gd2luZGluZ0xpbmU7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/windingLine.js\n"); + var dataDims = encodeDef.get(coordDim); // negative resultDimIdx means no need to mapping. -/***/ }), + if (dataDims === false) { + return; + } -/***/ "./node_modules/zrender/lib/container/Group.js": -/*!*****************************************************!*\ - !*** ./node_modules/zrender/lib/container/Group.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences. -eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Element = __webpack_require__(/*! ../Element */ \"./node_modules/zrender/lib/Element.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbmVyL0dyb3VwLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW5lci9Hcm91cC5qcz9lMWZjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB6clV0aWwgPSByZXF1aXJlKFwiLi4vY29yZS91dGlsXCIpO1xuXG52YXIgRWxlbWVudCA9IHJlcXVpcmUoXCIuLi9FbGVtZW50XCIpO1xuXG52YXIgQm91bmRpbmdSZWN0ID0gcmVxdWlyZShcIi4uL2NvcmUvQm91bmRpbmdSZWN0XCIpO1xuXG4vKipcbiAqIEdyb3Vw5piv5LiA5Liq5a655Zmo77yM5Y+v5Lul5o+S5YWl5a2Q6IqC54K577yMR3JvdXDnmoTlj5jmjaLkuZ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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/container/Group.js\n"); + if (!dataDims.length) { + for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { + while (availDimIdx < result.length && result[availDimIdx].coordDim != null) { + availDimIdx++; + } -/***/ }), + availDimIdx < result.length && dataDims.push(availDimIdx++); + } + } // Apply templates. -/***/ "./node_modules/zrender/lib/core/BoundingRect.js": -/*!*******************************************************!*\ - !*** ./node_modules/zrender/lib/core/BoundingRect.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -eval("var vec2 = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar matrix = __webpack_require__(/*! ./matrix */ \"./node_modules/zrender/lib/core/matrix.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;char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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/BoundingRect.js\n"); + each(dataDims, function (resultDimIdx, coordDimIndex) { + var resultItem = result[resultDimIdx]; + applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex); -/***/ }), + if (resultItem.name == null && sysDimItemDimsDef) { + var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex]; + !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { + name: sysDimItemDimsDefItem + }); + resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name; + resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip; + } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}} -/***/ "./node_modules/zrender/lib/core/LRU.js": -/*!**********************************************!*\ - !*** ./node_modules/zrender/lib/core/LRU.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { -eval("// 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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9MUlUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9MUlUuanM/ZDUxYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTaW1wbGUgTFJVIGNhY2hlIHVzZSBkb3VibHkgbG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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/LRU.js\n"); + sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims); + }); + }); -/***/ }), + function applyDim(resultItem, coordDim, coordDimIndex) { + if (OTHER_DIMENSIONS.get(coordDim) != null) { + resultItem.otherDims[coordDim] = coordDimIndex; + } else { + resultItem.coordDim = coordDim; + resultItem.coordDimIndex = coordDimIndex; + coordDimNameMap.set(coordDim, true); + } + } // Make sure the first extra dim is 'value'. -/***/ "./node_modules/zrender/lib/core/PathProxy.js": -/*!****************************************************!*\ - !*** ./node_modules/zrender/lib/core/PathProxy.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -eval("var curve = __webpack_require__(/*! ./curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\nvar vec2 = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar bbox = __webpack_require__(/*! ./bbox */ \"./node_modules/zrender/lib/core/bbox.js\");\n\nvar BoundingRect = __webpack_require__(/*! ./BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar _config = __webpack_require__(/*! ../config */ \"./node_modules/zrender/lib/config.js\");\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\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) {\n this._ux = mathAbs(1 / dpr / sx) || 0;\n this._uy = mathAbs(1 / 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, y0;\n var xi, yi;\n var x, 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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9QYXRoUHJveHkuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY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gICAgICAgICAgeGkgPSB4MDtcbiAgICAgICAgICB5aSA9IHkwO1xuICAgICAgICAgIG1pbjJbMF0gPSB4MDtcbiAgICAgICAgICBtaW4yWzFdID0geTA7XG4gICAgICAgICAgbWF4MlswXSA9IHgwO1xuICAgICAgICAgIG1heDJbMV0gPSB5MDtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENNRC5MOlxuICAgICAgICAgIGJib3guZnJvbUxpbmUoeGksIHlpLCBkYXRhW2ldLCBkYXRhW2kgKyAxXSwgbWluMiwgbWF4Mik7XG4gICAgICAgICAgeGkgPSBkYXRhW2krK107XG4gICAgICAgICAgeWkgPSBkYXRhW2krK107XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuQzpcbiAgICAgICAgICBiYm94LmZyb21DdWJpYyh4aSwgeWksIGRhdGFbaSsrXSwgZGF0YVtpKytdLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIG1pbjIsIG1heDIpO1xuICAgICAgICAgIHhpID0gZGF0YVtpKytdO1xuICAgICAgICAgIHlpID0gZGF0YVtpKytdO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ01ELlE6XG4gICAgICAgICAgYmJveC5mcm9tUXVhZHJhdGljKHhpLCB5aSwgZGF0YVtpKytdLCBkYXRhW2krK10sIGRhdGFbaV0sIGRhdGFbaSArIDFdLCBtaW4yLCBtYXgyKTtcbiAgICAgICAgICB4aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgICB5aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENNRC5BOlxuICAgICAgICAgIC8vIFRPRE8gQXJjIOWIpOaWreeahOW8gOmUgOavlOi+g+Wkp1xuICAgICAgICAgIHZhciBjeCA9IGRhdGFbaSsrXTtcbiAgICAgICAgICB2YXIgY3kgPSBkYXRhW2krK107XG4gICAgICAgICAg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5cbiAgICAgIGlmIChpID09PSAxKSB7XG4gICAgICAgIC8vIOWmguaenOesrOS4gOS4quWRveS7pOaYryBMLCBDLCBRXG4gICAgICAgIC8vIOWImSBwcmV2aW91cyBwb2ludCDlkIznu5jliLblkb3ku6TnmoTnrKzkuIDkuKogcG9pbnRcbiAgICAgICAgLy9cbiAgICAgICAgLy8g56ys5LiA5Liq5ZG95Luk5Li6IEFyYyDnmoTmg4XlhrXkuIvkvJrlnKjlkI7pnaLnibnmrorlpITnkIZcbiAgICAgICAgeGkgPSBkW2ldO1xuICAgICAgICB5aSA9IGRbaSArIDFdO1xuICAgICAgICB4MCA9IHhpO1xuICAgICAgICB5MCA9IHlpO1xuICAgICAgfVxuXG4gICAgICBzd2l0Y2ggKGNtZCkge1xuICAgICAgICBjYXNlIENNRC5NOlxuICAgICAgICAgIHgwID0geGkgPSBkW2krK107XG4gICAgICAgICAgeTAgPSB5aSA9IGRbaSsrXTtcbiAgICAgICAgICBjdHgubW92ZVRvKHhpLCB5aSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuTDpcbiAgICAgICAgICB4ID0gZFtpKytdO1xuICAgICAgICAgIHkgPSBkW2krK107IC8vIE5vdCBkcmF3IHRvbyBzbWFsbCBzZWcgYmV0d2VlblxuXG4gICAgICAgICAgaWYgKG1hdGhBYnMoeCAtIHhpKSA+IHV4IHx8IG1hdGhBYnMoeSAtIHlpKSA+IHV5IHx8IGkgPT09IGxlbiAtIDEpIHtcbiAgICAgICAgICAgIGN0eC5saW5lVG8oeCwgeSk7XG4gICAgICAgICAgICB4aSA9IHg7XG4gICAgICAgICAgICB5aSA9IHk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuQzpcbiAgICAgICAgICBjdHguYmV6aWVyQ3VydmVUbyhkW2krK10sIGRbaSsrXSwgZFtpKytdLCBkW2krK10sIGRbaSsrXSwgZFtpKytdKTtcbiAgICAgICAgICB4aSA9IGRbaSAtIDJdO1xuICAgICAgICAgIHlpID0gZFtpIC0gMV07XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuUTpcbiAgICAgICAgICBjdHgucXVhZHJhdGljQ3VydmVUbyhkW2krK10sIGRbaSsrXSwgZFtpKytdLCBkW2krK10pO1xuICAgICAgICAgIHhpID0gZFtpIC0gMl07XG4gICAgICAgICAgeWkgPSBkW2kgLSAxXTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENNRC5BOlxuICAgICAgICAgIHZhciBjeCA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgY3kgPSBkW2krK107XG4gICAgICAgICAgdmFyIHJ4ID0gZFtpKytdO1xuICAgICAgICAgIHZhciByeSA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgdGhldGEgPSBkW2krK107XG4gICAgICAgICAgdmFyIGRUaGV0YSA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgcHNpID0gZFtpKytdO1xuICAgICAgICAgIHZhciBmcyA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgciA9IHJ4ID4gcnkgPyByeCA6IHJ5O1xuICAgICAgICAgIHZhciBzY2FsZVggPSByeCA+IHJ5ID8gMSA6IHJ4IC8gcnk7XG4gICAgICAgICAgdmFyIHNjYWxlWSA9IHJ4ID4gcnkgPyByeSAvIHJ4IDogMTtcbiAgICAgICAgICB2YXIgaXNFbGxpcHNlID0gTWF0aC5hYnMocnggLSByeSkgPiAxZS0zO1xuICAgICAgICAgIHZhciBlbmRBbmdsZSA9IHRoZXRhICsgZFRoZXRhO1xuXG4gICAgICAgICAgaWYgKGlzRWxsaXBzZSkge1xuICAgICAgICAgICAgY3R4LnRyYW5zbGF0ZShjeCwgY3kpO1xuICAgICAgICAgICAgY3R4LnJvdGF0ZShwc2kpO1xuICAgICAgICAgICAgY3R4LnNjYWxlKHNjYWxlWCwgc2NhbGVZKTtcbiAgICAgICAgICAgIGN0eC5hcmMoMCwgMCwgciwgdGhldGEsIGVuZEFuZ2xlLCAxIC0gZnMpO1xuICAgICAgICAgICAgY3R4LnNjYWxlKDEgLyBzY2FsZVgsIDEgLyBzY2FsZVkpO1xuICAgICAgICAgICAgY3R4LnJvdGF0ZSgtcHNpKTtcbiAgICAgICAgICAgIGN0eC50cmFuc2xhdGUoLWN4LCAtY3kpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjdHguYXJjKGN4LCBjeSwgciwgdGhldGEsIGVuZEFuZ2xlLCAxIC0gZnMpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChpID09PSAxKSB7XG4gICAgICAgICAgICAvLyDnm7TmjqXkvb/nlKggYXJjIOWRveS7pFxuICAgICAgICAgICAgLy8g56ys5LiA5Liq5ZG95Luk6LW354K56L+Y5pyq5a6a5LmJXG4gICAgICAgICAgICB4MCA9IG1hdGhDb3ModGhldGEpICogcnggKyBjeDtcbiAgICAgICAgICAgIHkwID0gbWF0aFNpbih0aGV0YSkgKiByeSArIGN5O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHhpID0gbWF0aENvcyhlbmRBbmdsZSkgKiByeCArIGN4O1xuICAgICAgICAgIHlpID0gbWF0aFNpbihlbmRBbmdsZSkgKiByeSArIGN5O1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ01ELlI6XG4gICAgICAgICAgeDAgPSB4aSA9IGRbaV07XG4gICAgICAgICAgeTAgPSB5aSA9IGRbaSArIDFdO1xuICAgICAgICAgIGN0eC5yZWN0KGRbaSsrXSwgZFtpKytdLCBkW2krK10sIGRbaSsrXSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuWjpcbiAgICAgICAgICBjdHguY2xvc2VQYXRoKCk7XG4gICAgICAgICAgeGkgPSB4MDtcbiAgICAgICAgICB5aSA9IHkwO1xuICAgICAgfVxuICAgIH1cbiAgfVxufTtcblBhdGhQcm94e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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/PathProxy.js\n"); + var generateCoord = opt.generateCoord; + var generateCoordCount = opt.generateCoordCount; + var fromZero = generateCoordCount != null; + generateCoordCount = generateCoord ? generateCoordCount || 1 : 0; + var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props. -/***/ }), + for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { + var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo(); + var coordDim = resultItem.coordDim; -/***/ "./node_modules/zrender/lib/core/bbox.js": -/*!***********************************************!*\ - !*** ./node_modules/zrender/lib/core/bbox.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + if (coordDim == null) { + resultItem.coordDim = genName(extra, coordDimNameMap, fromZero); + resultItem.coordDimIndex = 0; -eval("var vec2 = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar curve = __webpack_require__(/*! ./curve */ \"./node_modules/zrender/lib/core/curve.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9iYm94LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvcmUvYmJveC5qcz9lMjYzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB2ZWMyID0gcmVxdWlyZShcIi4vdmVjdG9yXCIpO1xuXG52YXIgY3VydmUgPSByZXF1aXJlKFwiLi9jdXJ2ZVwiKT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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/bbox.js\n"); + if (!generateCoord || generateCoordCount <= 0) { + resultItem.isExtraCoord = true; + } -/***/ }), + generateCoordCount--; + } -/***/ "./node_modules/zrender/lib/core/curve.js": -/*!************************************************!*\ - !*** ./node_modules/zrender/lib/core/curve.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap)); -eval("var _vector = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLC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IDQgKiBBICogQztcblxuICAgIGlmIChpc0Fyb3VuZFplcm8oZGlzYykpIHtcbiAgICAgIHZhciBLID0gQiAvIEE7XG4gICAgICB2YXIgdDEgPSAtYiAvIGEgKyBLOyAvLyB0MSwgYSBpcyBub3QgemVyb1xuXG4gICAgICB2YXIgdDIgPSAtSyAvIDI7IC8vIHQyLCB0M1xuXG4gICAgICBpZiAodDEgPj0gMCAmJiB0MSA8PSAxKSB7XG4gICAgICAgIHJvb3RzW24rK10gPSB0MTtcbiAgICAgIH1cblxuICAgICAgaWYgKHQyID49IDAgJiYgdDIgPD0gMSkge1xuICAgICAgICByb290c1tuKytdID0gdDI7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChkaXNjID4gMCkge1xuICAgICAgdmFyIGRpc2NTcXJ0ID0gbWF0aFNxcnQoZGlzYyk7XG4gICAgICB2YXIgWTEgPSBBICogYiArIDEuNSAqIGEgKiAoLUIgKyBkaXNjU3FydCk7XG4gICAgICB2YXIgWTIgPSBBICogYiArIDEuNSAqIGEgKiAoLUIgLSBkaXNjU3FydCk7XG5cbiAgICAgIGlmIChZMSA8IDApIHtcbiAgICAgICAgWTEgPSAtbWF0aFBvdygtWTEsIE9ORV9USElSRCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBZMSA9IG1hdGhQb3coWTEsIE9ORV9USElSRCk7XG4gICAgICB9XG5cbiAgICAgIGlmIChZMiA8IDApIHtcbiAgICAgICAgWTIgPSAtbWF0aFBvdygtWTIsIE9ORV9USElSRCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBZMiA9IG1hdGhQb3coWTIsIE9ORV9USElSRCk7XG4gICAgICB9XG5cbiAgICAgIHZhciB0MSA9ICgtYiAtIChZMSArIFkyKSkgLyAoMyAqIGEpO1xuXG4gICAgICBpZiAodDEgPj0gMCAmJiB0MSA8PSAxKSB7XG4gICAgICAgIHJvb3RzW24rK10gPSB0MTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAg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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/curve.js\n"); + if (resultItem.type == null && (guessOrdinal(source, resultDimIdx, resultItem.name) === BE_ORDINAL.Must // Consider the case: + // { + // dataset: {source: [ + // ['2001', 123], + // ['2002', 456], + // ... + // ['The others', 987], + // ]}, + // series: {type: 'pie'} + // } + // The first colum should better be treated as a "ordinal" although it + // might not able to be detected as an "ordinal" by `guessOrdinal`. + || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) { + resultItem.type = 'ordinal'; + } + } -/***/ }), + return result; +} // ??? TODO +// Originally detect dimCount by data[0]. Should we +// optimize it to only by sysDims and dimensions and encode. +// So only necessary dims will be initialized. +// But +// (1) custom series should be considered. where other dims +// may be visited. +// (2) sometimes user need to calcualte bubble size or use visualMap +// on other dimensions besides coordSys needed. +// So, dims that is not used by system, should be shared in storage? -/***/ "./node_modules/zrender/lib/core/env.js": -/*!**********************************************!*\ - !*** ./node_modules/zrender/lib/core/env.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { -eval("/**\n * echarts设备环境识别\n *\n * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。\n * @author firede[firede@firede.us]\n * @desc thanks zepto.\n */\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: 'onpointerdown' in window // 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 // 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 && (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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9lbnYuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9lbnYuanM/MjJkMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIGVjaGFydHPorr7lpIfnjq/looPor4bliKtcbiAqXG4gKiBAZGVzYyBlY2hhcnRz5Z+65LqOQ2FudmFz77yM57qvSmF2YXNjcmlwdOWbvuihqOW6k++8jOaPkOS+m+ebtOingu+8jOeUn+WKqO+8jOWPr+S6pOS6ku+8jOWPr+S4quaAp+WMluWumuWItueahOaVsOaNrue7n+iuoeWbvuihqOOAglxuICogQGF1dGhvciBmaXJlZGVbZmlyZWRlQGZpcmVkZS51c11cbiAqIEBkZXNjIHRoYW5rcyB6ZXB0by5cbiAqL1xudmFyIGVudiA9IHt9O1xuXG5pZiAodHlwZW9mIHd4ID09PSAnb2JqZWN0JyAmJiB0eXBlb2Ygd3guZ2V0U3lzdGVtSW5mb1N5bmMgPT09ICdmdW5jdGlvbicpIHtcbiAgLy8gSW4gV2VpeGluIEFwcGxpY2F0aW9uXG4gIGVudiA9IHtcbiAgICBicm93c2VyOiB7fSxcbiAgICBvczoge30sXG4gICAgbm9kZTogZmFsc2UsXG4gICAgd3hhOiB0cnVlLFxuICAgIC8vIFdlaXhpbiBBcHBsaWNhdGlvblxuICAgIGNhbnZhc1N1cHBvcnRlZDogdHJ1ZSxcbiAgICBzdmdTdXBwb3J0ZWQ6IGZhbHNlLFxuICAgIH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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/env.js\n"); +function getDimCount(source, sysDims, dimsDef, optDimCount) { + // Note that the result dimCount should not small than columns count + // of data, otherwise `dataDimNameMap` checking will be incorrect. + var dimCount = Math.max(source.dimensionsDetectCount || 1, sysDims.length, dimsDef.length, optDimCount || 0); + each(sysDims, function (sysDimItem) { + var sysDimItemDimsDef = sysDimItem.dimsDef; + sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length)); + }); + return dimCount; +} -/***/ }), +function genName(name, map, fromZero) { + if (fromZero || map.get(name) != null) { + var i = 0; -/***/ "./node_modules/zrender/lib/core/guid.js": -/*!***********************************************!*\ - !*** ./node_modules/zrender/lib/core/guid.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + while (map.get(name + i) != null) { + i++; + } + + name += i; + } -eval("/**\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9ndWlkLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvcmUvZ3VpZC5qcz9kZTAwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogenJlbmRlcjog55Sf5oiQ5ZSv5LiAaWRcbiAqXG4gKiBAYXV0aG9yIGVycm9ycmlrIChlcnJvcnJpa0BnbWFpbC5jb20pXG4gKi9cbnZhciBpZFN0YXJ0ID0gMHgwOTA3O1xuXG5mdW5jdGlvbiBfZGVmYXVsdCgpIHtcbiAgcmV0dXJuIGlkU3RhcnQrKztcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfZGVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/guid.js\n"); + map.set(name, true); + return name; +} + +var _default = completeDimensions; +module.exports = _default; /***/ }), -/***/ "./node_modules/zrender/lib/core/log.js": -/*!**********************************************!*\ - !*** ./node_modules/zrender/lib/core/log.js ***! - \**********************************************/ +/***/ "./node_modules/echarts/lib/data/helper/dimensionHelper.js": +/*!*****************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/dimensionHelper.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var _config = __webpack_require__(/*! ../config */ \"./node_modules/zrender/lib/config.js\");\n\nvar debugMode = _config.debugMode;\n\nvar log = function () {};\n\nif (debugMode === 1) {\n log = function () {\n for (var k in arguments) {\n throw new Error(arguments[k]);\n }\n };\n} else if (debugMode > 1) {\n log = function () {\n for (var k in arguments) {\n console.log(arguments[k]);\n }\n };\n}\n\nvar _default = log;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9sb2cuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9sb2cuanM/NDk0MiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX2NvbmZpZyA9IHJlcXVpcmUoXCIuLi9jb25maWdcIik7XG5cbnZhciBkZWJ1Z01vZGUgPSBfY29uZmlnLmRlYnVnTW9kZTtcblxudmFyIGxvZyA9IGZ1bmN0aW9uICgpIHt9O1xuXG5pZiAoZGVidWdNb2RlID09PSAxKSB7XG4gIGxvZyA9IGZ1bmN0aW9uICgpIHtcbiAgICBmb3IgKHZhciBrIGluIGFyZ3VtZW50cykge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGFyZ3VtZW50c1trXSk7XG4gICAgfVxuICB9O1xufSBlbHNlIGlmIChkZWJ1Z01vZGUgPiAxKSB7XG4gIGxvZyA9IGZ1bmN0aW9uICgpIHtcbiAgICBmb3IgKHZhciBrIGluIGFyZ3VtZW50cykge1xuICAgICAgY29uc29sZS5sb2coYXJndW1lbnRzW2tdKTtcbiAgICB9XG4gIH07XG59XG5cbnZhciBfZGVmYXVsdCA9IGxvZztcbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/log.js\n"); -/***/ }), +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ "./node_modules/zrender/lib/core/matrix.js": -/*!*************************************************!*\ - !*** ./node_modules/zrender/lib/core/matrix.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +var _util = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); -eval("/**\n * 3x2矩阵操作类\n * @exports zrender/tool/matrix\n */\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9tYXRyaXguanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZ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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/matrix.js\n"); +var each = _util.each; +var createHashMap = _util.createHashMap; +var assert = _util.assert; -/***/ }), +var _config = __webpack_require__(/*! ../../config */ "./node_modules/echarts/lib/config.js"); -/***/ "./node_modules/zrender/lib/core/util.js": -/*!***********************************************!*\ - !*** ./node_modules/zrender/lib/core/util.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +var __DEV__ = _config.__DEV__; -eval("/**\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 clazz.prototype[prop] = clazzPrototype[prop];\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 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\n for (var key in this.data) {\n this.data.hasOwnProperty(key) && cb(this.data[key], key);\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS91dGlsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvcmUvdXRpbC5qcz82ZDhiIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQG1vZHVsZSB6cmVuZGVyL2NvcmUvdXRpbFxuICovXG4vLyDnlKjkuo7lpITnkIZtZXJnZeaXtuaXoOazlemBjeWOhkRhdGXnrYnlr7nosaHnmoTpl67pophcbnZhciBCVUlMVElOX09CSkVDVCA9IHtcbiAgJ1tvYmplY3QgRnVuY3Rpb25dJzogMSxcbiAgJ1tvYmplY3QgUmVnRXhwXSc6IDEsXG4gICdbb2JqZWN0IERhdGVdJzogMSxcbiAgJ1tvYmplY3QgRXJyb3JdJzogMSxcbiAgJ1tvYmplY3QgQ2Fudm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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/util.js\n"); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +var OTHER_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'seriesName']); -/***/ }), +function summarizeDimensions(data) { + var summary = {}; + var encode = summary.encode = {}; + var notExtraCoordDimMap = createHashMap(); + var defaultedLabel = []; + var defaultedTooltip = []; // See the comment of `List.js#userOutput`. -/***/ "./node_modules/zrender/lib/core/vector.js": -/*!*************************************************!*\ - !*** ./node_modules/zrender/lib/core/vector.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + var userOutput = summary.userOutput = { + dimensionNames: data.dimensions.slice(), + encode: {} + }; + each(data.dimensions, function (dimName) { + var dimItem = data.getDimensionInfo(dimName); + var coordDim = dimItem.coordDim; -eval("var 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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS92ZWN0b3IuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS92ZWN0b3IuanM/NDAxYiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgQXJyYXlDdG9yID0gdHlwZW9mIEZsb2F0MzJBcnJheSA9PT0gJ3VuZGVmaW5lZCcgPyBBcnJheSA6IEZsb2F0MzJBcnJheTtcbi8qKlxuICog5Yib5bu65LiA5Liq5ZCR6YePXG4gKiBAcGFyYW0ge251bWJlcn0gW3g9MF1cbiAqIEBwYXJhbSB7bnVtYmVyfSBbeT0wXVxuICogQHJldHVybiB7VmVjdG9yMn1cbiAqL1xuXG5mdW5jdGlvbiBjcmVhdGUoeCwgeSkge1xuICB2YXIgb3V0ID0gbmV3IEFycmF5Q3RvcigyKTtcblxuICBpZiAoeCA9PSBudWxsKSB7XG4gICAgeCA9IDA7XG4gIH1cblxuICBpZiAoeSA9PSBudWxsKSB7XG4gICAgeSA9IDA7XG4gIH1cblxuICBvdXRbMF0gPSB4O1xuICBvdXRbMV0gPSB5O1xuICByZXR1cm4gb3V0O1xufVxuLyoqXG4gKiDlpI3liLblkJHph4/mlbDmja5cbiAqIEBwYXJhbSB7VmVjdG9yMn0gb3V0XG4gKiBAcGFyYW0ge1ZlY3RvcjJ9IHZcbiAqIEByZXR1cm4ge1ZlY3RvcjJ9XG4gKi9cblxuXG5mdW5jdGlvbiBjb3B5KG91dCwgdikge1xuICBvdXRbMF0g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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/vector.js\n"); + if (coordDim) { + var coordDimIndex = dimItem.coordDimIndex; + getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName; -/***/ }), + if (!dimItem.isExtraCoord) { + notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label, + // because when dataset is used, it is hard to guess which dimension + // can be value dimension. If both show x, y on label is not look good, + // and conventionally y axis is focused more. -/***/ "./node_modules/zrender/lib/graphic/CompoundPath.js": -/*!**********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/CompoundPath.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + if (mayLabelDimType(dimItem.type)) { + defaultedLabel[0] = dimName; + } // User output encode do not contain generated coords. + // And it only has index. User can use index to retrieve value from the raw item array. + + + getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index; + } + + if (dimItem.defaultTooltip) { + defaultedTooltip.push(dimName); + } + } + + OTHER_DIMENSIONS.each(function (v, otherDim) { + var encodeArr = getOrCreateEncodeArr(encode, otherDim); + var dimIndex = dimItem.otherDims[otherDim]; + + if (dimIndex != null && dimIndex !== false) { + encodeArr[dimIndex] = dimItem.name; + } + }); + }); + var dataDimsOnCoord = []; + var encodeFirstDimNotExtra = {}; + notExtraCoordDimMap.each(function (v, coordDim) { + var dimArr = encode[coordDim]; // ??? FIXME extra coord should not be set in dataDimsOnCoord. + // But should fix the case that radar axes: simplify the logic + // of `completeDimension`, remove `extraPrefix`. + + encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data + // dim canot on more than one coordDim. + + dataDimsOnCoord = dataDimsOnCoord.concat(dimArr); + }); + summary.dataDimsOnCoord = dataDimsOnCoord; + summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; + var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set + // in this way. Use label.formatter instead. May be remove this approach someday. + + if (encodeLabel && encodeLabel.length) { + defaultedLabel = encodeLabel.slice(); + } + + var encodeTooltip = encode.tooltip; + + if (encodeTooltip && encodeTooltip.length) { + defaultedTooltip = encodeTooltip.slice(); + } else if (!defaultedTooltip.length) { + defaultedTooltip = defaultedLabel.slice(); + } + + encode.defaultedLabel = defaultedLabel; + encode.defaultedTooltip = defaultedTooltip; + return summary; +} -eval("var Path = __webpack_require__(/*! ./Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\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]);\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9Db21wb3VuZFBhdGguanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9Db21wb3VuZFBhdGguanM/ZDRjNiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuL1BhdGhcIik7XG5cbi8vIENvbXBvdW5kUGF0aCB0byBpbXByb3ZlIHBlcmZvcm1hbmNlXG52YXIgX2RlZmF1bHQgPSBQYXRoLmV4dGVuZCh7XG4gIHR5cGU6ICdjb21wb3VuZCcsXG4gIHNoYXBlOiB7XG4gICAgcGF0aHM6IG51bGxcbiAgfSxcbiAgX3VwZGF0ZVBhdGhEaXJ0eTogZnVuY3Rpb24gKCkge1xuICAgIHZhciBkaXJ0eVBhdGggPSB0aGlzLl9fZGlydHlQYXRoO1xuICAgIHZhciBwYXRocyA9IHRoaXMuc2hhcGUucGF0aHM7XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhdGhzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAvLyBNYXJrIGFzIGRpcnR5IGlmIGFueSBzdWJwYXRoIGlzIGRpcnR5XG4gICAgICBkaXJ0eVBhdGggPSBkaXJ0eVBhdGggfHwgcGF0aHNbaV0uX19kaXJ0eVBhdGg7XG4gICAgfVxuXG4gICAgdGhpcy5fX2RpcnR5UGF0aCA9IGRpcnR5UGF0aDtcbiAgICB0aGlzLl9fZGlydHkgPSB0aGlzLl9fZGlydHkgfHwgZGlydHlQYXRoO1xuICB9LFxuICBiZWZvcmVCcnVzaDogZn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jdC5jYWxsKHRoaXMpO1xuICB9XG59KTtcblxubW9kdWxlLmV4cG9ydHMgPSBfZGVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/CompoundPath.js\n"); +function getOrCreateEncodeArr(encode, dim) { + if (!encode.hasOwnProperty(dim)) { + encode[dim] = []; + } + + return encode[dim]; +} + +function getDimensionTypeByAxis(axisType) { + return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float'; +} + +function mayLabelDimType(dimType) { + // In most cases, ordinal and time do not suitable for label. + // Ordinal info can be displayed on axis. Time is too long. + return !(dimType === 'ordinal' || dimType === 'time'); +} // function findTheLastDimMayLabel(data) { +// // Get last value dim +// var dimensions = data.dimensions.slice(); +// var valueType; +// var valueDim; +// while (dimensions.length && ( +// valueDim = dimensions.pop(), +// valueType = data.getDimensionInfo(valueDim).type, +// valueType === 'ordinal' || valueType === 'time' +// )) {} // jshint ignore:line +// return valueDim; +// } + + +exports.OTHER_DIMENSIONS = OTHER_DIMENSIONS; +exports.summarizeDimensions = summarizeDimensions; +exports.getDimensionTypeByAxis = getDimensionTypeByAxis; /***/ }), -/***/ "./node_modules/zrender/lib/graphic/Displayable.js": -/*!*********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Displayable.js ***! - \*********************************************************/ +/***/ "./node_modules/echarts/lib/data/helper/sourceHelper.js": +/*!**************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/sourceHelper.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Style = __webpack_require__(/*! ./Style */ \"./node_modules/zrender/lib/graphic/Style.js\");\n\nvar Element = __webpack_require__(/*! ../Element */ \"./node_modules/zrender/lib/Element.js\");\n\nvar RectText = __webpack_require__(/*! ./mixin/RectText */ \"./node_modules/zrender/lib/graphic/mixin/RectText.js\");\n\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\n this.__clipPaths = []; // 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 * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制\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 * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件\n * If ignore drawing of the displayable object. Mouse event will still be triggered\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 * z层level,决定绘画在哪层canvas中\n * @name module:/zrender/graphic/Displayable#zlevel\n * @type {number}\n * @default 0\n */\n zlevel: 0,\n\n /**\n * 是否可拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n draggable: false,\n\n /**\n * 是否正在拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n dragging: false,\n\n /**\n * 是否相应鼠标事件\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 * 图形绘制方法\n * @param {CanvasRenderingContext2D} ctx\n */\n // Interface\n brush: function (ctx, prevEl) {},\n\n /**\n * 获取最小包围盒\n * @return {module:zrender/core/BoundingRect}\n */\n // Interface\n getBoundingRect: function () {},\n\n /**\n * 判断坐标 x, y 是否在图形上\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 * 判断坐标 x, y 是否在图形的包围盒上\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 * 标记图形元素为脏,并且在下一帧重绘\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 * 图形是否会触发事件\n * If displayable object binded any event\n * @return {boolean}\n */\n // TODO, 通过 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};\nzrUtil.inherits(Displayable, Element);\nzrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);\n\nvar _default = Displayable;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9EaXNwbGF5YWJsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdW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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Displayable.js\n"); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var _config = __webpack_require__(/*! ../../config */ "./node_modules/echarts/lib/config.js"); + +var __DEV__ = _config.__DEV__; + +var _model = __webpack_require__(/*! ../../util/model */ "./node_modules/echarts/lib/util/model.js"); + +var makeInner = _model.makeInner; +var getDataItemValue = _model.getDataItemValue; + +var _util = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); + +var createHashMap = _util.createHashMap; +var each = _util.each; +var map = _util.map; +var isArray = _util.isArray; +var isString = _util.isString; +var isObject = _util.isObject; +var isTypedArray = _util.isTypedArray; +var isArrayLike = _util.isArrayLike; +var extend = _util.extend; +var assert = _util.assert; + +var Source = __webpack_require__(/*! ../Source */ "./node_modules/echarts/lib/data/Source.js"); + +var _sourceType = __webpack_require__(/*! ./sourceType */ "./node_modules/echarts/lib/data/helper/sourceType.js"); + +var SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL; +var SOURCE_FORMAT_ARRAY_ROWS = _sourceType.SOURCE_FORMAT_ARRAY_ROWS; +var SOURCE_FORMAT_OBJECT_ROWS = _sourceType.SOURCE_FORMAT_OBJECT_ROWS; +var SOURCE_FORMAT_KEYED_COLUMNS = _sourceType.SOURCE_FORMAT_KEYED_COLUMNS; +var SOURCE_FORMAT_UNKNOWN = _sourceType.SOURCE_FORMAT_UNKNOWN; +var SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY; +var SERIES_LAYOUT_BY_ROW = _sourceType.SERIES_LAYOUT_BY_ROW; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +// The result of `guessOrdinal`. +var BE_ORDINAL = { + Must: 1, + // Encounter string but not '-' and not number-like. + Might: 2, + // Encounter string but number-like. + Not: 3 // Other cases + +}; +var inner = makeInner(); +/** + * @see {module:echarts/data/Source} + * @param {module:echarts/component/dataset/DatasetModel} datasetModel + * @return {string} sourceFormat + */ + +function detectSourceFormat(datasetModel) { + var data = datasetModel.option.source; + var sourceFormat = SOURCE_FORMAT_UNKNOWN; + + if (isTypedArray(data)) { + sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; + } else if (isArray(data)) { + // FIXME Whether tolerate null in top level array? + if (data.length === 0) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + } + + for (var i = 0, len = data.length; i < len; i++) { + var item = data[i]; + + if (item == null) { + continue; + } else if (isArray(item)) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + break; + } else if (isObject(item)) { + sourceFormat = SOURCE_FORMAT_OBJECT_ROWS; + break; + } + } + } else if (isObject(data)) { + for (var key in data) { + if (data.hasOwnProperty(key) && isArrayLike(data[key])) { + sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; + break; + } + } + } else if (data != null) { + throw new Error('Invalid data'); + } + + inner(datasetModel).sourceFormat = sourceFormat; +} +/** + * [Scenarios]: + * (1) Provide source data directly: + * series: { + * encode: {...}, + * dimensions: [...] + * seriesLayoutBy: 'row', + * data: [[...]] + * } + * (2) Refer to datasetModel. + * series: [{ + * encode: {...} + * // Ignore datasetIndex means `datasetIndex: 0` + * // and the dimensions defination in dataset is used + * }, { + * encode: {...}, + * seriesLayoutBy: 'column', + * datasetIndex: 1 + * }] + * + * Get data from series itself or datset. + * @return {module:echarts/data/Source} source + */ + + +function getSource(seriesModel) { + return inner(seriesModel).source; +} +/** + * MUST be called before mergeOption of all series. + * @param {module:echarts/model/Global} ecModel + */ + + +function resetSourceDefaulter(ecModel) { + // `datasetMap` is used to make default encode. + inner(ecModel).datasetMap = createHashMap(); +} +/** + * [Caution]: + * MUST be called after series option merged and + * before "series.getInitailData()" called. + * + * [The rule of making default encode]: + * Category axis (if exists) alway map to the first dimension. + * Each other axis occupies a subsequent dimension. + * + * [Why make default encode]: + * Simplify the typing of encode in option, avoiding the case like that: + * series: [{encode: {x: 0, y: 1}}, {encode: {x: 0, y: 2}}, {encode: {x: 0, y: 3}}], + * where the "y" have to be manually typed as "1, 2, 3, ...". + * + * @param {module:echarts/model/Series} seriesModel + */ + + +function prepareSource(seriesModel) { + var seriesOption = seriesModel.option; + var data = seriesOption.data; + var sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; + var fromDataset = false; + var seriesLayoutBy = seriesOption.seriesLayoutBy; + var sourceHeader = seriesOption.sourceHeader; + var dimensionsDefine = seriesOption.dimensions; + var datasetModel = getDatasetModel(seriesModel); + + if (datasetModel) { + var datasetOption = datasetModel.option; + data = datasetOption.source; + sourceFormat = inner(datasetModel).sourceFormat; + fromDataset = true; // These settings from series has higher priority. + + seriesLayoutBy = seriesLayoutBy || datasetOption.seriesLayoutBy; + sourceHeader == null && (sourceHeader = datasetOption.sourceHeader); + dimensionsDefine = dimensionsDefine || datasetOption.dimensions; + } + + var completeResult = completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine); + inner(seriesModel).source = new Source({ + data: data, + fromDataset: fromDataset, + seriesLayoutBy: seriesLayoutBy, + sourceFormat: sourceFormat, + dimensionsDefine: completeResult.dimensionsDefine, + startIndex: completeResult.startIndex, + dimensionsDetectCount: completeResult.dimensionsDetectCount, + // Note: dataset option does not have `encode`. + encodeDefine: seriesOption.encode + }); +} // return {startIndex, dimensionsDefine, dimensionsCount} + + +function completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) { + if (!data) { + return { + dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine) + }; + } + + var dimensionsDetectCount; + var startIndex; + + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + // Rule: Most of the first line are string: it is header. + // Caution: consider a line with 5 string and 1 number, + // it still can not be sure it is a head, because the + // 5 string may be 5 values of category columns. + if (sourceHeader === 'auto' || sourceHeader == null) { + arrayRowsTravelFirst(function (val) { + // '-' is regarded as null/undefined. + if (val != null && val !== '-') { + if (isString(val)) { + startIndex == null && (startIndex = 1); + } else { + startIndex = 0; + } + } // 10 is an experience number, avoid long loop. + + }, seriesLayoutBy, data, 10); + } else { + startIndex = sourceHeader ? 1 : 0; + } + + if (!dimensionsDefine && startIndex === 1) { + dimensionsDefine = []; + arrayRowsTravelFirst(function (val, index) { + dimensionsDefine[index] = val != null ? val : ''; + }, seriesLayoutBy, data); + } + + dimensionsDetectCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? data.length : data[0] ? data[0].length : null; + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + if (!dimensionsDefine) { + dimensionsDefine = objectRowsCollectDimensions(data); + } + } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + if (!dimensionsDefine) { + dimensionsDefine = []; + each(data, function (colArr, key) { + dimensionsDefine.push(key); + }); + } + } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + var value0 = getDataItemValue(data[0]); + dimensionsDetectCount = isArray(value0) && value0.length || 1; + } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {} + + return { + startIndex: startIndex, + dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine), + dimensionsDetectCount: dimensionsDetectCount + }; +} // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'], +// which is reasonable. But dimension name is duplicated. +// Returns undefined or an array contains only object without null/undefiend or string. + + +function normalizeDimensionsDefine(dimensionsDefine) { + if (!dimensionsDefine) { + // The meaning of null/undefined is different from empty array. + return; + } + + var nameMap = createHashMap(); + return map(dimensionsDefine, function (item, index) { + item = extend({}, isObject(item) ? item : { + name: item + }); // User can set null in dimensions. + // We dont auto specify name, othewise a given name may + // cause it be refered unexpectedly. + + if (item.name == null) { + return item; + } // Also consider number form like 2012. + + + item.name += ''; // User may also specify displayName. + // displayName will always exists except user not + // specified or dim name is not specified or detected. + // (A auto generated dim name will not be used as + // displayName). + + if (item.displayName == null) { + item.displayName = item.name; + } + + var exist = nameMap.get(item.name); + + if (!exist) { + nameMap.set(item.name, { + count: 1 + }); + } else { + item.name += '-' + exist.count++; + } + + return item; + }); +} + +function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) { + maxLoop == null && (maxLoop = Infinity); + + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + for (var i = 0; i < data.length && i < maxLoop; i++) { + cb(data[i] ? data[i][0] : null, i); + } + } else { + var value0 = data[0] || []; + + for (var i = 0; i < value0.length && i < maxLoop; i++) { + cb(value0[i], i); + } + } +} + +function objectRowsCollectDimensions(data) { + var firstIndex = 0; + var obj; + + while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line + + + if (obj) { + var dimensions = []; + each(obj, function (value, key) { + dimensions.push(key); + }); + return dimensions; + } +} +/** + * [The strategy of the arrengment of data dimensions for dataset]: + * "value way": all axes are non-category axes. So series one by one take + * several (the number is coordSysDims.length) dimensions from dataset. + * The result of data arrengment of data dimensions like: + * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y | + * "category way": at least one axis is category axis. So the the first data + * dimension is always mapped to the first category axis and shared by + * all of the series. The other data dimensions are taken by series like + * "value way" does. + * The result of data arrengment of data dimensions like: + * | ser_shared_x | ser0_y | ser1_y | ser2_y | + * + * @param {Array.} coordDimensions [{name: , type: , dimsDef: }, ...] + * @param {module:model/Series} seriesModel + * @param {module:data/Source} source + * @return {Object} encode Never be `null/undefined`. + */ + + +function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) { + var encode = {}; + var datasetModel = getDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur. + + if (!datasetModel || !coordDimensions) { + return encode; + } + + var encodeItemName = []; + var encodeSeriesName = []; + var ecModel = seriesModel.ecModel; + var datasetMap = inner(ecModel).datasetMap; + var key = datasetModel.uid + '_' + source.seriesLayoutBy; + var baseCategoryDimIndex; + var categoryWayValueDimStart; + coordDimensions = coordDimensions.slice(); + each(coordDimensions, function (coordDimInfo, coordDimIdx) { + !isObject(coordDimInfo) && (coordDimensions[coordDimIdx] = { + name: coordDimInfo + }); + + if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) { + baseCategoryDimIndex = coordDimIdx; + categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimensions[coordDimIdx]); + } + + encode[coordDimInfo.name] = []; + }); + var datasetRecord = datasetMap.get(key) || datasetMap.set(key, { + categoryWayDim: categoryWayValueDimStart, + valueWayDim: 0 + }); // TODO + // Auto detect first time axis and do arrangement. + + each(coordDimensions, function (coordDimInfo, coordDimIdx) { + var coordDimName = coordDimInfo.name; + var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way. + + if (baseCategoryDimIndex == null) { + var start = datasetRecord.valueWayDim; + pushDim(encode[coordDimName], start, count); + pushDim(encodeSeriesName, start, count); + datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule? + // especially when encode x y specified. + // consider: when mutiple series share one dimension + // category axis, series name should better use + // the other dimsion name. On the other hand, use + // both dimensions name. + } // In category way, the first category axis. + else if (baseCategoryDimIndex === coordDimIdx) { + pushDim(encode[coordDimName], 0, count); + pushDim(encodeItemName, 0, count); + } // In category way, the other axis. + else { + var start = datasetRecord.categoryWayDim; + pushDim(encode[coordDimName], start, count); + pushDim(encodeSeriesName, start, count); + datasetRecord.categoryWayDim += count; + } + }); + + function pushDim(dimIdxArr, idxFrom, idxCount) { + for (var i = 0; i < idxCount; i++) { + dimIdxArr.push(idxFrom + i); + } + } + + function getDataDimCountOnCoordDim(coordDimInfo) { + var dimsDef = coordDimInfo.dimsDef; + return dimsDef ? dimsDef.length : 1; + } + + encodeItemName.length && (encode.itemName = encodeItemName); + encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + return encode; +} +/** + * Work for data like [{name: ..., value: ...}, ...]. + * + * @param {module:model/Series} seriesModel + * @param {module:data/Source} source + * @return {Object} encode Never be `null/undefined`. + */ + + +function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) { + var encode = {}; + var datasetModel = getDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur. + + if (!datasetModel) { + return encode; + } + + var sourceFormat = source.sourceFormat; + var dimensionsDefine = source.dimensionsDefine; + var potentialNameDimIndex; + + if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + each(dimensionsDefine, function (dim, idx) { + if ((isObject(dim) ? dim.name : dim) === 'name') { + potentialNameDimIndex = idx; + } + }); + } // idxResult: {v, n}. + + + var idxResult = function () { + var idxRes0 = {}; + var idxRes1 = {}; + var guessRecords = []; // 5 is an experience value. + + for (var i = 0, len = Math.min(5, dimCount); i < len; i++) { + var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i); + guessRecords.push(guessResult); + var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim, + // and then find a name dim with the priority: + // "BE_ORDINAL.Might|BE_ORDINAL.Must" > "other dim" > "the value dim itself". + + if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) { + idxRes0.v = i; + } + + if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) { + idxRes0.n = i; + } + + if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) { + return idxRes0; + } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not), + // find the first BE_ORDINAL.Might as the value dim, + // and then find a name dim with the priority: + // "other dim" > "the value dim itself". + // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be + // treated as number. + + + if (!isPureNumber) { + if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) { + idxRes1.v = i; + } + + if (idxRes1.n == null || idxRes1.n === idxRes1.v) { + idxRes1.n = i; + } + } + } + + function fulfilled(idxResult) { + return idxResult.v != null && idxResult.n != null; + } + + return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null; + }(); + + if (idxResult) { + encode.value = idxResult.v; // `potentialNameDimIndex` has highest priority. + + var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label use itemName in charts. + // So we dont set encodeLabel here. + + encode.itemName = [nameDimIndex]; + encode.seriesName = [nameDimIndex]; + } + + return encode; +} +/** + * If return null/undefined, indicate that should not use datasetModel. + */ + + +function getDatasetModel(seriesModel) { + var option = seriesModel.option; // Caution: consider the scenario: + // A dataset is declared and a series is not expected to use the dataset, + // and at the beginning `setOption({series: { noData })` (just prepare other + // option but no data), then `setOption({series: {data: [...]}); In this case, + // the user should set an empty array to avoid that dataset is used by default. + + var thisData = option.data; + + if (!thisData) { + return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0); + } +} +/** + * The rule should not be complex, otherwise user might not + * be able to known where the data is wrong. + * The code is ugly, but how to make it neat? + * + * @param {module:echars/data/Source} source + * @param {number} dimIndex + * @return {BE_ORDINAL} guess result. + */ + + +function guessOrdinal(source, dimIndex) { + return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex); +} // dimIndex may be overflow source data. +// return {BE_ORDINAL} + + +function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) { + var result; // Experience value. + + var maxLoop = 5; + + if (isTypedArray(data)) { + return BE_ORDINAL.Not; + } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine + // always exists in source. + + + var dimName; + var dimType; + + if (dimensionsDefine) { + var dimDefItem = dimensionsDefine[dimIndex]; + + if (isObject(dimDefItem)) { + dimName = dimDefItem.name; + dimType = dimDefItem.type; + } else if (isString(dimDefItem)) { + dimName = dimDefItem; + } + } + + if (dimType != null) { + return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not; + } + + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + var sample = data[dimIndex]; + + for (var i = 0; i < (sample || []).length && i < maxLoop; i++) { + if ((result = detectValue(sample[startIndex + i])) != null) { + return result; + } + } + } else { + for (var i = 0; i < data.length && i < maxLoop; i++) { + var row = data[startIndex + i]; + + if (row && (result = detectValue(row[dimIndex])) != null) { + return result; + } + } + } + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + if (!dimName) { + return BE_ORDINAL.Not; + } + + for (var i = 0; i < data.length && i < maxLoop; i++) { + var item = data[i]; + + if (item && (result = detectValue(item[dimName])) != null) { + return result; + } + } + } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + if (!dimName) { + return BE_ORDINAL.Not; + } + + var sample = data[dimName]; + + if (!sample || isTypedArray(sample)) { + return BE_ORDINAL.Not; + } + + for (var i = 0; i < sample.length && i < maxLoop; i++) { + if ((result = detectValue(sample[i])) != null) { + return result; + } + } + } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + for (var i = 0; i < data.length && i < maxLoop; i++) { + var item = data[i]; + var val = getDataItemValue(item); + + if (!isArray(val)) { + return BE_ORDINAL.Not; + } + + if ((result = detectValue(val[dimIndex])) != null) { + return result; + } + } + } + + function detectValue(val) { + var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as "number". + // `isFinit('')` get `true`. + + if (val != null && isFinite(val) && val !== '') { + return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not; + } else if (beStr && val !== '-') { + return BE_ORDINAL.Must; + } + } + + return BE_ORDINAL.Not; +} + +exports.BE_ORDINAL = BE_ORDINAL; +exports.detectSourceFormat = detectSourceFormat; +exports.getSource = getSource; +exports.resetSourceDefaulter = resetSourceDefaulter; +exports.prepareSource = prepareSource; +exports.makeSeriesEncodeForAxisCoordSys = makeSeriesEncodeForAxisCoordSys; +exports.makeSeriesEncodeForNameBased = makeSeriesEncodeForNameBased; +exports.guessOrdinal = guessOrdinal; /***/ }), -/***/ "./node_modules/zrender/lib/graphic/Gradient.js": -/*!******************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Gradient.js ***! - \******************************************************/ +/***/ "./node_modules/echarts/lib/data/helper/sourceType.js": +/*!************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/sourceType.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("/**\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9HcmFkaWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0dyYWRpZW50LmpzPzQyZTUiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAcGFyYW0ge0FycmF5LjxPYmplY3Q+fSBjb2xvclN0b3BzXG4gKi9cbnZhciBHcmFkaWVudCA9IGZ1bmN0aW9uIChjb2xvclN0b3BzKSB7XG4gIHRoaXMuY29sb3JTdG9wcyA9IGNvbG9yU3RvcHMgfHwgW107XG59O1xuXG5HcmFkaWVudC5wcm90b3R5cGUgPSB7XG4gIGNvbnN0cnVjdG9yOiBHcmFkaWVudCxcbiAgYWRkQ29sb3JTdG9wOiBmdW5jdGlvbiAob2Zmc2V0LCBjb2xvcikge1xuICAgIHRoaXMuY29sb3JTdG9wcy5wdXNoKHtcbiAgICAgIG9mZnNldDogb2Zmc2V0LFxuICAgICAgY29sb3I6IGNvbG9yXG4gICAgfSk7XG4gIH1cbn07XG52YXIgX2RlZmF1bHQgPSBHcmFkaWVudDtcbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Gradient.js\n"); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +// Avoid typo. +var SOURCE_FORMAT_ORIGINAL = 'original'; +var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows'; +var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows'; +var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns'; +var SOURCE_FORMAT_UNKNOWN = 'unknown'; // ??? CHANGE A NAME + +var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray'; +var SERIES_LAYOUT_BY_COLUMN = 'column'; +var SERIES_LAYOUT_BY_ROW = 'row'; +exports.SOURCE_FORMAT_ORIGINAL = SOURCE_FORMAT_ORIGINAL; +exports.SOURCE_FORMAT_ARRAY_ROWS = SOURCE_FORMAT_ARRAY_ROWS; +exports.SOURCE_FORMAT_OBJECT_ROWS = SOURCE_FORMAT_OBJECT_ROWS; +exports.SOURCE_FORMAT_KEYED_COLUMNS = SOURCE_FORMAT_KEYED_COLUMNS; +exports.SOURCE_FORMAT_UNKNOWN = SOURCE_FORMAT_UNKNOWN; +exports.SOURCE_FORMAT_TYPED_ARRAY = SOURCE_FORMAT_TYPED_ARRAY; +exports.SERIES_LAYOUT_BY_COLUMN = SERIES_LAYOUT_BY_COLUMN; +exports.SERIES_LAYOUT_BY_ROW = SERIES_LAYOUT_BY_ROW; /***/ }), -/***/ "./node_modules/zrender/lib/graphic/Image.js": -/*!***************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Image.js ***! - \***************************************************/ +/***/ "./node_modules/echarts/lib/util/clazz.js": +/*!************************************************!*\ + !*** ./node_modules/echarts/lib/util/clazz.js ***! + \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var Displayable = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar imageHelper = __webpack_require__(/*! ./helper/image */ \"./node_modules/zrender/lib/graphic/helper/image.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9JbWFnZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0ltYWdlLmpzPzBkYTgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIERpc3BsYXlhYmxlID0gcmVxdWlyZShcIi4vRGlzcGxheWFibGVcIik7XG5cbnZhciBCb3VuZGluZ1JlY3QgPSByZXF1aXJlKFwiLi4vY29yZS9Cb3VuZGluZ1J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cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Image.js\n"); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var _config = __webpack_require__(/*! ../config */ "./node_modules/echarts/lib/config.js"); + +var __DEV__ = _config.__DEV__; + +var zrUtil = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +var TYPE_DELIMITER = '.'; +var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___'; +/** + * Notice, parseClassType('') should returns {main: '', sub: ''} + * @public + */ + +function parseClassType(componentType) { + var ret = { + main: '', + sub: '' + }; + + if (componentType) { + componentType = componentType.split(TYPE_DELIMITER); + ret.main = componentType[0] || ''; + ret.sub = componentType[1] || ''; + } + + return ret; +} +/** + * @public + */ + + +function checkClassType(componentType) { + zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal'); +} +/** + * @public + */ + + +function enableClassExtend(RootClass, mandatoryMethods) { + RootClass.$constructor = RootClass; + + RootClass.extend = function (proto) { + var superClass = this; + + var ExtendedClass = function () { + if (!proto.$constructor) { + superClass.apply(this, arguments); + } else { + proto.$constructor.apply(this, arguments); + } + }; + + zrUtil.extend(ExtendedClass.prototype, proto); + ExtendedClass.extend = this.extend; + ExtendedClass.superCall = superCall; + ExtendedClass.superApply = superApply; + zrUtil.inherits(ExtendedClass, this); + ExtendedClass.superClass = superClass; + return ExtendedClass; + }; +} + +var classBase = 0; +/** + * Can not use instanceof, consider different scope by + * cross domain or es module import in ec extensions. + * Mount a method "isInstance()" to Clz. + */ + +function enableClassCheck(Clz) { + var classAttr = ['__\0is_clz', classBase++, Math.random().toFixed(3)].join('_'); + Clz.prototype[classAttr] = true; + + Clz.isInstance = function (obj) { + return !!(obj && obj[classAttr]); + }; +} // superCall should have class info, which can not be fetch from 'this'. +// Consider this case: +// class A has method f, +// class B inherits class A, overrides method f, f call superApply('f'), +// class C inherits class B, do not overrides method f, +// then when method of class C is called, dead loop occured. + + +function superCall(context, methodName) { + var args = zrUtil.slice(arguments, 2); + return this.superClass.prototype[methodName].apply(context, args); +} + +function superApply(context, methodName, args) { + return this.superClass.prototype[methodName].apply(context, args); +} +/** + * @param {Object} entity + * @param {Object} options + * @param {boolean} [options.registerWhenExtend] + * @public + */ + + +function enableClassManagement(entity, options) { + options = options || {}; + /** + * Component model classes + * key: componentType, + * value: + * componentClass, when componentType is 'xxx' + * or Object., when componentType is 'xxx.yy' + * @type {Object} + */ + + var storage = {}; + + entity.registerClass = function (Clazz, componentType) { + if (componentType) { + checkClassType(componentType); + componentType = parseClassType(componentType); + + if (!componentType.sub) { + storage[componentType.main] = Clazz; + } else if (componentType.sub !== IS_CONTAINER) { + var container = makeContainer(componentType); + container[componentType.sub] = Clazz; + } + } + + return Clazz; + }; + + entity.getClass = function (componentMainType, subType, throwWhenNotFound) { + var Clazz = storage[componentMainType]; + + if (Clazz && Clazz[IS_CONTAINER]) { + Clazz = subType ? Clazz[subType] : null; + } + + if (throwWhenNotFound && !Clazz) { + throw new Error(!subType ? componentMainType + '.' + 'type should be specified.' : 'Component ' + componentMainType + '.' + (subType || '') + ' not exists. Load it first.'); + } + + return Clazz; + }; + + entity.getClassesByMainType = function (componentType) { + componentType = parseClassType(componentType); + var result = []; + var obj = storage[componentType.main]; + + if (obj && obj[IS_CONTAINER]) { + zrUtil.each(obj, function (o, type) { + type !== IS_CONTAINER && result.push(o); + }); + } else { + result.push(obj); + } + + return result; + }; + + entity.hasClass = function (componentType) { + // Just consider componentType.main. + componentType = parseClassType(componentType); + return !!storage[componentType.main]; + }; + /** + * @return {Array.} Like ['aa', 'bb'], but can not be ['aa.xx'] + */ + + + entity.getAllClassMainTypes = function () { + var types = []; + zrUtil.each(storage, function (obj, type) { + types.push(type); + }); + return types; + }; + /** + * If a main type is container and has sub types + * @param {string} mainType + * @return {boolean} + */ + + + entity.hasSubTypes = function (componentType) { + componentType = parseClassType(componentType); + var obj = storage[componentType.main]; + return obj && obj[IS_CONTAINER]; + }; + + entity.parseClassType = parseClassType; + + function makeContainer(componentType) { + var container = storage[componentType.main]; + + if (!container || !container[IS_CONTAINER]) { + container = storage[componentType.main] = {}; + container[IS_CONTAINER] = true; + } + + return container; + } + + if (options.registerWhenExtend) { + var originalExtend = entity.extend; + + if (originalExtend) { + entity.extend = function (proto) { + var ExtendedClass = originalExtend.call(this, proto); + return entity.registerClass(ExtendedClass, proto.type); + }; + } + } + + return entity; +} +/** + * @param {string|Array.} properties + */ + + +function setReadOnly(obj, properties) {// FIXME It seems broken in IE8 simulation of IE11 + // if (!zrUtil.isArray(properties)) { + // properties = properties != null ? [properties] : []; + // } + // zrUtil.each(properties, function (prop) { + // var value = obj[prop]; + // Object.defineProperty + // && Object.defineProperty(obj, prop, { + // value: value, writable: false + // }); + // zrUtil.isArray(obj[prop]) + // && Object.freeze + // && Object.freeze(obj[prop]); + // }); +} + +exports.parseClassType = parseClassType; +exports.enableClassExtend = enableClassExtend; +exports.enableClassCheck = enableClassCheck; +exports.enableClassManagement = enableClassManagement; +exports.setReadOnly = setReadOnly; /***/ }), -/***/ "./node_modules/zrender/lib/graphic/IncrementalDisplayable.js": -/*!********************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/IncrementalDisplayable.js ***! - \********************************************************************/ +/***/ "./node_modules/echarts/lib/util/graphic.js": +/*!**************************************************!*\ + !*** ./node_modules/echarts/lib/util/graphic.js ***! + \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar inherits = _util.inherits;\n\nvar Displayble = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9JbmNyZW1lbnRhbERpc3Bs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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/IncrementalDisplayable.js\n"); -/***/ }), +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -/***/ "./node_modules/zrender/lib/graphic/LinearGradient.js": -/*!************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/LinearGradient.js ***! - \************************************************************/ +var zrUtil = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); + +var pathTool = __webpack_require__(/*! zrender/lib/tool/path */ "./node_modules/zrender/lib/tool/path.js"); + +var colorTool = __webpack_require__(/*! zrender/lib/tool/color */ "./node_modules/zrender/lib/tool/color.js"); + +var matrix = __webpack_require__(/*! zrender/lib/core/matrix */ "./node_modules/zrender/lib/core/matrix.js"); + +var vector = __webpack_require__(/*! zrender/lib/core/vector */ "./node_modules/zrender/lib/core/vector.js"); + +var Path = __webpack_require__(/*! zrender/lib/graphic/Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var Transformable = __webpack_require__(/*! zrender/lib/mixin/Transformable */ "./node_modules/zrender/lib/mixin/Transformable.js"); + +var ZImage = __webpack_require__(/*! zrender/lib/graphic/Image */ "./node_modules/zrender/lib/graphic/Image.js"); + +exports.Image = ZImage; + +var Group = __webpack_require__(/*! zrender/lib/container/Group */ "./node_modules/zrender/lib/container/Group.js"); + +exports.Group = Group; + +var Text = __webpack_require__(/*! zrender/lib/graphic/Text */ "./node_modules/zrender/lib/graphic/Text.js"); + +exports.Text = Text; + +var Circle = __webpack_require__(/*! zrender/lib/graphic/shape/Circle */ "./node_modules/zrender/lib/graphic/shape/Circle.js"); + +exports.Circle = Circle; + +var Sector = __webpack_require__(/*! zrender/lib/graphic/shape/Sector */ "./node_modules/zrender/lib/graphic/shape/Sector.js"); + +exports.Sector = Sector; + +var Ring = __webpack_require__(/*! zrender/lib/graphic/shape/Ring */ "./node_modules/zrender/lib/graphic/shape/Ring.js"); + +exports.Ring = Ring; + +var Polygon = __webpack_require__(/*! zrender/lib/graphic/shape/Polygon */ "./node_modules/zrender/lib/graphic/shape/Polygon.js"); + +exports.Polygon = Polygon; + +var Polyline = __webpack_require__(/*! zrender/lib/graphic/shape/Polyline */ "./node_modules/zrender/lib/graphic/shape/Polyline.js"); + +exports.Polyline = Polyline; + +var Rect = __webpack_require__(/*! zrender/lib/graphic/shape/Rect */ "./node_modules/zrender/lib/graphic/shape/Rect.js"); + +exports.Rect = Rect; + +var Line = __webpack_require__(/*! zrender/lib/graphic/shape/Line */ "./node_modules/zrender/lib/graphic/shape/Line.js"); + +exports.Line = Line; + +var BezierCurve = __webpack_require__(/*! zrender/lib/graphic/shape/BezierCurve */ "./node_modules/zrender/lib/graphic/shape/BezierCurve.js"); + +exports.BezierCurve = BezierCurve; + +var Arc = __webpack_require__(/*! zrender/lib/graphic/shape/Arc */ "./node_modules/zrender/lib/graphic/shape/Arc.js"); + +exports.Arc = Arc; + +var CompoundPath = __webpack_require__(/*! zrender/lib/graphic/CompoundPath */ "./node_modules/zrender/lib/graphic/CompoundPath.js"); + +exports.CompoundPath = CompoundPath; + +var LinearGradient = __webpack_require__(/*! zrender/lib/graphic/LinearGradient */ "./node_modules/zrender/lib/graphic/LinearGradient.js"); + +exports.LinearGradient = LinearGradient; + +var RadialGradient = __webpack_require__(/*! zrender/lib/graphic/RadialGradient */ "./node_modules/zrender/lib/graphic/RadialGradient.js"); + +exports.RadialGradient = RadialGradient; + +var BoundingRect = __webpack_require__(/*! zrender/lib/core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +exports.BoundingRect = BoundingRect; + +var IncrementalDisplayable = __webpack_require__(/*! zrender/lib/graphic/IncrementalDisplayable */ "./node_modules/zrender/lib/graphic/IncrementalDisplayable.js"); + +exports.IncrementalDisplayable = IncrementalDisplayable; + +var subPixelOptimizeUtil = __webpack_require__(/*! zrender/lib/graphic/helper/subPixelOptimize */ "./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js"); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +var mathMax = Math.max; +var mathMin = Math.min; +var EMPTY_OBJ = {}; +var Z2_EMPHASIS_LIFT = 1; // key: label model property nane, value: style property name. + +var CACHED_LABEL_STYLE_PROPERTIES = { + color: 'textFill', + textBorderColor: 'textStroke', + textBorderWidth: 'textStrokeWidth' +}; +var EMPHASIS = 'emphasis'; +var NORMAL = 'normal'; // Reserve 0 as default. + +var _highlightNextDigit = 1; +var _highlightKeyMap = {}; +var _customShapeMap = {}; +/** + * Extend shape with parameters + */ + +function extendShape(opts) { + return Path.extend(opts); +} +/** + * Extend path + */ + + +function extendPath(pathData, opts) { + return pathTool.extendFromString(pathData, opts); +} +/** + * Register a user defined shape. + * The shape class can be fetched by `getShapeClass` + * This method will overwrite the registered shapes, including + * the registered built-in shapes, if using the same `name`. + * The shape can be used in `custom series` and + * `graphic component` by declaring `{type: name}`. + * + * @param {string} name + * @param {Object} ShapeClass Can be generated by `extendShape`. + */ + + +function registerShape(name, ShapeClass) { + _customShapeMap[name] = ShapeClass; +} +/** + * Find shape class registered by `registerShape`. Usually used in + * fetching user defined shape. + * + * [Caution]: + * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared + * to use user registered shapes. + * Because the built-in shape (see `getBuiltInShape`) will be registered by + * `registerShape` by default. That enables users to get both built-in + * shapes as well as the shapes belonging to themsleves. But users can overwrite + * the built-in shapes by using names like 'circle', 'rect' via calling + * `registerShape`. So the echarts inner featrues should not fetch shapes from here + * in case that it is overwritten by users, except that some features, like + * `custom series`, `graphic component`, do it deliberately. + * + * (2) In the features like `custom series`, `graphic component`, the user input + * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic + * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names + * are reserved names, that is, if some user register a shape named `'image'`, + * the shape will not be used. If we intending to add some more reserved names + * in feature, that might bring break changes (disable some existing user shape + * names). But that case probably rearly happen. So we dont make more mechanism + * to resolve this issue here. + * + * @param {string} name + * @return {Object} The shape class. If not found, return nothing. + */ + + +function getShapeClass(name) { + if (_customShapeMap.hasOwnProperty(name)) { + return _customShapeMap[name]; + } +} +/** + * Create a path element from path data string + * @param {string} pathData + * @param {Object} opts + * @param {module:zrender/core/BoundingRect} rect + * @param {string} [layout=cover] 'center' or 'cover' + */ + + +function makePath(pathData, opts, rect, layout) { + var path = pathTool.createFromString(pathData, opts); + + if (rect) { + if (layout === 'center') { + rect = centerGraphic(rect, path.getBoundingRect()); + } + + resizePath(path, rect); + } + + return path; +} +/** + * Create a image element from image url + * @param {string} imageUrl image url + * @param {Object} opts options + * @param {module:zrender/core/BoundingRect} rect constrain rect + * @param {string} [layout=cover] 'center' or 'cover' + */ + + +function makeImage(imageUrl, rect, layout) { + var path = new ZImage({ + style: { + image: imageUrl, + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + onload: function (img) { + if (layout === 'center') { + var boundingRect = { + width: img.width, + height: img.height + }; + path.setStyle(centerGraphic(rect, boundingRect)); + } + } + }); + return path; +} +/** + * Get position of centered element in bounding box. + * + * @param {Object} rect element local bounding box + * @param {Object} boundingRect constraint bounding box + * @return {Object} element position containing x, y, width, and height + */ + + +function centerGraphic(rect, boundingRect) { + // Set rect to center, keep width / height ratio. + var aspect = boundingRect.width / boundingRect.height; + var width = rect.height * aspect; + var height; + + if (width <= rect.width) { + height = rect.height; + } else { + width = rect.width; + height = width / aspect; + } + + var cx = rect.x + rect.width / 2; + var cy = rect.y + rect.height / 2; + return { + x: cx - width / 2, + y: cy - height / 2, + width: width, + height: height + }; +} + +var mergePath = pathTool.mergePath; +/** + * Resize a path to fit the rect + * @param {module:zrender/graphic/Path} path + * @param {Object} rect + */ + +function resizePath(path, rect) { + if (!path.applyTransform) { + return; + } + + var pathRect = path.getBoundingRect(); + var m = pathRect.calculateTransform(rect); + path.applyTransform(m); +} +/** + * Sub pixel optimize line for canvas + * + * @param {Object} param + * @param {Object} [param.shape] + * @param {number} [param.shape.x1] + * @param {number} [param.shape.y1] + * @param {number} [param.shape.x2] + * @param {number} [param.shape.y2] + * @param {Object} [param.style] + * @param {number} [param.style.lineWidth] + * @return {Object} Modified param + */ + + +function subPixelOptimizeLine(param) { + subPixelOptimizeUtil.subPixelOptimizeLine(param.shape, param.shape, param.style); + return param; +} +/** + * Sub pixel optimize rect for canvas + * + * @param {Object} param + * @param {Object} [param.shape] + * @param {number} [param.shape.x] + * @param {number} [param.shape.y] + * @param {number} [param.shape.width] + * @param {number} [param.shape.height] + * @param {Object} [param.style] + * @param {number} [param.style.lineWidth] + * @return {Object} Modified param + */ + + +function subPixelOptimizeRect(param) { + subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style); + return param; +} +/** + * Sub pixel optimize for canvas + * + * @param {number} position Coordinate, such as x, y + * @param {number} lineWidth Should be nonnegative integer. + * @param {boolean=} positiveOrNegative Default false (negative). + * @return {number} Optimized position. + */ + + +var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize; + +function hasFillOrStroke(fillOrStroke) { + return fillOrStroke != null && fillOrStroke !== 'none'; +} // Most lifted color are duplicated. + + +var liftedColorMap = zrUtil.createHashMap(); +var liftedColorCount = 0; + +function liftColor(color) { + if (typeof color !== 'string') { + return color; + } + + var liftedColor = liftedColorMap.get(color); + + if (!liftedColor) { + liftedColor = colorTool.lift(color, -0.1); + + if (liftedColorCount < 10000) { + liftedColorMap.set(color, liftedColor); + liftedColorCount++; + } + } + + return liftedColor; +} + +function cacheElementStl(el) { + if (!el.__hoverStlDirty) { + return; + } + + el.__hoverStlDirty = false; + var hoverStyle = el.__hoverStl; + + if (!hoverStyle) { + el.__cachedNormalStl = el.__cachedNormalZ2 = null; + return; + } + + var normalStyle = el.__cachedNormalStl = {}; + el.__cachedNormalZ2 = el.z2; + var elStyle = el.style; + + for (var name in hoverStyle) { + // See comment in `singleEnterEmphasis`. + if (hoverStyle[name] != null) { + normalStyle[name] = elStyle[name]; + } + } // Always cache fill and stroke to normalStyle for lifting color. + + + normalStyle.fill = elStyle.fill; + normalStyle.stroke = elStyle.stroke; +} + +function singleEnterEmphasis(el) { + var hoverStl = el.__hoverStl; + + if (!hoverStl || el.__highlighted) { + return; + } + + var zr = el.__zr; + var useHoverLayer = el.useHoverLayer && zr && zr.painter.type === 'canvas'; + el.__highlighted = useHoverLayer ? 'layer' : 'plain'; + + if (el.isGroup || !zr && el.useHoverLayer) { + return; + } + + var elTarget = el; + var targetStyle = el.style; + + if (useHoverLayer) { + elTarget = zr.addHover(el); + targetStyle = elTarget.style; + } + + rollbackDefaultTextStyle(targetStyle); + + if (!useHoverLayer) { + cacheElementStl(elTarget); + } // styles can be: + // { + // label: { + // show: false, + // position: 'outside', + // fontSize: 18 + // }, + // emphasis: { + // label: { + // show: true + // } + // } + // }, + // where properties of `emphasis` may not appear in `normal`. We previously use + // module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`. + // But consider rich text and setOption in merge mode, it is impossible to cover + // all properties in merge. So we use merge mode when setting style here. + // But we choose the merge strategy that only properties that is not `null/undefined`. + // Because when making a textStyle (espacially rich text), it is not easy to distinguish + // `hasOwnProperty` and `null/undefined` in code, so we trade them as the same for simplicity. + // But this strategy brings a trouble that `null/undefined` can not be used to remove + // style any more in `emphasis`. Users can both set properties directly on normal and + // emphasis to avoid this issue, or we might support `'none'` for this case if required. + + + targetStyle.extendFrom(hoverStl); + setDefaultHoverFillStroke(targetStyle, hoverStl, 'fill'); + setDefaultHoverFillStroke(targetStyle, hoverStl, 'stroke'); + applyDefaultTextStyle(targetStyle); + + if (!useHoverLayer) { + el.dirty(false); + el.z2 += Z2_EMPHASIS_LIFT; + } +} + +function setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) { + if (!hasFillOrStroke(hoverStyle[prop]) && hasFillOrStroke(targetStyle[prop])) { + targetStyle[prop] = liftColor(targetStyle[prop]); + } +} + +function singleEnterNormal(el) { + var highlighted = el.__highlighted; + + if (!highlighted) { + return; + } + + el.__highlighted = false; + + if (el.isGroup) { + return; + } + + if (highlighted === 'layer') { + el.__zr && el.__zr.removeHover(el); + } else { + var style = el.style; + var normalStl = el.__cachedNormalStl; + + if (normalStl) { + rollbackDefaultTextStyle(style); + el.setStyle(normalStl); + applyDefaultTextStyle(style); + } // `__cachedNormalZ2` will not be reset if calling `setElementHoverStyle` + // when `el` is on emphasis state. So here by comparing with 1, we try + // hard to make the bug case rare. + + + var normalZ2 = el.__cachedNormalZ2; + + if (normalZ2 != null && el.z2 - normalZ2 === Z2_EMPHASIS_LIFT) { + el.z2 = normalZ2; + } + } +} + +function traverseUpdate(el, updater, commonParam) { + // If root is group, also enter updater for `highDownOnUpdate`. + var fromState = NORMAL; + var toState = NORMAL; + var trigger; // See the rule of `highDownOnUpdate` on `graphic.setAsHighDownDispatcher`. + + el.__highlighted && (fromState = EMPHASIS, trigger = true); + updater(el, commonParam); + el.__highlighted && (toState = EMPHASIS, trigger = true); + el.isGroup && el.traverse(function (child) { + !child.isGroup && updater(child, commonParam); + }); + trigger && el.__highDownOnUpdate && el.__highDownOnUpdate(fromState, toState); +} +/** + * Set hover style (namely "emphasis style") of element, based on the current + * style of the given `el`. + * This method should be called after all of the normal styles have been adopted + * to the `el`. See the reason on `setHoverStyle`. + * + * @param {module:zrender/Element} el Should not be `zrender/container/Group`. + * @param {Object} [el.hoverStyle] Can be set on el or its descendants, + * e.g., `el.hoverStyle = ...; graphic.setHoverStyle(el); `. + * Often used when item group has a label element and it's hoverStyle is different. + * @param {Object|boolean} [hoverStl] The specified hover style. + * If set as `false`, disable the hover style. + * Similarly, The `el.hoverStyle` can alse be set + * as `false` to disable the hover style. + * Otherwise, use the default hover style if not provided. + */ + + +function setElementHoverStyle(el, hoverStl) { + // For performance consideration, it might be better to make the "hover style" only the + // difference properties from the "normal style", but not a entire copy of all styles. + hoverStl = el.__hoverStl = hoverStl !== false && (el.hoverStyle || hoverStl || {}); + el.__hoverStlDirty = true; // FIXME + // It is not completely right to save "normal"/"emphasis" flag on elements. + // It probably should be saved on `data` of series. Consider the cases: + // (1) A highlighted elements are moved out of the view port and re-enter + // again by dataZoom. + // (2) call `setOption` and replace elements totally when they are highlighted. + + if (el.__highlighted) { + // Consider the case: + // The styles of a highlighted `el` is being updated. The new "emphasis style" + // should be adapted to the `el`. Notice here new "normal styles" should have + // been set outside and the cached "normal style" is out of date. + el.__cachedNormalStl = null; // Do not clear `__cachedNormalZ2` here, because setting `z2` is not a constraint + // of this method. In most cases, `z2` is not set and hover style should be able + // to rollback. Of course, that would bring bug, but only in a rare case, see + // `doSingleLeaveHover` for details. + + singleEnterNormal(el); + singleEnterEmphasis(el); + } +} + +function onElementMouseOver(e) { + !shouldSilent(this, e) // "emphasis" event highlight has higher priority than mouse highlight. + && !this.__highByOuter && traverseUpdate(this, singleEnterEmphasis); +} + +function onElementMouseOut(e) { + !shouldSilent(this, e) // "emphasis" event highlight has higher priority than mouse highlight. + && !this.__highByOuter && traverseUpdate(this, singleEnterNormal); +} + +function onElementEmphasisEvent(highlightDigit) { + this.__highByOuter |= 1 << (highlightDigit || 0); + traverseUpdate(this, singleEnterEmphasis); +} + +function onElementNormalEvent(highlightDigit) { + !(this.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdate(this, singleEnterNormal); +} + +function shouldSilent(el, e) { + return el.__highDownSilentOnTouch && e.zrByTouch; +} +/** + * Set hover style (namely "emphasis style") of element, + * based on the current style of the given `el`. + * + * (1) + * **CONSTRAINTS** for this method: + * This method MUST be called after all of the normal styles having been adopted + * to the `el`. + * The input `hoverStyle` (that is, "emphasis style") MUST be the subset of the + * "normal style" having been set to the el. + * `color` MUST be one of the "normal styles" (because color might be lifted as + * a default hover style). + * + * The reason: this method treat the current style of the `el` as the "normal style" + * and cache them when enter/update the "emphasis style". Consider the case: the `el` + * is in "emphasis" state and `setOption`/`dispatchAction` trigger the style updating + * logic, where the el should shift from the original emphasis style to the new + * "emphasis style" and should be able to "downplay" back to the new "normal style". + * + * Indeed, it is error-prone to make a interface has so many constraints, but I have + * not found a better solution yet to fit the backward compatibility, performance and + * the current programming style. + * + * (2) + * Call the method for a "root" element once. Do not call it for each descendants. + * If the descendants elemenets of a group has itself hover style different from the + * root group, we can simply mount the style on `el.hoverStyle` for them, but should + * not call this method for them. + * + * (3) These input parameters can be set directly on `el`: + * + * @param {module:zrender/Element} el + * @param {Object} [el.hoverStyle] See `graphic.setElementHoverStyle`. + * @param {boolean} [el.highDownSilentOnTouch=false] See `graphic.setAsHighDownDispatcher`. + * @param {Function} [el.highDownOnUpdate] See `graphic.setAsHighDownDispatcher`. + * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`. + */ + + +function setHoverStyle(el, hoverStyle) { + setAsHighDownDispatcher(el, true); + traverseUpdate(el, setElementHoverStyle, hoverStyle); +} +/** + * @param {module:zrender/Element} el + * @param {Function} [el.highDownOnUpdate] Called when state updated. + * Since `setHoverStyle` has the constraint that it must be called after + * all of the normal style updated, `highDownOnUpdate` is not needed to + * trigger if both `fromState` and `toState` is 'normal', and needed to + * trigger if both `fromState` and `toState` is 'emphasis', which enables + * to sync outside style settings to "emphasis" state. + * @this {string} This dispatcher `el`. + * @param {string} fromState Can be "normal" or "emphasis". + * `fromState` might equal to `toState`, + * for example, when this method is called when `el` is + * on "emphasis" state. + * @param {string} toState Can be "normal" or "emphasis". + * + * FIXME + * CAUTION: Do not expose `highDownOnUpdate` outside echarts. + * Because it is not a complete solution. The update + * listener should not have been mount in element, + * and the normal/emphasis state should not have + * mantained on elements. + * + * @param {boolean} [el.highDownSilentOnTouch=false] + * In touch device, mouseover event will be trigger on touchstart event + * (see module:zrender/dom/HandlerProxy). By this mechanism, we can + * conveniently use hoverStyle when tap on touch screen without additional + * code for compatibility. + * But if the chart/component has select feature, which usually also use + * hoverStyle, there might be conflict between 'select-highlight' and + * 'hover-highlight' especially when roam is enabled (see geo for example). + * In this case, `highDownSilentOnTouch` should be used to disable + * hover-highlight on touch device. + * @param {boolean} [asDispatcher=true] If `false`, do not set as "highDownDispatcher". + */ + + +function setAsHighDownDispatcher(el, asDispatcher) { + var disable = asDispatcher === false; // Make `highDownSilentOnTouch` and `highDownOnUpdate` only work after + // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly. + + el.__highDownSilentOnTouch = el.highDownSilentOnTouch; + el.__highDownOnUpdate = el.highDownOnUpdate; // Simple optimize, since this method might be + // called for each elements of a group in some cases. + + if (!disable || el.__highDownDispatcher) { + var method = disable ? 'off' : 'on'; // Duplicated function will be auto-ignored, see Eventful.js. + + el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); // Emphasis, normal can be triggered manually by API or other components like hover link. + + el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); // Also keep previous record. + + el.__highByOuter = el.__highByOuter || 0; + el.__highDownDispatcher = !disable; + } +} +/** + * @param {module:zrender/src/Element} el + * @return {boolean} + */ + + +function isHighDownDispatcher(el) { + return !!(el && el.__highDownDispatcher); +} +/** + * Support hightlight/downplay record on each elements. + * For the case: hover highlight/downplay (legend, visualMap, ...) and + * user triggerred hightlight/downplay should not conflict. + * Only all of the highlightDigit cleared, return to normal. + * @param {string} highlightKey + * @return {number} highlightDigit + */ + + +function getHighlightDigit(highlightKey) { + var highlightDigit = _highlightKeyMap[highlightKey]; + + if (highlightDigit == null && _highlightNextDigit <= 32) { + highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++; + } + + return highlightDigit; +} +/** + * See more info in `setTextStyleCommon`. + * @param {Object|module:zrender/graphic/Style} normalStyle + * @param {Object} emphasisStyle + * @param {module:echarts/model/Model} normalModel + * @param {module:echarts/model/Model} emphasisModel + * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props. + * @param {string|Function} [opt.defaultText] + * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by + * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {number} [opt.labelDataIndex] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {number} [opt.labelDimIndex] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {string} [opt.labelProp] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {Object} [normalSpecified] + * @param {Object} [emphasisSpecified] + */ + + +function setLabelStyle(normalStyle, emphasisStyle, normalModel, emphasisModel, opt, normalSpecified, emphasisSpecified) { + opt = opt || EMPTY_OBJ; + var labelFetcher = opt.labelFetcher; + var labelDataIndex = opt.labelDataIndex; + var labelDimIndex = opt.labelDimIndex; + var labelProp = opt.labelProp; // This scenario, `label.normal.show = true; label.emphasis.show = false`, + // is not supported util someone requests. + + var showNormal = normalModel.getShallow('show'); + var showEmphasis = emphasisModel.getShallow('show'); // Consider performance, only fetch label when necessary. + // If `normal.show` is `false` and `emphasis.show` is `true` and `emphasis.formatter` is not set, + // label should be displayed, where text is fetched by `normal.formatter` or `opt.defaultText`. + + var baseText; + + if (showNormal || showEmphasis) { + if (labelFetcher) { + baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, labelProp); + } + + if (baseText == null) { + baseText = zrUtil.isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText; + } + } + + var normalStyleText = showNormal ? baseText : null; + 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. + + if (normalStyleText != null || emphasisStyleText != null) { + // Always set `textStyle` even if `normalStyle.text` is null, because default + // values have to be set on `normalStyle`. + // If we set default values on `emphasisStyle`, consider case: + // Firstly, `setOption(... label: {normal: {text: null}, emphasis: {show: true}} ...);` + // Secondly, `setOption(... label: {noraml: {show: true, text: 'abc', color: 'red'} ...);` + // Then the 'red' will not work on emphasis. + setTextStyle(normalStyle, normalModel, normalSpecified, opt); + setTextStyle(emphasisStyle, emphasisModel, emphasisSpecified, opt, true); + } + + normalStyle.text = normalStyleText; + emphasisStyle.text = emphasisStyleText; +} +/** + * Modify label style manually. + * Only works after `setLabelStyle` and `setElementHoverStyle` called. + * + * @param {module:zrender/src/Element} el + * @param {Object} [normalStyleProps] optional + * @param {Object} [emphasisStyleProps] optional + */ + + +function modifyLabelStyle(el, normalStyleProps, emphasisStyleProps) { + var elStyle = el.style; + + if (normalStyleProps) { + rollbackDefaultTextStyle(elStyle); + el.setStyle(normalStyleProps); + applyDefaultTextStyle(elStyle); + } + + elStyle = el.__hoverStl; + + if (emphasisStyleProps && elStyle) { + rollbackDefaultTextStyle(elStyle); + zrUtil.extend(elStyle, emphasisStyleProps); + applyDefaultTextStyle(elStyle); + } +} +/** + * Set basic textStyle properties. + * See more info in `setTextStyleCommon`. + * @param {Object|module:zrender/graphic/Style} textStyle + * @param {module:echarts/model/Model} model + * @param {Object} [specifiedTextStyle] Can be overrided by settings in model. + * @param {Object} [opt] See `opt` of `setTextStyleCommon`. + * @param {boolean} [isEmphasis] + */ + + +function setTextStyle(textStyle, textStyleModel, specifiedTextStyle, opt, isEmphasis) { + setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis); + specifiedTextStyle && zrUtil.extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); + + return textStyle; +} +/** + * Set text option in the style. + * See more info in `setTextStyleCommon`. + * @deprecated + * @param {Object} textStyle + * @param {module:echarts/model/Model} labelModel + * @param {string|boolean} defaultColor Default text color. + * If set as false, it will be processed as a emphasis style. + */ + + +function setText(textStyle, labelModel, defaultColor) { + var opt = { + isRectText: true + }; + var isEmphasis; + + if (defaultColor === false) { + isEmphasis = true; + } else { + // Support setting color as 'auto' to get visual color. + opt.autoColor = defaultColor; + } + + setTextStyleCommon(textStyle, labelModel, opt, isEmphasis); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); +} +/** + * The uniform entry of set text style, that is, retrieve style definitions + * from `model` and set to `textStyle` object. + * + * Never in merge mode, but in overwrite mode, that is, all of the text style + * properties will be set. (Consider the states of normal and emphasis and + * default value can be adopted, merge would make the logic too complicated + * to manage.) + * + * The `textStyle` object can either be a plain object or an instance of + * `zrender/src/graphic/Style`, and either be the style of normal or emphasis. + * After this mothod called, the `textStyle` object can then be used in + * `el.setStyle(textStyle)` or `el.hoverStyle = textStyle`. + * + * Default value will be adopted and `insideRollbackOpt` will be created. + * See `applyDefaultTextStyle` `rollbackDefaultTextStyle` for more details. + * + * opt: { + * disableBox: boolean, Whether diable drawing box of block (outer most). + * isRectText: boolean, + * autoColor: string, specify a color when color is 'auto', + * for textFill, textStroke, textBackgroundColor, and textBorderColor. + * If autoColor specified, it is used as default textFill. + * useInsideStyle: + * `true`: Use inside style (textFill, textStroke, textStrokeWidth) + * if `textFill` is not specified. + * `false`: Do not use inside style. + * `null/undefined`: use inside style if `isRectText` is true and + * `textFill` is not specified and textPosition contains `'inside'`. + * forceRich: boolean + * } + */ + + +function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) { + // Consider there will be abnormal when merge hover style to normal style if given default value. + opt = opt || EMPTY_OBJ; + + if (opt.isRectText) { + var textPosition; + + if (opt.getTextPosition) { + textPosition = opt.getTextPosition(textStyleModel, isEmphasis); + } else { + textPosition = textStyleModel.getShallow('position') || (isEmphasis ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used + // in bar series, and magric type should be considered. + + textPosition === 'outside' && (textPosition = 'top'); + } + + textStyle.textPosition = textPosition; + textStyle.textOffset = textStyleModel.getShallow('offset'); + var labelRotate = textStyleModel.getShallow('rotate'); + labelRotate != null && (labelRotate *= Math.PI / 180); + textStyle.textRotation = labelRotate; + textStyle.textDistance = zrUtil.retrieve2(textStyleModel.getShallow('distance'), isEmphasis ? null : 5); + } + + var ecModel = textStyleModel.ecModel; + var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case: + // { + // data: [{ + // value: 12, + // label: { + // rich: { + // // no 'a' here but using parent 'a'. + // } + // } + // }], + // rich: { + // a: { ... } + // } + // } + + var richItemNames = getRichItemNames(textStyleModel); + var richResult; + + if (richItemNames) { + richResult = {}; + + for (var name in richItemNames) { + if (richItemNames.hasOwnProperty(name)) { + // Cascade is supported in rich. + var richTextStyle = textStyleModel.getModel(['rich', name]); // In rich, never `disableBox`. + // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`, + // the default color `'blue'` will not be adopted if no color declared in `rich`. + // That might confuses users. So probably we should put `textStyleModel` as the + // root ancestor of the `richTextStyle`. But that would be a break change. + + setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis); + } + } + } + + textStyle.rich = richResult; + setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, true); + + if (opt.forceRich && !opt.textStyle) { + opt.textStyle = {}; + } + + return textStyle; +} // Consider case: +// { +// data: [{ +// value: 12, +// label: { +// rich: { +// // no 'a' here but using parent 'a'. +// } +// } +// }], +// rich: { +// a: { ... } +// } +// } + + +function getRichItemNames(textStyleModel) { + // Use object to remove duplicated names. + var richItemNameMap; + + while (textStyleModel && textStyleModel !== textStyleModel.ecModel) { + var rich = (textStyleModel.option || EMPTY_OBJ).rich; + + if (rich) { + richItemNameMap = richItemNameMap || {}; + + for (var name in rich) { + if (rich.hasOwnProperty(name)) { + richItemNameMap[name] = 1; + } + } + } + + textStyleModel = textStyleModel.parentModel; + } + + return richItemNameMap; +} + +function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, isBlock) { + // In merge mode, default value should not be given. + globalTextStyle = !isEmphasis && globalTextStyle || EMPTY_OBJ; + textStyle.textFill = getAutoColor(textStyleModel.getShallow('color'), opt) || globalTextStyle.color; + textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt) || globalTextStyle.textBorderColor; + textStyle.textStrokeWidth = zrUtil.retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth); + + if (!isEmphasis) { + if (isBlock) { + textStyle.insideRollbackOpt = opt; + applyDefaultTextStyle(textStyle); + } // Set default finally. + + + if (textStyle.textFill == null) { + textStyle.textFill = opt.autoColor; + } + } // Do not use `getFont` here, because merge should be supported, where + // part of these properties may be changed in emphasis style, and the + // others should remain their original value got from normal style. + + + textStyle.fontStyle = textStyleModel.getShallow('fontStyle') || globalTextStyle.fontStyle; + textStyle.fontWeight = textStyleModel.getShallow('fontWeight') || globalTextStyle.fontWeight; + textStyle.fontSize = textStyleModel.getShallow('fontSize') || globalTextStyle.fontSize; + textStyle.fontFamily = textStyleModel.getShallow('fontFamily') || globalTextStyle.fontFamily; + textStyle.textAlign = textStyleModel.getShallow('align'); + textStyle.textVerticalAlign = textStyleModel.getShallow('verticalAlign') || textStyleModel.getShallow('baseline'); + textStyle.textLineHeight = textStyleModel.getShallow('lineHeight'); + textStyle.textWidth = textStyleModel.getShallow('width'); + textStyle.textHeight = textStyleModel.getShallow('height'); + textStyle.textTag = textStyleModel.getShallow('tag'); + + if (!isBlock || !opt.disableBox) { + textStyle.textBackgroundColor = getAutoColor(textStyleModel.getShallow('backgroundColor'), opt); + textStyle.textPadding = textStyleModel.getShallow('padding'); + textStyle.textBorderColor = getAutoColor(textStyleModel.getShallow('borderColor'), opt); + textStyle.textBorderWidth = textStyleModel.getShallow('borderWidth'); + textStyle.textBorderRadius = textStyleModel.getShallow('borderRadius'); + textStyle.textBoxShadowColor = textStyleModel.getShallow('shadowColor'); + textStyle.textBoxShadowBlur = textStyleModel.getShallow('shadowBlur'); + textStyle.textBoxShadowOffsetX = textStyleModel.getShallow('shadowOffsetX'); + textStyle.textBoxShadowOffsetY = textStyleModel.getShallow('shadowOffsetY'); + } + + textStyle.textShadowColor = textStyleModel.getShallow('textShadowColor') || globalTextStyle.textShadowColor; + textStyle.textShadowBlur = textStyleModel.getShallow('textShadowBlur') || globalTextStyle.textShadowBlur; + textStyle.textShadowOffsetX = textStyleModel.getShallow('textShadowOffsetX') || globalTextStyle.textShadowOffsetX; + textStyle.textShadowOffsetY = textStyleModel.getShallow('textShadowOffsetY') || globalTextStyle.textShadowOffsetY; +} + +function getAutoColor(color, opt) { + return color !== 'auto' ? color : opt && opt.autoColor ? opt.autoColor : null; +} +/** + * Give some default value to the input `textStyle` object, based on the current settings + * in this `textStyle` object. + * + * The Scenario: + * when text position is `inside` and `textFill` is not specified, we show + * text border by default for better view. But it should be considered that text position + * might be changed when hovering or being emphasis, where the `insideRollback` is used to + * restore the style. + * + * Usage (& NOTICE): + * When a style object (eithor plain object or instance of `zrender/src/graphic/Style`) is + * about to be modified on its text related properties, `rollbackDefaultTextStyle` should + * be called before the modification and `applyDefaultTextStyle` should be called after that. + * (For the case that all of the text related properties is reset, like `setTextStyleCommon` + * does, `rollbackDefaultTextStyle` is not needed to be called). + */ + + +function applyDefaultTextStyle(textStyle) { + var textPosition = textStyle.textPosition; + var opt = textStyle.insideRollbackOpt; + var insideRollback; + + if (opt && textStyle.textFill == null) { + var autoColor = opt.autoColor; + var isRectText = opt.isRectText; + var useInsideStyle = opt.useInsideStyle; + var useInsideStyleCache = useInsideStyle !== false && (useInsideStyle === true || isRectText && textPosition // textPosition can be [10, 30] + && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0); + var useAutoColorCache = !useInsideStyleCache && autoColor != null; // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached. + + if (useInsideStyleCache || useAutoColorCache) { + insideRollback = { + textFill: textStyle.textFill, + textStroke: textStyle.textStroke, + textStrokeWidth: textStyle.textStrokeWidth + }; + } + + if (useInsideStyleCache) { + textStyle.textFill = '#fff'; // Consider text with #fff overflow its container. + + if (textStyle.textStroke == null) { + textStyle.textStroke = autoColor; + textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2); + } + } + + if (useAutoColorCache) { + textStyle.textFill = autoColor; + } + } // Always set `insideRollback`, so that the previous one can be cleared. + + + textStyle.insideRollback = insideRollback; +} +/** + * Consider the case: in a scatter, + * label: { + * normal: {position: 'inside'}, + * emphasis: {position: 'top'} + * } + * In the normal state, the `textFill` will be set as '#fff' for pretty view (see + * `applyDefaultTextStyle`), but when switching to emphasis state, the `textFill` + * should be retured to 'autoColor', but not keep '#fff'. + */ + + +function rollbackDefaultTextStyle(style) { + var insideRollback = style.insideRollback; + + if (insideRollback) { + // Reset all of the props in `CACHED_LABEL_STYLE_PROPERTIES`. + style.textFill = insideRollback.textFill; + style.textStroke = insideRollback.textStroke; + style.textStrokeWidth = insideRollback.textStrokeWidth; + style.insideRollback = null; + } +} + +function getFont(opt, ecModel) { + var gTextStyleModel = ecModel && ecModel.getModel('textStyle'); + return zrUtil.trim([// FIXME in node-canvas fontWeight is before fontStyle + 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(' ')); +} + +function animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb) { + if (typeof dataIndex === 'function') { + cb = dataIndex; + dataIndex = null; + } // Do not check 'animation' property directly here. Consider this case: + // animation model is an `itemModel`, whose does not have `isAnimationEnabled` + // but its parent model (`seriesModel`) does. + + + var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); + + if (animationEnabled) { + var postfix = isUpdate ? 'Update' : ''; + var duration = animatableModel.getShallow('animationDuration' + postfix); + var animationEasing = animatableModel.getShallow('animationEasing' + postfix); + var animationDelay = animatableModel.getShallow('animationDelay' + postfix); + + if (typeof animationDelay === 'function') { + animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null); + } + + if (typeof duration === 'function') { + duration = duration(dataIndex); + } + + duration > 0 ? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb) : (el.stopAnimation(), el.attr(props), cb && cb()); + } else { + el.stopAnimation(); + el.attr(props); + cb && cb(); + } +} +/** + * Update graphic element properties with or without animation according to the + * configuration in series. + * + * Caution: this method will stop previous animation. + * So do not use this method to one element twice before + * animation starts, unless you know what you are doing. + * + * @param {module:zrender/Element} el + * @param {Object} props + * @param {module:echarts/model/Model} [animatableModel] + * @param {number} [dataIndex] + * @param {Function} [cb] + * @example + * graphic.updateProps(el, { + * position: [100, 100] + * }, seriesModel, dataIndex, function () { console.log('Animation done!'); }); + * // Or + * graphic.updateProps(el, { + * position: [100, 100] + * }, seriesModel, function () { console.log('Animation done!'); }); + */ + + +function updateProps(el, props, animatableModel, dataIndex, cb) { + animateOrSetProps(true, el, props, animatableModel, dataIndex, cb); +} +/** + * Init graphic element properties with or without animation according to the + * configuration in series. + * + * Caution: this method will stop previous animation. + * So do not use this method to one element twice before + * animation starts, unless you know what you are doing. + * + * @param {module:zrender/Element} el + * @param {Object} props + * @param {module:echarts/model/Model} [animatableModel] + * @param {number} [dataIndex] + * @param {Function} cb + */ + + +function initProps(el, props, animatableModel, dataIndex, cb) { + animateOrSetProps(false, el, props, animatableModel, dataIndex, cb); +} +/** + * Get transform matrix of target (param target), + * in coordinate of its ancestor (param ancestor) + * + * @param {module:zrender/mixin/Transformable} target + * @param {module:zrender/mixin/Transformable} [ancestor] + */ + + +function getTransform(target, ancestor) { + var mat = matrix.identity([]); + + while (target && target !== ancestor) { + matrix.mul(mat, target.getLocalTransform(), mat); + target = target.parent; + } + + return mat; +} +/** + * Apply transform to an vertex. + * @param {Array.} target [x, y] + * @param {Array.|TypedArray.|Object} transform Can be: + * + Transform matrix: like [1, 0, 0, 1, 0, 0] + * + {position, rotation, scale}, the same as `zrender/Transformable`. + * @param {boolean=} invert Whether use invert matrix. + * @return {Array.} [x, y] + */ + + +function applyTransform(target, transform, invert) { + if (transform && !zrUtil.isArrayLike(transform)) { + transform = Transformable.getLocalTransform(transform); + } + + if (invert) { + transform = matrix.invert([], transform); + } + + return vector.applyTransform([], target, transform); +} +/** + * @param {string} direction 'left' 'right' 'top' 'bottom' + * @param {Array.} transform Transform matrix: like [1, 0, 0, 1, 0, 0] + * @param {boolean=} invert Whether use invert matrix. + * @return {string} Transformed direction. 'left' 'right' 'top' 'bottom' + */ + + +function transformDirection(direction, transform, invert) { + // Pick a base, ensure that transform result will not be (0, 0). + var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]); + var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]); + var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0]; + vertex = applyTransform(vertex, transform, invert); + return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top'; +} +/** + * Apply group transition animation from g1 to g2. + * If no animatableModel, no animation. + */ + + +function groupTransition(g1, g2, animatableModel, cb) { + if (!g1 || !g2) { + return; + } + + function getElMap(g) { + var elMap = {}; + g.traverse(function (el) { + if (!el.isGroup && el.anid) { + elMap[el.anid] = el; + } + }); + return elMap; + } + + function getAnimatableProps(el) { + var obj = { + position: vector.clone(el.position), + rotation: el.rotation + }; + + if (el.shape) { + obj.shape = zrUtil.extend({}, el.shape); + } + + return obj; + } + + var elMap1 = getElMap(g1); + g2.traverse(function (el) { + if (!el.isGroup && el.anid) { + var oldEl = elMap1[el.anid]; + + if (oldEl) { + var newProp = getAnimatableProps(el); + el.attr(getAnimatableProps(oldEl)); + updateProps(el, newProp, animatableModel, el.dataIndex); + } // else { + // if (el.previousProps) { + // graphic.updateProps + // } + // } + + } + }); +} +/** + * @param {Array.>} points Like: [[23, 44], [53, 66], ...] + * @param {Object} rect {x, y, width, height} + * @return {Array.>} A new clipped points. + */ + + +function clipPointsByRect(points, rect) { + // FIXME: this way migth be incorrect when grpahic clipped by a corner. + // and when element have border. + return zrUtil.map(points, function (point) { + var x = point[0]; + x = mathMax(x, rect.x); + x = mathMin(x, rect.x + rect.width); + var y = point[1]; + y = mathMax(y, rect.y); + y = mathMin(y, rect.y + rect.height); + return [x, y]; + }); +} +/** + * @param {Object} targetRect {x, y, width, height} + * @param {Object} rect {x, y, width, height} + * @return {Object} A new clipped rect. If rect size are negative, return undefined. + */ + + +function clipRectByRect(targetRect, rect) { + var x = mathMax(targetRect.x, rect.x); + var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width); + var y = mathMax(targetRect.y, rect.y); + var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border, + // should be painted. So return undefined. + + if (x2 >= x && y2 >= y) { + return { + x: x, + y: y, + width: x2 - x, + height: y2 - y + }; + } +} +/** + * @param {string} iconStr Support 'image://' or 'path://' or direct svg path. + * @param {Object} [opt] Properties of `module:zrender/Element`, except `style`. + * @param {Object} [rect] {x, y, width, height} + * @return {module:zrender/Element} Icon path or image element. + */ + + +function createIcon(iconStr, opt, rect) { + opt = zrUtil.extend({ + rectHover: true + }, opt); + var style = opt.style = { + strokeNoScale: true + }; + rect = rect || { + x: -1, + y: -1, + width: 2, + height: 2 + }; + + if (iconStr) { + return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), zrUtil.defaults(style, rect), new ZImage(opt)) : makePath(iconStr.replace('path://', ''), opt, rect, 'center'); + } +} +/** + * Return `true` if the given line (line `a`) and the given polygon + * are intersect. + * Note that we do not count colinear as intersect here because no + * requirement for that. We could do that if required in future. + * + * @param {number} a1x + * @param {number} a1y + * @param {number} a2x + * @param {number} a2y + * @param {Array.>} points Points of the polygon. + * @return {boolean} + */ + + +function linePolygonIntersect(a1x, a1y, a2x, a2y, points) { + for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { + var p = points[i]; + + if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) { + return true; + } + + p2 = p; + } +} +/** + * Return `true` if the given two lines (line `a` and line `b`) + * are intersect. + * Note that we do not count colinear as intersect here because no + * requirement for that. We could do that if required in future. + * + * @param {number} a1x + * @param {number} a1y + * @param {number} a2x + * @param {number} a2y + * @param {number} b1x + * @param {number} b1y + * @param {number} b2x + * @param {number} b2y + * @return {boolean} + */ + + +function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { + // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`. + var mx = a2x - a1x; + var my = a2y - a1y; + var nx = b2x - b1x; + var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff + // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`. + + var nmCrossProduct = crossProduct2d(nx, ny, mx, my); + + if (nearZero(nmCrossProduct)) { + return false; + } // `vec_m` and `vec_n` are intersect iff + // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`, + // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)` + // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`. + + + var b1a1x = a1x - b1x; + var b1a1y = a1y - b1y; + var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct; + + if (q < 0 || q > 1) { + return false; + } + + var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct; + + if (p < 0 || p > 1) { + return false; + } + + return true; +} +/** + * Cross product of 2-dimension vector. + */ + + +function crossProduct2d(x1, y1, x2, y2) { + return x1 * y2 - x2 * y1; +} + +function nearZero(val) { + return val <= 1e-6 && val >= -1e-6; +} // Register built-in shapes. These shapes might be overwirtten +// by users, although we do not recommend that. + + +registerShape('circle', Circle); +registerShape('sector', Sector); +registerShape('ring', Ring); +registerShape('polygon', Polygon); +registerShape('polyline', Polyline); +registerShape('rect', Rect); +registerShape('line', Line); +registerShape('bezierCurve', BezierCurve); +registerShape('arc', Arc); +exports.Z2_EMPHASIS_LIFT = Z2_EMPHASIS_LIFT; +exports.CACHED_LABEL_STYLE_PROPERTIES = CACHED_LABEL_STYLE_PROPERTIES; +exports.extendShape = extendShape; +exports.extendPath = extendPath; +exports.registerShape = registerShape; +exports.getShapeClass = getShapeClass; +exports.makePath = makePath; +exports.makeImage = makeImage; +exports.mergePath = mergePath; +exports.resizePath = resizePath; +exports.subPixelOptimizeLine = subPixelOptimizeLine; +exports.subPixelOptimizeRect = subPixelOptimizeRect; +exports.subPixelOptimize = subPixelOptimize; +exports.setElementHoverStyle = setElementHoverStyle; +exports.setHoverStyle = setHoverStyle; +exports.setAsHighDownDispatcher = setAsHighDownDispatcher; +exports.isHighDownDispatcher = isHighDownDispatcher; +exports.getHighlightDigit = getHighlightDigit; +exports.setLabelStyle = setLabelStyle; +exports.modifyLabelStyle = modifyLabelStyle; +exports.setTextStyle = setTextStyle; +exports.setText = setText; +exports.getFont = getFont; +exports.updateProps = updateProps; +exports.initProps = initProps; +exports.getTransform = getTransform; +exports.applyTransform = applyTransform; +exports.transformDirection = transformDirection; +exports.groupTransition = groupTransition; +exports.clipPointsByRect = clipPointsByRect; +exports.clipRectByRect = clipRectByRect; +exports.createIcon = createIcon; +exports.linePolygonIntersect = linePolygonIntersect; +exports.lineLineIntersect = lineLineIntersect; + +/***/ }), + +/***/ "./node_modules/echarts/lib/util/model.js": +/*!************************************************!*\ + !*** ./node_modules/echarts/lib/util/model.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var zrUtil = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); + +var env = __webpack_require__(/*! zrender/lib/core/env */ "./node_modules/zrender/lib/core/env.js"); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +var each = zrUtil.each; +var isObject = zrUtil.isObject; +var isArray = zrUtil.isArray; +/** + * Make the name displayable. But we should + * make sure it is not duplicated with user + * specified name, so use '\0'; + */ + +var DUMMY_COMPONENT_NAME_PREFIX = 'series\0'; +/** + * If value is not array, then translate it to array. + * @param {*} value + * @return {Array} [value] or value + */ + +function normalizeToArray(value) { + return value instanceof Array ? value : value == null ? [] : [value]; +} +/** + * Sync default option between normal and emphasis like `position` and `show` + * In case some one will write code like + * label: { + * show: false, + * position: 'outside', + * fontSize: 18 + * }, + * emphasis: { + * label: { show: true } + * } + * @param {Object} opt + * @param {string} key + * @param {Array.} subOpts + */ + + +function defaultEmphasis(opt, key, subOpts) { + // Caution: performance sensitive. + if (opt) { + opt[key] = opt[key] || {}; + opt.emphasis = opt.emphasis || {}; + opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal + + for (var i = 0, len = subOpts.length; i < len; i++) { + var subOptName = subOpts[i]; + + if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) { + opt.emphasis[key][subOptName] = opt[key][subOptName]; + } + } + } +} + +var 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([ +// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter', +// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', +// // FIXME: deprecated, check and remove it. +// 'textStyle' +// ]); + +/** + * The method do not ensure performance. + * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] + * This helper method retieves value from data. + * @param {string|number|Date|Array|Object} dataItem + * @return {number|string|Date|Array.} + */ + +function getDataItemValue(dataItem) { + return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem; +} +/** + * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] + * This helper method determine if dataItem has extra option besides value + * @param {string|number|Date|Array|Object} dataItem + */ + + +function isDataItemOption(dataItem) { + return isObject(dataItem) && !(dataItem instanceof Array); // // markLine data can be array + // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array)); +} +/** + * Mapping to exists for merge. + * + * @public + * @param {Array.|Array.} exists + * @param {Object|Array.} newCptOptions + * @return {Array.} Result, like [{exist: ..., option: ...}, {}], + * index of which is the same as exists. + */ + + +function mappingToExists(exists, newCptOptions) { + // Mapping by the order by original option (but not order of + // new option) in merge mode. Because we should ensure + // some specified index (like xAxisIndex) is consistent with + // original option, which is easy to understand, espatially in + // media query. And in most case, merge option is used to + // update partial option but not be expected to change order. + newCptOptions = (newCptOptions || []).slice(); + var result = zrUtil.map(exists || [], function (obj, index) { + return { + exist: obj + }; + }); // Mapping by id or name if specified. + + each(newCptOptions, function (cptOption, index) { + if (!isObject(cptOption)) { + return; + } // id has highest priority. + + + for (var i = 0; i < result.length; i++) { + if (!result[i].option // Consider name: two map to one. + && cptOption.id != null && result[i].exist.id === cptOption.id + '') { + result[i].option = cptOption; + newCptOptions[index] = null; + return; + } + } + + for (var i = 0; i < result.length; i++) { + var exist = result[i].exist; + + if (!result[i].option // Consider name: two map to one. + // Can not match when both ids exist but different. + && (exist.id == null || cptOption.id == null) && cptOption.name != null && !isIdInner(cptOption) && !isIdInner(exist) && exist.name === cptOption.name + '') { + result[i].option = cptOption; + newCptOptions[index] = null; + return; + } + } + }); // Otherwise mapping by index. + + each(newCptOptions, function (cptOption, index) { + if (!isObject(cptOption)) { + return; + } + + var i = 0; + + for (; i < result.length; i++) { + var exist = result[i].exist; + + if (!result[i].option // Existing model that already has id should be able to + // mapped to (because after mapping performed model may + // be assigned with a id, whish should not affect next + // mapping), except those has inner id. + && !isIdInner(exist) // Caution: + // Do not overwrite id. But name can be overwritten, + // because axis use name as 'show label text'. + // 'exist' always has id and name and we dont + // need to check it. + && cptOption.id == null) { + result[i].option = cptOption; + break; + } + } + + if (i >= result.length) { + result.push({ + option: cptOption + }); + } + }); + return result; +} +/** + * Make id and name for mapping result (result of mappingToExists) + * into `keyInfo` field. + * + * @public + * @param {Array.} Result, like [{exist: ..., option: ...}, {}], + * which order is the same as exists. + * @return {Array.} The input. + */ + + +function makeIdAndName(mapResult) { + // We use this id to hash component models and view instances + // in echarts. id can be specified by user, or auto generated. + // The id generation rule ensures new view instance are able + // to mapped to old instance when setOption are called in + // no-merge mode. So we generate model id by name and plus + // type in view id. + // name can be duplicated among components, which is convenient + // to specify multi components (like series) by one name. + // Ensure that each id is distinct. + var idMap = zrUtil.createHashMap(); + each(mapResult, function (item, index) { + var existCpt = item.exist; + existCpt && idMap.set(existCpt.id, item); + }); + each(mapResult, function (item, index) { + var opt = item.option; + zrUtil.assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id)); + opt && opt.id != null && idMap.set(opt.id, item); + !item.keyInfo && (item.keyInfo = {}); + }); // Make name and id. + + each(mapResult, function (item, index) { + var existCpt = item.exist; + var opt = item.option; + var keyInfo = item.keyInfo; + + if (!isObject(opt)) { + return; + } // name can be overwitten. Consider case: axis.name = '20km'. + // But id generated by name will not be changed, which affect + // only in that case: setOption with 'not merge mode' and view + // instance will be recreated, which can be accepted. + + + keyInfo.name = opt.name != null ? opt.name + '' : existCpt ? existCpt.name // Avoid diffferent series has the same name, + // because name may be used like in color pallet. + : DUMMY_COMPONENT_NAME_PREFIX + index; + + if (existCpt) { + keyInfo.id = existCpt.id; + } else if (opt.id != null) { + keyInfo.id = opt.id + ''; + } else { + // Consider this situatoin: + // optionA: [{name: 'a'}, {name: 'a'}, {..}] + // optionB [{..}, {name: 'a'}, {name: 'a'}] + // Series with the same name between optionA and optionB + // should be mapped. + var idNum = 0; + + do { + keyInfo.id = '\0' + keyInfo.name + '\0' + idNum++; + } while (idMap.get(keyInfo.id)); + } + + idMap.set(keyInfo.id, item); + }); +} + +function isNameSpecified(componentModel) { + var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0. + + return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); +} +/** + * @public + * @param {Object} cptOption + * @return {boolean} + */ + + +function isIdInner(cptOption) { + return isObject(cptOption) && cptOption.id && (cptOption.id + '').indexOf('\0_ec_\0') === 0; +} +/** + * A helper for removing duplicate items between batchA and batchB, + * and in themselves, and categorize by series. + * + * @param {Array.} batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] + * @param {Array.} batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] + * @return {Array., Array.>} result: [resultBatchA, resultBatchB] + */ + + +function compressBatches(batchA, batchB) { + var mapA = {}; + var mapB = {}; + makeMap(batchA || [], mapA); + makeMap(batchB || [], mapB, mapA); + return [mapToArray(mapA), mapToArray(mapB)]; + + function makeMap(sourceBatch, map, otherMap) { + for (var i = 0, len = sourceBatch.length; i < len; i++) { + var seriesId = sourceBatch[i].seriesId; + var dataIndices = normalizeToArray(sourceBatch[i].dataIndex); + var otherDataIndices = otherMap && otherMap[seriesId]; + + for (var j = 0, lenj = dataIndices.length; j < lenj; j++) { + var dataIndex = dataIndices[j]; + + if (otherDataIndices && otherDataIndices[dataIndex]) { + otherDataIndices[dataIndex] = null; + } else { + (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1; + } + } + } + } + + function mapToArray(map, isData) { + var result = []; + + for (var i in map) { + if (map.hasOwnProperty(i) && map[i] != null) { + if (isData) { + result.push(+i); + } else { + var dataIndices = mapToArray(map[i], true); + dataIndices.length && result.push({ + seriesId: i, + dataIndex: dataIndices + }); + } + } + } + + return result; + } +} +/** + * @param {module:echarts/data/List} data + * @param {Object} payload Contains dataIndex (means rawIndex) / dataIndexInside / name + * each of which can be Array or primary type. + * @return {number|Array.} dataIndex If not found, return undefined/null. + */ + + +function queryDataIndex(data, payload) { + if (payload.dataIndexInside != null) { + return payload.dataIndexInside; + } else if (payload.dataIndex != null) { + return zrUtil.isArray(payload.dataIndex) ? zrUtil.map(payload.dataIndex, function (value) { + return data.indexOfRawIndex(value); + }) : data.indexOfRawIndex(payload.dataIndex); + } else if (payload.name != null) { + return zrUtil.isArray(payload.name) ? zrUtil.map(payload.name, function (value) { + return data.indexOfName(value); + }) : data.indexOfName(payload.name); + } +} +/** + * Enable property storage to any host object. + * Notice: Serialization is not supported. + * + * For example: + * var inner = zrUitl.makeInner(); + * + * function some1(hostObj) { + * inner(hostObj).someProperty = 1212; + * ... + * } + * function some2() { + * var fields = inner(this); + * fields.someProperty1 = 1212; + * fields.someProperty2 = 'xx'; + * ... + * } + * + * @return {Function} + */ + + +function makeInner() { + // Consider different scope by es module import. + var key = '__\0ec_inner_' + innerUniqueIndex++ + '_' + Math.random().toFixed(5); + return function (hostObj) { + return hostObj[key] || (hostObj[key] = {}); + }; +} + +var innerUniqueIndex = 0; +/** + * @param {module:echarts/model/Global} ecModel + * @param {string|Object} finder + * If string, e.g., 'geo', means {geoIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex, seriesId, seriesName, + * geoIndex, geoId, geoName, + * bmapIndex, bmapId, bmapName, + * xAxisIndex, xAxisId, xAxisName, + * yAxisIndex, yAxisId, yAxisName, + * gridIndex, gridId, gridName, + * ... (can be extended) + * } + * Each properties can be number|string|Array.|Array. + * For example, a finder could be + * { + * seriesIndex: 3, + * geoId: ['aa', 'cc'], + * gridName: ['xx', 'rr'] + * } + * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify) + * If nothing or null/undefined specified, return nothing. + * @param {Object} [opt] + * @param {string} [opt.defaultMainType] + * @param {Array.} [opt.includeMainTypes] + * @return {Object} result like: + * { + * seriesModels: [seriesModel1, seriesModel2], + * seriesModel: seriesModel1, // The first model + * geoModels: [geoModel1, geoModel2], + * geoModel: geoModel1, // The first model + * ... + * } + */ + +function parseFinder(ecModel, finder, opt) { + if (zrUtil.isString(finder)) { + var obj = {}; + obj[finder + 'Index'] = 0; + finder = obj; + } + + var defaultMainType = opt && opt.defaultMainType; + + if (defaultMainType && !has(finder, defaultMainType + 'Index') && !has(finder, defaultMainType + 'Id') && !has(finder, defaultMainType + 'Name')) { + finder[defaultMainType + 'Index'] = 0; + } + + var result = {}; + each(finder, function (value, key) { + var value = finder[key]; // Exclude 'dataIndex' and other illgal keys. + + if (key === 'dataIndex' || key === 'dataIndexInside') { + result[key] = value; + return; + } + + var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; + var mainType = parsedKey[1]; + var queryType = (parsedKey[2] || '').toLowerCase(); + + if (!mainType || !queryType || value == null || queryType === 'index' && value === 'none' || opt && opt.includeMainTypes && zrUtil.indexOf(opt.includeMainTypes, mainType) < 0) { + return; + } + + var queryParam = { + mainType: mainType + }; + + if (queryType !== 'index' || value !== 'all') { + queryParam[queryType] = value; + } + + var models = ecModel.queryComponents(queryParam); + result[mainType + 'Models'] = models; + result[mainType + 'Model'] = models[0]; + }); + return result; +} + +function has(obj, prop) { + return obj && obj.hasOwnProperty(prop); +} + +function setAttribute(dom, key, value) { + dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value; +} + +function getAttribute(dom, key) { + return dom.getAttribute ? dom.getAttribute(key) : dom[key]; +} + +function getTooltipRenderMode(renderModeOption) { + if (renderModeOption === 'auto') { + // Using html when `document` exists, use richText otherwise + return env.domSupported ? 'html' : 'richText'; + } else { + return renderModeOption || 'html'; + } +} +/** + * Group a list by key. + * + * @param {Array} array + * @param {Function} getKey + * param {*} Array item + * return {string} key + * @return {Object} Result + * {Array}: keys, + * {module:zrender/core/util/HashMap} buckets: {key -> Array} + */ + + +function groupData(array, getKey) { + var buckets = zrUtil.createHashMap(); + var keys = []; + zrUtil.each(array, function (item) { + var key = getKey(item); + (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item); + }); + return { + keys: keys, + buckets: buckets + }; +} + +exports.normalizeToArray = normalizeToArray; +exports.defaultEmphasis = defaultEmphasis; +exports.TEXT_STYLE_OPTIONS = TEXT_STYLE_OPTIONS; +exports.getDataItemValue = getDataItemValue; +exports.isDataItemOption = isDataItemOption; +exports.mappingToExists = mappingToExists; +exports.makeIdAndName = makeIdAndName; +exports.isNameSpecified = isNameSpecified; +exports.isIdInner = isIdInner; +exports.compressBatches = compressBatches; +exports.queryDataIndex = queryDataIndex; +exports.makeInner = makeInner; +exports.parseFinder = parseFinder; +exports.setAttribute = setAttribute; +exports.getAttribute = getAttribute; +exports.getTooltipRenderMode = getTooltipRenderMode; +exports.groupData = groupData; + +/***/ }), + +/***/ "./node_modules/echarts/lib/util/symbol.js": +/*!*************************************************!*\ + !*** ./node_modules/echarts/lib/util/symbol.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var zrUtil = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); + +var graphic = __webpack_require__(/*! ./graphic */ "./node_modules/echarts/lib/util/graphic.js"); + +var BoundingRect = __webpack_require__(/*! zrender/lib/core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +var _text = __webpack_require__(/*! zrender/lib/contain/text */ "./node_modules/zrender/lib/contain/text.js"); + +var calculateTextPosition = _text.calculateTextPosition; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +// Symbol factory + +/** + * Triangle shape + * @inner + */ +var Triangle = graphic.extendShape({ + type: 'triangle', + shape: { + cx: 0, + cy: 0, + width: 0, + height: 0 + }, + buildPath: function (path, shape) { + var cx = shape.cx; + var cy = shape.cy; + var width = shape.width / 2; + var height = shape.height / 2; + path.moveTo(cx, cy - height); + path.lineTo(cx + width, cy + height); + path.lineTo(cx - width, cy + height); + path.closePath(); + } +}); +/** + * Diamond shape + * @inner + */ + +var Diamond = graphic.extendShape({ + type: 'diamond', + shape: { + cx: 0, + cy: 0, + width: 0, + height: 0 + }, + buildPath: function (path, shape) { + var cx = shape.cx; + var cy = shape.cy; + var width = shape.width / 2; + var height = shape.height / 2; + path.moveTo(cx, cy - height); + path.lineTo(cx + width, cy); + path.lineTo(cx, cy + height); + path.lineTo(cx - width, cy); + path.closePath(); + } +}); +/** + * Pin shape + * @inner + */ + +var Pin = graphic.extendShape({ + type: 'pin', + shape: { + // x, y on the cusp + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function (path, shape) { + var x = shape.x; + var y = shape.y; + var w = shape.width / 5 * 3; // Height must be larger than width + + var h = Math.max(w, shape.height); + var r = w / 2; // Dist on y with tangent point and circle center + + var dy = r * r / (h - r); + var cy = y - h + r + dy; + var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center + + var dx = Math.cos(angle) * r; + var tanX = Math.sin(angle); + var tanY = Math.cos(angle); + var cpLen = r * 0.6; + var cpLen2 = r * 0.7; + path.moveTo(x - dx, cy + dy); + path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle); + path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y); + path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy); + path.closePath(); + } +}); +/** + * Arrow shape + * @inner + */ + +var Arrow = graphic.extendShape({ + type: 'arrow', + shape: { + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function (ctx, shape) { + var height = shape.height; + var width = shape.width; + var x = shape.x; + var y = shape.y; + var dx = width / 3 * 2; + ctx.moveTo(x, y); + ctx.lineTo(x + dx, y + height); + ctx.lineTo(x, y + height / 4 * 3); + ctx.lineTo(x - dx, y + height); + ctx.lineTo(x, y); + ctx.closePath(); + } +}); +/** + * Map of path contructors + * @type {Object.} + */ + +var symbolCtors = { + line: graphic.Line, + rect: graphic.Rect, + roundRect: graphic.Rect, + square: graphic.Rect, + circle: graphic.Circle, + diamond: Diamond, + pin: Pin, + arrow: Arrow, + triangle: Triangle +}; +var symbolShapeMakers = { + line: function (x, y, w, h, shape) { + // FIXME + shape.x1 = x; + shape.y1 = y + h / 2; + shape.x2 = x + w; + shape.y2 = y + h / 2; + }, + rect: function (x, y, w, h, shape) { + shape.x = x; + shape.y = y; + shape.width = w; + shape.height = h; + }, + roundRect: function (x, y, w, h, shape) { + shape.x = x; + shape.y = y; + shape.width = w; + shape.height = h; + shape.r = Math.min(w, h) / 4; + }, + square: function (x, y, w, h, shape) { + var size = Math.min(w, h); + shape.x = x; + shape.y = y; + shape.width = size; + shape.height = size; + }, + circle: function (x, y, w, h, shape) { + // Put circle in the center of square + shape.cx = x + w / 2; + shape.cy = y + h / 2; + shape.r = Math.min(w, h) / 2; + }, + diamond: function (x, y, w, h, shape) { + shape.cx = x + w / 2; + shape.cy = y + h / 2; + shape.width = w; + shape.height = h; + }, + pin: function (x, y, w, h, shape) { + shape.x = x + w / 2; + shape.y = y + h / 2; + shape.width = w; + shape.height = h; + }, + arrow: function (x, y, w, h, shape) { + shape.x = x + w / 2; + shape.y = y + h / 2; + shape.width = w; + shape.height = h; + }, + triangle: function (x, y, w, h, shape) { + shape.cx = x + w / 2; + shape.cy = y + h / 2; + shape.width = w; + shape.height = h; + } +}; +var symbolBuildProxies = {}; +zrUtil.each(symbolCtors, function (Ctor, name) { + symbolBuildProxies[name] = new Ctor(); +}); +var SymbolClz = graphic.extendShape({ + type: 'symbol', + shape: { + symbolType: '', + x: 0, + y: 0, + width: 0, + height: 0 + }, + calculateTextPosition: function (out, style, rect) { + var res = calculateTextPosition(out, style, rect); + var shape = this.shape; + + if (shape && shape.symbolType === 'pin' && style.textPosition === 'inside') { + res.y = rect.y + rect.height * 0.4; + } + + return res; + }, + buildPath: function (ctx, shape, inBundle) { + var symbolType = shape.symbolType; + + if (symbolType !== 'none') { + var proxySymbol = symbolBuildProxies[symbolType]; + + if (!proxySymbol) { + // Default rect + symbolType = 'rect'; + proxySymbol = symbolBuildProxies[symbolType]; + } + + symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape); + proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle); + } + } +}); // Provide setColor helper method to avoid determine if set the fill or stroke outside + +function symbolPathSetColor(color, innerColor) { + if (this.type !== 'image') { + var symbolStyle = this.style; + var symbolShape = this.shape; + + if (symbolShape && symbolShape.symbolType === 'line') { + symbolStyle.stroke = color; + } else if (this.__isEmptyBrush) { + symbolStyle.stroke = color; + symbolStyle.fill = innerColor || '#fff'; + } else { + // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ? + symbolStyle.fill && (symbolStyle.fill = color); + symbolStyle.stroke && (symbolStyle.stroke = color); + } + + this.dirty(false); + } +} +/** + * Create a symbol element with given symbol configuration: shape, x, y, width, height, color + * @param {string} symbolType + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @param {string} color + * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h, + * for path and image only. + */ + + +function createSymbol(symbolType, x, y, w, h, color, keepAspect) { + // TODO Support image object, DynamicImage. + var isEmpty = symbolType.indexOf('empty') === 0; + + if (isEmpty) { + symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6); + } + + var symbolPath; + + if (symbolType.indexOf('image://') === 0) { + symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); + } else if (symbolType.indexOf('path://') === 0) { + symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); + } else { + symbolPath = new SymbolClz({ + shape: { + symbolType: symbolType, + x: x, + y: y, + width: w, + height: h + } + }); + } + + symbolPath.__isEmptyBrush = isEmpty; + symbolPath.setColor = symbolPathSetColor; + symbolPath.setColor(color); + return symbolPath; +} + +exports.createSymbol = createSymbol; + +/***/ }), + +/***/ "./node_modules/echarts/lib/visual/dataColor.js": +/*!******************************************************!*\ + !*** ./node_modules/echarts/lib/visual/dataColor.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var _util = __webpack_require__(/*! zrender/lib/core/util */ "./node_modules/zrender/lib/core/util.js"); + +var createHashMap = _util.createHashMap; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +// Pick color from palette for each data item. +// Applicable for charts that require applying color palette +// in data level (like pie, funnel, chord). +function _default(seriesType) { + return { + getTargetSeries: function (ecModel) { + // Pie and funnel may use diferrent scope + var paletteScope = {}; + var seiresModelMap = createHashMap(); + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + seriesModel.__paletteScope = paletteScope; + seiresModelMap.set(seriesModel.uid, seriesModel); + }); + return seiresModelMap; + }, + reset: function (seriesModel, ecModel) { + var dataAll = seriesModel.getRawData(); + var idxMap = {}; + var data = seriesModel.getData(); + data.each(function (idx) { + var rawIdx = data.getRawIndex(idx); + idxMap[rawIdx] = idx; + }); + dataAll.each(function (rawIdx) { + var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded + + var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true); + var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true); + var itemModel; + + if (!singleDataColor || !singleDataBorderColor) { + // FIXME Performance + itemModel = dataAll.getItemModel(rawIdx); + } + + if (!singleDataColor) { + var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered + + if (filteredIdx != null) { + data.setItemVisual(filteredIdx, 'color', color); + } + } + + if (!singleDataBorderColor) { + var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered + + if (filteredIdx != null) { + data.setItemVisual(filteredIdx, 'borderColor', borderColor); + } + } + }); + } + }; +} + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ "./node_modules/zrender/lib/Element.js": +/*!*********************************************!*\ + !*** ./node_modules/zrender/lib/Element.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var guid = __webpack_require__(/*! ./core/guid */ "./node_modules/zrender/lib/core/guid.js"); + +var Eventful = __webpack_require__(/*! ./mixin/Eventful */ "./node_modules/zrender/lib/mixin/Eventful.js"); + +var Transformable = __webpack_require__(/*! ./mixin/Transformable */ "./node_modules/zrender/lib/mixin/Transformable.js"); + +var Animatable = __webpack_require__(/*! ./mixin/Animatable */ "./node_modules/zrender/lib/mixin/Animatable.js"); + +var zrUtil = __webpack_require__(/*! ./core/util */ "./node_modules/zrender/lib/core/util.js"); + +/** + * @alias module:zrender/Element + * @constructor + * @extends {module:zrender/mixin/Animatable} + * @extends {module:zrender/mixin/Transformable} + * @extends {module:zrender/mixin/Eventful} + */ +var Element = function (opts) { + // jshint ignore:line + Transformable.call(this, opts); + Eventful.call(this, opts); + Animatable.call(this, opts); + /** + * 画布元素ID + * @type {string} + */ + + this.id = opts.id || guid(); +}; + +Element.prototype = { + /** + * 元素类型 + * Element type + * @type {string} + */ + type: 'element', + + /** + * 元素名字 + * Element name + * @type {string} + */ + name: '', + + /** + * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值 + * ZRender instance will be assigned when element is associated with zrender + * @name module:/zrender/Element#__zr + * @type {module:zrender/ZRender} + */ + __zr: null, + + /** + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * If ignore drawing and events of the element object + * @name module:/zrender/Element#ignore + * @type {boolean} + * @default false + */ + ignore: false, + + /** + * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪 + * 该路径会继承被裁减对象的变换 + * @type {module:zrender/graphic/Path} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + * @readOnly + */ + clipPath: null, + + /** + * 是否是 Group + * @type {boolean} + */ + isGroup: false, + + /** + * Drift element + * @param {number} dx dx on the global space + * @param {number} dy dy on the global space + */ + drift: function (dx, dy) { + switch (this.draggable) { + case 'horizontal': + dy = 0; + break; + + case 'vertical': + dx = 0; + break; + } + + var m = this.transform; + + if (!m) { + m = this.transform = [1, 0, 0, 1, 0, 0]; + } + + m[4] += dx; + m[5] += dy; + this.decomposeTransform(); + this.dirty(false); + }, + + /** + * Hook before update + */ + beforeUpdate: function () {}, + + /** + * Hook after update + */ + afterUpdate: function () {}, + + /** + * Update each frame + */ + update: function () { + this.updateTransform(); + }, + + /** + * @param {Function} cb + * @param {} context + */ + traverse: function (cb, context) {}, + + /** + * @protected + */ + attrKV: function (key, value) { + if (key === 'position' || key === 'scale' || key === 'origin') { + // Copy the array + if (value) { + var target = this[key]; + + if (!target) { + target = this[key] = []; + } + + target[0] = value[0]; + target[1] = value[1]; + } + } else { + this[key] = value; + } + }, + + /** + * Hide the element + */ + hide: function () { + this.ignore = true; + this.__zr && this.__zr.refresh(); + }, + + /** + * Show the element + */ + show: function () { + this.ignore = false; + this.__zr && this.__zr.refresh(); + }, + + /** + * @param {string|Object} key + * @param {*} value + */ + attr: function (key, value) { + if (typeof key === 'string') { + this.attrKV(key, value); + } else if (zrUtil.isObject(key)) { + for (var name in key) { + if (key.hasOwnProperty(name)) { + this.attrKV(name, key[name]); + } + } + } + + this.dirty(false); + return this; + }, + + /** + * @param {module:zrender/graphic/Path} clipPath + */ + setClipPath: function (clipPath) { + var zr = this.__zr; + + if (zr) { + clipPath.addSelfToZr(zr); + } // Remove previous clip path + + + if (this.clipPath && this.clipPath !== clipPath) { + this.removeClipPath(); + } + + this.clipPath = clipPath; + clipPath.__zr = zr; + clipPath.__clipTarget = this; + this.dirty(false); + }, + + /** + */ + removeClipPath: function () { + var clipPath = this.clipPath; + + if (clipPath) { + if (clipPath.__zr) { + clipPath.removeSelfFromZr(clipPath.__zr); + } + + clipPath.__zr = null; + clipPath.__clipTarget = null; + this.clipPath = null; + this.dirty(false); + } + }, + + /** + * Add self from zrender instance. + * Not recursively because it will be invoked when element added to storage. + * @param {module:zrender/ZRender} zr + */ + addSelfToZr: function (zr) { + this.__zr = zr; // 添加动画 + + var animators = this.animators; + + if (animators) { + for (var i = 0; i < animators.length; i++) { + zr.animation.addAnimator(animators[i]); + } + } + + if (this.clipPath) { + this.clipPath.addSelfToZr(zr); + } + }, + + /** + * Remove self from zrender instance. + * Not recursively because it will be invoked when element added to storage. + * @param {module:zrender/ZRender} zr + */ + removeSelfFromZr: function (zr) { + this.__zr = null; // 移除动画 + + var animators = this.animators; + + if (animators) { + for (var i = 0; i < animators.length; i++) { + zr.animation.removeAnimator(animators[i]); + } + } + + if (this.clipPath) { + this.clipPath.removeSelfFromZr(zr); + } + } +}; +zrUtil.mixin(Element, Animatable); +zrUtil.mixin(Element, Transformable); +zrUtil.mixin(Element, Eventful); +var _default = Element; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/animation/Animator.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/animation/Animator.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Clip = __webpack_require__(/*! ./Clip */ "./node_modules/zrender/lib/animation/Clip.js"); + +var color = __webpack_require__(/*! ../tool/color */ "./node_modules/zrender/lib/tool/color.js"); + +var _util = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var isArrayLike = _util.isArrayLike; + +/** + * @module echarts/animation/Animator + */ +var arraySlice = Array.prototype.slice; + +function defaultGetter(target, key) { + return target[key]; +} + +function defaultSetter(target, key, value) { + target[key] = value; +} +/** + * @param {number} p0 + * @param {number} p1 + * @param {number} percent + * @return {number} + */ + + +function interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; +} +/** + * @param {string} p0 + * @param {string} p1 + * @param {number} percent + * @return {string} + */ + + +function interpolateString(p0, p1, percent) { + return percent > 0.5 ? p1 : p0; +} +/** + * @param {Array} p0 + * @param {Array} p1 + * @param {number} percent + * @param {Array} out + * @param {number} arrDim + */ + + +function interpolateArray(p0, p1, percent, out, arrDim) { + var len = p0.length; + + if (arrDim === 1) { + for (var i = 0; i < len; i++) { + out[i] = interpolateNumber(p0[i], p1[i], percent); + } + } else { + var len2 = len && p0[0].length; + + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent); + } + } + } +} // arr0 is source array, arr1 is target array. +// Do some preprocess to avoid error happened when interpolating from arr0 to arr1 + + +function fillArr(arr0, arr1, arrDim) { + var arr0Len = arr0.length; + var arr1Len = arr1.length; + + if (arr0Len !== arr1Len) { + // FIXME Not work for TypedArray + var isPreviousLarger = arr0Len > arr1Len; + + if (isPreviousLarger) { + // Cut the previous + arr0.length = arr1Len; + } else { + // Fill the previous + for (var i = arr0Len; i < arr1Len; i++) { + arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i])); + } + } + } // Handling NaN value + + + var len2 = arr0[0] && arr0[0].length; + + for (var i = 0; i < arr0.length; i++) { + if (arrDim === 1) { + if (isNaN(arr0[i])) { + arr0[i] = arr1[i]; + } + } else { + for (var j = 0; j < len2; j++) { + if (isNaN(arr0[i][j])) { + arr0[i][j] = arr1[i][j]; + } + } + } + } +} +/** + * @param {Array} arr0 + * @param {Array} arr1 + * @param {number} arrDim + * @return {boolean} + */ + + +function isArraySame(arr0, arr1, arrDim) { + if (arr0 === arr1) { + return true; + } + + var len = arr0.length; + + if (len !== arr1.length) { + return false; + } + + if (arrDim === 1) { + for (var i = 0; i < len; i++) { + if (arr0[i] !== arr1[i]) { + return false; + } + } + } else { + var len2 = arr0[0].length; + + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + if (arr0[i][j] !== arr1[i][j]) { + return false; + } + } + } + } + + return true; +} +/** + * Catmull Rom interpolate array + * @param {Array} p0 + * @param {Array} p1 + * @param {Array} p2 + * @param {Array} p3 + * @param {number} t + * @param {number} t2 + * @param {number} t3 + * @param {Array} out + * @param {number} arrDim + */ + + +function catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) { + var len = p0.length; + + if (arrDim === 1) { + for (var i = 0; i < len; i++) { + out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3); + } + } else { + var len2 = p0[0].length; + + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3); + } + } + } +} +/** + * Catmull Rom interpolate number + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {number} t2 + * @param {number} t3 + * @return {number} + */ + + +function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; +} + +function cloneValue(value) { + if (isArrayLike(value)) { + var len = value.length; + + if (isArrayLike(value[0])) { + var ret = []; + + for (var i = 0; i < len; i++) { + ret.push(arraySlice.call(value[i])); + } + + return ret; + } + + return arraySlice.call(value); + } + + return value; +} + +function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]); + rgba[1] = Math.floor(rgba[1]); + rgba[2] = Math.floor(rgba[2]); + return 'rgba(' + rgba.join(',') + ')'; +} + +function getArrayDim(keyframes) { + var lastValue = keyframes[keyframes.length - 1].value; + return isArrayLike(lastValue && lastValue[0]) ? 2 : 1; +} + +function createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) { + var getter = animator._getter; + var setter = animator._setter; + var useSpline = easing === 'spline'; + var trackLen = keyframes.length; + + if (!trackLen) { + return; + } // Guess data type + + + var firstVal = keyframes[0].value; + var isValueArray = isArrayLike(firstVal); + var isValueColor = false; + var isValueString = false; // For vertices morphing + + var arrDim = isValueArray ? getArrayDim(keyframes) : 0; + var trackMaxTime; // Sort keyframe as ascending + + keyframes.sort(function (a, b) { + return a.time - b.time; + }); + trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe + + var kfPercents = []; // Value of each keyframe + + var kfValues = []; + var prevValue = keyframes[0].value; + var isAllValueEqual = true; + + for (var i = 0; i < trackLen; i++) { + kfPercents.push(keyframes[i].time / trackMaxTime); // Assume value is a color when it is a string + + var value = keyframes[i].value; // Check if value is equal, deep check if value is array + + if (!(isValueArray && isArraySame(value, prevValue, arrDim) || !isValueArray && value === prevValue)) { + isAllValueEqual = false; + } + + prevValue = value; // Try converting a string to a color array + + if (typeof value === 'string') { + var colorArray = color.parse(value); + + if (colorArray) { + value = colorArray; + isValueColor = true; + } else { + isValueString = true; + } + } + + kfValues.push(value); + } + + if (!forceAnimate && isAllValueEqual) { + return; + } + + var lastValue = kfValues[trackLen - 1]; // Polyfill array and NaN value + + for (var i = 0; i < trackLen - 1; i++) { + if (isValueArray) { + fillArr(kfValues[i], lastValue, arrDim); + } else { + if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) { + kfValues[i] = lastValue; + } + } + } + + isValueArray && fillArr(getter(animator._target, propName), lastValue, arrDim); // Cache the key of last frame to speed up when + // animation playback is sequency + + var lastFrame = 0; + var lastFramePercent = 0; + var start; + var w; + var p0; + var p1; + var p2; + var p3; + + if (isValueColor) { + var rgba = [0, 0, 0, 0]; + } + + var onframe = function (target, percent) { + // Find the range keyframes + // kf1-----kf2---------current--------kf3 + // find kf2 and kf3 and do interpolation + var frame; // In the easing function like elasticOut, percent may less than 0 + + if (percent < 0) { + frame = 0; + } else if (percent < lastFramePercent) { + // Start from next key + // PENDING start from lastFrame ? + start = Math.min(lastFrame + 1, trackLen - 1); + + for (frame = start; frame >= 0; frame--) { + if (kfPercents[frame] <= percent) { + break; + } + } // PENDING really need to do this ? + + + frame = Math.min(frame, trackLen - 2); + } else { + for (frame = lastFrame; frame < trackLen; frame++) { + if (kfPercents[frame] > percent) { + break; + } + } + + frame = Math.min(frame - 1, trackLen - 2); + } + + lastFrame = frame; + lastFramePercent = percent; + var range = kfPercents[frame + 1] - kfPercents[frame]; + + if (range === 0) { + return; + } else { + w = (percent - kfPercents[frame]) / range; + } + + if (useSpline) { + p1 = kfValues[frame]; + p0 = kfValues[frame === 0 ? frame : frame - 1]; + p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1]; + p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2]; + + if (isValueArray) { + catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim); + } else { + var value; + + if (isValueColor) { + value = catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1); + value = rgba2String(rgba); + } else if (isValueString) { + // String is step(0.5) + return interpolateString(p1, p2, w); + } else { + value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w); + } + + setter(target, propName, value); + } + } else { + if (isValueArray) { + interpolateArray(kfValues[frame], kfValues[frame + 1], w, getter(target, propName), arrDim); + } else { + var value; + + if (isValueColor) { + interpolateArray(kfValues[frame], kfValues[frame + 1], w, rgba, 1); + value = rgba2String(rgba); + } else if (isValueString) { + // String is step(0.5) + return interpolateString(kfValues[frame], kfValues[frame + 1], w); + } else { + value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w); + } + + setter(target, propName, value); + } + } + }; + + var clip = new Clip({ + target: animator._target, + life: trackMaxTime, + loop: animator._loop, + delay: animator._delay, + onframe: onframe, + ondestroy: oneTrackDone + }); + + if (easing && easing !== 'spline') { + clip.easing = easing; + } + + return clip; +} +/** + * @alias module:zrender/animation/Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ + + +var Animator = function (target, loop, getter, setter) { + this._tracks = {}; + this._target = target; + this._loop = loop || false; + this._getter = getter || defaultGetter; + this._setter = setter || defaultSetter; + this._clipCount = 0; + this._delay = 0; + this._doneList = []; + this._onframeList = []; + this._clipList = []; +}; + +Animator.prototype = { + /** + * Set Animation keyframe + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animator} + */ + when: function (time + /* ms */ + , props) { + var tracks = this._tracks; + + for (var propName in props) { + if (!props.hasOwnProperty(propName)) { + continue; + } + + if (!tracks[propName]) { + tracks[propName] = []; // Invalid value + + var value = this._getter(this._target, propName); + + if (value == null) { + // zrLog('Invalid property ' + propName); + continue; + } // If time is 0 + // Then props is given initialize value + // Else + // Initialize value from current prop value + + + if (time !== 0) { + tracks[propName].push({ + time: 0, + value: cloneValue(value) + }); + } + } + + tracks[propName].push({ + time: time, + value: props[propName] + }); + } + + return this; + }, + + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animator} + */ + during: function (callback) { + this._onframeList.push(callback); + + return this; + }, + pause: function () { + for (var i = 0; i < this._clipList.length; i++) { + this._clipList[i].pause(); + } + + this._paused = true; + }, + resume: function () { + for (var i = 0; i < this._clipList.length; i++) { + this._clipList[i].resume(); + } + + this._paused = false; + }, + isPaused: function () { + return !!this._paused; + }, + _doneCallback: function () { + // Clear all tracks + this._tracks = {}; // Clear all clips + + this._clipList.length = 0; + var doneList = this._doneList; + var len = doneList.length; + + for (var i = 0; i < len; i++) { + doneList[i].call(this); + } + }, + + /** + * Start the animation + * @param {string|Function} [easing] + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @param {boolean} forceAnimate + * @return {module:zrender/animation/Animator} + */ + start: function (easing, forceAnimate) { + var self = this; + var clipCount = 0; + + var oneTrackDone = function () { + clipCount--; + + if (!clipCount) { + self._doneCallback(); + } + }; + + var lastClip; + + for (var propName in this._tracks) { + if (!this._tracks.hasOwnProperty(propName)) { + continue; + } + + var clip = createTrackClip(this, easing, oneTrackDone, this._tracks[propName], propName, forceAnimate); + + if (clip) { + this._clipList.push(clip); + + clipCount++; // If start after added to animation + + if (this.animation) { + this.animation.addClip(clip); + } + + lastClip = clip; + } + } // Add during callback on the last clip + + + if (lastClip) { + var oldOnFrame = lastClip.onframe; + + lastClip.onframe = function (target, percent) { + oldOnFrame(target, percent); + + for (var i = 0; i < self._onframeList.length; i++) { + self._onframeList[i](target, percent); + } + }; + } // This optimization will help the case that in the upper application + // the view may be refreshed frequently, where animation will be + // called repeatly but nothing changed. + + + if (!clipCount) { + this._doneCallback(); + } + + return this; + }, + + /** + * Stop animation + * @param {boolean} forwardToLast If move to last frame before stop + */ + stop: function (forwardToLast) { + var clipList = this._clipList; + var animation = this.animation; + + for (var i = 0; i < clipList.length; i++) { + var clip = clipList[i]; + + if (forwardToLast) { + // Move to last frame before stop + clip.onframe(this._target, 1); + } + + animation && animation.removeClip(clip); + } + + clipList.length = 0; + }, + + /** + * Set when animation delay starts + * @param {number} time 单位ms + * @return {module:zrender/animation/Animator} + */ + delay: function (time) { + this._delay = time; + return this; + }, + + /** + * Add callback for animation end + * @param {Function} cb + * @return {module:zrender/animation/Animator} + */ + done: function (cb) { + if (cb) { + this._doneList.push(cb); + } + + return this; + }, + + /** + * @return {Array.} + */ + getClips: function () { + return this._clipList; + } +}; +var _default = Animator; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/animation/Clip.js": +/*!****************************************************!*\ + !*** ./node_modules/zrender/lib/animation/Clip.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var easingFuncs = __webpack_require__(/*! ./easing */ "./node_modules/zrender/lib/animation/easing.js"); + +/** + * 动画主控制器 + * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 + * @config life(1000) 动画时长 + * @config delay(0) 动画延迟时间 + * @config loop(true) + * @config gap(0) 循环的间隔时间 + * @config onframe + * @config easing(optional) + * @config ondestroy(optional) + * @config onrestart(optional) + * + * TODO pause + */ +function Clip(options) { + this._target = options.target; // 生命周期 + + this._life = options.life || 1000; // 延时 + + this._delay = options.delay || 0; // 开始时间 + // this._startTime = new Date().getTime() + this._delay;// 单位毫秒 + + this._initialized = false; // 是否循环 + + this.loop = options.loop == null ? false : options.loop; + this.gap = options.gap || 0; + this.easing = options.easing || 'Linear'; + this.onframe = options.onframe; + this.ondestroy = options.ondestroy; + this.onrestart = options.onrestart; + this._pausedTime = 0; + this._paused = false; +} + +Clip.prototype = { + constructor: Clip, + step: function (globalTime, deltaTime) { + // Set startTime on first step, or _startTime may has milleseconds different between clips + // PENDING + if (!this._initialized) { + this._startTime = globalTime + this._delay; + this._initialized = true; + } + + if (this._paused) { + this._pausedTime += deltaTime; + return; + } + + var percent = (globalTime - this._startTime - this._pausedTime) / this._life; // 还没开始 + + if (percent < 0) { + return; + } + + percent = Math.min(percent, 1); + var easing = this.easing; + var easingFunc = typeof easing === 'string' ? easingFuncs[easing] : easing; + var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent; + this.fire('frame', schedule); // 结束 + + if (percent === 1) { + if (this.loop) { + this.restart(globalTime); // 重新开始周期 + // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 + + return 'restart'; + } // 动画完成将这个控制器标识为待删除 + // 在Animation.update中进行批量删除 + + + this._needsRemove = true; + return 'destroy'; + } + + return null; + }, + restart: function (globalTime) { + var remainder = (globalTime - this._startTime - this._pausedTime) % this._life; + this._startTime = globalTime - remainder + this.gap; + this._pausedTime = 0; + this._needsRemove = false; + }, + fire: function (eventType, arg) { + eventType = 'on' + eventType; + + if (this[eventType]) { + this[eventType](this._target, arg); + } + }, + pause: function () { + this._paused = true; + }, + resume: function () { + this._paused = false; + } +}; +var _default = Clip; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/animation/easing.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/animation/easing.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing + */ +var easing = { + /** + * @param {number} k + * @return {number} + */ + linear: function (k) { + return k; + }, + + /** + * @param {number} k + * @return {number} + */ + quadraticIn: function (k) { + return k * k; + }, + + /** + * @param {number} k + * @return {number} + */ + quadraticOut: function (k) { + return k * (2 - k); + }, + + /** + * @param {number} k + * @return {number} + */ + quadraticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + + return -0.5 * (--k * (k - 2) - 1); + }, + // 三次方的缓动(t^3) + + /** + * @param {number} k + * @return {number} + */ + cubicIn: function (k) { + return k * k * k; + }, + + /** + * @param {number} k + * @return {number} + */ + cubicOut: function (k) { + return --k * k * k + 1; + }, + + /** + * @param {number} k + * @return {number} + */ + cubicInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + + return 0.5 * ((k -= 2) * k * k + 2); + }, + // 四次方的缓动(t^4) + + /** + * @param {number} k + * @return {number} + */ + quarticIn: function (k) { + return k * k * k * k; + }, + + /** + * @param {number} k + * @return {number} + */ + quarticOut: function (k) { + return 1 - --k * k * k * k; + }, + + /** + * @param {number} k + * @return {number} + */ + quarticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + // 五次方的缓动(t^5) + + /** + * @param {number} k + * @return {number} + */ + quinticIn: function (k) { + return k * k * k * k * k; + }, + + /** + * @param {number} k + * @return {number} + */ + quinticOut: function (k) { + return --k * k * k * k * k + 1; + }, + + /** + * @param {number} k + * @return {number} + */ + quinticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + // 正弦曲线的缓动(sin(t)) + + /** + * @param {number} k + * @return {number} + */ + sinusoidalIn: function (k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + + /** + * @param {number} k + * @return {number} + */ + sinusoidalOut: function (k) { + return Math.sin(k * Math.PI / 2); + }, + + /** + * @param {number} k + * @return {number} + */ + sinusoidalInOut: function (k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + // 指数曲线的缓动(2^t) + + /** + * @param {number} k + * @return {number} + */ + exponentialIn: function (k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + + /** + * @param {number} k + * @return {number} + */ + exponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + + /** + * @param {number} k + * @return {number} + */ + exponentialInOut: function (k) { + if (k === 0) { + return 0; + } + + if (k === 1) { + return 1; + } + + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + // 圆形曲线的缓动(sqrt(1-t^2)) + + /** + * @param {number} k + * @return {number} + */ + circularIn: function (k) { + return 1 - Math.sqrt(1 - k * k); + }, + + /** + * @param {number} k + * @return {number} + */ + circularOut: function (k) { + return Math.sqrt(1 - --k * k); + }, + + /** + * @param {number} k + * @return {number} + */ + circularInOut: function (k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + // 创建类似于弹簧在停止前来回振荡的动画 + + /** + * @param {number} k + * @return {number} + */ + elasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; + + if (k === 0) { + return 0; + } + + if (k === 1) { + return 1; + } + + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + + return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + }, + + /** + * @param {number} k + * @return {number} + */ + elasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + + if (k === 0) { + return 0; + } + + if (k === 1) { + return 1; + } + + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + + return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1; + }, + + /** + * @param {number} k + * @return {number} + */ + elasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + + if (k === 0) { + return 0; + } + + if (k === 1) { + return 1; + } + + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + } + + return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + }, + // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 + + /** + * @param {number} k + * @return {number} + */ + backIn: function (k) { + var s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + + /** + * @param {number} k + * @return {number} + */ + backOut: function (k) { + var s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + + /** + * @param {number} k + * @return {number} + */ + backInOut: function (k) { + var s = 1.70158 * 1.525; + + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + // 创建弹跳效果 + + /** + * @param {number} k + * @return {number} + */ + bounceIn: function (k) { + return 1 - easing.bounceOut(1 - k); + }, + + /** + * @param {number} k + * @return {number} + */ + bounceOut: function (k) { + if (k < 1 / 2.75) { + return 7.5625 * k * k; + } else if (k < 2 / 2.75) { + return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75; + } else if (k < 2.5 / 2.75) { + return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375; + } else { + return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375; + } + }, + + /** + * @param {number} k + * @return {number} + */ + bounceInOut: function (k) { + if (k < 0.5) { + return easing.bounceIn(k * 2) * 0.5; + } + + return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5; + } +}; +var _default = easing; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/config.js": +/*!********************************************!*\ + !*** ./node_modules/zrender/lib/config.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var dpr = 1; // If in browser environment + +if (typeof window !== 'undefined') { + dpr = Math.max(window.devicePixelRatio || 1, 1); +} +/** + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + */ + +/** + * Debug log mode: + * 0: Do nothing, for release. + * 1: console.error, for debug. + */ + + +var debugMode = 0; // retina 屏幕优化 + +var devicePixelRatio = dpr; +exports.debugMode = debugMode; +exports.devicePixelRatio = devicePixelRatio; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/arc.js": +/*!*************************************************!*\ + !*** ./node_modules/zrender/lib/contain/arc.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _util = __webpack_require__(/*! ./util */ "./node_modules/zrender/lib/contain/util.js"); + +var normalizeRadian = _util.normalizeRadian; +var PI2 = Math.PI * 2; +/** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + +function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + + var _l = lineWidth; + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + + if (d - _l > r || d + _l < r) { + return false; + } + + if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) { + // Is a circle + return true; + } + + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + + if (startAngle > endAngle) { + endAngle += PI2; + } + + var angle = Math.atan2(y, x); + + if (angle < 0) { + angle += PI2; + } + + return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle; +} + +exports.containStroke = containStroke; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/cubic.js": +/*!***************************************************!*\ + !*** ./node_modules/zrender/lib/contain/cubic.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var curve = __webpack_require__(/*! ../core/curve */ "./node_modules/zrender/lib/core/curve.js"); + +/** + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ +function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + + var _l = lineWidth; // Quick reject + + 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) { + return false; + } + + var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null); + return d <= _l / 2; +} + +exports.containStroke = containStroke; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/line.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/line.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ +function containStroke(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + + var _l = lineWidth; + var _a = 0; + var _b = x0; // Quick reject + + 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) { + return false; + } + + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1); + } else { + return Math.abs(x - x0) <= _l / 2; + } + + var tmp = _a * x - y + _b; + + var _s = tmp * tmp / (_a * _a + 1); + + return _s <= _l / 2 * _l / 2; +} + +exports.containStroke = containStroke; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/path.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/path.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var PathProxy = __webpack_require__(/*! ../core/PathProxy */ "./node_modules/zrender/lib/core/PathProxy.js"); + +var line = __webpack_require__(/*! ./line */ "./node_modules/zrender/lib/contain/line.js"); + +var cubic = __webpack_require__(/*! ./cubic */ "./node_modules/zrender/lib/contain/cubic.js"); + +var quadratic = __webpack_require__(/*! ./quadratic */ "./node_modules/zrender/lib/contain/quadratic.js"); + +var arc = __webpack_require__(/*! ./arc */ "./node_modules/zrender/lib/contain/arc.js"); + +var _util = __webpack_require__(/*! ./util */ "./node_modules/zrender/lib/contain/util.js"); + +var normalizeRadian = _util.normalizeRadian; + +var curve = __webpack_require__(/*! ../core/curve */ "./node_modules/zrender/lib/core/curve.js"); + +var windingLine = __webpack_require__(/*! ./windingLine */ "./node_modules/zrender/lib/contain/windingLine.js"); + +var CMD = PathProxy.CMD; +var PI2 = Math.PI * 2; +var EPSILON = 1e-4; + +function isAroundEqual(a, b) { + return Math.abs(a - b) < EPSILON; +} // 临时数组 + + +var roots = [-1, -1, -1]; +var extrema = [-1, -1]; + +function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; +} + +function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) { + return 0; + } + + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + + if (nRoots === 0) { + return 0; + } else { + var w = 0; + var nExtrema = -1; + var y0_; + var y1_; + + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; // Avoid winding error when intersection point is the connect point of two line of polygon + + var unit = t === 0 || t === 1 ? 0.5 : 1; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + + if (x_ < x) { + // Quick reject + continue; + } + + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + + if (nExtrema === 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? unit : -unit; + } else if (t < extrema[1]) { + w += y1_ < y0_ ? unit : -unit; + } else { + w += y3 < y1_ ? unit : -unit; + } + } else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? unit : -unit; + } else { + w += y3 < y0_ ? unit : -unit; + } + } + } + + return w; + } +} + +function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) { + return 0; + } + + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + + if (nRoots === 0) { + return 0; + } else { + var t = curve.quadraticExtremum(y0, y1, y2); + + if (t >= 0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + + for (var i = 0; i < nRoots; i++) { + // Remove one endpoint. + var unit = roots[i] === 0 || roots[i] === 1 ? 0.5 : 1; + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + + if (x_ < x) { + // Quick reject + continue; + } + + if (roots[i] < t) { + w += y_ < y0 ? unit : -unit; + } else { + w += y2 < y_ ? unit : -unit; + } + } + + return w; + } else { + // Remove one endpoint. + var unit = roots[0] === 0 || roots[0] === 1 ? 0.5 : 1; + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + + if (x_ < x) { + // Quick reject + return 0; + } + + return y2 < y0 ? unit : -unit; + } + } +} // TODO +// Arc 旋转 + + +function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) { + y -= cy; + + if (y > r || y < -r) { + return 0; + } + + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + var diff = Math.abs(startAngle - endAngle); + + if (diff < 1e-4) { + return 0; + } + + if (diff % PI2 < 1e-4) { + // Is a circle + startAngle = 0; + endAngle = PI2; + var dir = anticlockwise ? 1 : -1; + + if (x >= roots[0] + cx && x <= roots[1] + cx) { + return dir; + } else { + return 0; + } + } + + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + + if (angle < 0) { + angle = PI2 + angle; + } + + if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + + w += dir; + } + } + } + + return w; +} + +function containPath(data, lineWidth, isStroke, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + + for (var i = 0; i < data.length;) { + var cmd = data[i++]; // Begin a new subpath + + if (cmd === CMD.M && i > 1) { + // Close previous subpath + if (!isStroke) { + w += windingLine(xi, yi, x0, y0, x, y); + } // 如果被任何一个 subpath 包含 + // if (w !== 0) { + // return true; + // } + + } + + if (i === 1) { + // 如果第一个命令是 L, C, Q + // 则 previous point 同绘制命令的第一个 point + // + // 第一个命令为 Arc 的情况下会在后面特殊处理 + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + + switch (cmd) { + case CMD.M: + // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 + // 在 closePath 的时候使用 + x0 = data[i++]; + y0 = data[i++]; + xi = x0; + yi = y0; + break; + + case CMD.L: + if (isStroke) { + if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) { + return true; + } + } else { + // NOTE 在第一个命令为 L, C, Q 的时候会计算出 NaN + w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0; + } + + xi = data[i++]; + yi = data[i++]; + break; + + case CMD.C: + if (isStroke) { + if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) { + return true; + } + } else { + w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0; + } + + xi = data[i++]; + yi = data[i++]; + break; + + case CMD.Q: + if (isStroke) { + if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) { + return true; + } + } else { + w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0; + } + + xi = data[i++]; + yi = data[i++]; + break; + + case CMD.A: + // TODO Arc 判断的开销比较大 + var cx = data[i++]; + var cy = data[i++]; + var rx = data[i++]; + var ry = data[i++]; + var theta = data[i++]; + var dTheta = data[i++]; // TODO Arc 旋转 + + i += 1; + var anticlockwise = 1 - data[i++]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令 + + if (i > 1) { + w += windingLine(xi, yi, x1, y1, x, y); + } else { + // 第一个命令起点还未定义 + x0 = x1; + y0 = y1; + } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + + + var _x = (x - cx) * ry / rx + cx; + + if (isStroke) { + if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) { + return true; + } + } else { + w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y); + } + + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + + case CMD.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + var width = data[i++]; + var height = data[i++]; + var x1 = x0 + width; + var y1 = y0 + height; + + if (isStroke) { + 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)) { + return true; + } + } else { + // FIXME Clockwise ? + w += windingLine(x1, y0, x1, y1, x, y); + w += windingLine(x0, y1, x0, y0, x, y); + } + + break; + + case CMD.Z: + if (isStroke) { + if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) { + return true; + } + } else { + // Close a subpath + w += windingLine(xi, yi, x0, y0, x, y); // 如果被任何一个 subpath 包含 + // FIXME subpaths may overlap + // if (w !== 0) { + // return true; + // } + } + + xi = x0; + yi = y0; + break; + } + } + + if (!isStroke && !isAroundEqual(yi, y0)) { + w += windingLine(xi, yi, x0, y0, x, y) || 0; + } + + return w !== 0; +} + +function contain(pathData, x, y) { + return containPath(pathData, 0, false, x, y); +} + +function containStroke(pathData, lineWidth, x, y) { + return containPath(pathData, lineWidth, true, x, y); +} + +exports.contain = contain; +exports.containStroke = containStroke; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/quadratic.js": +/*!*******************************************************!*\ + !*** ./node_modules/zrender/lib/contain/quadratic.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _curve = __webpack_require__(/*! ../core/curve */ "./node_modules/zrender/lib/core/curve.js"); + +var quadraticProjectPoint = _curve.quadraticProjectPoint; + +/** + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ +function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + + var _l = lineWidth; // Quick reject + + 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) { + return false; + } + + var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null); + return d <= _l / 2; +} + +exports.containStroke = containStroke; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/text.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/text.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +var imageHelper = __webpack_require__(/*! ../graphic/helper/image */ "./node_modules/zrender/lib/graphic/helper/image.js"); + +var _util = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var getContext = _util.getContext; +var extend = _util.extend; +var retrieve2 = _util.retrieve2; +var retrieve3 = _util.retrieve3; +var trim = _util.trim; +var textWidthCache = {}; +var textWidthCacheCounter = 0; +var TEXT_CACHE_MAX = 5000; +var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g; +var DEFAULT_FONT = '12px sans-serif'; // Avoid assign to an exported variable, for transforming to cjs. + +var methods = {}; + +function $override(name, fn) { + methods[name] = fn; +} +/** + * @public + * @param {string} text + * @param {string} font + * @return {number} width + */ + + +function getWidth(text, font) { + font = font || DEFAULT_FONT; + var key = text + ':' + font; + + if (textWidthCache[key]) { + return textWidthCache[key]; + } + + var textLines = (text + '').split('\n'); + var width = 0; + + for (var i = 0, l = textLines.length; i < l; i++) { + // textContain.measureText may be overrided in SVG or VML + width = Math.max(measureText(textLines[i], font).width, width); + } + + if (textWidthCacheCounter > TEXT_CACHE_MAX) { + textWidthCacheCounter = 0; + textWidthCache = {}; + } + + textWidthCacheCounter++; + textWidthCache[key] = width; + return width; +} +/** + * @public + * @param {string} text + * @param {string} font + * @param {string} [textAlign='left'] + * @param {string} [textVerticalAlign='top'] + * @param {Array.} [textPadding] + * @param {Object} [rich] + * @param {Object} [truncate] + * @return {Object} {x, y, width, height, lineHeight} + */ + + +function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) { + return rich ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate); +} + +function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate) { + var contentBlock = parsePlainText(text, font, textPadding, textLineHeight, truncate); + var outerWidth = getWidth(text, font); + + if (textPadding) { + outerWidth += textPadding[1] + textPadding[3]; + } + + var outerHeight = contentBlock.outerHeight; + var x = adjustTextX(0, outerWidth, textAlign); + var y = adjustTextY(0, outerHeight, textVerticalAlign); + var rect = new BoundingRect(x, y, outerWidth, outerHeight); + rect.lineHeight = contentBlock.lineHeight; + return rect; +} + +function getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) { + var contentBlock = parseRichText(text, { + rich: rich, + truncate: truncate, + font: font, + textAlign: textAlign, + textPadding: textPadding, + textLineHeight: textLineHeight + }); + var outerWidth = contentBlock.outerWidth; + var outerHeight = contentBlock.outerHeight; + var x = adjustTextX(0, outerWidth, textAlign); + var y = adjustTextY(0, outerHeight, textVerticalAlign); + return new BoundingRect(x, y, outerWidth, outerHeight); +} +/** + * @public + * @param {number} x + * @param {number} width + * @param {string} [textAlign='left'] + * @return {number} Adjusted x. + */ + + +function adjustTextX(x, width, textAlign) { + // FIXME Right to left language + if (textAlign === 'right') { + x -= width; + } else if (textAlign === 'center') { + x -= width / 2; + } + + return x; +} +/** + * @public + * @param {number} y + * @param {number} height + * @param {string} [textVerticalAlign='top'] + * @return {number} Adjusted y. + */ + + +function adjustTextY(y, height, textVerticalAlign) { + if (textVerticalAlign === 'middle') { + y -= height / 2; + } else if (textVerticalAlign === 'bottom') { + y -= height; + } + + return y; +} +/** + * Follow same interface to `Displayable.prototype.calculateTextPosition`. + * @public + * @param {Obejct} [out] Prepared out object. If not input, auto created in the method. + * @param {module:zrender/graphic/Style} style where `textPosition` and `textDistance` are visited. + * @param {Object} rect {x, y, width, height} Rect of the host elment, according to which the text positioned. + * @return {Object} The input `out`. Set: {x, y, textAlign, textVerticalAlign} + */ + + +function calculateTextPosition(out, style, rect) { + var textPosition = style.textPosition; + var distance = style.textDistance; + var x = rect.x; + var y = rect.y; + distance = distance || 0; + var height = rect.height; + var width = rect.width; + var halfHeight = height / 2; + var textAlign = 'left'; + var textVerticalAlign = 'top'; + + switch (textPosition) { + case 'left': + x -= distance; + y += halfHeight; + textAlign = 'right'; + textVerticalAlign = 'middle'; + break; + + case 'right': + x += distance + width; + y += halfHeight; + textVerticalAlign = 'middle'; + break; + + case 'top': + x += width / 2; + y -= distance; + textAlign = 'center'; + textVerticalAlign = 'bottom'; + break; + + case 'bottom': + x += width / 2; + y += height + distance; + textAlign = 'center'; + break; + + case 'inside': + x += width / 2; + y += halfHeight; + textAlign = 'center'; + textVerticalAlign = 'middle'; + break; + + case 'insideLeft': + x += distance; + y += halfHeight; + textVerticalAlign = 'middle'; + break; + + case 'insideRight': + x += width - distance; + y += halfHeight; + textAlign = 'right'; + textVerticalAlign = 'middle'; + break; + + case 'insideTop': + x += width / 2; + y += distance; + textAlign = 'center'; + break; + + case 'insideBottom': + x += width / 2; + y += height - distance; + textAlign = 'center'; + textVerticalAlign = 'bottom'; + break; + + case 'insideTopLeft': + x += distance; + y += distance; + break; + + case 'insideTopRight': + x += width - distance; + y += distance; + textAlign = 'right'; + break; + + case 'insideBottomLeft': + x += distance; + y += height - distance; + textVerticalAlign = 'bottom'; + break; + + case 'insideBottomRight': + x += width - distance; + y += height - distance; + textAlign = 'right'; + textVerticalAlign = 'bottom'; + break; + } + + out = out || {}; + out.x = x; + out.y = y; + out.textAlign = textAlign; + out.textVerticalAlign = textVerticalAlign; + return out; +} +/** + * To be removed. But still do not remove in case that some one has imported it. + * @deprecated + * @public + * @param {stirng} textPosition + * @param {Object} rect {x, y, width, height} + * @param {number} distance + * @return {Object} {x, y, textAlign, textVerticalAlign} + */ + + +function adjustTextPositionOnRect(textPosition, rect, distance) { + var dummyStyle = { + textPosition: textPosition, + textDistance: distance + }; + return calculateTextPosition({}, dummyStyle, rect); +} +/** + * Show ellipsis if overflow. + * + * @public + * @param {string} text + * @param {string} containerWidth + * @param {string} font + * @param {number} [ellipsis='...'] + * @param {Object} [options] + * @param {number} [options.maxIterations=3] + * @param {number} [options.minChar=0] If truncate result are less + * then minChar, ellipsis will not show, which is + * better for user hint in some cases. + * @param {number} [options.placeholder=''] When all truncated, use the placeholder. + * @return {string} + */ + + +function truncateText(text, containerWidth, font, ellipsis, options) { + if (!containerWidth) { + return ''; + } + + var textLines = (text + '').split('\n'); + options = prepareTruncateOptions(containerWidth, font, ellipsis, options); // FIXME + // It is not appropriate that every line has '...' when truncate multiple lines. + + for (var i = 0, len = textLines.length; i < len; i++) { + textLines[i] = truncateSingleLine(textLines[i], options); + } + + return textLines.join('\n'); +} + +function prepareTruncateOptions(containerWidth, font, ellipsis, options) { + options = extend({}, options); + options.font = font; + var ellipsis = retrieve2(ellipsis, '...'); + options.maxIterations = retrieve2(options.maxIterations, 2); + var minChar = options.minChar = retrieve2(options.minChar, 0); // FIXME + // Other languages? + + options.cnCharWidth = getWidth('国', font); // FIXME + // Consider proportional font? + + var ascCharWidth = options.ascCharWidth = getWidth('a', font); + options.placeholder = retrieve2(options.placeholder, ''); // Example 1: minChar: 3, text: 'asdfzxcv', truncate result: 'asdf', but not: 'a...'. + // Example 2: minChar: 3, text: '维度', truncate result: '维', but not: '...'. + + var contentWidth = containerWidth = Math.max(0, containerWidth - 1); // Reserve some gap. + + for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) { + contentWidth -= ascCharWidth; + } + + var ellipsisWidth = getWidth(ellipsis, font); + + if (ellipsisWidth > contentWidth) { + ellipsis = ''; + ellipsisWidth = 0; + } + + contentWidth = containerWidth - ellipsisWidth; + options.ellipsis = ellipsis; + options.ellipsisWidth = ellipsisWidth; + options.contentWidth = contentWidth; + options.containerWidth = containerWidth; + return options; +} + +function truncateSingleLine(textLine, options) { + var containerWidth = options.containerWidth; + var font = options.font; + var contentWidth = options.contentWidth; + + if (!containerWidth) { + return ''; + } + + var lineWidth = getWidth(textLine, font); + + if (lineWidth <= containerWidth) { + return textLine; + } + + for (var j = 0;; j++) { + if (lineWidth <= contentWidth || j >= options.maxIterations) { + textLine += options.ellipsis; + break; + } + + var subLength = j === 0 ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0; + textLine = textLine.substr(0, subLength); + lineWidth = getWidth(textLine, font); + } + + if (textLine === '') { + textLine = options.placeholder; + } + + return textLine; +} + +function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) { + var width = 0; + var i = 0; + + for (var len = text.length; i < len && width < contentWidth; i++) { + var charCode = text.charCodeAt(i); + width += 0 <= charCode && charCode <= 127 ? ascCharWidth : cnCharWidth; + } + + return i; +} +/** + * @public + * @param {string} font + * @return {number} line height + */ + + +function getLineHeight(font) { + // FIXME A rough approach. + return getWidth('国', font); +} +/** + * @public + * @param {string} text + * @param {string} font + * @return {Object} width + */ + + +function measureText(text, font) { + return methods.measureText(text, font); +} // Avoid assign to an exported variable, for transforming to cjs. + + +methods.measureText = function (text, font) { + var ctx = getContext(); + ctx.font = font || DEFAULT_FONT; + return ctx.measureText(text); +}; +/** + * @public + * @param {string} text + * @param {string} font + * @param {Object} [truncate] + * @return {Object} block: {lineHeight, lines, height, outerHeight, canCacheByTextString} + * Notice: for performance, do not calculate outerWidth util needed. + * `canCacheByTextString` means the result `lines` is only determined by the input `text`. + * Thus we can simply comparing the `input` text to determin whether the result changed, + * without travel the result `lines`. + */ + + +function parsePlainText(text, font, padding, textLineHeight, truncate) { + text != null && (text += ''); + var lineHeight = retrieve2(textLineHeight, getLineHeight(font)); + var lines = text ? text.split('\n') : []; + var height = lines.length * lineHeight; + var outerHeight = height; + var canCacheByTextString = true; + + if (padding) { + outerHeight += padding[0] + padding[2]; + } + + if (text && truncate) { + canCacheByTextString = false; + var truncOuterHeight = truncate.outerHeight; + var truncOuterWidth = truncate.outerWidth; + + if (truncOuterHeight != null && outerHeight > truncOuterHeight) { + text = ''; + lines = []; + } else if (truncOuterWidth != null) { + var options = prepareTruncateOptions(truncOuterWidth - (padding ? padding[1] + padding[3] : 0), font, truncate.ellipsis, { + minChar: truncate.minChar, + placeholder: truncate.placeholder + }); // FIXME + // It is not appropriate that every line has '...' when truncate multiple lines. + + for (var i = 0, len = lines.length; i < len; i++) { + lines[i] = truncateSingleLine(lines[i], options); + } + } + } + + return { + lines: lines, + height: height, + outerHeight: outerHeight, + lineHeight: lineHeight, + canCacheByTextString: canCacheByTextString + }; +} +/** + * For example: 'some text {a|some text}other text{b|some text}xxx{c|}xxx' + * Also consider 'bbbb{a|xxx\nzzz}xxxx\naaaa'. + * + * @public + * @param {string} text + * @param {Object} style + * @return {Object} block + * { + * width, + * height, + * lines: [{ + * lineHeight, + * width, + * tokens: [[{ + * styleName, + * text, + * width, // include textPadding + * height, // include textPadding + * textWidth, // pure text width + * textHeight, // pure text height + * lineHeihgt, + * font, + * textAlign, + * textVerticalAlign + * }], [...], ...] + * }, ...] + * } + * If styleName is undefined, it is plain text. + */ + + +function parseRichText(text, style) { + var contentBlock = { + lines: [], + width: 0, + height: 0 + }; + text != null && (text += ''); + + if (!text) { + return contentBlock; + } + + var lastIndex = STYLE_REG.lastIndex = 0; + var result; + + while ((result = STYLE_REG.exec(text)) != null) { + var matchedIndex = result.index; + + if (matchedIndex > lastIndex) { + pushTokens(contentBlock, text.substring(lastIndex, matchedIndex)); + } + + pushTokens(contentBlock, result[2], result[1]); + lastIndex = STYLE_REG.lastIndex; + } + + if (lastIndex < text.length) { + pushTokens(contentBlock, text.substring(lastIndex, text.length)); + } + + var lines = contentBlock.lines; + var contentHeight = 0; + var contentWidth = 0; // For `textWidth: 100%` + + var pendingList = []; + var stlPadding = style.textPadding; + var truncate = style.truncate; + var truncateWidth = truncate && truncate.outerWidth; + var truncateHeight = truncate && truncate.outerHeight; + + if (stlPadding) { + truncateWidth != null && (truncateWidth -= stlPadding[1] + stlPadding[3]); + truncateHeight != null && (truncateHeight -= stlPadding[0] + stlPadding[2]); + } // Calculate layout info of tokens. + + + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + var lineHeight = 0; + var lineWidth = 0; + + for (var j = 0; j < line.tokens.length; j++) { + var token = line.tokens[j]; + var tokenStyle = token.styleName && style.rich[token.styleName] || {}; // textPadding should not inherit from style. + + var textPadding = token.textPadding = tokenStyle.textPadding; // textFont has been asigned to font by `normalizeStyle`. + + var font = token.font = tokenStyle.font || style.font; // textHeight can be used when textVerticalAlign is specified in token. + + var tokenHeight = token.textHeight = retrieve2( // textHeight should not be inherited, consider it can be specified + // as box height of the block. + tokenStyle.textHeight, getLineHeight(font)); + textPadding && (tokenHeight += textPadding[0] + textPadding[2]); + token.height = tokenHeight; + token.lineHeight = retrieve3(tokenStyle.textLineHeight, style.textLineHeight, tokenHeight); + token.textAlign = tokenStyle && tokenStyle.textAlign || style.textAlign; + token.textVerticalAlign = tokenStyle && tokenStyle.textVerticalAlign || 'middle'; + + if (truncateHeight != null && contentHeight + token.lineHeight > truncateHeight) { + return { + lines: [], + width: 0, + height: 0 + }; + } + + token.textWidth = getWidth(token.text, font); + var tokenWidth = tokenStyle.textWidth; + var tokenWidthNotSpecified = tokenWidth == null || tokenWidth === 'auto'; // Percent width, can be `100%`, can be used in drawing separate + // line when box width is needed to be auto. + + if (typeof tokenWidth === 'string' && tokenWidth.charAt(tokenWidth.length - 1) === '%') { + token.percentWidth = tokenWidth; + pendingList.push(token); + tokenWidth = 0; // Do not truncate in this case, because there is no user case + // and it is too complicated. + } else { + if (tokenWidthNotSpecified) { + tokenWidth = token.textWidth; // FIXME: If image is not loaded and textWidth is not specified, calling + // `getBoundingRect()` will not get correct result. + + var textBackgroundColor = tokenStyle.textBackgroundColor; + var bgImg = textBackgroundColor && textBackgroundColor.image; // Use cases: + // (1) If image is not loaded, it will be loaded at render phase and call + // `dirty()` and `textBackgroundColor.image` will be replaced with the loaded + // image, and then the right size will be calculated here at the next tick. + // See `graphic/helper/text.js`. + // (2) If image loaded, and `textBackgroundColor.image` is image src string, + // use `imageHelper.findExistImage` to find cached image. + // `imageHelper.findExistImage` will always be called here before + // `imageHelper.createOrUpdateImage` in `graphic/helper/text.js#renderRichText` + // which ensures that image will not be rendered before correct size calcualted. + + if (bgImg) { + bgImg = imageHelper.findExistImage(bgImg); + + if (imageHelper.isImageReady(bgImg)) { + tokenWidth = Math.max(tokenWidth, bgImg.width * tokenHeight / bgImg.height); + } + } + } + + var paddingW = textPadding ? textPadding[1] + textPadding[3] : 0; + tokenWidth += paddingW; + var remianTruncWidth = truncateWidth != null ? truncateWidth - lineWidth : null; + + if (remianTruncWidth != null && remianTruncWidth < tokenWidth) { + if (!tokenWidthNotSpecified || remianTruncWidth < paddingW) { + token.text = ''; + token.textWidth = tokenWidth = 0; + } else { + token.text = truncateText(token.text, remianTruncWidth - paddingW, font, truncate.ellipsis, { + minChar: truncate.minChar + }); + token.textWidth = getWidth(token.text, font); + tokenWidth = token.textWidth + paddingW; + } + } + } + + lineWidth += token.width = tokenWidth; + tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight)); + } + + line.width = lineWidth; + line.lineHeight = lineHeight; + contentHeight += lineHeight; + contentWidth = Math.max(contentWidth, lineWidth); + } + + contentBlock.outerWidth = contentBlock.width = retrieve2(style.textWidth, contentWidth); + contentBlock.outerHeight = contentBlock.height = retrieve2(style.textHeight, contentHeight); + + if (stlPadding) { + contentBlock.outerWidth += stlPadding[1] + stlPadding[3]; + contentBlock.outerHeight += stlPadding[0] + stlPadding[2]; + } + + for (var i = 0; i < pendingList.length; i++) { + var token = pendingList[i]; + var percentWidth = token.percentWidth; // Should not base on outerWidth, because token can not be placed out of padding. + + token.width = parseInt(percentWidth, 10) / 100 * contentWidth; + } + + return contentBlock; +} + +function pushTokens(block, str, styleName) { + var isEmptyStr = str === ''; + var strs = str.split('\n'); + var lines = block.lines; + + for (var i = 0; i < strs.length; i++) { + var text = strs[i]; + var token = { + styleName: styleName, + text: text, + isLineHolder: !text && !isEmptyStr + }; // The first token should be appended to the last line. + + if (!i) { + var tokens = (lines[lines.length - 1] || (lines[0] = { + tokens: [] + })).tokens; // Consider cases: + // (1) ''.split('\n') => ['', '\n', ''], the '' at the first item + // (which is a placeholder) should be replaced by new token. + // (2) A image backage, where token likes {a|}. + // (3) A redundant '' will affect textAlign in line. + // (4) tokens with the same tplName should not be merged, because + // they should be displayed in different box (with border and padding). + + var tokensLen = tokens.length; + tokensLen === 1 && tokens[0].isLineHolder ? tokens[0] = token : // Consider text is '', only insert when it is the "lineHolder" or + // "emptyStr". Otherwise a redundant '' will affect textAlign in line. + (text || !tokensLen || isEmptyStr) && tokens.push(token); + } // Other tokens always start a new line. + else { + // If there is '', insert it as a placeholder. + lines.push({ + tokens: [token] + }); + } + } +} + +function makeFont(style) { + // FIXME in node-canvas fontWeight is before fontStyle + // Use `fontSize` `fontFamily` to check whether font properties are defined. + var font = (style.fontSize || style.fontFamily) && [style.fontStyle, style.fontWeight, (style.fontSize || 12) + 'px', // If font properties are defined, `fontFamily` should not be ignored. + style.fontFamily || 'sans-serif'].join(' '); + return font && trim(font) || style.textFont || style.font; +} + +exports.DEFAULT_FONT = DEFAULT_FONT; +exports.$override = $override; +exports.getWidth = getWidth; +exports.getBoundingRect = getBoundingRect; +exports.adjustTextX = adjustTextX; +exports.adjustTextY = adjustTextY; +exports.calculateTextPosition = calculateTextPosition; +exports.adjustTextPositionOnRect = adjustTextPositionOnRect; +exports.truncateText = truncateText; +exports.getLineHeight = getLineHeight; +exports.measureText = measureText; +exports.parsePlainText = parsePlainText; +exports.parseRichText = parseRichText; +exports.makeFont = makeFont; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/util.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/util.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var PI2 = Math.PI * 2; + +function normalizeRadian(angle) { + angle %= PI2; + + if (angle < 0) { + angle += PI2; + } + + return angle; +} + +exports.normalizeRadian = normalizeRadian; + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/windingLine.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/contain/windingLine.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function windingLine(x0, y0, x1, y1, x, y) { + if (y > y0 && y > y1 || y < y0 && y < y1) { + return 0; + } // Ignore horizontal line + + + if (y1 === y0) { + return 0; + } + + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); // Avoid winding error when intersection point is the connect point of two line of polygon + + if (t === 1 || t === 0) { + dir = y1 < y0 ? 0.5 : -0.5; + } + + var x_ = t * (x1 - x0) + x0; // If (x, y) on the line, considered as "contain". + + return x_ === x ? Infinity : x_ > x ? dir : 0; +} + +module.exports = windingLine; + +/***/ }), + +/***/ "./node_modules/zrender/lib/container/Group.js": +/*!*****************************************************!*\ + !*** ./node_modules/zrender/lib/container/Group.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var Element = __webpack_require__(/*! ../Element */ "./node_modules/zrender/lib/Element.js"); + +var BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/graphic/Group + * @example + * var Group = require('zrender/container/Group'); + * var Circle = require('zrender/graphic/shape/Circle'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.add(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * } + * })); + * zr.add(g); + */ + +/** + * @alias module:zrender/graphic/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + */ +var Group = function (opts) { + opts = opts || {}; + Element.call(this, opts); + + for (var key in opts) { + if (opts.hasOwnProperty(key)) { + this[key] = opts[key]; + } + } + + this._children = []; + this.__storage = null; + this.__dirty = true; +}; + +Group.prototype = { + constructor: Group, + isGroup: true, + + /** + * @type {string} + */ + type: 'group', + + /** + * 所有子孙元素是否响应鼠标事件 + * @name module:/zrender/container/Group#silent + * @type {boolean} + * @default false + */ + silent: false, + + /** + * @return {Array.} + */ + children: function () { + return this._children.slice(); + }, + + /** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Element} + */ + childAt: function (idx) { + return this._children[idx]; + }, + + /** + * 获取指定名字的儿子节点 + * @param {string} name + * @return {module:zrender/Element} + */ + childOfName: function (name) { + var children = this._children; + + for (var i = 0; i < children.length; i++) { + if (children[i].name === name) { + return children[i]; + } + } + }, + + /** + * @return {number} + */ + childCount: function () { + return this._children.length; + }, + + /** + * 添加子节点到最后 + * @param {module:zrender/Element} child + */ + add: function (child) { + if (child && child !== this && child.parent !== this) { + this._children.push(child); + + this._doAdd(child); + } + + return this; + }, + + /** + * 添加子节点在 nextSibling 之前 + * @param {module:zrender/Element} child + * @param {module:zrender/Element} nextSibling + */ + addBefore: function (child, nextSibling) { + if (child && child !== this && child.parent !== this && nextSibling && nextSibling.parent === this) { + var children = this._children; + var idx = children.indexOf(nextSibling); + + if (idx >= 0) { + children.splice(idx, 0, child); + + this._doAdd(child); + } + } + + return this; + }, + _doAdd: function (child) { + if (child.parent) { + child.parent.remove(child); + } + + child.parent = this; + var storage = this.__storage; + var zr = this.__zr; + + if (storage && storage !== child.__storage) { + storage.addToStorage(child); + + if (child instanceof Group) { + child.addChildrenToStorage(storage); + } + } + + zr && zr.refresh(); + }, + + /** + * 移除子节点 + * @param {module:zrender/Element} child + */ + remove: function (child) { + var zr = this.__zr; + var storage = this.__storage; + var children = this._children; + var idx = zrUtil.indexOf(children, child); + + if (idx < 0) { + return this; + } + + children.splice(idx, 1); + child.parent = null; + + if (storage) { + storage.delFromStorage(child); + + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } + + zr && zr.refresh(); + return this; + }, + + /** + * 移除所有子节点 + */ + removeAll: function () { + var children = this._children; + var storage = this.__storage; + var child; + var i; + + for (i = 0; i < children.length; i++) { + child = children[i]; + + if (storage) { + storage.delFromStorage(child); + + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } + + child.parent = null; + } + + children.length = 0; + return this; + }, + + /** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ + eachChild: function (cb, context) { + var children = this._children; + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + cb.call(context, child, i); + } + + return this; + }, + + /** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ + traverse: function (cb, context) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + cb.call(context, child); + + if (child.type === 'group') { + child.traverse(cb, context); + } + } + + return this; + }, + addChildrenToStorage: function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToStorage(child); + + if (child instanceof Group) { + child.addChildrenToStorage(storage); + } + } + }, + delChildrenFromStorage: function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromStorage(child); + + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } + }, + dirty: function () { + this.__dirty = true; + this.__zr && this.__zr.refresh(); + return this; + }, + + /** + * @return {module:zrender/core/BoundingRect} + */ + getBoundingRect: function (includeChildren) { + // TODO Caching + var rect = null; + var tmpRect = new BoundingRect(0, 0, 0, 0); + var children = includeChildren || this._children; + var tmpMat = []; + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + + if (child.ignore || child.invisible) { + continue; + } + + var childRect = child.getBoundingRect(); + var transform = child.getLocalTransform(tmpMat); // TODO + // The boundingRect cacluated by transforming original + // rect may be bigger than the actual bundingRect when rotation + // is used. (Consider a circle rotated aginst its center, where + // the actual boundingRect should be the same as that not be + // rotated.) But we can not find better approach to calculate + // actual boundingRect yet, considering performance. + + if (transform) { + tmpRect.copy(childRect); + tmpRect.applyTransform(transform); + rect = rect || tmpRect.clone(); + rect.union(tmpRect); + } else { + rect = rect || childRect.clone(); + rect.union(childRect); + } + } + + return rect || tmpRect; + } +}; +zrUtil.inherits(Group, Element); +var _default = Group; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/BoundingRect.js": +/*!*******************************************************!*\ + !*** ./node_modules/zrender/lib/core/BoundingRect.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var vec2 = __webpack_require__(/*! ./vector */ "./node_modules/zrender/lib/core/vector.js"); + +var matrix = __webpack_require__(/*! ./matrix */ "./node_modules/zrender/lib/core/matrix.js"); + +/** + * @module echarts/core/BoundingRect + */ +var v2ApplyTransform = vec2.applyTransform; +var mathMin = Math.min; +var mathMax = Math.max; +/** + * @alias module:echarts/core/BoundingRect + */ + +function BoundingRect(x, y, width, height) { + if (width < 0) { + x = x + width; + width = -width; + } + + if (height < 0) { + y = y + height; + height = -height; + } + /** + * @type {number} + */ + + + this.x = x; + /** + * @type {number} + */ + + this.y = y; + /** + * @type {number} + */ + + this.width = width; + /** + * @type {number} + */ + + this.height = height; +} + +BoundingRect.prototype = { + constructor: BoundingRect, + + /** + * @param {module:echarts/core/BoundingRect} other + */ + union: function (other) { + var x = mathMin(other.x, this.x); + var y = mathMin(other.y, this.y); + this.width = mathMax(other.x + other.width, this.x + this.width) - x; + this.height = mathMax(other.y + other.height, this.y + this.height) - y; + this.x = x; + this.y = y; + }, + + /** + * @param {Array.} m + * @methods + */ + applyTransform: function () { + var lt = []; + var rb = []; + var lb = []; + var rt = []; + return function (m) { + // In case usage like this + // el.getBoundingRect().applyTransform(el.transform) + // And element has no transform + if (!m) { + return; + } + + lt[0] = lb[0] = this.x; + lt[1] = rt[1] = this.y; + rb[0] = rt[0] = this.x + this.width; + rb[1] = lb[1] = this.y + this.height; + v2ApplyTransform(lt, lt, m); + v2ApplyTransform(rb, rb, m); + v2ApplyTransform(lb, lb, m); + v2ApplyTransform(rt, rt, m); + this.x = mathMin(lt[0], rb[0], lb[0], rt[0]); + this.y = mathMin(lt[1], rb[1], lb[1], rt[1]); + var maxX = mathMax(lt[0], rb[0], lb[0], rt[0]); + var maxY = mathMax(lt[1], rb[1], lb[1], rt[1]); + this.width = maxX - this.x; + this.height = maxY - this.y; + }; + }(), + + /** + * Calculate matrix of transforming from self to target rect + * @param {module:zrender/core/BoundingRect} b + * @return {Array.} + */ + calculateTransform: function (b) { + var a = this; + var sx = b.width / a.width; + var sy = b.height / a.height; + var m = matrix.create(); // 矩阵右乘 + + matrix.translate(m, m, [-a.x, -a.y]); + matrix.scale(m, m, [sx, sy]); + matrix.translate(m, m, [b.x, b.y]); + return m; + }, + + /** + * @param {(module:echarts/core/BoundingRect|Object)} b + * @return {boolean} + */ + intersect: function (b) { + if (!b) { + return false; + } + + if (!(b instanceof BoundingRect)) { + // Normalize negative width/height. + b = BoundingRect.create(b); + } + + var a = this; + var ax0 = a.x; + var ax1 = a.x + a.width; + var ay0 = a.y; + var ay1 = a.y + a.height; + var bx0 = b.x; + var bx1 = b.x + b.width; + var by0 = b.y; + var by1 = b.y + b.height; + return !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); + }, + contain: function (x, y) { + var rect = this; + return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height; + }, + + /** + * @return {module:echarts/core/BoundingRect} + */ + clone: function () { + return new BoundingRect(this.x, this.y, this.width, this.height); + }, + + /** + * Copy from another rect + */ + copy: function (other) { + this.x = other.x; + this.y = other.y; + this.width = other.width; + this.height = other.height; + }, + plain: function () { + return { + x: this.x, + y: this.y, + width: this.width, + height: this.height + }; + } +}; +/** + * @param {Object|module:zrender/core/BoundingRect} rect + * @param {number} rect.x + * @param {number} rect.y + * @param {number} rect.width + * @param {number} rect.height + * @return {module:zrender/core/BoundingRect} + */ + +BoundingRect.create = function (rect) { + return new BoundingRect(rect.x, rect.y, rect.width, rect.height); +}; + +var _default = BoundingRect; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/LRU.js": +/*!**********************************************!*\ + !*** ./node_modules/zrender/lib/core/LRU.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// Simple LRU cache use doubly linked list +// @module zrender/core/LRU + +/** + * Simple double linked list. Compared with array, it has O(1) remove operation. + * @constructor + */ +var LinkedList = function () { + /** + * @type {module:zrender/core/LRU~Entry} + */ + this.head = null; + /** + * @type {module:zrender/core/LRU~Entry} + */ + + this.tail = null; + this._len = 0; +}; + +var linkedListProto = LinkedList.prototype; +/** + * Insert a new value at the tail + * @param {} val + * @return {module:zrender/core/LRU~Entry} + */ + +linkedListProto.insert = function (val) { + var entry = new Entry(val); + this.insertEntry(entry); + return entry; +}; +/** + * Insert an entry at the tail + * @param {module:zrender/core/LRU~Entry} entry + */ + + +linkedListProto.insertEntry = function (entry) { + if (!this.head) { + this.head = this.tail = entry; + } else { + this.tail.next = entry; + entry.prev = this.tail; + entry.next = null; + this.tail = entry; + } + + this._len++; +}; +/** + * Remove entry. + * @param {module:zrender/core/LRU~Entry} entry + */ + + +linkedListProto.remove = function (entry) { + var prev = entry.prev; + var next = entry.next; + + if (prev) { + prev.next = next; + } else { + // Is head + this.head = next; + } + + if (next) { + next.prev = prev; + } else { + // Is tail + this.tail = prev; + } + + entry.next = entry.prev = null; + this._len--; +}; +/** + * @return {number} + */ + + +linkedListProto.len = function () { + return this._len; +}; +/** + * Clear list + */ + + +linkedListProto.clear = function () { + this.head = this.tail = null; + this._len = 0; +}; +/** + * @constructor + * @param {} val + */ + + +var Entry = function (val) { + /** + * @type {} + */ + this.value = val; + /** + * @type {module:zrender/core/LRU~Entry} + */ + + this.next; + /** + * @type {module:zrender/core/LRU~Entry} + */ + + this.prev; +}; +/** + * LRU Cache + * @constructor + * @alias module:zrender/core/LRU + */ + + +var LRU = function (maxSize) { + this._list = new LinkedList(); + this._map = {}; + this._maxSize = maxSize || 10; + this._lastRemovedEntry = null; +}; + +var LRUProto = LRU.prototype; +/** + * @param {string} key + * @param {} value + * @return {} Removed value + */ + +LRUProto.put = function (key, value) { + var list = this._list; + var map = this._map; + var removed = null; + + if (map[key] == null) { + var len = list.len(); // Reuse last removed entry + + var entry = this._lastRemovedEntry; + + if (len >= this._maxSize && len > 0) { + // Remove the least recently used + var leastUsedEntry = list.head; + list.remove(leastUsedEntry); + delete map[leastUsedEntry.key]; + removed = leastUsedEntry.value; + this._lastRemovedEntry = leastUsedEntry; + } + + if (entry) { + entry.value = value; + } else { + entry = new Entry(value); + } + + entry.key = key; + list.insertEntry(entry); + map[key] = entry; + } + + return removed; +}; +/** + * @param {string} key + * @return {} + */ + + +LRUProto.get = function (key) { + var entry = this._map[key]; + var list = this._list; + + if (entry != null) { + // Put the latest used entry in the tail + if (entry !== list.tail) { + list.remove(entry); + list.insertEntry(entry); + } + + return entry.value; + } +}; +/** + * Clear the cache + */ + + +LRUProto.clear = function () { + this._list.clear(); + + this._map = {}; +}; + +var _default = LRU; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/PathProxy.js": +/*!****************************************************!*\ + !*** ./node_modules/zrender/lib/core/PathProxy.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var curve = __webpack_require__(/*! ./curve */ "./node_modules/zrender/lib/core/curve.js"); + +var vec2 = __webpack_require__(/*! ./vector */ "./node_modules/zrender/lib/core/vector.js"); + +var bbox = __webpack_require__(/*! ./bbox */ "./node_modules/zrender/lib/core/bbox.js"); + +var BoundingRect = __webpack_require__(/*! ./BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +var _config = __webpack_require__(/*! ../config */ "./node_modules/zrender/lib/config.js"); + +var dpr = _config.devicePixelRatio; + +/** + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/core/PathProxy + * @author Yi Shen (http://www.github.com/pissang) + */ +// TODO getTotalLength, getPointAtLength + +/* global Float32Array */ +var CMD = { + M: 1, + L: 2, + C: 3, + Q: 4, + A: 5, + Z: 6, + // Rect + R: 7 +}; // var CMD_MEM_SIZE = { +// M: 3, +// L: 3, +// C: 7, +// Q: 5, +// A: 9, +// R: 5, +// Z: 1 +// }; + +var min = []; +var max = []; +var min2 = []; +var max2 = []; +var mathMin = Math.min; +var mathMax = Math.max; +var mathCos = Math.cos; +var mathSin = Math.sin; +var mathSqrt = Math.sqrt; +var mathAbs = Math.abs; +var hasTypedArray = typeof Float32Array !== 'undefined'; +/** + * @alias module:zrender/core/PathProxy + * @constructor + */ + +var PathProxy = function (notSaveData) { + this._saveData = !(notSaveData || false); + + if (this._saveData) { + /** + * Path data. Stored as flat array + * @type {Array.} + */ + this.data = []; + } + + this._ctx = null; +}; +/** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ + + +PathProxy.prototype = { + constructor: PathProxy, + _xi: 0, + _yi: 0, + _x0: 0, + _y0: 0, + // Unit x, Unit y. Provide for avoiding drawing that too short line segment + _ux: 0, + _uy: 0, + _len: 0, + _lineDash: null, + _dashOffset: 0, + _dashIdx: 0, + _dashSum: 0, + + /** + * @readOnly + */ + setScale: function (sx, sy, segmentIgnoreThreshold) { + // Compat. Previously there is no segmentIgnoreThreshold. + segmentIgnoreThreshold = segmentIgnoreThreshold || 0; + this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0; + this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0; + }, + getContext: function () { + return this._ctx; + }, + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {module:zrender/core/PathProxy} + */ + beginPath: function (ctx) { + this._ctx = ctx; + ctx && ctx.beginPath(); + ctx && (this.dpr = ctx.dpr); // Reset + + if (this._saveData) { + this._len = 0; + } + + if (this._lineDash) { + this._lineDash = null; + this._dashOffset = 0; + } + + return this; + }, + + /** + * @param {number} x + * @param {number} y + * @return {module:zrender/core/PathProxy} + */ + moveTo: function (x, y) { + this.addData(CMD.M, x, y); + this._ctx && this._ctx.moveTo(x, y); // x0, y0, xi, yi 是记录在 _dashedXXXXTo 方法中使用 + // xi, yi 记录当前点, x0, y0 在 closePath 的时候回到起始点。 + // 有可能在 beginPath 之后直接调用 lineTo,这时候 x0, y0 需要 + // 在 lineTo 方法中记录,这里先不考虑这种情况,dashed line 也只在 IE10- 中不支持 + + this._x0 = x; + this._y0 = y; + this._xi = x; + this._yi = y; + return this; + }, + + /** + * @param {number} x + * @param {number} y + * @return {module:zrender/core/PathProxy} + */ + lineTo: function (x, y) { + var exceedUnit = mathAbs(x - this._xi) > this._ux || mathAbs(y - this._yi) > this._uy // Force draw the first segment + || this._len < 5; + this.addData(CMD.L, x, y); + + if (this._ctx && exceedUnit) { + this._needsDash() ? this._dashedLineTo(x, y) : this._ctx.lineTo(x, y); + } + + if (exceedUnit) { + this._xi = x; + this._yi = y; + } + + return this; + }, + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {module:zrender/core/PathProxy} + */ + bezierCurveTo: function (x1, y1, x2, y2, x3, y3) { + this.addData(CMD.C, x1, y1, x2, y2, x3, y3); + + if (this._ctx) { + this._needsDash() ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3) : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + + this._xi = x3; + this._yi = y3; + return this; + }, + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {module:zrender/core/PathProxy} + */ + quadraticCurveTo: function (x1, y1, x2, y2) { + this.addData(CMD.Q, x1, y1, x2, y2); + + if (this._ctx) { + this._needsDash() ? this._dashedQuadraticTo(x1, y1, x2, y2) : this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + + this._xi = x2; + this._yi = y2; + return this; + }, + + /** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {module:zrender/core/PathProxy} + */ + arc: function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.addData(CMD.A, cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1); + this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + this._xi = mathCos(endAngle) * r + cx; + this._yi = mathSin(endAngle) * r + cy; + return this; + }, + // TODO + arcTo: function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + + return this; + }, + // TODO + rect: function (x, y, w, h) { + this._ctx && this._ctx.rect(x, y, w, h); + this.addData(CMD.R, x, y, w, h); + return this; + }, + + /** + * @return {module:zrender/core/PathProxy} + */ + closePath: function () { + this.addData(CMD.Z); + var ctx = this._ctx; + var x0 = this._x0; + var y0 = this._y0; + + if (ctx) { + this._needsDash() && this._dashedLineTo(x0, y0); + ctx.closePath(); + } + + this._xi = x0; + this._yi = y0; + return this; + }, + + /** + * Context 从外部传入,因为有可能是 rebuildPath 完之后再 fill。 + * stroke 同样 + * @param {CanvasRenderingContext2D} ctx + * @return {module:zrender/core/PathProxy} + */ + fill: function (ctx) { + ctx && ctx.fill(); + this.toStatic(); + }, + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {module:zrender/core/PathProxy} + */ + stroke: function (ctx) { + ctx && ctx.stroke(); + this.toStatic(); + }, + + /** + * 必须在其它绘制命令前调用 + * Must be invoked before all other path drawing methods + * @return {module:zrender/core/PathProxy} + */ + setLineDash: function (lineDash) { + if (lineDash instanceof Array) { + this._lineDash = lineDash; + this._dashIdx = 0; + var lineDashSum = 0; + + for (var i = 0; i < lineDash.length; i++) { + lineDashSum += lineDash[i]; + } + + this._dashSum = lineDashSum; + } + + return this; + }, + + /** + * 必须在其它绘制命令前调用 + * Must be invoked before all other path drawing methods + * @return {module:zrender/core/PathProxy} + */ + setLineDashOffset: function (offset) { + this._dashOffset = offset; + return this; + }, + + /** + * + * @return {boolean} + */ + len: function () { + return this._len; + }, + + /** + * 直接设置 Path 数据 + */ + setData: function (data) { + var len = data.length; + + if (!(this.data && this.data.length === len) && hasTypedArray) { + this.data = new Float32Array(len); + } + + for (var i = 0; i < len; i++) { + this.data[i] = data[i]; + } + + this._len = len; + }, + + /** + * 添加子路径 + * @param {module:zrender/core/PathProxy|Array.} path + */ + appendPath: function (path) { + if (!(path instanceof Array)) { + path = [path]; + } + + var len = path.length; + var appendSize = 0; + var offset = this._len; + + for (var i = 0; i < len; i++) { + appendSize += path[i].len(); + } + + if (hasTypedArray && this.data instanceof Float32Array) { + this.data = new Float32Array(offset + appendSize); + } + + for (var i = 0; i < len; i++) { + var appendPathData = path[i].data; + + for (var k = 0; k < appendPathData.length; k++) { + this.data[offset++] = appendPathData[k]; + } + } + + this._len = offset; + }, + + /** + * 填充 Path 数据。 + * 尽量复用而不申明新的数组。大部分图形重绘的指令数据长度都是不变的。 + */ + addData: function (cmd) { + if (!this._saveData) { + return; + } + + var data = this.data; + + if (this._len + arguments.length > data.length) { + // 因为之前的数组已经转换成静态的 Float32Array + // 所以不够用时需要扩展一个新的动态数组 + this._expandData(); + + data = this.data; + } + + for (var i = 0; i < arguments.length; i++) { + data[this._len++] = arguments[i]; + } + + this._prevCmd = cmd; + }, + _expandData: function () { + // Only if data is Float32Array + if (!(this.data instanceof Array)) { + var newData = []; + + for (var i = 0; i < this._len; i++) { + newData[i] = this.data[i]; + } + + this.data = newData; + } + }, + + /** + * If needs js implemented dashed line + * @return {boolean} + * @private + */ + _needsDash: function () { + return this._lineDash; + }, + _dashedLineTo: function (x1, y1) { + var dashSum = this._dashSum; + var offset = this._dashOffset; + var lineDash = this._lineDash; + var ctx = this._ctx; + var x0 = this._xi; + var y0 = this._yi; + var dx = x1 - x0; + var dy = y1 - y0; + var dist = mathSqrt(dx * dx + dy * dy); + var x = x0; + var y = y0; + var dash; + var nDash = lineDash.length; + var idx; + dx /= dist; + dy /= dist; + + if (offset < 0) { + // Convert to positive offset + offset = dashSum + offset; + } + + offset %= dashSum; + x -= offset * dx; + y -= offset * dy; + + while (dx > 0 && x <= x1 || dx < 0 && x >= x1 || dx === 0 && (dy > 0 && y <= y1 || dy < 0 && y >= y1)) { + idx = this._dashIdx; + dash = lineDash[idx]; + x += dx * dash; + y += dy * dash; + this._dashIdx = (idx + 1) % nDash; // Skip positive offset + + if (dx > 0 && x < x0 || dx < 0 && x > x0 || dy > 0 && y < y0 || dy < 0 && y > y0) { + continue; + } + + ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin(x, x1) : mathMax(x, x1), dy >= 0 ? mathMin(y, y1) : mathMax(y, y1)); + } // Offset for next lineTo + + + dx = x - x1; + dy = y - y1; + this._dashOffset = -mathSqrt(dx * dx + dy * dy); + }, + // Not accurate dashed line to + _dashedBezierTo: function (x1, y1, x2, y2, x3, y3) { + var dashSum = this._dashSum; + var offset = this._dashOffset; + var lineDash = this._lineDash; + var ctx = this._ctx; + var x0 = this._xi; + var y0 = this._yi; + var t; + var dx; + var dy; + var cubicAt = curve.cubicAt; + var bezierLen = 0; + var idx = this._dashIdx; + var nDash = lineDash.length; + var x; + var y; + var tmpLen = 0; + + if (offset < 0) { + // Convert to positive offset + offset = dashSum + offset; + } + + offset %= dashSum; // Bezier approx length + + for (t = 0; t < 1; t += 0.1) { + dx = cubicAt(x0, x1, x2, x3, t + 0.1) - cubicAt(x0, x1, x2, x3, t); + dy = cubicAt(y0, y1, y2, y3, t + 0.1) - cubicAt(y0, y1, y2, y3, t); + bezierLen += mathSqrt(dx * dx + dy * dy); + } // Find idx after add offset + + + for (; idx < nDash; idx++) { + tmpLen += lineDash[idx]; + + if (tmpLen > offset) { + break; + } + } + + t = (tmpLen - offset) / bezierLen; + + while (t <= 1) { + x = cubicAt(x0, x1, x2, x3, t); + y = cubicAt(y0, y1, y2, y3, t); // Use line to approximate dashed bezier + // Bad result if dash is long + + idx % 2 ? ctx.moveTo(x, y) : ctx.lineTo(x, y); + t += lineDash[idx] / bezierLen; + idx = (idx + 1) % nDash; + } // Finish the last segment and calculate the new offset + + + idx % 2 !== 0 && ctx.lineTo(x3, y3); + dx = x3 - x; + dy = y3 - y; + this._dashOffset = -mathSqrt(dx * dx + dy * dy); + }, + _dashedQuadraticTo: function (x1, y1, x2, y2) { + // Convert quadratic to cubic using degree elevation + var x3 = x2; + var y3 = y2; + x2 = (x2 + 2 * x1) / 3; + y2 = (y2 + 2 * y1) / 3; + x1 = (this._xi + 2 * x1) / 3; + y1 = (this._yi + 2 * y1) / 3; + + this._dashedBezierTo(x1, y1, x2, y2, x3, y3); + }, + + /** + * 转成静态的 Float32Array 减少堆内存占用 + * Convert dynamic array to static Float32Array + */ + toStatic: function () { + var data = this.data; + + if (data instanceof Array) { + data.length = this._len; + + if (hasTypedArray) { + this.data = new Float32Array(data); + } + } + }, + + /** + * @return {module:zrender/core/BoundingRect} + */ + getBoundingRect: function () { + min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE; + max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE; + var data = this.data; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + + for (var i = 0; i < data.length;) { + var cmd = data[i++]; + + if (i === 1) { + // 如果第一个命令是 L, C, Q + // 则 previous point 同绘制命令的第一个 point + // + // 第一个命令为 Arc 的情况下会在后面特殊处理 + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + + switch (cmd) { + case CMD.M: + // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 + // 在 closePath 的时候使用 + x0 = data[i++]; + y0 = data[i++]; + xi = x0; + yi = y0; + min2[0] = x0; + min2[1] = y0; + max2[0] = x0; + max2[1] = y0; + break; + + case CMD.L: + bbox.fromLine(xi, yi, data[i], data[i + 1], min2, max2); + xi = data[i++]; + yi = data[i++]; + break; + + case CMD.C: + bbox.fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2); + xi = data[i++]; + yi = data[i++]; + break; + + case CMD.Q: + bbox.fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2); + xi = data[i++]; + yi = data[i++]; + break; + + case CMD.A: + // TODO Arc 判断的开销比较大 + var cx = data[i++]; + var cy = data[i++]; + var rx = data[i++]; + var ry = data[i++]; + var startAngle = data[i++]; + var endAngle = data[i++] + startAngle; // TODO Arc 旋转 + + i += 1; + var anticlockwise = 1 - data[i++]; + + if (i === 1) { + // 直接使用 arc 命令 + // 第一个命令起点还未定义 + x0 = mathCos(startAngle) * rx + cx; + y0 = mathSin(startAngle) * ry + cy; + } + + bbox.fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2); + xi = mathCos(endAngle) * rx + cx; + yi = mathSin(endAngle) * ry + cy; + break; + + case CMD.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + var width = data[i++]; + var height = data[i++]; // Use fromLine + + bbox.fromLine(x0, y0, x0 + width, y0 + height, min2, max2); + break; + + case CMD.Z: + xi = x0; + yi = y0; + break; + } // Union + + + vec2.min(min, min, min2); + vec2.max(max, max, max2); + } // No data + + + if (i === 0) { + min[0] = min[1] = max[0] = max[1] = 0; + } + + return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); + }, + + /** + * Rebuild path from current data + * Rebuild path will not consider javascript implemented line dash. + * @param {CanvasRenderingContext2D} ctx + */ + rebuildPath: function (ctx) { + var d = this.data; + var x0; + var y0; + var xi; + var yi; + var x; + var y; + var ux = this._ux; + var uy = this._uy; + var len = this._len; + + for (var i = 0; i < len;) { + var cmd = d[i++]; + + if (i === 1) { + // 如果第一个命令是 L, C, Q + // 则 previous point 同绘制命令的第一个 point + // + // 第一个命令为 Arc 的情况下会在后面特殊处理 + xi = d[i]; + yi = d[i + 1]; + x0 = xi; + y0 = yi; + } + + switch (cmd) { + case CMD.M: + x0 = xi = d[i++]; + y0 = yi = d[i++]; + ctx.moveTo(xi, yi); + break; + + case CMD.L: + x = d[i++]; + y = d[i++]; // Not draw too small seg between + + if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) { + ctx.lineTo(x, y); + xi = x; + yi = y; + } + + break; + + case CMD.C: + ctx.bezierCurveTo(d[i++], d[i++], d[i++], d[i++], d[i++], d[i++]); + xi = d[i - 2]; + yi = d[i - 1]; + break; + + case CMD.Q: + ctx.quadraticCurveTo(d[i++], d[i++], d[i++], d[i++]); + xi = d[i - 2]; + yi = d[i - 1]; + break; + + case CMD.A: + var cx = d[i++]; + var cy = d[i++]; + var rx = d[i++]; + var ry = d[i++]; + var theta = d[i++]; + var dTheta = d[i++]; + var psi = d[i++]; + var fs = d[i++]; + var r = rx > ry ? rx : ry; + var scaleX = rx > ry ? 1 : rx / ry; + var scaleY = rx > ry ? ry / rx : 1; + var isEllipse = Math.abs(rx - ry) > 1e-3; + var endAngle = theta + dTheta; + + if (isEllipse) { + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, endAngle, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + } else { + ctx.arc(cx, cy, r, theta, endAngle, 1 - fs); + } + + if (i === 1) { + // 直接使用 arc 命令 + // 第一个命令起点还未定义 + x0 = mathCos(theta) * rx + cx; + y0 = mathSin(theta) * ry + cy; + } + + xi = mathCos(endAngle) * rx + cx; + yi = mathSin(endAngle) * ry + cy; + break; + + case CMD.R: + x0 = xi = d[i]; + y0 = yi = d[i + 1]; + ctx.rect(d[i++], d[i++], d[i++], d[i++]); + break; + + case CMD.Z: + ctx.closePath(); + xi = x0; + yi = y0; + } + } + } +}; +PathProxy.CMD = CMD; +var _default = PathProxy; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/bbox.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/core/bbox.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var vec2 = __webpack_require__(/*! ./vector */ "./node_modules/zrender/lib/core/vector.js"); + +var curve = __webpack_require__(/*! ./curve */ "./node_modules/zrender/lib/core/curve.js"); + +/** + * @author Yi Shen(https://github.com/pissang) + */ +var mathMin = Math.min; +var mathMax = Math.max; +var mathSin = Math.sin; +var mathCos = Math.cos; +var PI2 = Math.PI * 2; +var start = vec2.create(); +var end = vec2.create(); +var extremity = vec2.create(); +/** + * 从顶点数组中计算出最小包围盒,写入`min`和`max`中 + * @module zrender/core/bbox + * @param {Array} points 顶点数组 + * @param {number} min + * @param {number} max + */ + +function fromPoints(points, min, max) { + if (points.length === 0) { + return; + } + + var p = points[0]; + var left = p[0]; + var right = p[0]; + var top = p[1]; + var bottom = p[1]; + var i; + + for (i = 1; i < points.length; i++) { + p = points[i]; + left = mathMin(left, p[0]); + right = mathMax(right, p[0]); + top = mathMin(top, p[1]); + bottom = mathMax(bottom, p[1]); + } + + min[0] = left; + min[1] = top; + max[0] = right; + max[1] = bottom; +} +/** + * @memberOf module:zrender/core/bbox + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {Array.} min + * @param {Array.} max + */ + + +function fromLine(x0, y0, x1, y1, min, max) { + min[0] = mathMin(x0, x1); + min[1] = mathMin(y0, y1); + max[0] = mathMax(x0, x1); + max[1] = mathMax(y0, y1); +} + +var xDim = []; +var yDim = []; +/** + * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中 + * @memberOf module:zrender/core/bbox + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {Array.} min + * @param {Array.} max + */ + +function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) { + var cubicExtrema = curve.cubicExtrema; + var cubicAt = curve.cubicAt; + var i; + var n = cubicExtrema(x0, x1, x2, x3, xDim); + min[0] = Infinity; + min[1] = Infinity; + max[0] = -Infinity; + max[1] = -Infinity; + + for (i = 0; i < n; i++) { + var x = cubicAt(x0, x1, x2, x3, xDim[i]); + min[0] = mathMin(x, min[0]); + max[0] = mathMax(x, max[0]); + } + + n = cubicExtrema(y0, y1, y2, y3, yDim); + + for (i = 0; i < n; i++) { + var y = cubicAt(y0, y1, y2, y3, yDim[i]); + min[1] = mathMin(y, min[1]); + max[1] = mathMax(y, max[1]); + } + + min[0] = mathMin(x0, min[0]); + max[0] = mathMax(x0, max[0]); + min[0] = mathMin(x3, min[0]); + max[0] = mathMax(x3, max[0]); + min[1] = mathMin(y0, min[1]); + max[1] = mathMax(y0, max[1]); + min[1] = mathMin(y3, min[1]); + max[1] = mathMax(y3, max[1]); +} +/** + * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中 + * @memberOf module:zrender/core/bbox + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {Array.} min + * @param {Array.} max + */ + + +function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) { + var quadraticExtremum = curve.quadraticExtremum; + var quadraticAt = curve.quadraticAt; // Find extremities, where derivative in x dim or y dim is zero + + var tx = mathMax(mathMin(quadraticExtremum(x0, x1, x2), 1), 0); + var ty = mathMax(mathMin(quadraticExtremum(y0, y1, y2), 1), 0); + var x = quadraticAt(x0, x1, x2, tx); + var y = quadraticAt(y0, y1, y2, ty); + min[0] = mathMin(x0, x2, x); + min[1] = mathMin(y0, y2, y); + max[0] = mathMax(x0, x2, x); + max[1] = mathMax(y0, y2, y); +} +/** + * 从圆弧中计算出最小包围盒,写入`min`和`max`中 + * @method + * @memberOf module:zrender/core/bbox + * @param {number} x + * @param {number} y + * @param {number} rx + * @param {number} ry + * @param {number} startAngle + * @param {number} endAngle + * @param {number} anticlockwise + * @param {Array.} min + * @param {Array.} max + */ + + +function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max) { + var vec2Min = vec2.min; + var vec2Max = vec2.max; + var diff = Math.abs(startAngle - endAngle); + + if (diff % PI2 < 1e-4 && diff > 1e-4) { + // Is a circle + min[0] = x - rx; + min[1] = y - ry; + max[0] = x + rx; + max[1] = y + ry; + return; + } + + start[0] = mathCos(startAngle) * rx + x; + start[1] = mathSin(startAngle) * ry + y; + end[0] = mathCos(endAngle) * rx + x; + end[1] = mathSin(endAngle) * ry + y; + vec2Min(min, start, end); + vec2Max(max, start, end); // Thresh to [0, Math.PI * 2] + + startAngle = startAngle % PI2; + + if (startAngle < 0) { + startAngle = startAngle + PI2; + } + + endAngle = endAngle % PI2; + + if (endAngle < 0) { + endAngle = endAngle + PI2; + } + + if (startAngle > endAngle && !anticlockwise) { + endAngle += PI2; + } else if (startAngle < endAngle && anticlockwise) { + startAngle += PI2; + } + + if (anticlockwise) { + var tmp = endAngle; + endAngle = startAngle; + startAngle = tmp; + } // var number = 0; + // var step = (anticlockwise ? -Math.PI : Math.PI) / 2; + + + for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { + if (angle > startAngle) { + extremity[0] = mathCos(angle) * rx + x; + extremity[1] = mathSin(angle) * ry + y; + vec2Min(min, extremity, min); + vec2Max(max, extremity, max); + } + } +} + +exports.fromPoints = fromPoints; +exports.fromLine = fromLine; +exports.fromCubic = fromCubic; +exports.fromQuadratic = fromQuadratic; +exports.fromArc = fromArc; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/curve.js": +/*!************************************************!*\ + !*** ./node_modules/zrender/lib/core/curve.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _vector = __webpack_require__(/*! ./vector */ "./node_modules/zrender/lib/core/vector.js"); + +var v2Create = _vector.create; +var v2DistSquare = _vector.distSquare; + +/** + * 曲线辅助模块 + * @module zrender/core/curve + * @author pissang(https://www.github.com/pissang) + */ +var mathPow = Math.pow; +var mathSqrt = Math.sqrt; +var EPSILON = 1e-8; +var EPSILON_NUMERIC = 1e-4; +var THREE_SQRT = mathSqrt(3); +var ONE_THIRD = 1 / 3; // 临时变量 + +var _v0 = v2Create(); + +var _v1 = v2Create(); + +var _v2 = v2Create(); + +function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; +} + +function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; +} +/** + * 计算三次贝塞尔值 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + + +function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2); +} +/** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + + +function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t); +} +/** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + + +function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + var n = 0; + + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } else { + var t1 = -c / b; //t1, t2, t3, b is not zero + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } else { + var disc = B * B - 4 * A * C; + + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + + var t2 = -K / 2; // t2, t3 + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } else if (disc > 0) { + var discSqrt = mathSqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + + if (Y1 < 0) { + Y1 = -mathPow(-Y1, ONE_THIRD); + } else { + Y1 = mathPow(Y1, ONE_THIRD); + } + + if (Y2 < 0) { + Y2 = -mathPow(-Y2, ONE_THIRD); + } else { + Y2 = mathPow(Y2, ONE_THIRD); + } + + var t1 = (-b - (Y1 + Y2)) / (3 * a); + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } else { + var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = mathSqrt(A); + var tmp = Math.cos(theta); + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + + return n; +} +/** + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 + */ + + +function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + var n = 0; + + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + } + } else { + var disc = b * b - 4 * a * c; + + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } else if (disc > 0) { + var discSqrt = mathSqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + + return n; +} +/** + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out + */ + + +function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + var p0123 = (p123 - p012) * t + p012; // Seg0 + + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; // Seg1 + + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; +} +/** + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} + */ + + +function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + var prev; + var next; + var d1; + var d2; + _v0[0] = x; + _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + d1 = v2DistSquare(_v0, _v1); + + if (d1 < d) { + t = _t; + d = d1; + } + } + + d = Infinity; // At most 32 iteration + + for (var i = 0; i < 32; i++) { + if (interval < EPSILON_NUMERIC) { + break; + } + + prev = t - interval; + next = t + interval; // t - interval + + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + d1 = v2DistSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + d2 = v2DistSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } // t + + + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } // console.log(interval, i); + + + return mathSqrt(d); +} +/** + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + + +function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; +} +/** + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + + +function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); +} +/** + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 + */ + + +function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + var n = 0; + + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } else { + var disc = b * b - 4 * a * c; + + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } else if (disc > 0) { + var discSqrt = mathSqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + + return n; +} +/** + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} + */ + + +function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; + } else { + return (p0 - p1) / divider; + } +} +/** + * 细分二次贝塞尔曲线 + * @memberOf module:zrender/core/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} out + */ + + +function quadraticSubdivide(p0, p1, p2, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p012 = (p12 - p01) * t + p01; // Seg0 + + out[0] = p0; + out[1] = p01; + out[2] = p012; // Seg1 + + out[3] = p012; + out[4] = p12; + out[5] = p2; +} +/** + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} + */ + + +function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + _v0[0] = x; + _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = v2DistSquare(_v0, _v1); + + if (d1 < d) { + t = _t; + d = d1; + } + } + + d = Infinity; // At most 32 iteration + + for (var i = 0; i < 32; i++) { + if (interval < EPSILON_NUMERIC) { + break; + } + + var prev = t - interval; + var next = t + interval; // t - interval + + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + var d1 = v2DistSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = v2DistSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } // t + + + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } // console.log(interval, i); + + + return mathSqrt(d); +} + +exports.cubicAt = cubicAt; +exports.cubicDerivativeAt = cubicDerivativeAt; +exports.cubicRootAt = cubicRootAt; +exports.cubicExtrema = cubicExtrema; +exports.cubicSubdivide = cubicSubdivide; +exports.cubicProjectPoint = cubicProjectPoint; +exports.quadraticAt = quadraticAt; +exports.quadraticDerivativeAt = quadraticDerivativeAt; +exports.quadraticRootAt = quadraticRootAt; +exports.quadraticExtremum = quadraticExtremum; +exports.quadraticSubdivide = quadraticSubdivide; +exports.quadraticProjectPoint = quadraticProjectPoint; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/env.js": +/*!**********************************************!*\ + !*** ./node_modules/zrender/lib/core/env.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * echarts设备环境识别 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author firede[firede@firede.us] + * @desc thanks zepto. + */ + +/* global wx */ +var env = {}; + +if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') { + // In Weixin Application + env = { + browser: {}, + os: {}, + node: false, + wxa: true, + // Weixin Application + canvasSupported: true, + svgSupported: false, + touchEventsSupported: true, + domSupported: false + }; +} else if (typeof document === 'undefined' && typeof self !== 'undefined') { + // In worker + env = { + browser: {}, + os: {}, + node: false, + worker: true, + canvasSupported: true, + domSupported: false + }; +} else if (typeof navigator === 'undefined') { + // In node + env = { + browser: {}, + os: {}, + node: true, + worker: false, + // Assume canvas is supported + canvasSupported: true, + svgSupported: true, + domSupported: false + }; +} else { + env = detect(navigator.userAgent); +} + +var _default = env; // Zepto.js +// (c) 2010-2013 Thomas Fuchs +// Zepto.js may be freely distributed under the MIT license. + +function detect(ua) { + var os = {}; + var browser = {}; // var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); + // var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + // var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + // var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + // var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); + // var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); + // var touchpad = webos && ua.match(/TouchPad/); + // var kindle = ua.match(/Kindle\/([\d.]+)/); + // var silk = ua.match(/Silk\/([\d._]+)/); + // var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); + // var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); + // var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); + // var playbook = ua.match(/PlayBook/); + // var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); + + var firefox = ua.match(/Firefox\/([\d.]+)/); // var safari = webkit && ua.match(/Mobile\//) && !chrome; + // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; + + var ie = ua.match(/MSIE\s([\d.]+)/) // IE 11 Trident/7.0; rv:11.0 + || ua.match(/Trident\/.+?rv:(([\d.]+))/); + var edge = ua.match(/Edge\/([\d.]+)/); // IE 12 and 12+ + + var weChat = /micromessenger/i.test(ua); // Todo: clean this up with a better OS/browser seperation: + // - discern (more) between multiple browsers on android + // - decide if kindle fire in silk mode is android or not + // - Firefox on Android doesn't specify the Android version + // - possibly devide in os, device and browser hashes + // if (browser.webkit = !!webkit) browser.version = webkit[1]; + // if (android) os.android = true, os.version = android[2]; + // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); + // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); + // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + // if (webos) os.webos = true, os.version = webos[2]; + // if (touchpad) os.touchpad = true; + // if (blackberry) os.blackberry = true, os.version = blackberry[2]; + // if (bb10) os.bb10 = true, os.version = bb10[2]; + // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; + // if (playbook) browser.playbook = true; + // if (kindle) os.kindle = true, os.version = kindle[1]; + // if (silk) browser.silk = true, browser.version = silk[1]; + // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; + // if (chrome) browser.chrome = true, browser.version = chrome[1]; + + if (firefox) { + browser.firefox = true; + browser.version = firefox[1]; + } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; + // if (webview) browser.webview = true; + + + if (ie) { + browser.ie = true; + browser.version = ie[1]; + } + + if (edge) { + browser.edge = true; + browser.version = edge[1]; + } // It is difficult to detect WeChat in Win Phone precisely, because ua can + // not be set on win phone. So we do not consider Win Phone. + + + if (weChat) { + browser.weChat = true; + } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || + // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); + // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || + // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || + // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); + + + return { + browser: browser, + os: os, + node: false, + // 原生canvas支持,改极端点了 + // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9) + canvasSupported: !!document.createElement('canvas').getContext, + svgSupported: typeof SVGRect !== 'undefined', + // works on most browsers + // IE10/11 does not support touch event, and MS Edge supports them but not by + // default, so we dont check navigator.maxTouchPoints for them here. + touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge, + // . + pointerEventsSupported: // (1) Firefox supports pointer but not by default, only MS browsers are reliable on pointer + // events currently. So we dont use that on other browsers unless tested sufficiently. + // For example, in iOS 13 Mobile Chromium 78, if the touching behavior starts page + // scroll, the `pointermove` event can not be fired any more. That will break some + // features like "pan horizontally to move something and pan vertically to page scroll". + // The horizontal pan probably be interrupted by the casually triggered page scroll. + // (2) Although IE 10 supports pointer event, it use old style and is different from the + // standard. So we exclude that. (IE 10 is hardly used on touch device) + 'onpointerdown' in window && (browser.edge || browser.ie && browser.version >= 11), + // passiveSupported: detectPassiveSupport() + domSupported: typeof document !== 'undefined' + }; +} // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection +// function detectPassiveSupport() { +// // Test via a getter in the options object to see if the passive property is accessed +// var supportsPassive = false; +// try { +// var opts = Object.defineProperty({}, 'passive', { +// get: function() { +// supportsPassive = true; +// } +// }); +// window.addEventListener('testPassive', function() {}, opts); +// } catch (e) { +// } +// return supportsPassive; +// } + + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/guid.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/core/guid.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * zrender: 生成唯一id + * + * @author errorrik (errorrik@gmail.com) + */ +var idStart = 0x0907; + +function _default() { + return idStart++; +} + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/log.js": +/*!**********************************************!*\ + !*** ./node_modules/zrender/lib/core/log.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _config = __webpack_require__(/*! ../config */ "./node_modules/zrender/lib/config.js"); + +var debugMode = _config.debugMode; + +var logError = function () {}; + +if (debugMode === 1) { + logError = console.error; +} + +var _default = logError; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/matrix.js": +/*!*************************************************!*\ + !*** ./node_modules/zrender/lib/core/matrix.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ + +/* global Float32Array */ +var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; +/** + * Create a identity matrix. + * @return {Float32Array|Array.} + */ + +function create() { + var out = new ArrayCtor(6); + identity(out); + return out; +} +/** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ + + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ + + +function copy(out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; +} +/** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ + + +function mul(out, m1, m2) { + // Consider matrix.mul(m, m2, m); + // where out is the same as m2. + // So use temp variable to escape error. + var out0 = m1[0] * m2[0] + m1[2] * m2[1]; + var out1 = m1[1] * m2[0] + m1[3] * m2[1]; + var out2 = m1[0] * m2[2] + m1[2] * m2[3]; + var out3 = m1[1] * m2[2] + m1[3] * m2[3]; + var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = out3; + out[4] = out4; + out[5] = out5; + return out; +} +/** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + + +function translate(out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; +} +/** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ + + +function rotate(out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; +} +/** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + + +function scale(out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; +} +/** + * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + */ + + +function invert(out, a) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var det = aa * ad - ab * ac; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; +} +/** + * Clone a new matrix. + * @param {Float32Array|Array.} a + */ + + +function clone(a) { + var b = create(); + copy(b, a); + return b; +} + +exports.create = create; +exports.identity = identity; +exports.copy = copy; +exports.mul = mul; +exports.translate = translate; +exports.rotate = rotate; +exports.scale = scale; +exports.invert = invert; +exports.clone = clone; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/util.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/core/util.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @module zrender/core/util + */ +// 用于处理merge时无法遍历Date等对象的问题 +var BUILTIN_OBJECT = { + '[object Function]': 1, + '[object RegExp]': 1, + '[object Date]': 1, + '[object Error]': 1, + '[object CanvasGradient]': 1, + '[object CanvasPattern]': 1, + // For node-canvas + '[object Image]': 1, + '[object Canvas]': 1 +}; +var TYPED_ARRAY = { + '[object Int8Array]': 1, + '[object Uint8Array]': 1, + '[object Uint8ClampedArray]': 1, + '[object Int16Array]': 1, + '[object Uint16Array]': 1, + '[object Int32Array]': 1, + '[object Uint32Array]': 1, + '[object Float32Array]': 1, + '[object Float64Array]': 1 +}; +var objToString = Object.prototype.toString; +var arrayProto = Array.prototype; +var nativeForEach = arrayProto.forEach; +var nativeFilter = arrayProto.filter; +var nativeSlice = arrayProto.slice; +var nativeMap = arrayProto.map; +var nativeReduce = arrayProto.reduce; // Avoid assign to an exported variable, for transforming to cjs. + +var methods = {}; + +function $override(name, fn) { + // Clear ctx instance for different environment + if (name === 'createCanvas') { + _ctx = null; + } + + methods[name] = fn; +} +/** + * Those data types can be cloned: + * Plain object, Array, TypedArray, number, string, null, undefined. + * Those data types will be assgined using the orginal data: + * BUILTIN_OBJECT + * Instance of user defined class will be cloned to a plain object, without + * properties in prototype. + * Other data types is not supported (not sure what will happen). + * + * Caution: do not support clone Date, for performance consideration. + * (There might be a large number of date in `series.data`). + * So date should not be modified in and out of echarts. + * + * @param {*} source + * @return {*} new + */ + + +function clone(source) { + if (source == null || typeof source !== 'object') { + return source; + } + + var result = source; + var typeStr = objToString.call(source); + + if (typeStr === '[object Array]') { + if (!isPrimitive(source)) { + result = []; + + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } + } else if (TYPED_ARRAY[typeStr]) { + if (!isPrimitive(source)) { + var Ctor = source.constructor; + + if (source.constructor.from) { + result = Ctor.from(source); + } else { + result = new Ctor(source.length); + + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } + } + } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) { + result = {}; + + for (var key in source) { + if (source.hasOwnProperty(key)) { + result[key] = clone(source[key]); + } + } + } + + return result; +} +/** + * @memberOf module:zrender/core/util + * @param {*} target + * @param {*} source + * @param {boolean} [overwrite=false] + */ + + +function merge(target, source, overwrite) { + // We should escapse that source is string + // and enter for ... in ... + if (!isObject(source) || !isObject(target)) { + return overwrite ? clone(source) : target; + } + + for (var key in source) { + if (source.hasOwnProperty(key)) { + var targetProp = target[key]; + var sourceProp = source[key]; + + if (isObject(sourceProp) && isObject(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) { + // 如果需要递归覆盖,就递归调用merge + merge(targetProp, sourceProp, overwrite); + } else if (overwrite || !(key in target)) { + // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 + // NOTE,在 target[key] 不存在的时候也是直接覆盖 + target[key] = clone(source[key], true); + } + } + } + + return target; +} +/** + * @param {Array} targetAndSources The first item is target, and the rests are source. + * @param {boolean} [overwrite=false] + * @return {*} target + */ + + +function mergeAll(targetAndSources, overwrite) { + var result = targetAndSources[0]; + + for (var i = 1, len = targetAndSources.length; i < len; i++) { + result = merge(result, targetAndSources[i], overwrite); + } + + return result; +} +/** + * @param {*} target + * @param {*} source + * @memberOf module:zrender/core/util + */ + + +function extend(target, source) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key]; + } + } + + return target; +} +/** + * @param {*} target + * @param {*} source + * @param {boolean} [overlay=false] + * @memberOf module:zrender/core/util + */ + + +function defaults(target, source, overlay) { + for (var key in source) { + if (source.hasOwnProperty(key) && (overlay ? source[key] != null : target[key] == null)) { + target[key] = source[key]; + } + } + + return target; +} + +var createCanvas = function () { + return methods.createCanvas(); +}; + +methods.createCanvas = function () { + return document.createElement('canvas'); +}; // FIXME + + +var _ctx; + +function getContext() { + if (!_ctx) { + // Use util.createCanvas instead of createCanvas + // because createCanvas may be overwritten in different environment + _ctx = createCanvas().getContext('2d'); + } + + return _ctx; +} +/** + * 查询数组中元素的index + * @memberOf module:zrender/core/util + */ + + +function indexOf(array, value) { + if (array) { + if (array.indexOf) { + return array.indexOf(value); + } + + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + } + + return -1; +} +/** + * 构造类继承关系 + * + * @memberOf module:zrender/core/util + * @param {Function} clazz 源类 + * @param {Function} baseClazz 基类 + */ + + +function inherits(clazz, baseClazz) { + var clazzPrototype = clazz.prototype; + + function F() {} + + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + + for (var prop in clazzPrototype) { + if (clazzPrototype.hasOwnProperty(prop)) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + } + + clazz.prototype.constructor = clazz; + clazz.superClass = baseClazz; +} +/** + * @memberOf module:zrender/core/util + * @param {Object|Function} target + * @param {Object|Function} sorce + * @param {boolean} overlay + */ + + +function mixin(target, source, overlay) { + target = 'prototype' in target ? target.prototype : target; + source = 'prototype' in source ? source.prototype : source; + defaults(target, source, overlay); +} +/** + * Consider typed array. + * @param {Array|TypedArray} data + */ + + +function isArrayLike(data) { + if (!data) { + return; + } + + if (typeof data === 'string') { + return false; + } + + return typeof data.length === 'number'; +} +/** + * 数组或对象遍历 + * @memberOf module:zrender/core/util + * @param {Object|Array} obj + * @param {Function} cb + * @param {*} [context] + */ + + +function each(obj, cb, context) { + if (!(obj && cb)) { + return; + } + + if (obj.forEach && obj.forEach === nativeForEach) { + obj.forEach(cb, context); + } else if (obj.length === +obj.length) { + for (var i = 0, len = obj.length; i < len; i++) { + cb.call(context, obj[i], i, obj); + } + } else { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + cb.call(context, obj[key], key, obj); + } + } + } +} +/** + * 数组映射 + * @memberOf module:zrender/core/util + * @param {Array} obj + * @param {Function} cb + * @param {*} [context] + * @return {Array} + */ + + +function map(obj, cb, context) { + if (!(obj && cb)) { + return; + } + + if (obj.map && obj.map === nativeMap) { + return obj.map(cb, context); + } else { + var result = []; + + for (var i = 0, len = obj.length; i < len; i++) { + result.push(cb.call(context, obj[i], i, obj)); + } + + return result; + } +} +/** + * @memberOf module:zrender/core/util + * @param {Array} obj + * @param {Function} cb + * @param {Object} [memo] + * @param {*} [context] + * @return {Array} + */ + + +function reduce(obj, cb, memo, context) { + if (!(obj && cb)) { + return; + } + + if (obj.reduce && obj.reduce === nativeReduce) { + return obj.reduce(cb, memo, context); + } else { + for (var i = 0, len = obj.length; i < len; i++) { + memo = cb.call(context, memo, obj[i], i, obj); + } + + return memo; + } +} +/** + * 数组过滤 + * @memberOf module:zrender/core/util + * @param {Array} obj + * @param {Function} cb + * @param {*} [context] + * @return {Array} + */ + + +function filter(obj, cb, context) { + if (!(obj && cb)) { + return; + } + + if (obj.filter && obj.filter === nativeFilter) { + return obj.filter(cb, context); + } else { + var result = []; + + for (var i = 0, len = obj.length; i < len; i++) { + if (cb.call(context, obj[i], i, obj)) { + result.push(obj[i]); + } + } + + return result; + } +} +/** + * 数组项查找 + * @memberOf module:zrender/core/util + * @param {Array} obj + * @param {Function} cb + * @param {*} [context] + * @return {*} + */ + + +function find(obj, cb, context) { + if (!(obj && cb)) { + return; + } + + for (var i = 0, len = obj.length; i < len; i++) { + if (cb.call(context, obj[i], i, obj)) { + return obj[i]; + } + } +} +/** + * @memberOf module:zrender/core/util + * @param {Function} func + * @param {*} context + * @return {Function} + */ + + +function bind(func, context) { + var args = nativeSlice.call(arguments, 2); + return function () { + return func.apply(context, args.concat(nativeSlice.call(arguments))); + }; +} +/** + * @memberOf module:zrender/core/util + * @param {Function} func + * @return {Function} + */ + + +function curry(func) { + var args = nativeSlice.call(arguments, 1); + return function () { + return func.apply(this, args.concat(nativeSlice.call(arguments))); + }; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isArray(value) { + return objToString.call(value) === '[object Array]'; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isFunction(value) { + return typeof value === 'function'; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isString(value) { + return objToString.call(value) === '[object String]'; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type === 'function' || !!value && type === 'object'; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isBuiltInObject(value) { + return !!BUILTIN_OBJECT[objToString.call(value)]; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isTypedArray(value) { + return !!TYPED_ARRAY[objToString.call(value)]; +} +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ + + +function isDom(value) { + return typeof value === 'object' && typeof value.nodeType === 'number' && typeof value.ownerDocument === 'object'; +} +/** + * Whether is exactly NaN. Notice isNaN('a') returns true. + * @param {*} value + * @return {boolean} + */ + + +function eqNaN(value) { + /* eslint-disable-next-line no-self-compare */ + return value !== value; +} +/** + * If value1 is not null, then return value1, otherwise judget rest of values. + * Low performance. + * @memberOf module:zrender/core/util + * @return {*} Final value + */ + + +function retrieve(values) { + for (var i = 0, len = arguments.length; i < len; i++) { + if (arguments[i] != null) { + return arguments[i]; + } + } +} + +function retrieve2(value0, value1) { + return value0 != null ? value0 : value1; +} + +function retrieve3(value0, value1, value2) { + return value0 != null ? value0 : value1 != null ? value1 : value2; +} +/** + * @memberOf module:zrender/core/util + * @param {Array} arr + * @param {number} startIndex + * @param {number} endIndex + * @return {Array} + */ + + +function slice() { + return Function.call.apply(nativeSlice, arguments); +} +/** + * Normalize css liked array configuration + * e.g. + * 3 => [3, 3, 3, 3] + * [4, 2] => [4, 2, 4, 2] + * [4, 3, 2] => [4, 3, 2, 3] + * @param {number|Array.} val + * @return {Array.} + */ + + +function normalizeCssArray(val) { + if (typeof val === 'number') { + return [val, val, val, val]; + } + + var len = val.length; + + if (len === 2) { + // vertical | horizontal + return [val[0], val[1], val[0], val[1]]; + } else if (len === 3) { + // top | horizontal | bottom + return [val[0], val[1], val[2], val[1]]; + } + + return val; +} +/** + * @memberOf module:zrender/core/util + * @param {boolean} condition + * @param {string} message + */ + + +function assert(condition, message) { + if (!condition) { + throw new Error(message); + } +} +/** + * @memberOf module:zrender/core/util + * @param {string} str string to be trimed + * @return {string} trimed string + */ + + +function trim(str) { + if (str == null) { + return null; + } else if (typeof str.trim === 'function') { + return str.trim(); + } else { + return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + } +} + +var primitiveKey = '__ec_primitive__'; +/** + * Set an object as primitive to be ignored traversing children in clone or merge + */ + +function setAsPrimitive(obj) { + obj[primitiveKey] = true; +} + +function isPrimitive(obj) { + return obj[primitiveKey]; +} +/** + * @constructor + * @param {Object} obj Only apply `ownProperty`. + */ + + +function HashMap(obj) { + var isArr = isArray(obj); // Key should not be set on this, otherwise + // methods get/set/... may be overrided. + + this.data = {}; + var thisMap = this; + obj instanceof HashMap ? obj.each(visit) : obj && each(obj, visit); + + function visit(value, key) { + isArr ? thisMap.set(value, key) : thisMap.set(key, value); + } +} + +HashMap.prototype = { + constructor: HashMap, + // Do not provide `has` method to avoid defining what is `has`. + // (We usually treat `null` and `undefined` as the same, different + // from ES6 Map). + get: function (key) { + return this.data.hasOwnProperty(key) ? this.data[key] : null; + }, + set: function (key, value) { + // Comparing with invocation chaining, `return value` is more commonly + // used in this case: `var someVal = map.set('a', genVal());` + return this.data[key] = value; + }, + // Although util.each can be performed on this hashMap directly, user + // should not use the exposed keys, who are prefixed. + each: function (cb, context) { + context !== void 0 && (cb = bind(cb, context)); + /* eslint-disable guard-for-in */ + + for (var key in this.data) { + this.data.hasOwnProperty(key) && cb(this.data[key], key); + } + /* eslint-enable guard-for-in */ + + }, + // Do not use this method if performance sensitive. + removeKey: function (key) { + delete this.data[key]; + } +}; + +function createHashMap(obj) { + return new HashMap(obj); +} + +function concatArray(a, b) { + var newArray = new a.constructor(a.length + b.length); + + for (var i = 0; i < a.length; i++) { + newArray[i] = a[i]; + } + + var offset = a.length; + + for (i = 0; i < b.length; i++) { + newArray[i + offset] = b[i]; + } + + return newArray; +} + +function noop() {} + +exports.$override = $override; +exports.clone = clone; +exports.merge = merge; +exports.mergeAll = mergeAll; +exports.extend = extend; +exports.defaults = defaults; +exports.createCanvas = createCanvas; +exports.getContext = getContext; +exports.indexOf = indexOf; +exports.inherits = inherits; +exports.mixin = mixin; +exports.isArrayLike = isArrayLike; +exports.each = each; +exports.map = map; +exports.reduce = reduce; +exports.filter = filter; +exports.find = find; +exports.bind = bind; +exports.curry = curry; +exports.isArray = isArray; +exports.isFunction = isFunction; +exports.isString = isString; +exports.isObject = isObject; +exports.isBuiltInObject = isBuiltInObject; +exports.isTypedArray = isTypedArray; +exports.isDom = isDom; +exports.eqNaN = eqNaN; +exports.retrieve = retrieve; +exports.retrieve2 = retrieve2; +exports.retrieve3 = retrieve3; +exports.slice = slice; +exports.normalizeCssArray = normalizeCssArray; +exports.assert = assert; +exports.trim = trim; +exports.setAsPrimitive = setAsPrimitive; +exports.isPrimitive = isPrimitive; +exports.createHashMap = createHashMap; +exports.concatArray = concatArray; +exports.noop = noop; + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/vector.js": +/*!*************************************************!*\ + !*** ./node_modules/zrender/lib/core/vector.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* global Float32Array */ +var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; +/** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Vector2} + */ + +function create(x, y) { + var out = new ArrayCtor(2); + + if (x == null) { + x = 0; + } + + if (y == null) { + y = 0; + } + + out[0] = x; + out[1] = y; + return out; +} +/** + * 复制向量数据 + * @param {Vector2} out + * @param {Vector2} v + * @return {Vector2} + */ + + +function copy(out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; +} +/** + * 克隆一个向量 + * @param {Vector2} v + * @return {Vector2} + */ + + +function clone(v) { + var out = new ArrayCtor(2); + out[0] = v[0]; + out[1] = v[1]; + return out; +} +/** + * 设置向量的两个项 + * @param {Vector2} out + * @param {number} a + * @param {number} b + * @return {Vector2} 结果 + */ + + +function set(out, a, b) { + out[0] = a; + out[1] = b; + return out; +} +/** + * 向量相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + + +function add(out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; +} +/** + * 向量缩放后相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} a + */ + + +function scaleAndAdd(out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; +} +/** + * 向量相减 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + + +function sub(out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; +} +/** + * 向量长度 + * @param {Vector2} v + * @return {number} + */ + + +function len(v) { + return Math.sqrt(lenSquare(v)); +} + +var length = len; // jshint ignore:line + +/** + * 向量长度平方 + * @param {Vector2} v + * @return {number} + */ + +function lenSquare(v) { + return v[0] * v[0] + v[1] * v[1]; +} + +var lengthSquare = lenSquare; +/** + * 向量乘法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + +function mul(out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; +} +/** + * 向量除法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + + +function div(out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; +} +/** + * 向量点乘 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + + +function dot(v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; +} +/** + * 向量缩放 + * @param {Vector2} out + * @param {Vector2} v + * @param {number} s + */ + + +function scale(out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; +} +/** + * 向量归一化 + * @param {Vector2} out + * @param {Vector2} v + */ + + +function normalize(out, v) { + var d = len(v); + + if (d === 0) { + out[0] = 0; + out[1] = 0; + } else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + + return out; +} +/** + * 计算向量间距离 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + + +function distance(v1, v2) { + return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1])); +} + +var dist = distance; +/** + * 向量距离平方 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + +function distanceSquare(v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]); +} + +var distSquare = distanceSquare; +/** + * 求负向量 + * @param {Vector2} out + * @param {Vector2} v + */ + +function negate(out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; +} +/** + * 插值两个点 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} t + */ + + +function lerp(out, v1, v2, t) { + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; +} +/** + * 矩阵左乘向量 + * @param {Vector2} out + * @param {Vector2} v + * @param {Vector2} m + */ + + +function applyTransform(out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; +} +/** + * 求两个向量最小值 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + + +function min(out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; +} +/** + * 求两个向量最大值 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + + +function max(out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; +} + +exports.create = create; +exports.copy = copy; +exports.clone = clone; +exports.set = set; +exports.add = add; +exports.scaleAndAdd = scaleAndAdd; +exports.sub = sub; +exports.len = len; +exports.length = length; +exports.lenSquare = lenSquare; +exports.lengthSquare = lengthSquare; +exports.mul = mul; +exports.div = div; +exports.dot = dot; +exports.scale = scale; +exports.normalize = normalize; +exports.distance = distance; +exports.dist = dist; +exports.distanceSquare = distanceSquare; +exports.distSquare = distSquare; +exports.negate = negate; +exports.lerp = lerp; +exports.applyTransform = applyTransform; +exports.min = min; +exports.max = max; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/CompoundPath.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/CompoundPath.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ./Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +// CompoundPath to improve performance +var _default = Path.extend({ + type: 'compound', + shape: { + paths: null + }, + _updatePathDirty: function () { + var dirtyPath = this.__dirtyPath; + var paths = this.shape.paths; + + for (var i = 0; i < paths.length; i++) { + // Mark as dirty if any subpath is dirty + dirtyPath = dirtyPath || paths[i].__dirtyPath; + } + + this.__dirtyPath = dirtyPath; + this.__dirty = this.__dirty || dirtyPath; + }, + beforeBrush: function () { + this._updatePathDirty(); + + var paths = this.shape.paths || []; + var scale = this.getGlobalScale(); // Update path scale + + for (var i = 0; i < paths.length; i++) { + if (!paths[i].path) { + paths[i].createPathProxy(); + } + + paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold); + } + }, + buildPath: function (ctx, shape) { + var paths = shape.paths || []; + + for (var i = 0; i < paths.length; i++) { + paths[i].buildPath(ctx, paths[i].shape, true); + } + }, + afterBrush: function () { + var paths = this.shape.paths || []; + + for (var i = 0; i < paths.length; i++) { + paths[i].__dirtyPath = false; + } + }, + getBoundingRect: function () { + this._updatePathDirty(); + + return Path.prototype.getBoundingRect.call(this); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Displayable.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Displayable.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var Style = __webpack_require__(/*! ./Style */ "./node_modules/zrender/lib/graphic/Style.js"); + +var Element = __webpack_require__(/*! ../Element */ "./node_modules/zrender/lib/Element.js"); + +var RectText = __webpack_require__(/*! ./mixin/RectText */ "./node_modules/zrender/lib/graphic/mixin/RectText.js"); + +/** + * Base class of all displayable graphic objects + * @module zrender/graphic/Displayable + */ + +/** + * @alias module:zrender/graphic/Displayable + * @extends module:zrender/Element + * @extends module:zrender/graphic/mixin/RectText + */ +function Displayable(opts) { + opts = opts || {}; + Element.call(this, opts); // Extend properties + + for (var name in opts) { + if (opts.hasOwnProperty(name) && name !== 'style') { + this[name] = opts[name]; + } + } + /** + * @type {module:zrender/graphic/Style} + */ + + + this.style = new Style(opts.style, this); + this._rect = null; // Shapes for cascade clipping. + // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array. + // because it is easy to only using null to check whether clipPaths changed. + + this.__clipPaths = null; // FIXME Stateful must be mixined after style is setted + // Stateful.call(this, opts); +} + +Displayable.prototype = { + constructor: Displayable, + type: 'displayable', + + /** + * Dirty flag. From which painter will determine if this displayable object needs brush. + * @name module:zrender/graphic/Displayable#__dirty + * @type {boolean} + */ + __dirty: true, + + /** + * Whether the displayable object is visible. when it is true, the displayable object + * is not drawn, but the mouse event can still trigger the object. + * @name module:/zrender/graphic/Displayable#invisible + * @type {boolean} + * @default false + */ + invisible: false, + + /** + * @name module:/zrender/graphic/Displayable#z + * @type {number} + * @default 0 + */ + z: 0, + + /** + * @name module:/zrender/graphic/Displayable#z + * @type {number} + * @default 0 + */ + z2: 0, + + /** + * The z level determines the displayable object can be drawn in which layer canvas. + * @name module:/zrender/graphic/Displayable#zlevel + * @type {number} + * @default 0 + */ + zlevel: 0, + + /** + * Whether it can be dragged. + * @name module:/zrender/graphic/Displayable#draggable + * @type {boolean} + * @default false + */ + draggable: false, + + /** + * Whether is it dragging. + * @name module:/zrender/graphic/Displayable#draggable + * @type {boolean} + * @default false + */ + dragging: false, + + /** + * Whether to respond to mouse events. + * @name module:/zrender/graphic/Displayable#silent + * @type {boolean} + * @default false + */ + silent: false, + + /** + * If enable culling + * @type {boolean} + * @default false + */ + culling: false, + + /** + * Mouse cursor when hovered + * @name module:/zrender/graphic/Displayable#cursor + * @type {string} + */ + cursor: 'pointer', + + /** + * If hover area is bounding rect + * @name module:/zrender/graphic/Displayable#rectHover + * @type {string} + */ + rectHover: false, + + /** + * Render the element progressively when the value >= 0, + * usefull for large data. + * @type {boolean} + */ + progressive: false, + + /** + * @type {boolean} + */ + incremental: false, + + /** + * Scale ratio for global scale. + * @type {boolean} + */ + globalScaleRatio: 1, + beforeBrush: function (ctx) {}, + afterBrush: function (ctx) {}, + + /** + * Graphic drawing method. + * @param {CanvasRenderingContext2D} ctx + */ + // Interface + brush: function (ctx, prevEl) {}, + + /** + * Get the minimum bounding box. + * @return {module:zrender/core/BoundingRect} + */ + // Interface + getBoundingRect: function () {}, + + /** + * If displayable element contain coord x, y + * @param {number} x + * @param {number} y + * @return {boolean} + */ + contain: function (x, y) { + return this.rectContain(x, y); + }, + + /** + * @param {Function} cb + * @param {} context + */ + traverse: function (cb, context) { + cb.call(context, this); + }, + + /** + * If bounding rect of element contain coord x, y + * @param {number} x + * @param {number} y + * @return {boolean} + */ + rectContain: function (x, y) { + var coord = this.transformCoordToLocal(x, y); + var rect = this.getBoundingRect(); + return rect.contain(coord[0], coord[1]); + }, + + /** + * Mark displayable element dirty and refresh next frame + */ + dirty: function () { + this.__dirty = this.__dirtyText = true; + this._rect = null; + this.__zr && this.__zr.refresh(); + }, + + /** + * If displayable object binded any event + * @return {boolean} + */ + // TODO, events bound by bind + // isSilent: function () { + // return !( + // this.hoverable || this.draggable + // || this.onmousemove || this.onmouseover || this.onmouseout + // || this.onmousedown || this.onmouseup || this.onclick + // || this.ondragenter || this.ondragover || this.ondragleave + // || this.ondrop + // ); + // }, + + /** + * Alias for animate('style') + * @param {boolean} loop + */ + animateStyle: function (loop) { + return this.animate('style', loop); + }, + attrKV: function (key, value) { + if (key !== 'style') { + Element.prototype.attrKV.call(this, key, value); + } else { + this.style.set(value); + } + }, + + /** + * @param {Object|string} key + * @param {*} value + */ + setStyle: function (key, value) { + this.style.set(key, value); + this.dirty(false); + return this; + }, + + /** + * Use given style object + * @param {Object} obj + */ + useStyle: function (obj) { + this.style = new Style(obj, this); + this.dirty(false); + return this; + }, + + /** + * The string value of `textPosition` needs to be calculated to a real postion. + * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]` + * by default. See `contain/text.js#calculateTextPosition` for more details. + * But some coutom shapes like "pin", "flag" have center that is not exactly + * `[width/2, height/2]`. So we provide this hook to customize the calculation + * for those shapes. It will be called if the `style.textPosition` is a string. + * @param {Obejct} [out] Prepared out object. If not provided, this method should + * be responsible for creating one. + * @param {module:zrender/graphic/Style} style + * @param {Object} rect {x, y, width, height} + * @return {Obejct} out The same as the input out. + * { + * x: number. mandatory. + * y: number. mandatory. + * textAlign: string. optional. use style.textAlign by default. + * textVerticalAlign: string. optional. use style.textVerticalAlign by default. + * } + */ + calculateTextPosition: null +}; +zrUtil.inherits(Displayable, Element); +zrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful); + +var _default = Displayable; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Gradient.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Gradient.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @param {Array.} colorStops + */ +var Gradient = function (colorStops) { + this.colorStops = colorStops || []; +}; + +Gradient.prototype = { + constructor: Gradient, + addColorStop: function (offset, color) { + this.colorStops.push({ + offset: offset, + color: color + }); + } +}; +var _default = Gradient; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Image.js": +/*!***************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Image.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Displayable = __webpack_require__(/*! ./Displayable */ "./node_modules/zrender/lib/graphic/Displayable.js"); + +var BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var imageHelper = __webpack_require__(/*! ./helper/image */ "./node_modules/zrender/lib/graphic/helper/image.js"); + +/** + * @alias zrender/graphic/Image + * @extends module:zrender/graphic/Displayable + * @constructor + * @param {Object} opts + */ +function ZImage(opts) { + Displayable.call(this, opts); +} + +ZImage.prototype = { + constructor: ZImage, + type: 'image', + brush: function (ctx, prevEl) { + var style = this.style; + var src = style.image; // Must bind each time + + style.bind(ctx, this, prevEl); + var image = this._image = imageHelper.createOrUpdateImage(src, this._image, this, this.onload); + + if (!image || !imageHelper.isImageReady(image)) { + return; + } // 图片已经加载完成 + // if (image.nodeName.toUpperCase() == 'IMG') { + // if (!image.complete) { + // return; + // } + // } + // Else is canvas + + + var x = style.x || 0; + var y = style.y || 0; + var width = style.width; + var height = style.height; + var aspect = image.width / image.height; + + if (width == null && height != null) { + // Keep image/height ratio + width = height * aspect; + } else if (height == null && width != null) { + height = width / aspect; + } else if (width == null && height == null) { + width = image.width; + height = image.height; + } // 设置transform + + + this.setTransform(ctx); + + if (style.sWidth && style.sHeight) { + var sx = style.sx || 0; + var sy = style.sy || 0; + ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height); + } else if (style.sx && style.sy) { + var sx = style.sx; + var sy = style.sy; + var sWidth = width - sx; + var sHeight = height - sy; + ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height); + } else { + ctx.drawImage(image, x, y, width, height); + } // Draw rect text + + + if (style.text != null) { + // Only restore transform when needs draw text. + this.restoreTransform(ctx); + this.drawRectText(ctx, this.getBoundingRect()); + } + }, + getBoundingRect: function () { + var style = this.style; + + if (!this._rect) { + this._rect = new BoundingRect(style.x || 0, style.y || 0, style.width || 0, style.height || 0); + } + + return this._rect; + } +}; +zrUtil.inherits(ZImage, Displayable); +var _default = ZImage; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/IncrementalDisplayable.js": +/*!********************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/IncrementalDisplayable.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _util = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var inherits = _util.inherits; + +var Displayble = __webpack_require__(/*! ./Displayable */ "./node_modules/zrender/lib/graphic/Displayable.js"); + +var BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +/** + * Displayable for incremental rendering. It will be rendered in a separate layer + * IncrementalDisplay have two main methods. `clearDisplayables` and `addDisplayables` + * addDisplayables will render the added displayables incremetally. + * + * It use a not clearFlag to tell the painter don't clear the layer if it's the first element. + */ +// TODO Style override ? +function IncrementalDisplayble(opts) { + Displayble.call(this, opts); + this._displayables = []; + this._temporaryDisplayables = []; + this._cursor = 0; + this.notClear = true; +} + +IncrementalDisplayble.prototype.incremental = true; + +IncrementalDisplayble.prototype.clearDisplaybles = function () { + this._displayables = []; + this._temporaryDisplayables = []; + this._cursor = 0; + this.dirty(); + this.notClear = false; +}; + +IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) { + if (notPersistent) { + this._temporaryDisplayables.push(displayable); + } else { + this._displayables.push(displayable); + } + + this.dirty(); +}; + +IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) { + notPersistent = notPersistent || false; + + for (var i = 0; i < displayables.length; i++) { + this.addDisplayable(displayables[i], notPersistent); + } +}; + +IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) { + for (var i = this._cursor; i < this._displayables.length; i++) { + cb && cb(this._displayables[i]); + } + + for (var i = 0; i < this._temporaryDisplayables.length; i++) { + cb && cb(this._temporaryDisplayables[i]); + } +}; + +IncrementalDisplayble.prototype.update = function () { + this.updateTransform(); + + for (var i = this._cursor; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; // PENDING + + displayable.parent = this; + displayable.update(); + displayable.parent = null; + } + + for (var i = 0; i < this._temporaryDisplayables.length; i++) { + var displayable = this._temporaryDisplayables[i]; // PENDING + + displayable.parent = this; + displayable.update(); + displayable.parent = null; + } +}; + +IncrementalDisplayble.prototype.brush = function (ctx, prevEl) { + // Render persistant displayables. + for (var i = this._cursor; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + displayable.beforeBrush && displayable.beforeBrush(ctx); + displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]); + displayable.afterBrush && displayable.afterBrush(ctx); + } + + this._cursor = i; // Render temporary displayables. + + for (var i = 0; i < this._temporaryDisplayables.length; i++) { + var displayable = this._temporaryDisplayables[i]; + displayable.beforeBrush && displayable.beforeBrush(ctx); + displayable.brush(ctx, i === 0 ? null : this._temporaryDisplayables[i - 1]); + displayable.afterBrush && displayable.afterBrush(ctx); + } + + this._temporaryDisplayables = []; + this.notClear = true; +}; + +var m = []; + +IncrementalDisplayble.prototype.getBoundingRect = function () { + if (!this._rect) { + var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity); + + for (var i = 0; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + var childRect = displayable.getBoundingRect().clone(); + + if (displayable.needLocalTransform()) { + childRect.applyTransform(displayable.getLocalTransform(m)); + } + + rect.union(childRect); + } + + this._rect = rect; + } + + return this._rect; +}; + +IncrementalDisplayble.prototype.contain = function (x, y) { + var localPos = this.transformCoordToLocal(x, y); + var rect = this.getBoundingRect(); + + if (rect.contain(localPos[0], localPos[1])) { + for (var i = 0; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + + if (displayable.contain(x, y)) { + return true; + } + } + } + + return false; +}; + +inherits(IncrementalDisplayble, Displayble); +var _default = IncrementalDisplayble; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/LinearGradient.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/LinearGradient.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var Gradient = __webpack_require__(/*! ./Gradient */ "./node_modules/zrender/lib/graphic/Gradient.js"); + +/** + * x, y, x2, y2 are all percent from 0 to 1 + * @param {number} [x=0] + * @param {number} [y=0] + * @param {number} [x2=1] + * @param {number} [y2=0] + * @param {Array.} colorStops + * @param {boolean} [globalCoord=false] + */ +var LinearGradient = function (x, y, x2, y2, colorStops, globalCoord) { + // Should do nothing more in this constructor. Because gradient can be + // declard by `color: {type: 'linear', colorStops: ...}`, where + // this constructor will not be called. + this.x = x == null ? 0 : x; + this.y = y == null ? 0 : y; + this.x2 = x2 == null ? 1 : x2; + this.y2 = y2 == null ? 0 : y2; // Can be cloned + + this.type = 'linear'; // If use global coord + + this.global = globalCoord || false; + Gradient.call(this, colorStops); +}; + +LinearGradient.prototype = { + constructor: LinearGradient +}; +zrUtil.inherits(LinearGradient, Gradient); +var _default = LinearGradient; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Path.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Path.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Displayable = __webpack_require__(/*! ./Displayable */ "./node_modules/zrender/lib/graphic/Displayable.js"); + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var PathProxy = __webpack_require__(/*! ../core/PathProxy */ "./node_modules/zrender/lib/core/PathProxy.js"); + +var pathContain = __webpack_require__(/*! ../contain/path */ "./node_modules/zrender/lib/contain/path.js"); + +var Pattern = __webpack_require__(/*! ./Pattern */ "./node_modules/zrender/lib/graphic/Pattern.js"); + +var getCanvasPattern = Pattern.prototype.getCanvasPattern; +var abs = Math.abs; +var pathProxyForDraw = new PathProxy(true); +/** + * @alias module:zrender/graphic/Path + * @extends module:zrender/graphic/Displayable + * @constructor + * @param {Object} opts + */ + +function Path(opts) { + Displayable.call(this, opts); + /** + * @type {module:zrender/core/PathProxy} + * @readOnly + */ + + this.path = null; +} + +Path.prototype = { + constructor: Path, + type: 'path', + __dirtyPath: true, + strokeContainThreshold: 5, + // This item default to be false. But in map series in echarts, + // in order to improve performance, it should be set to true, + // so the shorty segment won't draw. + segmentIgnoreThreshold: 0, + + /** + * See `module:zrender/src/graphic/helper/subPixelOptimize`. + * @type {boolean} + */ + subPixelOptimize: false, + brush: function (ctx, prevEl) { + var style = this.style; + var path = this.path || pathProxyForDraw; + var hasStroke = style.hasStroke(); + var hasFill = style.hasFill(); + var fill = style.fill; + var stroke = style.stroke; + var hasFillGradient = hasFill && !!fill.colorStops; + var hasStrokeGradient = hasStroke && !!stroke.colorStops; + var hasFillPattern = hasFill && !!fill.image; + var hasStrokePattern = hasStroke && !!stroke.image; + style.bind(ctx, this, prevEl); + this.setTransform(ctx); + + if (this.__dirty) { + var rect; // Update gradient because bounding rect may changed + + if (hasFillGradient) { + rect = rect || this.getBoundingRect(); + this._fillGradient = style.getGradient(ctx, fill, rect); + } + + if (hasStrokeGradient) { + rect = rect || this.getBoundingRect(); + this._strokeGradient = style.getGradient(ctx, stroke, rect); + } + } // Use the gradient or pattern + + + if (hasFillGradient) { + // PENDING If may have affect the state + ctx.fillStyle = this._fillGradient; + } else if (hasFillPattern) { + ctx.fillStyle = getCanvasPattern.call(fill, ctx); + } + + if (hasStrokeGradient) { + ctx.strokeStyle = this._strokeGradient; + } else if (hasStrokePattern) { + ctx.strokeStyle = getCanvasPattern.call(stroke, ctx); + } + + var lineDash = style.lineDash; + var lineDashOffset = style.lineDashOffset; + var ctxLineDash = !!ctx.setLineDash; // Update path sx, sy + + var scale = this.getGlobalScale(); + path.setScale(scale[0], scale[1], this.segmentIgnoreThreshold); // Proxy context + // Rebuild path in following 2 cases + // 1. Path is dirty + // 2. Path needs javascript implemented lineDash stroking. + // In this case, lineDash information will not be saved in PathProxy + + if (this.__dirtyPath || lineDash && !ctxLineDash && hasStroke) { + path.beginPath(ctx); // Setting line dash before build path + + if (lineDash && !ctxLineDash) { + path.setLineDash(lineDash); + path.setLineDashOffset(lineDashOffset); + } + + this.buildPath(path, this.shape, false); // Clear path dirty flag + + if (this.path) { + this.__dirtyPath = false; + } + } else { + // Replay path building + ctx.beginPath(); + this.path.rebuildPath(ctx); + } + + if (hasFill) { + if (style.fillOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.fillOpacity * style.opacity; + path.fill(ctx); + ctx.globalAlpha = originalGlobalAlpha; + } else { + path.fill(ctx); + } + } + + if (lineDash && ctxLineDash) { + ctx.setLineDash(lineDash); + ctx.lineDashOffset = lineDashOffset; + } + + if (hasStroke) { + if (style.strokeOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.strokeOpacity * style.opacity; + path.stroke(ctx); + ctx.globalAlpha = originalGlobalAlpha; + } else { + path.stroke(ctx); + } + } + + if (lineDash && ctxLineDash) { + // PENDING + // Remove lineDash + ctx.setLineDash([]); + } // Draw rect text + + + if (style.text != null) { + // Only restore transform when needs draw text. + this.restoreTransform(ctx); + this.drawRectText(ctx, this.getBoundingRect()); + } + }, + // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath + // Like in circle + buildPath: function (ctx, shapeCfg, inBundle) {}, + createPathProxy: function () { + this.path = new PathProxy(); + }, + getBoundingRect: function () { + var rect = this._rect; + var style = this.style; + var needsUpdateRect = !rect; + + if (needsUpdateRect) { + var path = this.path; + + if (!path) { + // Create path on demand. + path = this.path = new PathProxy(); + } + + if (this.__dirtyPath) { + path.beginPath(); + this.buildPath(path, this.shape, false); + } + + rect = path.getBoundingRect(); + } + + this._rect = rect; + + if (style.hasStroke()) { + // Needs update rect with stroke lineWidth when + // 1. Element changes scale or lineWidth + // 2. Shape is changed + var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone()); + + if (this.__dirty || needsUpdateRect) { + rectWithStroke.copy(rect); // FIXME Must after updateTransform + + var w = style.lineWidth; // PENDING, Min line width is needed when line is horizontal or vertical + + var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Only add extra hover lineWidth when there are no fill + + if (!style.hasFill()) { + w = Math.max(w, this.strokeContainThreshold || 4); + } // Consider line width + // Line scale can't be 0; + + + if (lineScale > 1e-10) { + rectWithStroke.width += w / lineScale; + rectWithStroke.height += w / lineScale; + rectWithStroke.x -= w / lineScale / 2; + rectWithStroke.y -= w / lineScale / 2; + } + } // Return rect with stroke + + + return rectWithStroke; + } + + return rect; + }, + contain: function (x, y) { + var localPos = this.transformCoordToLocal(x, y); + var rect = this.getBoundingRect(); + var style = this.style; + x = localPos[0]; + y = localPos[1]; + + if (rect.contain(x, y)) { + var pathData = this.path.data; + + if (style.hasStroke()) { + var lineWidth = style.lineWidth; + var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Line scale can't be 0; + + if (lineScale > 1e-10) { + // Only add extra hover lineWidth when there are no fill + if (!style.hasFill()) { + lineWidth = Math.max(lineWidth, this.strokeContainThreshold); + } + + if (pathContain.containStroke(pathData, lineWidth / lineScale, x, y)) { + return true; + } + } + } + + if (style.hasFill()) { + return pathContain.contain(pathData, x, y); + } + } + + return false; + }, + + /** + * @param {boolean} dirtyPath + */ + dirty: function (dirtyPath) { + if (dirtyPath == null) { + dirtyPath = true; + } // Only mark dirty, not mark clean + + + if (dirtyPath) { + this.__dirtyPath = dirtyPath; + this._rect = null; + } + + this.__dirty = this.__dirtyText = true; + this.__zr && this.__zr.refresh(); // Used as a clipping path + + if (this.__clipTarget) { + this.__clipTarget.dirty(); + } + }, + + /** + * Alias for animate('shape') + * @param {boolean} loop + */ + animateShape: function (loop) { + return this.animate('shape', loop); + }, + // Overwrite attrKV + attrKV: function (key, value) { + // FIXME + if (key === 'shape') { + this.setShape(value); + this.__dirtyPath = true; + this._rect = null; + } else { + Displayable.prototype.attrKV.call(this, key, value); + } + }, + + /** + * @param {Object|string} key + * @param {*} value + */ + setShape: function (key, value) { + var shape = this.shape; // Path from string may not have shape + + if (shape) { + if (zrUtil.isObject(key)) { + for (var name in key) { + if (key.hasOwnProperty(name)) { + shape[name] = key[name]; + } + } + } else { + shape[key] = value; + } + + this.dirty(true); + } + + return this; + }, + getLineScale: function () { + var m = this.transform; // Get the line scale. + // Determinant of `m` means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + + 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; + } +}; +/** + * 扩展一个 Path element, 比如星形,圆等。 + * Extend a path element + * @param {Object} props + * @param {string} props.type Path type + * @param {Function} props.init Initialize + * @param {Function} props.buildPath Overwrite buildPath method + * @param {Object} [props.style] Extended default style config + * @param {Object} [props.shape] Extended default shape config + */ + +Path.extend = function (defaults) { + var Sub = function (opts) { + Path.call(this, opts); + + if (defaults.style) { + // Extend default style + this.style.extendFrom(defaults.style, false); + } // Extend default shape + + + var defaultShape = defaults.shape; + + if (defaultShape) { + this.shape = this.shape || {}; + var thisShape = this.shape; + + for (var name in defaultShape) { + if (!thisShape.hasOwnProperty(name) && defaultShape.hasOwnProperty(name)) { + thisShape[name] = defaultShape[name]; + } + } + } + + defaults.init && defaults.init.call(this, opts); + }; + + zrUtil.inherits(Sub, Path); // FIXME 不能 extend position, rotation 等引用对象 + + for (var name in defaults) { + // Extending prototype values and methods + if (name !== 'style' && name !== 'shape') { + Sub.prototype[name] = defaults[name]; + } + } + + return Sub; +}; + +zrUtil.inherits(Path, Displayable); +var _default = Path; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Pattern.js": +/*!*****************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Pattern.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var Pattern = function (image, repeat) { + // Should do nothing more in this constructor. Because gradient can be + // declard by `color: {image: ...}`, where this constructor will not be called. + this.image = image; + this.repeat = repeat; // Can be cloned + + this.type = 'pattern'; +}; + +Pattern.prototype.getCanvasPattern = function (ctx) { + return ctx.createPattern(this.image, this.repeat || 'repeat'); +}; + +var _default = Pattern; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/RadialGradient.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/RadialGradient.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var Gradient = __webpack_require__(/*! ./Gradient */ "./node_modules/zrender/lib/graphic/Gradient.js"); + +/** + * x, y, r are all percent from 0 to 1 + * @param {number} [x=0.5] + * @param {number} [y=0.5] + * @param {number} [r=0.5] + * @param {Array.} [colorStops] + * @param {boolean} [globalCoord=false] + */ +var RadialGradient = function (x, y, r, colorStops, globalCoord) { + // Should do nothing more in this constructor. Because gradient can be + // declard by `color: {type: 'radial', colorStops: ...}`, where + // this constructor will not be called. + this.x = x == null ? 0.5 : x; + this.y = y == null ? 0.5 : y; + this.r = r == null ? 0.5 : r; // Can be cloned + + this.type = 'radial'; // If use global coord + + this.global = globalCoord || false; + Gradient.call(this, colorStops); +}; + +RadialGradient.prototype = { + constructor: RadialGradient +}; +zrUtil.inherits(RadialGradient, Gradient); +var _default = RadialGradient; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Style.js": +/*!***************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Style.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fixShadow = __webpack_require__(/*! ./helper/fixShadow */ "./node_modules/zrender/lib/graphic/helper/fixShadow.js"); + +var _constant = __webpack_require__(/*! ./constant */ "./node_modules/zrender/lib/graphic/constant.js"); + +var ContextCachedBy = _constant.ContextCachedBy; +var 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); +// var LINE_PROPS = STYLE_COMMON_PROPS.slice(4); + +var Style = function (opts) { + this.extendFrom(opts, false); +}; + +function createLinearGradient(ctx, obj, rect) { + var x = obj.x == null ? 0 : obj.x; + var x2 = obj.x2 == null ? 1 : obj.x2; + var y = obj.y == null ? 0 : obj.y; + var y2 = obj.y2 == null ? 0 : obj.y2; + + if (!obj.global) { + x = x * rect.width + rect.x; + x2 = x2 * rect.width + rect.x; + y = y * rect.height + rect.y; + y2 = y2 * rect.height + rect.y; + } // Fix NaN when rect is Infinity + + + x = isNaN(x) ? 0 : x; + x2 = isNaN(x2) ? 1 : x2; + y = isNaN(y) ? 0 : y; + y2 = isNaN(y2) ? 0 : y2; + var canvasGradient = ctx.createLinearGradient(x, y, x2, y2); + return canvasGradient; +} + +function createRadialGradient(ctx, obj, rect) { + var width = rect.width; + var height = rect.height; + var min = Math.min(width, height); + var x = obj.x == null ? 0.5 : obj.x; + var y = obj.y == null ? 0.5 : obj.y; + var r = obj.r == null ? 0.5 : obj.r; + + if (!obj.global) { + x = x * width + rect.x; + y = y * height + rect.y; + r = r * min; + } + + var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r); + return canvasGradient; +} + +Style.prototype = { + constructor: Style, + + /** + * @type {string} + */ + fill: '#000', + + /** + * @type {string} + */ + stroke: null, + + /** + * @type {number} + */ + opacity: 1, + + /** + * @type {number} + */ + fillOpacity: null, + + /** + * @type {number} + */ + strokeOpacity: null, + + /** + * `true` is not supported. + * `false`/`null`/`undefined` are the same. + * `false` is used to remove lineDash in some + * case that `null`/`undefined` can not be set. + * (e.g., emphasis.lineStyle in echarts) + * @type {Array.|boolean} + */ + lineDash: null, + + /** + * @type {number} + */ + lineDashOffset: 0, + + /** + * @type {number} + */ + shadowBlur: 0, + + /** + * @type {number} + */ + shadowOffsetX: 0, + + /** + * @type {number} + */ + shadowOffsetY: 0, + + /** + * @type {number} + */ + lineWidth: 1, + + /** + * If stroke ignore scale + * @type {Boolean} + */ + strokeNoScale: false, + // Bounding rect text configuration + // Not affected by element transform + + /** + * @type {string} + */ + text: null, + + /** + * If `fontSize` or `fontFamily` exists, `font` will be reset by + * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`. + * So do not visit it directly in upper application (like echarts), + * but use `contain/text#makeFont` instead. + * @type {string} + */ + font: null, + + /** + * The same as font. Use font please. + * @deprecated + * @type {string} + */ + textFont: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * @type {string} + */ + fontStyle: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * @type {string} + */ + fontWeight: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * Should be 12 but not '12px'. + * @type {number} + */ + fontSize: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * @type {string} + */ + fontFamily: null, + + /** + * Reserved for special functinality, like 'hr'. + * @type {string} + */ + textTag: null, + + /** + * @type {string} + */ + textFill: '#000', + + /** + * @type {string} + */ + textStroke: null, + + /** + * @type {number} + */ + textWidth: null, + + /** + * Only for textBackground. + * @type {number} + */ + textHeight: null, + + /** + * textStroke may be set as some color as a default + * value in upper applicaion, where the default value + * of textStrokeWidth should be 0 to make sure that + * user can choose to do not use text stroke. + * @type {number} + */ + textStrokeWidth: 0, + + /** + * @type {number} + */ + textLineHeight: null, + + /** + * 'inside', 'left', 'right', 'top', 'bottom' + * [x, y] + * Based on x, y of rect. + * @type {string|Array.} + * @default 'inside' + */ + textPosition: 'inside', + + /** + * If not specified, use the boundingRect of a `displayable`. + * @type {Object} + */ + textRect: null, + + /** + * [x, y] + * @type {Array.} + */ + textOffset: null, + + /** + * @type {string} + */ + textAlign: null, + + /** + * @type {string} + */ + textVerticalAlign: null, + + /** + * @type {number} + */ + textDistance: 5, + + /** + * @type {string} + */ + textShadowColor: 'transparent', + + /** + * @type {number} + */ + textShadowBlur: 0, + + /** + * @type {number} + */ + textShadowOffsetX: 0, + + /** + * @type {number} + */ + textShadowOffsetY: 0, + + /** + * @type {string} + */ + textBoxShadowColor: 'transparent', + + /** + * @type {number} + */ + textBoxShadowBlur: 0, + + /** + * @type {number} + */ + textBoxShadowOffsetX: 0, + + /** + * @type {number} + */ + textBoxShadowOffsetY: 0, + + /** + * Whether transform text. + * Only available in Path and Image element, + * where the text is called as `RectText`. + * @type {boolean} + */ + transformText: false, + + /** + * Text rotate around position of Path or Image. + * The origin of the rotation can be specified by `textOrigin`. + * Only available in Path and Image element, + * where the text is called as `RectText`. + */ + textRotation: 0, + + /** + * Text origin of text rotation. + * Useful in the case like label rotation of circular symbol. + * Only available in Path and Image element, where the text is called + * as `RectText` and the element is called as "host element". + * The value can be: + * + If specified as a coordinate like `[10, 40]`, it is the `[x, y]` + * base on the left-top corner of the rect of its host element. + * + If specified as a string `center`, it is the center of the rect of + * its host element. + * + By default, this origin is the `textPosition`. + * @type {string|Array.} + */ + textOrigin: null, + + /** + * @type {string} + */ + textBackgroundColor: null, + + /** + * @type {string} + */ + textBorderColor: null, + + /** + * @type {number} + */ + textBorderWidth: 0, + + /** + * @type {number} + */ + textBorderRadius: 0, + + /** + * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]` + * @type {number|Array.} + */ + textPadding: null, + + /** + * Text styles for rich text. + * @type {Object} + */ + rich: null, + + /** + * {outerWidth, outerHeight, ellipsis, placeholder} + * @type {Object} + */ + truncate: null, + + /** + * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation + * @type {string} + */ + blend: null, + + /** + * @param {CanvasRenderingContext2D} ctx + */ + bind: function (ctx, el, prevEl) { + var style = this; + var prevStyle = prevEl && prevEl.style; // If no prevStyle, it means first draw. + // Only apply cache if the last time cachced by this function. + + var notCheckCache = !prevStyle || ctx.__attrCachedBy !== ContextCachedBy.STYLE_BIND; + ctx.__attrCachedBy = ContextCachedBy.STYLE_BIND; + + for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { + var prop = STYLE_COMMON_PROPS[i]; + var styleName = prop[0]; + + if (notCheckCache || style[styleName] !== prevStyle[styleName]) { + // FIXME Invalid property value will cause style leak from previous element. + ctx[styleName] = fixShadow(ctx, styleName, style[styleName] || prop[1]); + } + } + + if (notCheckCache || style.fill !== prevStyle.fill) { + ctx.fillStyle = style.fill; + } + + if (notCheckCache || style.stroke !== prevStyle.stroke) { + ctx.strokeStyle = style.stroke; + } + + if (notCheckCache || style.opacity !== prevStyle.opacity) { + ctx.globalAlpha = style.opacity == null ? 1 : style.opacity; + } + + if (notCheckCache || style.blend !== prevStyle.blend) { + ctx.globalCompositeOperation = style.blend || 'source-over'; + } + + if (this.hasStroke()) { + var lineWidth = style.lineWidth; + ctx.lineWidth = lineWidth / (this.strokeNoScale && el && el.getLineScale ? el.getLineScale() : 1); + } + }, + hasFill: function () { + var fill = this.fill; + return fill != null && fill !== 'none'; + }, + hasStroke: function () { + var stroke = this.stroke; + return stroke != null && stroke !== 'none' && this.lineWidth > 0; + }, + + /** + * Extend from other style + * @param {zrender/graphic/Style} otherStyle + * @param {boolean} overwrite true: overwrirte any way. + * false: overwrite only when !target.hasOwnProperty + * others: overwrite when property is not null/undefined. + */ + extendFrom: function (otherStyle, overwrite) { + if (otherStyle) { + for (var name in otherStyle) { + if (otherStyle.hasOwnProperty(name) && (overwrite === true || (overwrite === false ? !this.hasOwnProperty(name) : otherStyle[name] != null))) { + this[name] = otherStyle[name]; + } + } + } + }, + + /** + * Batch setting style with a given object + * @param {Object|string} obj + * @param {*} [obj] + */ + set: function (obj, value) { + if (typeof obj === 'string') { + this[obj] = value; + } else { + this.extendFrom(obj, true); + } + }, + + /** + * Clone + * @return {zrender/graphic/Style} [description] + */ + clone: function () { + var newStyle = new this.constructor(); + newStyle.extendFrom(this, true); + return newStyle; + }, + getGradient: function (ctx, obj, rect) { + var method = obj.type === 'radial' ? createRadialGradient : createLinearGradient; + var canvasGradient = method(ctx, obj, rect); + var colorStops = obj.colorStops; + + for (var i = 0; i < colorStops.length; i++) { + canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color); + } + + return canvasGradient; + } +}; +var styleProto = Style.prototype; + +for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { + var prop = STYLE_COMMON_PROPS[i]; + + if (!(prop[0] in styleProto)) { + styleProto[prop[0]] = prop[1]; + } +} // Provide for others + + +Style.getGradient = styleProto.getGradient; +var _default = Style; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Text.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Text.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Displayable = __webpack_require__(/*! ./Displayable */ "./node_modules/zrender/lib/graphic/Displayable.js"); + +var zrUtil = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var textContain = __webpack_require__(/*! ../contain/text */ "./node_modules/zrender/lib/contain/text.js"); + +var textHelper = __webpack_require__(/*! ./helper/text */ "./node_modules/zrender/lib/graphic/helper/text.js"); + +var _constant = __webpack_require__(/*! ./constant */ "./node_modules/zrender/lib/graphic/constant.js"); + +var ContextCachedBy = _constant.ContextCachedBy; + +/** + * @alias zrender/graphic/Text + * @extends module:zrender/graphic/Displayable + * @constructor + * @param {Object} opts + */ +var Text = function (opts) { + // jshint ignore:line + Displayable.call(this, opts); +}; + +Text.prototype = { + constructor: Text, + type: 'text', + brush: function (ctx, prevEl) { + var style = this.style; // Optimize, avoid normalize every time. + + this.__dirty && textHelper.normalizeTextStyle(style, true); // Use props with prefix 'text'. + + style.fill = style.stroke = style.shadowBlur = style.shadowColor = style.shadowOffsetX = style.shadowOffsetY = null; + var text = style.text; // Convert to string + + text != null && (text += ''); // Do not apply style.bind in Text node. Because the real bind job + // is in textHelper.renderText, and performance of text render should + // be considered. + // style.bind(ctx, this, prevEl); + + if (!textHelper.needDrawText(text, style)) { + // The current el.style is not applied + // and should not be used as cache. + ctx.__attrCachedBy = ContextCachedBy.NONE; + return; + } + + this.setTransform(ctx); + textHelper.renderText(this, ctx, text, style, null, prevEl); + this.restoreTransform(ctx); + }, + getBoundingRect: function () { + var style = this.style; // Optimize, avoid normalize every time. + + this.__dirty && textHelper.normalizeTextStyle(style, true); + + if (!this._rect) { + var text = style.text; + text != null ? text += '' : text = ''; + var rect = textContain.getBoundingRect(style.text + '', style.font, style.textAlign, style.textVerticalAlign, style.textPadding, style.textLineHeight, style.rich); + rect.x += style.x || 0; + rect.y += style.y || 0; + + if (textHelper.getStroke(style.textStroke, style.textStrokeWidth)) { + var w = style.textStrokeWidth; + rect.x -= w / 2; + rect.y -= w / 2; + rect.width += w; + rect.height += w; + } + + this._rect = rect; + } + + return this._rect; + } +}; +zrUtil.inherits(Text, Displayable); +var _default = Text; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/constant.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/constant.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var ContextCachedBy = { + NONE: 0, + STYLE_BIND: 1, + PLAIN_TEXT: 2 +}; // Avoid confused with 0/false. + +var WILL_BE_RESTORED = 9; +exports.ContextCachedBy = ContextCachedBy; +exports.WILL_BE_RESTORED = WILL_BE_RESTORED; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js": +/*!**********************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var env = __webpack_require__(/*! ../../core/env */ "./node_modules/zrender/lib/core/env.js"); + +// Fix weird bug in some version of IE11 (like 11.0.9600.178**), +// where exception "unexpected call to method or property access" +// might be thrown when calling ctx.fill or ctx.stroke after a path +// whose area size is zero is drawn and ctx.clip() is called and +// shadowBlur is set. See #4572, #3112, #5777. +// (e.g., +// ctx.moveTo(10, 10); +// ctx.lineTo(20, 10); +// ctx.closePath(); +// ctx.clip(); +// ctx.shadowBlur = 10; +// ... +// ctx.fill(); +// ) +var shadowTemp = [['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0]]; + +function _default(orignalBrush) { + // version string can be: '11.0' + return env.browser.ie && env.browser.version >= 11 ? function () { + var clipPaths = this.__clipPaths; + var style = this.style; + var modified; + + if (clipPaths) { + for (var i = 0; i < clipPaths.length; i++) { + var clipPath = clipPaths[i]; + var shape = clipPath && clipPath.shape; + var type = clipPath && clipPath.type; + + if (shape && (type === 'sector' && shape.startAngle === shape.endAngle || type === 'rect' && (!shape.width || !shape.height))) { + for (var j = 0; j < shadowTemp.length; j++) { + // It is save to put shadowTemp static, because shadowTemp + // will be all modified each item brush called. + shadowTemp[j][2] = style[shadowTemp[j][0]]; + style[shadowTemp[j][0]] = shadowTemp[j][1]; + } + + modified = true; + break; + } + } + } + + orignalBrush.apply(this, arguments); + + if (modified) { + for (var j = 0; j < shadowTemp.length; j++) { + style[shadowTemp[j][0]] = shadowTemp[j][2]; + } + } + } : orignalBrush; +} + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/fixShadow.js": +/*!**************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/fixShadow.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var SHADOW_PROPS = { + 'shadowBlur': 1, + 'shadowOffsetX': 1, + 'shadowOffsetY': 1, + 'textShadowBlur': 1, + 'textShadowOffsetX': 1, + 'textShadowOffsetY': 1, + 'textBoxShadowBlur': 1, + 'textBoxShadowOffsetX': 1, + 'textBoxShadowOffsetY': 1 +}; + +function _default(ctx, propName, value) { + if (SHADOW_PROPS.hasOwnProperty(propName)) { + return value *= ctx.dpr; + } + + return value; +} + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/image.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/image.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var LRU = __webpack_require__(/*! ../../core/LRU */ "./node_modules/zrender/lib/core/LRU.js"); + +var globalImageCache = new LRU(50); +/** + * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc + * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image + */ + +function findExistImage(newImageOrSrc) { + if (typeof newImageOrSrc === 'string') { + var cachedImgObj = globalImageCache.get(newImageOrSrc); + return cachedImgObj && cachedImgObj.image; + } else { + return newImageOrSrc; + } +} +/** + * Caution: User should cache loaded images, but not just count on LRU. + * Consider if required images more than LRU size, will dead loop occur? + * + * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc + * @param {HTMLImageElement|HTMLCanvasElement|Canvas} image Existent image. + * @param {module:zrender/Element} [hostEl] For calling `dirty`. + * @param {Function} [cb] params: (image, cbPayload) + * @param {Object} [cbPayload] Payload on cb calling. + * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image + */ + + +function createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) { + if (!newImageOrSrc) { + return image; + } else if (typeof newImageOrSrc === 'string') { + // Image should not be loaded repeatly. + if (image && image.__zrImageSrc === newImageOrSrc || !hostEl) { + return image; + } // Only when there is no existent image or existent image src + // is different, this method is responsible for load. + + + var cachedImgObj = globalImageCache.get(newImageOrSrc); + var pendingWrap = { + hostEl: hostEl, + cb: cb, + cbPayload: cbPayload + }; + + if (cachedImgObj) { + image = cachedImgObj.image; + !isImageReady(image) && cachedImgObj.pending.push(pendingWrap); + } else { + image = new Image(); + image.onload = image.onerror = imageOnLoad; + globalImageCache.put(newImageOrSrc, image.__cachedImgObj = { + image: image, + pending: [pendingWrap] + }); + image.src = image.__zrImageSrc = newImageOrSrc; + } + + return image; + } // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas + else { + return newImageOrSrc; + } +} + +function imageOnLoad() { + var cachedImgObj = this.__cachedImgObj; + this.onload = this.onerror = this.__cachedImgObj = null; + + for (var i = 0; i < cachedImgObj.pending.length; i++) { + var pendingWrap = cachedImgObj.pending[i]; + var cb = pendingWrap.cb; + cb && cb(this, pendingWrap.cbPayload); + pendingWrap.hostEl.dirty(); + } + + cachedImgObj.pending.length = 0; +} + +function isImageReady(image) { + return image && image.width && image.height; +} + +exports.findExistImage = findExistImage; +exports.createOrUpdateImage = createOrUpdateImage; +exports.isImageReady = isImageReady; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/poly.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/poly.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var smoothSpline = __webpack_require__(/*! ./smoothSpline */ "./node_modules/zrender/lib/graphic/helper/smoothSpline.js"); + +var smoothBezier = __webpack_require__(/*! ./smoothBezier */ "./node_modules/zrender/lib/graphic/helper/smoothBezier.js"); + +function buildPath(ctx, shape, closePath) { + var points = shape.points; + var smooth = shape.smooth; + + if (points && points.length >= 2) { + if (smooth && smooth !== 'spline') { + var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint); + ctx.moveTo(points[0][0], points[0][1]); + var len = points.length; + + for (var i = 0; i < (closePath ? len : len - 1); i++) { + var cp1 = controlPoints[i * 2]; + var cp2 = controlPoints[i * 2 + 1]; + var p = points[(i + 1) % len]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } else { + if (smooth === 'spline') { + points = smoothSpline(points, closePath); + } + + ctx.moveTo(points[0][0], points[0][1]); + + for (var i = 1, l = points.length; i < l; i++) { + ctx.lineTo(points[i][0], points[i][1]); + } + } + + closePath && ctx.closePath(); + } +} + +exports.buildPath = buildPath; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/roundRect.js": +/*!**************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/roundRect.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @param {Object} ctx + * @param {Object} shape + * @param {number} shape.x + * @param {number} shape.y + * @param {number} shape.width + * @param {number} shape.height + * @param {number} shape.r + */ +function buildPath(ctx, shape) { + var x = shape.x; + var y = shape.y; + var width = shape.width; + var height = shape.height; + var r = shape.r; + var r1; + var r2; + var r3; + var r4; // Convert width and height to positive for better borderRadius + + if (width < 0) { + x = x + width; + width = -width; + } + + if (height < 0) { + y = y + height; + height = -height; + } + + if (typeof r === 'number') { + r1 = r2 = r3 = r4 = r; + } else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } else { + r1 = r2 = r3 = r4 = 0; + } + + var total; + + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5); +} + +exports.buildPath = buildPath; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/smoothBezier.js": +/*!*****************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/smoothBezier.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _vector = __webpack_require__(/*! ../../core/vector */ "./node_modules/zrender/lib/core/vector.js"); + +var v2Min = _vector.min; +var v2Max = _vector.max; +var v2Scale = _vector.scale; +var v2Distance = _vector.distance; +var v2Add = _vector.add; +var v2Clone = _vector.clone; +var v2Sub = _vector.sub; + +/** + * 贝塞尔平滑曲线 + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 + */ +function _default(points, smooth, isLoop, constraint) { + var cps = []; + var v = []; + var v1 = []; + var v2 = []; + var prevPoint; + var nextPoint; + var min; + var max; + + if (constraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + + for (var i = 0, len = points.length; i < len; i++) { + v2Min(min, min, points[i]); + v2Max(max, max, points[i]); + } // 与指定的包围盒做并集 + + + v2Min(min, min, constraint[0]); + v2Max(max, max, constraint[1]); + } + + for (var i = 0, len = points.length; i < len; i++) { + var point = points[i]; + + if (isLoop) { + prevPoint = points[i ? i - 1 : len - 1]; + nextPoint = points[(i + 1) % len]; + } else { + if (i === 0 || i === len - 1) { + cps.push(v2Clone(points[i])); + continue; + } else { + prevPoint = points[i - 1]; + nextPoint = points[i + 1]; + } + } + + v2Sub(v, nextPoint, prevPoint); // use degree to scale the handle length + + v2Scale(v, v, smooth); + var d0 = v2Distance(point, prevPoint); + var d1 = v2Distance(point, nextPoint); + var sum = d0 + d1; + + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } + + v2Scale(v1, v, -d0); + v2Scale(v2, v, d1); + var cp0 = v2Add([], point, v1); + var cp1 = v2Add([], point, v2); + + if (constraint) { + v2Max(cp0, cp0, min); + v2Min(cp0, cp0, max); + v2Max(cp1, cp1, min); + v2Min(cp1, cp1, max); + } + + cps.push(cp0); + cps.push(cp1); + } + + if (isLoop) { + cps.push(cps.shift()); + } + + return cps; +} + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/smoothSpline.js": +/*!*****************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/smoothSpline.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _vector = __webpack_require__(/*! ../../core/vector */ "./node_modules/zrender/lib/core/vector.js"); + +var v2Distance = _vector.distance; + +/** + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * @inner + */ +function interpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; +} +/** + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @return {Array} + */ + + +function _default(points, isLoop) { + var len = points.length; + var ret = []; + var distance = 0; + + for (var i = 1; i < len; i++) { + distance += v2Distance(points[i - 1], points[i]); + } + + var segs = distance / 2; + segs = segs < len ? len : segs; + + for (var i = 0; i < segs; i++) { + var pos = i / (segs - 1) * (isLoop ? len : len - 1); + var idx = Math.floor(pos); + var w = pos - idx; + var p0; + var p1 = points[idx % len]; + var p2; + var p3; + + if (!isLoop) { + p0 = points[idx === 0 ? idx : idx - 1]; + p2 = points[idx > len - 2 ? len - 1 : idx + 1]; + p3 = points[idx > len - 3 ? len - 1 : idx + 2]; + } else { + p0 = points[(idx - 1 + len) % len]; + p2 = points[(idx + 1) % len]; + p3 = points[(idx + 2) % len]; + } + + var w2 = w * w; + var w3 = w * w2; + 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)]); + } + + return ret; +} + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js": +/*!*********************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Sub-pixel optimize for canvas rendering, prevent from blur + * when rendering a thin vertical/horizontal line. + */ +var round = Math.round; +/** + * Sub pixel optimize line for canvas + * + * @param {Object} outputShape The modification will be performed on `outputShape`. + * `outputShape` and `inputShape` can be the same object. + * `outputShape` object can be used repeatly, because all of + * the `x1`, `x2`, `y1`, `y2` will be assigned in this method. + * @param {Object} [inputShape] + * @param {number} [inputShape.x1] + * @param {number} [inputShape.y1] + * @param {number} [inputShape.x2] + * @param {number} [inputShape.y2] + * @param {Object} [style] + * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize. + */ + +function subPixelOptimizeLine(outputShape, inputShape, style) { + if (!inputShape) { + return; + } + + var x1 = inputShape.x1; + var x2 = inputShape.x2; + var y1 = inputShape.y1; + var y2 = inputShape.y2; + outputShape.x1 = x1; + outputShape.x2 = x2; + outputShape.y1 = y1; + outputShape.y2 = y2; + var lineWidth = style && style.lineWidth; + + if (!lineWidth) { + return; + } + + if (round(x1 * 2) === round(x2 * 2)) { + outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true); + } + + if (round(y1 * 2) === round(y2 * 2)) { + outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true); + } +} +/** + * Sub pixel optimize rect for canvas + * + * @param {Object} outputShape The modification will be performed on `outputShape`. + * `outputShape` and `inputShape` can be the same object. + * `outputShape` object can be used repeatly, because all of + * the `x`, `y`, `width`, `height` will be assigned in this method. + * @param {Object} [inputShape] + * @param {number} [inputShape.x] + * @param {number} [inputShape.y] + * @param {number} [inputShape.width] + * @param {number} [inputShape.height] + * @param {Object} [style] + * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize. + */ + + +function subPixelOptimizeRect(outputShape, inputShape, style) { + if (!inputShape) { + return; + } + + var originX = inputShape.x; + var originY = inputShape.y; + var originWidth = inputShape.width; + var originHeight = inputShape.height; + outputShape.x = originX; + outputShape.y = originY; + outputShape.width = originWidth; + outputShape.height = originHeight; + var lineWidth = style && style.lineWidth; + + if (!lineWidth) { + return; + } + + outputShape.x = subPixelOptimize(originX, lineWidth, true); + outputShape.y = subPixelOptimize(originY, lineWidth, true); + outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1); + outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1); +} +/** + * Sub pixel optimize for canvas + * + * @param {number} position Coordinate, such as x, y + * @param {number} lineWidth If `null`/`undefined`/`0`, do not optimize. + * @param {boolean=} positiveOrNegative Default false (negative). + * @return {number} Optimized position. + */ + + +function subPixelOptimize(position, lineWidth, positiveOrNegative) { + if (!lineWidth) { + return position; + } // Assure that (position + lineWidth / 2) is near integer edge, + // otherwise line will be fuzzy in canvas. + + + var doubledPosition = round(position * 2); + return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2; +} + +exports.subPixelOptimizeLine = subPixelOptimizeLine; +exports.subPixelOptimizeRect = subPixelOptimizeRect; +exports.subPixelOptimize = subPixelOptimize; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/text.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/text.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _util = __webpack_require__(/*! ../../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var retrieve2 = _util.retrieve2; +var retrieve3 = _util.retrieve3; +var each = _util.each; +var normalizeCssArray = _util.normalizeCssArray; +var isString = _util.isString; +var isObject = _util.isObject; + +var textContain = __webpack_require__(/*! ../../contain/text */ "./node_modules/zrender/lib/contain/text.js"); + +var roundRectHelper = __webpack_require__(/*! ./roundRect */ "./node_modules/zrender/lib/graphic/helper/roundRect.js"); + +var imageHelper = __webpack_require__(/*! ./image */ "./node_modules/zrender/lib/graphic/helper/image.js"); + +var fixShadow = __webpack_require__(/*! ./fixShadow */ "./node_modules/zrender/lib/graphic/helper/fixShadow.js"); + +var _constant = __webpack_require__(/*! ../constant */ "./node_modules/zrender/lib/graphic/constant.js"); + +var ContextCachedBy = _constant.ContextCachedBy; +var WILL_BE_RESTORED = _constant.WILL_BE_RESTORED; +var DEFAULT_FONT = textContain.DEFAULT_FONT; // TODO: Have not support 'start', 'end' yet. + +var VALID_TEXT_ALIGN = { + left: 1, + right: 1, + center: 1 +}; +var VALID_TEXT_VERTICAL_ALIGN = { + top: 1, + bottom: 1, + middle: 1 +}; // Different from `STYLE_COMMON_PROPS` of `graphic/Style`, +// the default value of shadowColor is `'transparent'`. + +var SHADOW_STYLE_COMMON_PROPS = [['textShadowBlur', 'shadowBlur', 0], ['textShadowOffsetX', 'shadowOffsetX', 0], ['textShadowOffsetY', 'shadowOffsetY', 0], ['textShadowColor', 'shadowColor', 'transparent']]; +var _tmpTextPositionResult = {}; +var _tmpBoxPositionResult = {}; +/** + * @param {module:zrender/graphic/Style} style + * @return {module:zrender/graphic/Style} The input style. + */ + +function normalizeTextStyle(style) { + normalizeStyle(style); + each(style.rich, normalizeStyle); + return style; +} + +function normalizeStyle(style) { + if (style) { + style.font = textContain.makeFont(style); + var textAlign = style.textAlign; + textAlign === 'middle' && (textAlign = 'center'); + style.textAlign = textAlign == null || VALID_TEXT_ALIGN[textAlign] ? textAlign : 'left'; // Compatible with textBaseline. + + var textVerticalAlign = style.textVerticalAlign || style.textBaseline; + textVerticalAlign === 'center' && (textVerticalAlign = 'middle'); + style.textVerticalAlign = textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign] ? textVerticalAlign : 'top'; + var textPadding = style.textPadding; + + if (textPadding) { + style.textPadding = normalizeCssArray(style.textPadding); + } + } +} +/** + * @param {CanvasRenderingContext2D} ctx + * @param {string} text + * @param {module:zrender/graphic/Style} style + * @param {Object|boolean} [rect] {x, y, width, height} + * If set false, rect text is not used. + * @param {Element|module:zrender/graphic/helper/constant.WILL_BE_RESTORED} [prevEl] For ctx prop cache. + */ + + +function renderText(hostEl, ctx, text, style, rect, prevEl) { + style.rich ? renderRichText(hostEl, ctx, text, style, rect, prevEl) : renderPlainText(hostEl, ctx, text, style, rect, prevEl); +} // Avoid setting to ctx according to prevEl if possible for +// performance in scenarios of large amount text. + + +function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { + 'use strict'; + + var needDrawBg = needDrawBackground(style); + var prevStyle; + var checkCache = false; + var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText. + + if (prevEl !== WILL_BE_RESTORED) { + if (prevEl) { + prevStyle = prevEl.style; + checkCache = !needDrawBg && cachedByMe && prevStyle; + } // Prevent from using cache in `Style::bind`, because of the case: + // ctx property is modified by other properties than `Style::bind` + // used, and Style::bind is called next. + + + ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT; + } // Since this will be restored, prevent from using these props to check cache in the next + // entering of this method. But do not need to clear other cache like `Style::bind`. + else if (cachedByMe) { + ctx.__attrCachedBy = ContextCachedBy.NONE; + } + + var styleFont = style.font || DEFAULT_FONT; // PENDING + // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically + // we can make font cache on ctx, which can cache for text el that are discontinuous. + // But layer save/restore needed to be considered. + // if (styleFont !== ctx.__fontCache) { + // ctx.font = styleFont; + // if (prevEl !== WILL_BE_RESTORED) { + // ctx.__fontCache = styleFont; + // } + // } + + if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) { + ctx.font = styleFont; + } // Use the final font from context-2d, because the final + // font might not be the style.font when it is illegal. + // But get `ctx.font` might be time consuming. + + + var computedFont = hostEl.__computedFont; + + if (hostEl.__styleFont !== styleFont) { + hostEl.__styleFont = styleFont; + computedFont = hostEl.__computedFont = ctx.font; + } + + var textPadding = style.textPadding; + var textLineHeight = style.textLineHeight; + var contentBlock = hostEl.__textCotentBlock; + + if (!contentBlock || hostEl.__dirtyText) { + contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate); + } + + var outerHeight = contentBlock.outerHeight; + var textLines = contentBlock.lines; + var lineHeight = contentBlock.lineHeight; + var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect); + var baseX = boxPos.baseX; + var baseY = boxPos.baseY; + var textAlign = boxPos.textAlign || 'left'; + var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing. + + applyTextRotation(ctx, style, rect, baseX, baseY); + var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign); + var textX = baseX; + var textY = boxY; + + if (needDrawBg || textPadding) { + // Consider performance, do not call getTextWidth util necessary. + var textWidth = textContain.getWidth(text, computedFont); + var outerWidth = textWidth; + textPadding && (outerWidth += textPadding[1] + textPadding[3]); + var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign); + needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight); + + if (textPadding) { + textX = getTextXForPadding(baseX, textAlign, textPadding); + textY += textPadding[0]; + } + } // Always set textAlign and textBase line, because it is difficute to calculate + // textAlign from prevEl, and we dont sure whether textAlign will be reset if + // font set happened. + + + ctx.textAlign = textAlign; // Force baseline to be "middle". Otherwise, if using "top", the + // text will offset downward a little bit in font "Microsoft YaHei". + + ctx.textBaseline = 'middle'; // Set text opacity + + ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable. + + for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) { + var propItem = SHADOW_STYLE_COMMON_PROPS[i]; + var styleProp = propItem[0]; + var ctxProp = propItem[1]; + var val = style[styleProp]; + + if (!checkCache || val !== prevStyle[styleProp]) { + ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]); + } + } // `textBaseline` is set as 'middle'. + + + textY += lineHeight / 2; + var textStrokeWidth = style.textStrokeWidth; + var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null; + var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev; + var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke; + var textStroke = getStroke(style.textStroke, textStrokeWidth); + var textFill = getFill(style.textFill); + + if (textStroke) { + if (strokeWidthChanged) { + ctx.lineWidth = textStrokeWidth; + } + + if (strokeChanged) { + ctx.strokeStyle = textStroke; + } + } + + if (textFill) { + if (!checkCache || style.textFill !== prevStyle.textFill) { + ctx.fillStyle = textFill; + } + } // Optimize simply, in most cases only one line exists. + + + if (textLines.length === 1) { + // Fill after stroke so the outline will not cover the main part. + textStroke && ctx.strokeText(textLines[0], textX, textY); + textFill && ctx.fillText(textLines[0], textX, textY); + } else { + for (var i = 0; i < textLines.length; i++) { + // Fill after stroke so the outline will not cover the main part. + textStroke && ctx.strokeText(textLines[i], textX, textY); + textFill && ctx.fillText(textLines[i], textX, textY); + textY += lineHeight; + } + } +} + +function renderRichText(hostEl, ctx, text, style, rect, prevEl) { + // Do not do cache for rich text because of the complexity. + // But `RectText` this will be restored, do not need to clear other cache like `Style::bind`. + if (prevEl !== WILL_BE_RESTORED) { + ctx.__attrCachedBy = ContextCachedBy.NONE; + } + + var contentBlock = hostEl.__textCotentBlock; + + if (!contentBlock || hostEl.__dirtyText) { + contentBlock = hostEl.__textCotentBlock = textContain.parseRichText(text, style); + } + + drawRichText(hostEl, ctx, contentBlock, style, rect); +} + +function drawRichText(hostEl, ctx, contentBlock, style, rect) { + var contentWidth = contentBlock.width; + var outerWidth = contentBlock.outerWidth; + var outerHeight = contentBlock.outerHeight; + var textPadding = style.textPadding; + var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect); + var baseX = boxPos.baseX; + var baseY = boxPos.baseY; + var textAlign = boxPos.textAlign; + var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing. + + applyTextRotation(ctx, style, rect, baseX, baseY); + var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign); + var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign); + var xLeft = boxX; + var lineTop = boxY; + + if (textPadding) { + xLeft += textPadding[3]; + lineTop += textPadding[0]; + } + + var xRight = xLeft + contentWidth; + needDrawBackground(style) && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight); + + for (var i = 0; i < contentBlock.lines.length; i++) { + var line = contentBlock.lines[i]; + var tokens = line.tokens; + var tokenCount = tokens.length; + var lineHeight = line.lineHeight; + var usedWidth = line.width; + var leftIndex = 0; + var lineXLeft = xLeft; + var lineXRight = xRight; + var rightIndex = tokenCount - 1; + var token; + + while (leftIndex < tokenCount && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left')) { + placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left'); + usedWidth -= token.width; + lineXLeft += token.width; + leftIndex++; + } + + while (rightIndex >= 0 && (token = tokens[rightIndex], token.textAlign === 'right')) { + placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right'); + usedWidth -= token.width; + lineXRight -= token.width; + rightIndex--; + } // The other tokens are placed as textAlign 'center' if there is enough space. + + + lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2; + + while (leftIndex <= rightIndex) { + token = tokens[leftIndex]; // Consider width specified by user, use 'center' rather than 'left'. + + placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center'); + lineXLeft += token.width; + leftIndex++; + } + + lineTop += lineHeight; + } +} + +function applyTextRotation(ctx, style, rect, x, y) { + // textRotation only apply in RectText. + if (rect && style.textRotation) { + var origin = style.textOrigin; + + if (origin === 'center') { + x = rect.width / 2 + rect.x; + y = rect.height / 2 + rect.y; + } else if (origin) { + x = origin[0] + rect.x; + y = origin[1] + rect.y; + } + + ctx.translate(x, y); // Positive: anticlockwise + + ctx.rotate(-style.textRotation); + ctx.translate(-x, -y); + } +} + +function placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) { + var tokenStyle = style.rich[token.styleName] || {}; + tokenStyle.text = token.text; // 'ctx.textBaseline' is always set as 'middle', for sake of + // the bias of "Microsoft YaHei". + + var textVerticalAlign = token.textVerticalAlign; + var y = lineTop + lineHeight / 2; + + if (textVerticalAlign === 'top') { + y = lineTop + token.height / 2; + } else if (textVerticalAlign === 'bottom') { + y = lineTop + lineHeight - token.height / 2; + } + + !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); + var textPadding = token.textPadding; + + if (textPadding) { + x = getTextXForPadding(x, textAlign, textPadding); + y -= token.height / 2 - textPadding[2] - token.textHeight / 2; + } + + setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0)); + setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent'); + setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0)); + setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0)); + setCtx(ctx, 'textAlign', textAlign); // Force baseline to be "middle". Otherwise, if using "top", the + // text will offset downward a little bit in font "Microsoft YaHei". + + setCtx(ctx, 'textBaseline', 'middle'); + setCtx(ctx, 'font', token.font || DEFAULT_FONT); + var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth); + var textFill = getFill(tokenStyle.textFill || style.textFill); + var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth); // Fill after stroke so the outline will not cover the main part. + + if (textStroke) { + setCtx(ctx, 'lineWidth', textStrokeWidth); + setCtx(ctx, 'strokeStyle', textStroke); + ctx.strokeText(token.text, x, y); + } + + if (textFill) { + setCtx(ctx, 'fillStyle', textFill); + ctx.fillText(token.text, x, y); + } +} + +function needDrawBackground(style) { + return !!(style.textBackgroundColor || style.textBorderWidth && style.textBorderColor); +} // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius, text} +// shape: {x, y, width, height} + + +function drawBackground(hostEl, ctx, style, x, y, width, height) { + var textBackgroundColor = style.textBackgroundColor; + var textBorderWidth = style.textBorderWidth; + var textBorderColor = style.textBorderColor; + var isPlainBg = isString(textBackgroundColor); + setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0); + setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent'); + setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0); + setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0); + + if (isPlainBg || textBorderWidth && textBorderColor) { + ctx.beginPath(); + var textBorderRadius = style.textBorderRadius; + + if (!textBorderRadius) { + ctx.rect(x, y, width, height); + } else { + roundRectHelper.buildPath(ctx, { + x: x, + y: y, + width: width, + height: height, + r: textBorderRadius + }); + } + + ctx.closePath(); + } + + if (isPlainBg) { + setCtx(ctx, 'fillStyle', textBackgroundColor); + + if (style.fillOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.fillOpacity * style.opacity; + ctx.fill(); + ctx.globalAlpha = originalGlobalAlpha; + } else { + ctx.fill(); + } + } else if (isObject(textBackgroundColor)) { + var image = textBackgroundColor.image; + image = imageHelper.createOrUpdateImage(image, null, hostEl, onBgImageLoaded, textBackgroundColor); + + if (image && imageHelper.isImageReady(image)) { + ctx.drawImage(image, x, y, width, height); + } + } + + if (textBorderWidth && textBorderColor) { + setCtx(ctx, 'lineWidth', textBorderWidth); + setCtx(ctx, 'strokeStyle', textBorderColor); + + if (style.strokeOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.strokeOpacity * style.opacity; + ctx.stroke(); + ctx.globalAlpha = originalGlobalAlpha; + } else { + ctx.stroke(); + } + } +} + +function onBgImageLoaded(image, textBackgroundColor) { + // Replace image, so that `contain/text.js#parseRichText` + // will get correct result in next tick. + textBackgroundColor.image = image; +} + +function getBoxPosition(out, hostEl, style, rect) { + var baseX = style.x || 0; + var baseY = style.y || 0; + var textAlign = style.textAlign; + var textVerticalAlign = style.textVerticalAlign; // Text position represented by coord + + if (rect) { + var textPosition = style.textPosition; + + if (textPosition instanceof Array) { + // Percent + baseX = rect.x + parsePercent(textPosition[0], rect.width); + baseY = rect.y + parsePercent(textPosition[1], rect.height); + } else { + var res = hostEl && hostEl.calculateTextPosition ? hostEl.calculateTextPosition(_tmpTextPositionResult, style, rect) : textContain.calculateTextPosition(_tmpTextPositionResult, style, rect); + baseX = res.x; + baseY = res.y; // Default align and baseline when has textPosition + + textAlign = textAlign || res.textAlign; + textVerticalAlign = textVerticalAlign || res.textVerticalAlign; + } // textOffset is only support in RectText, otherwise + // we have to adjust boundingRect for textOffset. + + + var textOffset = style.textOffset; + + if (textOffset) { + baseX += textOffset[0]; + baseY += textOffset[1]; + } + } + + out = out || {}; + out.baseX = baseX; + out.baseY = baseY; + out.textAlign = textAlign; + out.textVerticalAlign = textVerticalAlign; + return out; +} + +function setCtx(ctx, prop, value) { + ctx[prop] = fixShadow(ctx, prop, value); + return ctx[prop]; +} +/** + * @param {string} [stroke] If specified, do not check style.textStroke. + * @param {string} [lineWidth] If specified, do not check style.textStroke. + * @param {number} style + */ + + +function getStroke(stroke, lineWidth) { + return stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none' ? null // TODO pattern and gradient? + : stroke.image || stroke.colorStops ? '#000' : stroke; +} + +function getFill(fill) { + return fill == null || fill === 'none' ? null // TODO pattern and gradient? + : fill.image || fill.colorStops ? '#000' : fill; +} + +function parsePercent(value, maxValue) { + if (typeof value === 'string') { + if (value.lastIndexOf('%') >= 0) { + return parseFloat(value) / 100 * maxValue; + } + + return parseFloat(value); + } + + return value; +} + +function getTextXForPadding(x, textAlign, textPadding) { + return textAlign === 'right' ? x - textPadding[1] : textAlign === 'center' ? x + textPadding[3] / 2 - textPadding[1] / 2 : x + textPadding[3]; +} +/** + * @param {string} text + * @param {module:zrender/Style} style + * @return {boolean} + */ + + +function needDrawText(text, style) { + return text != null && (text || style.textBackgroundColor || style.textBorderWidth && style.textBorderColor || style.textPadding); +} + +exports.normalizeTextStyle = normalizeTextStyle; +exports.renderText = renderText; +exports.getBoxPosition = getBoxPosition; +exports.getStroke = getStroke; +exports.getFill = getFill; +exports.parsePercent = parsePercent; +exports.needDrawText = needDrawText; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/mixin/RectText.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/mixin/RectText.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var textHelper = __webpack_require__(/*! ../helper/text */ "./node_modules/zrender/lib/graphic/helper/text.js"); + +var BoundingRect = __webpack_require__(/*! ../../core/BoundingRect */ "./node_modules/zrender/lib/core/BoundingRect.js"); + +var _constant = __webpack_require__(/*! ../constant */ "./node_modules/zrender/lib/graphic/constant.js"); + +var WILL_BE_RESTORED = _constant.WILL_BE_RESTORED; + +/** + * Mixin for drawing text in a element bounding rect + * @module zrender/mixin/RectText + */ +var tmpRect = new BoundingRect(); + +var RectText = function () {}; + +RectText.prototype = { + constructor: RectText, + + /** + * Draw text in a rect with specified position. + * @param {CanvasRenderingContext2D} ctx + * @param {Object} rect Displayable rect + */ + drawRectText: function (ctx, rect) { + var style = this.style; + rect = style.textRect || rect; // Optimize, avoid normalize every time. + + this.__dirty && textHelper.normalizeTextStyle(style, true); + var text = style.text; // Convert to string + + text != null && (text += ''); + + if (!textHelper.needDrawText(text, style)) { + return; + } // FIXME + // Do not provide prevEl to `textHelper.renderText` for ctx prop cache, + // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect + // text propably break the cache for its host elements. + + + ctx.save(); // Transform rect to view space + + var transform = this.transform; + + if (!style.transformText) { + if (transform) { + tmpRect.copy(rect); + tmpRect.applyTransform(transform); + rect = tmpRect; + } + } else { + this.setTransform(ctx); + } // transformText and textRotation can not be used at the same time. + + + textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED); + ctx.restore(); + } +}; +var _default = RectText; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Arc.js": +/*!*******************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Arc.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +/** + * 圆弧 + * @module zrender/graphic/shape/Arc + */ +var _default = Path.extend({ + type: 'arc', + shape: { + cx: 0, + cy: 0, + r: 0, + startAngle: 0, + endAngle: Math.PI * 2, + clockwise: true + }, + style: { + stroke: '#000', + fill: null + }, + buildPath: function (ctx, shape) { + var x = shape.cx; + var y = shape.cy; + var r = Math.max(shape.r, 0); + var startAngle = shape.startAngle; + var endAngle = shape.endAngle; + var clockwise = shape.clockwise; + var unitX = Math.cos(startAngle); + var unitY = Math.sin(startAngle); + ctx.moveTo(unitX * r + x, unitY * r + y); + ctx.arc(x, y, r, startAngle, endAngle, !clockwise); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/BezierCurve.js": +/*!***************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/BezierCurve.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var vec2 = __webpack_require__(/*! ../../core/vector */ "./node_modules/zrender/lib/core/vector.js"); + +var _curve = __webpack_require__(/*! ../../core/curve */ "./node_modules/zrender/lib/core/curve.js"); + +var quadraticSubdivide = _curve.quadraticSubdivide; +var cubicSubdivide = _curve.cubicSubdivide; +var quadraticAt = _curve.quadraticAt; +var cubicAt = _curve.cubicAt; +var quadraticDerivativeAt = _curve.quadraticDerivativeAt; +var cubicDerivativeAt = _curve.cubicDerivativeAt; + +/** + * 贝塞尔曲线 + * @module zrender/shape/BezierCurve + */ +var out = []; + +function someVectorAt(shape, t, isTangent) { + var cpx2 = shape.cpx2; + var cpy2 = shape.cpy2; + + if (cpx2 === null || cpy2 === null) { + 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)]; + } else { + return [(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)]; + } +} + +var _default = Path.extend({ + type: 'bezier-curve', + shape: { + x1: 0, + y1: 0, + x2: 0, + y2: 0, + cpx1: 0, + cpy1: 0, + // cpx2: 0, + // cpy2: 0 + // Curve show percent, for animating + percent: 1 + }, + style: { + stroke: '#000', + fill: null + }, + buildPath: function (ctx, shape) { + var x1 = shape.x1; + var y1 = shape.y1; + var x2 = shape.x2; + var y2 = shape.y2; + var cpx1 = shape.cpx1; + var cpy1 = shape.cpy1; + var cpx2 = shape.cpx2; + var cpy2 = shape.cpy2; + var percent = shape.percent; + + if (percent === 0) { + return; + } + + ctx.moveTo(x1, y1); + + if (cpx2 == null || cpy2 == null) { + if (percent < 1) { + quadraticSubdivide(x1, cpx1, x2, percent, out); + cpx1 = out[1]; + x2 = out[2]; + quadraticSubdivide(y1, cpy1, y2, percent, out); + cpy1 = out[1]; + y2 = out[2]; + } + + ctx.quadraticCurveTo(cpx1, cpy1, x2, y2); + } else { + if (percent < 1) { + cubicSubdivide(x1, cpx1, cpx2, x2, percent, out); + cpx1 = out[1]; + cpx2 = out[2]; + x2 = out[3]; + cubicSubdivide(y1, cpy1, cpy2, y2, percent, out); + cpy1 = out[1]; + cpy2 = out[2]; + y2 = out[3]; + } + + ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2); + } + }, + + /** + * Get point at percent + * @param {number} t + * @return {Array.} + */ + pointAt: function (t) { + return someVectorAt(this.shape, t, false); + }, + + /** + * Get tangent at percent + * @param {number} t + * @return {Array.} + */ + tangentAt: function (t) { + var p = someVectorAt(this.shape, t, true); + return vec2.normalize(p, p); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Circle.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Circle.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +/** + * 圆形 + * @module zrender/shape/Circle + */ +var _default = Path.extend({ + type: 'circle', + shape: { + cx: 0, + cy: 0, + r: 0 + }, + buildPath: function (ctx, shape, inBundle) { + // Better stroking in ShapeBundle + // Always do it may have performence issue ( fill may be 2x more cost) + if (inBundle) { + ctx.moveTo(shape.cx + shape.r, shape.cy); + } // else { + // if (ctx.allocate && !ctx.data.length) { + // ctx.allocate(ctx.CMD_MEM_SIZE.A); + // } + // } + // Better stroking in ShapeBundle + // ctx.moveTo(shape.cx + shape.r, shape.cy); + + + ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Line.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Line.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var _subPixelOptimize = __webpack_require__(/*! ../helper/subPixelOptimize */ "./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js"); + +var subPixelOptimizeLine = _subPixelOptimize.subPixelOptimizeLine; + +/** + * 直线 + * @module zrender/graphic/shape/Line + */ +// Avoid create repeatly. +var subPixelOptimizeOutputShape = {}; + +var _default = Path.extend({ + type: 'line', + shape: { + // Start point + x1: 0, + y1: 0, + // End point + x2: 0, + y2: 0, + percent: 1 + }, + style: { + stroke: '#000', + fill: null + }, + buildPath: function (ctx, shape) { + var x1; + var y1; + var x2; + var y2; + + if (this.subPixelOptimize) { + subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style); + x1 = subPixelOptimizeOutputShape.x1; + y1 = subPixelOptimizeOutputShape.y1; + x2 = subPixelOptimizeOutputShape.x2; + y2 = subPixelOptimizeOutputShape.y2; + } else { + x1 = shape.x1; + y1 = shape.y1; + x2 = shape.x2; + y2 = shape.y2; + } + + var percent = shape.percent; + + if (percent === 0) { + return; + } + + ctx.moveTo(x1, y1); + + if (percent < 1) { + x2 = x1 * (1 - percent) + x2 * percent; + y2 = y1 * (1 - percent) + y2 * percent; + } + + ctx.lineTo(x2, y2); + }, + + /** + * Get point at percent + * @param {number} percent + * @return {Array.} + */ + pointAt: function (p) { + var shape = this.shape; + return [shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p]; + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Polygon.js": +/*!***********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Polygon.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var polyHelper = __webpack_require__(/*! ../helper/poly */ "./node_modules/zrender/lib/graphic/helper/poly.js"); + +/** + * 多边形 + * @module zrender/shape/Polygon + */ +var _default = Path.extend({ + type: 'polygon', + shape: { + points: null, + smooth: false, + smoothConstraint: null + }, + buildPath: function (ctx, shape) { + polyHelper.buildPath(ctx, shape, true); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Polyline.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Polyline.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var polyHelper = __webpack_require__(/*! ../helper/poly */ "./node_modules/zrender/lib/graphic/helper/poly.js"); + +/** + * @module zrender/graphic/shape/Polyline + */ +var _default = Path.extend({ + type: 'polyline', + shape: { + points: null, + smooth: false, + smoothConstraint: null + }, + style: { + stroke: '#000', + fill: null + }, + buildPath: function (ctx, shape) { + polyHelper.buildPath(ctx, shape, false); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Rect.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Rect.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var roundRectHelper = __webpack_require__(/*! ../helper/roundRect */ "./node_modules/zrender/lib/graphic/helper/roundRect.js"); + +var _subPixelOptimize = __webpack_require__(/*! ../helper/subPixelOptimize */ "./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js"); + +var subPixelOptimizeRect = _subPixelOptimize.subPixelOptimizeRect; + +/** + * 矩形 + * @module zrender/graphic/shape/Rect + */ +// Avoid create repeatly. +var subPixelOptimizeOutputShape = {}; + +var _default = Path.extend({ + type: 'rect', + shape: { + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + r: 0, + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function (ctx, shape) { + var x; + var y; + var width; + var height; + + if (this.subPixelOptimize) { + subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style); + x = subPixelOptimizeOutputShape.x; + y = subPixelOptimizeOutputShape.y; + width = subPixelOptimizeOutputShape.width; + height = subPixelOptimizeOutputShape.height; + subPixelOptimizeOutputShape.r = shape.r; + shape = subPixelOptimizeOutputShape; + } else { + x = shape.x; + y = shape.y; + width = shape.width; + height = shape.height; + } + + if (!shape.r) { + ctx.rect(x, y, width, height); + } else { + roundRectHelper.buildPath(ctx, shape); + } + + ctx.closePath(); + return; + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Ring.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Ring.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +/** + * 圆环 + * @module zrender/graphic/shape/Ring + */ +var _default = Path.extend({ + type: 'ring', + shape: { + cx: 0, + cy: 0, + r: 0, + r0: 0 + }, + buildPath: function (ctx, shape) { + var x = shape.cx; + var y = shape.cy; + var PI2 = Math.PI * 2; + ctx.moveTo(x + shape.r, y); + ctx.arc(x, y, shape.r, 0, PI2, false); + ctx.moveTo(x + shape.r0, y); + ctx.arc(x, y, shape.r0, 0, PI2, true); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Sector.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Sector.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var fixClipWithShadow = __webpack_require__(/*! ../helper/fixClipWithShadow */ "./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js"); + +/** + * 扇形 + * @module zrender/graphic/shape/Sector + */ +var _default = Path.extend({ + type: 'sector', + shape: { + cx: 0, + cy: 0, + r0: 0, + r: 0, + startAngle: 0, + endAngle: Math.PI * 2, + clockwise: true + }, + brush: fixClipWithShadow(Path.prototype.brush), + buildPath: function (ctx, shape) { + var x = shape.cx; + var y = shape.cy; + var r0 = Math.max(shape.r0 || 0, 0); + var r = Math.max(shape.r, 0); + var startAngle = shape.startAngle; + var endAngle = shape.endAngle; + var clockwise = shape.clockwise; + var unitX = Math.cos(startAngle); + var unitY = Math.sin(startAngle); + ctx.moveTo(unitX * r0 + x, unitY * r0 + y); + ctx.lineTo(unitX * r + x, unitY * r + y); + ctx.arc(x, y, r, startAngle, endAngle, !clockwise); + ctx.lineTo(Math.cos(endAngle) * r0 + x, Math.sin(endAngle) * r0 + y); + + if (r0 !== 0) { + ctx.arc(x, y, r0, endAngle, startAngle, clockwise); + } + + ctx.closePath(); + } +}); + +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/mixin/Animatable.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/mixin/Animatable.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Animator = __webpack_require__(/*! ../animation/Animator */ "./node_modules/zrender/lib/animation/Animator.js"); + +var logError = __webpack_require__(/*! ../core/log */ "./node_modules/zrender/lib/core/log.js"); + +var _util = __webpack_require__(/*! ../core/util */ "./node_modules/zrender/lib/core/util.js"); + +var isString = _util.isString; +var isFunction = _util.isFunction; +var isObject = _util.isObject; +var isArrayLike = _util.isArrayLike; +var indexOf = _util.indexOf; + +/** + * @alias module:zrender/mixin/Animatable + * @constructor + */ +var Animatable = function () { + /** + * @type {Array.} + * @readOnly + */ + this.animators = []; +}; + +Animatable.prototype = { + constructor: Animatable, + + /** + * 动画 + * + * @param {string} path The path to fetch value from object, like 'a.b.c'. + * @param {boolean} [loop] Whether to loop animation. + * @return {module:zrender/animation/Animator} + * @example: + * el.animate('style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ + animate: function (path, loop) { + var target; + var animatingShape = false; + var el = this; + var zr = this.__zr; + + if (path) { + var pathSplitted = path.split('.'); + var prop = el; // If animating shape + + animatingShape = pathSplitted[0] === 'shape'; + + for (var i = 0, l = pathSplitted.length; i < l; i++) { + if (!prop) { + continue; + } + + prop = prop[pathSplitted[i]]; + } + + if (prop) { + target = prop; + } + } else { + target = el; + } + + if (!target) { + logError('Property "' + path + '" is not existed in element ' + el.id); + return; + } + + var animators = el.animators; + var animator = new Animator(target, loop); + animator.during(function (target) { + el.dirty(animatingShape); + }).done(function () { + // FIXME Animator will not be removed if use `Animator#stop` to stop animation + animators.splice(indexOf(animators, animator), 1); + }); + animators.push(animator); // If animate after added to the zrender + + if (zr) { + zr.animation.addAnimator(animator); + } + + return animator; + }, + + /** + * 停止动画 + * @param {boolean} forwardToLast If move to last frame before stop + */ + stopAnimation: function (forwardToLast) { + var animators = this.animators; + var len = animators.length; + + for (var i = 0; i < len; i++) { + animators[i].stop(forwardToLast); + } + + animators.length = 0; + return this; + }, + + /** + * Caution: this method will stop previous animation. + * So do not use this method to one element twice before + * animation starts, unless you know what you are doing. + * @param {Object} target + * @param {number} [time=500] Time in ms + * @param {string} [easing='linear'] + * @param {number} [delay=0] + * @param {Function} [callback] + * @param {Function} [forceAnimate] Prevent stop animation and callback + * immediently when target values are the same as current values. + * + * @example + * // Animate position + * el.animateTo({ + * position: [10, 10] + * }, function () { // done }) + * + * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing + * el.animateTo({ + * shape: { + * width: 500 + * }, + * style: { + * fill: 'red' + * } + * position: [10, 10] + * }, 100, 100, 'cubicOut', function () { // done }) + */ + // TODO Return animation key + animateTo: function (target, time, delay, easing, callback, forceAnimate) { + animateTo(this, target, time, delay, easing, callback, forceAnimate); + }, + + /** + * Animate from the target state to current state. + * The params and the return value are the same as `this.animateTo`. + */ + animateFrom: function (target, time, delay, easing, callback, forceAnimate) { + animateTo(this, target, time, delay, easing, callback, forceAnimate, true); + } +}; + +function animateTo(animatable, target, time, delay, easing, callback, forceAnimate, reverse) { + // animateTo(target, time, easing, callback); + if (isString(delay)) { + callback = easing; + easing = delay; + delay = 0; + } // animateTo(target, time, delay, callback); + else if (isFunction(easing)) { + callback = easing; + easing = 'linear'; + delay = 0; + } // animateTo(target, time, callback); + else if (isFunction(delay)) { + callback = delay; + delay = 0; + } // animateTo(target, callback) + else if (isFunction(time)) { + callback = time; + time = 500; + } // animateTo(target) + else if (!time) { + time = 500; + } // Stop all previous animations + + + animatable.stopAnimation(); + animateToShallow(animatable, '', animatable, target, time, delay, reverse); // Animators may be removed immediately after start + // if there is nothing to animate + + var animators = animatable.animators.slice(); + var count = animators.length; + + function done() { + count--; + + if (!count) { + callback && callback(); + } + } // No animators. This should be checked before animators[i].start(), + // because 'done' may be executed immediately if no need to animate. + + + if (!count) { + callback && callback(); + } // Start after all animators created + // Incase any animator is done immediately when all animation properties are not changed + + + for (var i = 0; i < animators.length; i++) { + animators[i].done(done).start(easing, forceAnimate); + } +} +/** + * @param {string} path='' + * @param {Object} source=animatable + * @param {Object} target + * @param {number} [time=500] + * @param {number} [delay=0] + * @param {boolean} [reverse] If `true`, animate + * from the `target` to current state. + * + * @example + * // Animate position + * el._animateToShallow({ + * position: [10, 10] + * }) + * + * // Animate shape, style and position in 100ms, delayed 100ms + * el._animateToShallow({ + * shape: { + * width: 500 + * }, + * style: { + * fill: 'red' + * } + * position: [10, 10] + * }, 100, 100) + */ + + +function animateToShallow(animatable, path, source, target, time, delay, reverse) { + var objShallow = {}; + var propertyCount = 0; + + for (var name in target) { + if (!target.hasOwnProperty(name)) { + continue; + } + + if (source[name] != null) { + if (isObject(target[name]) && !isArrayLike(target[name])) { + animateToShallow(animatable, path ? path + '.' + name : name, source[name], target[name], time, delay, reverse); + } else { + if (reverse) { + objShallow[name] = source[name]; + setAttrByPath(animatable, path, name, target[name]); + } else { + objShallow[name] = target[name]; + } + + propertyCount++; + } + } else if (target[name] != null && !reverse) { + setAttrByPath(animatable, path, name, target[name]); + } + } + + if (propertyCount > 0) { + animatable.animate(path, false).when(time == null ? 500 : time, objShallow).delay(delay || 0); + } +} + +function setAttrByPath(el, path, name, value) { + // Attr directly if not has property + // FIXME, if some property not needed for element ? + if (!path) { + el.attr(name, value); + } else { + // Only support set shape or style + var props = {}; + props[path] = {}; + props[path][name] = value; + el.attr(props); + } +} + +var _default = Animatable; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/mixin/Eventful.js": +/*!****************************************************!*\ + !*** ./node_modules/zrender/lib/mixin/Eventful.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Event Mixin + * @module zrender/mixin/Eventful + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + */ +var arrySlice = Array.prototype.slice; +/** + * Event dispatcher. + * + * @alias module:zrender/mixin/Eventful + * @constructor + * @param {Object} [eventProcessor] The object eventProcessor is the scope when + * `eventProcessor.xxx` called. + * @param {Function} [eventProcessor.normalizeQuery] + * param: {string|Object} Raw query. + * return: {string|Object} Normalized query. + * @param {Function} [eventProcessor.filter] Event will be dispatched only + * if it returns `true`. + * param: {string} eventType + * param: {string|Object} query + * return: {boolean} + * @param {Function} [eventProcessor.afterTrigger] Called after all handlers called. + * param: {string} eventType + */ + +var Eventful = function (eventProcessor) { + this._$handlers = {}; + this._$eventProcessor = eventProcessor; +}; + +Eventful.prototype = { + constructor: Eventful, + + /** + * The handler can only be triggered once, then removed. + * + * @param {string} event The event name. + * @param {string|Object} [query] Condition used on event filter. + * @param {Function} handler The event handler. + * @param {Object} context + */ + one: function (event, query, handler, context) { + return on(this, event, query, handler, context, true); + }, + + /** + * Bind a handler. + * + * @param {string} event The event name. + * @param {string|Object} [query] Condition used on event filter. + * @param {Function} handler The event handler. + * @param {Object} [context] + */ + on: function (event, query, handler, context) { + return on(this, event, query, handler, context, false); + }, + + /** + * Whether any handler has bound. + * + * @param {string} event + * @return {boolean} + */ + isSilent: function (event) { + var _h = this._$handlers; + return !_h[event] || !_h[event].length; + }, + + /** + * Unbind a event. + * + * @param {string} [event] The event name. + * If no `event` input, "off" all listeners. + * @param {Function} [handler] The event handler. + * If no `handler` input, "off" all listeners of the `event`. + */ + off: function (event, handler) { + var _h = this._$handlers; + + if (!event) { + this._$handlers = {}; + return this; + } + + if (handler) { + if (_h[event]) { + var newList = []; + + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i].h !== handler) { + newList.push(_h[event][i]); + } + } + + _h[event] = newList; + } + + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } else { + delete _h[event]; + } + + return this; + }, + + /** + * Dispatch a event. + * + * @param {string} type The event name. + */ + trigger: function (type) { + var _h = this._$handlers[type]; + var eventProcessor = this._$eventProcessor; + + if (_h) { + var args = arguments; + var argLen = args.length; + + if (argLen > 3) { + args = arrySlice.call(args, 1); + } + + var len = _h.length; + + for (var i = 0; i < len;) { + var hItem = _h[i]; + + if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) { + i++; + continue; + } // Optimize advise from backbone + + + switch (argLen) { + case 1: + hItem.h.call(hItem.ctx); + break; + + case 2: + hItem.h.call(hItem.ctx, args[1]); + break; + + case 3: + hItem.h.call(hItem.ctx, args[1], args[2]); + break; + + default: + // have more than 2 given arguments + hItem.h.apply(hItem.ctx, args); + break; + } + + if (hItem.one) { + _h.splice(i, 1); + + len--; + } else { + i++; + } + } + } + + eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type); + return this; + }, + + /** + * Dispatch a event with context, which is specified at the last parameter. + * + * @param {string} type The event name. + */ + triggerWithContext: function (type) { + var _h = this._$handlers[type]; + var eventProcessor = this._$eventProcessor; + + if (_h) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = arrySlice.call(args, 1, args.length - 1); + } + + var ctx = args[args.length - 1]; + var len = _h.length; + + for (var i = 0; i < len;) { + var hItem = _h[i]; + + if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) { + i++; + continue; + } // Optimize advise from backbone + + + switch (argLen) { + case 1: + hItem.h.call(ctx); + break; + + case 2: + hItem.h.call(ctx, args[1]); + break; + + case 3: + hItem.h.call(ctx, args[1], args[2]); + break; + + default: + // have more than 2 given arguments + hItem.h.apply(ctx, args); + break; + } + + if (hItem.one) { + _h.splice(i, 1); + + len--; + } else { + i++; + } + } + } + + eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type); + return this; + } +}; + +function normalizeQuery(host, query) { + var eventProcessor = host._$eventProcessor; + + if (query != null && eventProcessor && eventProcessor.normalizeQuery) { + query = eventProcessor.normalizeQuery(query); + } + + return query; +} + +function on(eventful, event, query, handler, context, isOnce) { + var _h = eventful._$handlers; + + if (typeof query === 'function') { + context = handler; + handler = query; + query = null; + } + + if (!handler || !event) { + return eventful; + } + + query = normalizeQuery(eventful, query); + + if (!_h[event]) { + _h[event] = []; + } + + for (var i = 0; i < _h[event].length; i++) { + if (_h[event][i].h === handler) { + return eventful; + } + } + + var wrap = { + h: handler, + one: isOnce, + query: query, + ctx: context || eventful, + // FIXME + // Do not publish this feature util it is proved that it makes sense. + callAtLast: handler.zrEventfulCallAtLast + }; + var lastIndex = _h[event].length - 1; + var lastWrap = _h[event][lastIndex]; + lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap); + return eventful; +} // ---------------------- +// The events in zrender +// ---------------------- + +/** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondrag + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ + +/** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + + +var _default = Eventful; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/mixin/Transformable.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/mixin/Transformable.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var matrix = __webpack_require__(/*! ../core/matrix */ "./node_modules/zrender/lib/core/matrix.js"); + +var vector = __webpack_require__(/*! ../core/vector */ "./node_modules/zrender/lib/core/vector.js"); + +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ +var mIdentity = matrix.identity; +var EPSILON = 5e-5; + +function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; +} +/** + * @alias module:zrender/mixin/Transformable + * @constructor + */ + + +var Transformable = function (opts) { + opts = opts || {}; // If there are no given position, rotation, scale + + if (!opts.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [0, 0]; + } + + if (opts.rotation == null) { + /** + * 旋转 + * @type {Array.} + * @default 0 + */ + this.rotation = 0; + } + + if (!opts.scale) { + /** + * 缩放 + * @type {Array.} + * @default [1, 1] + */ + this.scale = [1, 1]; + } + /** + * 旋转和缩放的原点 + * @type {Array.} + * @default null + */ + + + this.origin = this.origin || null; +}; + +var transformableProto = Transformable.prototype; +transformableProto.transform = null; +/** + * 判断是否需要有坐标变换 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + +transformableProto.needLocalTransform = function () { + return isNotAroundZero(this.rotation) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1); +}; + +var scaleTmp = []; + +transformableProto.updateTransform = function () { + var parent = this.parent; + var parentHasTransform = parent && parent.transform; + var needLocalTransform = this.needLocalTransform(); + var m = this.transform; + + if (!(needLocalTransform || parentHasTransform)) { + m && mIdentity(m); + return; + } + + m = m || matrix.create(); + + if (needLocalTransform) { + this.getLocalTransform(m); + } else { + mIdentity(m); + } // 应用父节点变换 + + + if (parentHasTransform) { + if (needLocalTransform) { + matrix.mul(m, parent.transform, m); + } else { + matrix.copy(m, parent.transform); + } + } // 保存这个变换矩阵 + + + this.transform = m; + var globalScaleRatio = this.globalScaleRatio; + + if (globalScaleRatio != null && globalScaleRatio !== 1) { + this.getGlobalScale(scaleTmp); + var relX = scaleTmp[0] < 0 ? -1 : 1; + var relY = scaleTmp[1] < 0 ? -1 : 1; + var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0; + var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0; + m[0] *= sx; + m[1] *= sx; + m[2] *= sy; + m[3] *= sy; + } + + this.invTransform = this.invTransform || matrix.create(); + matrix.invert(this.invTransform, m); +}; + +transformableProto.getLocalTransform = function (m) { + return Transformable.getLocalTransform(this, m); +}; +/** + * 将自己的transform应用到context上 + * @param {CanvasRenderingContext2D} ctx + */ + + +transformableProto.setTransform = function (ctx) { + var m = this.transform; + var dpr = ctx.dpr || 1; + + if (m) { + ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]); + } else { + ctx.setTransform(dpr, 0, 0, dpr, 0, 0); + } +}; + +transformableProto.restoreTransform = function (ctx) { + var dpr = ctx.dpr || 1; + ctx.setTransform(dpr, 0, 0, dpr, 0, 0); +}; + +var tmpTransform = []; +var originTransform = matrix.create(); + +transformableProto.setLocalTransform = function (m) { + if (!m) { + // TODO return or set identity? + return; + } + + var sx = m[0] * m[0] + m[1] * m[1]; + var sy = m[2] * m[2] + m[3] * m[3]; + var position = this.position; + var scale = this.scale; + + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + + if (m[0] < 0) { + sx = -sx; + } + + if (m[3] < 0) { + sy = -sy; + } + + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + this.rotation = Math.atan2(-m[1] / sy, m[0] / sx); +}; +/** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + + +transformableProto.decomposeTransform = function () { + if (!this.transform) { + return; + } + + var parent = this.parent; + var m = this.transform; + + if (parent && parent.transform) { + // Get local transform and decompose them to position, scale, rotation + matrix.mul(tmpTransform, parent.invTransform, m); + m = tmpTransform; + } + + var origin = this.origin; + + if (origin && (origin[0] || origin[1])) { + originTransform[4] = origin[0]; + originTransform[5] = origin[1]; + matrix.mul(tmpTransform, m, originTransform); + tmpTransform[4] -= origin[0]; + tmpTransform[5] -= origin[1]; + m = tmpTransform; + } + + this.setLocalTransform(m); +}; +/** + * Get global scale + * @return {Array.} + */ + + +transformableProto.getGlobalScale = function (out) { + var m = this.transform; + out = out || []; + + if (!m) { + out[0] = 1; + out[1] = 1; + return out; + } + + out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]); + out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]); + + if (m[0] < 0) { + out[0] = -out[0]; + } + + if (m[3] < 0) { + out[1] = -out[1]; + } + + return out; +}; +/** + * 变换坐标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ + + +transformableProto.transformCoordToLocal = function (x, y) { + var v2 = [x, y]; + var invTransform = this.invTransform; + + if (invTransform) { + vector.applyTransform(v2, v2, invTransform); + } + + return v2; +}; +/** + * 变换局部坐标位置到全局坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ + + +transformableProto.transformCoordToGlobal = function (x, y) { + var v2 = [x, y]; + var transform = this.transform; + + if (transform) { + vector.applyTransform(v2, v2, transform); + } + + return v2; +}; +/** + * @static + * @param {Object} target + * @param {Array.} target.origin + * @param {number} target.rotation + * @param {Array.} target.position + * @param {Array.} [m] + */ + + +Transformable.getLocalTransform = function (target, m) { + m = m || []; + mIdentity(m); + var origin = target.origin; + var scale = target.scale || [1, 1]; + var rotation = target.rotation || 0; + var position = target.position || [0, 0]; + + if (origin) { + // Translate to origin + m[4] -= origin[0]; + m[5] -= origin[1]; + } + + matrix.scale(m, m, scale); + + if (rotation) { + matrix.rotate(m, m, rotation); + } + + if (origin) { + // Translate back from origin + m[4] += origin[0]; + m[5] += origin[1]; + } + + m[4] += position[0]; + m[5] += position[1]; + return m; +}; + +var _default = Transformable; +module.exports = _default; + +/***/ }), + +/***/ "./node_modules/zrender/lib/tool/color.js": +/*!************************************************!*\ + !*** ./node_modules/zrender/lib/tool/color.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var LRU = __webpack_require__(/*! ../core/LRU */ "./node_modules/zrender/lib/core/LRU.js"); + +var kCSSColorTable = { + 'transparent': [0, 0, 0, 0], + 'aliceblue': [240, 248, 255, 1], + 'antiquewhite': [250, 235, 215, 1], + 'aqua': [0, 255, 255, 1], + 'aquamarine': [127, 255, 212, 1], + 'azure': [240, 255, 255, 1], + 'beige': [245, 245, 220, 1], + 'bisque': [255, 228, 196, 1], + 'black': [0, 0, 0, 1], + 'blanchedalmond': [255, 235, 205, 1], + 'blue': [0, 0, 255, 1], + 'blueviolet': [138, 43, 226, 1], + 'brown': [165, 42, 42, 1], + 'burlywood': [222, 184, 135, 1], + 'cadetblue': [95, 158, 160, 1], + 'chartreuse': [127, 255, 0, 1], + 'chocolate': [210, 105, 30, 1], + 'coral': [255, 127, 80, 1], + 'cornflowerblue': [100, 149, 237, 1], + 'cornsilk': [255, 248, 220, 1], + 'crimson': [220, 20, 60, 1], + 'cyan': [0, 255, 255, 1], + 'darkblue': [0, 0, 139, 1], + 'darkcyan': [0, 139, 139, 1], + 'darkgoldenrod': [184, 134, 11, 1], + 'darkgray': [169, 169, 169, 1], + 'darkgreen': [0, 100, 0, 1], + 'darkgrey': [169, 169, 169, 1], + 'darkkhaki': [189, 183, 107, 1], + 'darkmagenta': [139, 0, 139, 1], + 'darkolivegreen': [85, 107, 47, 1], + 'darkorange': [255, 140, 0, 1], + 'darkorchid': [153, 50, 204, 1], + 'darkred': [139, 0, 0, 1], + 'darksalmon': [233, 150, 122, 1], + 'darkseagreen': [143, 188, 143, 1], + 'darkslateblue': [72, 61, 139, 1], + 'darkslategray': [47, 79, 79, 1], + 'darkslategrey': [47, 79, 79, 1], + 'darkturquoise': [0, 206, 209, 1], + 'darkviolet': [148, 0, 211, 1], + 'deeppink': [255, 20, 147, 1], + 'deepskyblue': [0, 191, 255, 1], + 'dimgray': [105, 105, 105, 1], + 'dimgrey': [105, 105, 105, 1], + 'dodgerblue': [30, 144, 255, 1], + 'firebrick': [178, 34, 34, 1], + 'floralwhite': [255, 250, 240, 1], + 'forestgreen': [34, 139, 34, 1], + 'fuchsia': [255, 0, 255, 1], + 'gainsboro': [220, 220, 220, 1], + 'ghostwhite': [248, 248, 255, 1], + 'gold': [255, 215, 0, 1], + 'goldenrod': [218, 165, 32, 1], + 'gray': [128, 128, 128, 1], + 'green': [0, 128, 0, 1], + 'greenyellow': [173, 255, 47, 1], + 'grey': [128, 128, 128, 1], + 'honeydew': [240, 255, 240, 1], + 'hotpink': [255, 105, 180, 1], + 'indianred': [205, 92, 92, 1], + 'indigo': [75, 0, 130, 1], + 'ivory': [255, 255, 240, 1], + 'khaki': [240, 230, 140, 1], + 'lavender': [230, 230, 250, 1], + 'lavenderblush': [255, 240, 245, 1], + 'lawngreen': [124, 252, 0, 1], + 'lemonchiffon': [255, 250, 205, 1], + 'lightblue': [173, 216, 230, 1], + 'lightcoral': [240, 128, 128, 1], + 'lightcyan': [224, 255, 255, 1], + 'lightgoldenrodyellow': [250, 250, 210, 1], + 'lightgray': [211, 211, 211, 1], + 'lightgreen': [144, 238, 144, 1], + 'lightgrey': [211, 211, 211, 1], + 'lightpink': [255, 182, 193, 1], + 'lightsalmon': [255, 160, 122, 1], + 'lightseagreen': [32, 178, 170, 1], + 'lightskyblue': [135, 206, 250, 1], + 'lightslategray': [119, 136, 153, 1], + 'lightslategrey': [119, 136, 153, 1], + 'lightsteelblue': [176, 196, 222, 1], + 'lightyellow': [255, 255, 224, 1], + 'lime': [0, 255, 0, 1], + 'limegreen': [50, 205, 50, 1], + 'linen': [250, 240, 230, 1], + 'magenta': [255, 0, 255, 1], + 'maroon': [128, 0, 0, 1], + 'mediumaquamarine': [102, 205, 170, 1], + 'mediumblue': [0, 0, 205, 1], + 'mediumorchid': [186, 85, 211, 1], + 'mediumpurple': [147, 112, 219, 1], + 'mediumseagreen': [60, 179, 113, 1], + 'mediumslateblue': [123, 104, 238, 1], + 'mediumspringgreen': [0, 250, 154, 1], + 'mediumturquoise': [72, 209, 204, 1], + 'mediumvioletred': [199, 21, 133, 1], + 'midnightblue': [25, 25, 112, 1], + 'mintcream': [245, 255, 250, 1], + 'mistyrose': [255, 228, 225, 1], + 'moccasin': [255, 228, 181, 1], + 'navajowhite': [255, 222, 173, 1], + 'navy': [0, 0, 128, 1], + 'oldlace': [253, 245, 230, 1], + 'olive': [128, 128, 0, 1], + 'olivedrab': [107, 142, 35, 1], + 'orange': [255, 165, 0, 1], + 'orangered': [255, 69, 0, 1], + 'orchid': [218, 112, 214, 1], + 'palegoldenrod': [238, 232, 170, 1], + 'palegreen': [152, 251, 152, 1], + 'paleturquoise': [175, 238, 238, 1], + 'palevioletred': [219, 112, 147, 1], + 'papayawhip': [255, 239, 213, 1], + 'peachpuff': [255, 218, 185, 1], + 'peru': [205, 133, 63, 1], + 'pink': [255, 192, 203, 1], + 'plum': [221, 160, 221, 1], + 'powderblue': [176, 224, 230, 1], + 'purple': [128, 0, 128, 1], + 'red': [255, 0, 0, 1], + 'rosybrown': [188, 143, 143, 1], + 'royalblue': [65, 105, 225, 1], + 'saddlebrown': [139, 69, 19, 1], + 'salmon': [250, 128, 114, 1], + 'sandybrown': [244, 164, 96, 1], + 'seagreen': [46, 139, 87, 1], + 'seashell': [255, 245, 238, 1], + 'sienna': [160, 82, 45, 1], + 'silver': [192, 192, 192, 1], + 'skyblue': [135, 206, 235, 1], + 'slateblue': [106, 90, 205, 1], + 'slategray': [112, 128, 144, 1], + 'slategrey': [112, 128, 144, 1], + 'snow': [255, 250, 250, 1], + 'springgreen': [0, 255, 127, 1], + 'steelblue': [70, 130, 180, 1], + 'tan': [210, 180, 140, 1], + 'teal': [0, 128, 128, 1], + 'thistle': [216, 191, 216, 1], + 'tomato': [255, 99, 71, 1], + 'turquoise': [64, 224, 208, 1], + 'violet': [238, 130, 238, 1], + 'wheat': [245, 222, 179, 1], + 'white': [255, 255, 255, 1], + 'whitesmoke': [245, 245, 245, 1], + 'yellow': [255, 255, 0, 1], + 'yellowgreen': [154, 205, 50, 1] +}; + +function clampCssByte(i) { + // Clamp to integer 0 .. 255. + i = Math.round(i); // Seems to be what Chrome does (vs truncation). + + return i < 0 ? 0 : i > 255 ? 255 : i; +} + +function clampCssAngle(i) { + // Clamp to integer 0 .. 360. + i = Math.round(i); // Seems to be what Chrome does (vs truncation). + + return i < 0 ? 0 : i > 360 ? 360 : i; +} + +function clampCssFloat(f) { + // Clamp to float 0.0 .. 1.0. + return f < 0 ? 0 : f > 1 ? 1 : f; +} + +function parseCssInt(str) { + // int or percentage. + if (str.length && str.charAt(str.length - 1) === '%') { + return clampCssByte(parseFloat(str) / 100 * 255); + } + + return clampCssByte(parseInt(str, 10)); +} + +function parseCssFloat(str) { + // float or percentage. + if (str.length && str.charAt(str.length - 1) === '%') { + return clampCssFloat(parseFloat(str) / 100); + } + + return clampCssFloat(parseFloat(str)); +} + +function cssHueToRgb(m1, m2, h) { + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + + if (h * 6 < 1) { + return m1 + (m2 - m1) * h * 6; + } + + if (h * 2 < 1) { + return m2; + } + + if (h * 3 < 2) { + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + } + + return m1; +} + +function lerpNumber(a, b, p) { + return a + (b - a) * p; +} + +function setRgba(out, r, g, b, a) { + out[0] = r; + out[1] = g; + out[2] = b; + out[3] = a; + return out; +} + +function copyRgba(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} + +var colorCache = new LRU(20); +var lastRemovedArr = null; + +function putToCache(colorStr, rgbaArr) { + // Reuse removed array + if (lastRemovedArr) { + copyRgba(lastRemovedArr, rgbaArr); + } + + lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice()); +} +/** + * @param {string} colorStr + * @param {Array.} out + * @return {Array.} + * @memberOf module:zrender/util/color + */ + + +function parse(colorStr, rgbaArr) { + if (!colorStr) { + return; + } + + rgbaArr = rgbaArr || []; + var cached = colorCache.get(colorStr); + + if (cached) { + return copyRgba(rgbaArr, cached); + } // colorStr may be not string + + + colorStr = colorStr + ''; // Remove all whitespace, not compliant, but should just be more accepting. + + var str = colorStr.replace(/ /g, '').toLowerCase(); // Color keywords (and transparent) lookup. + + if (str in kCSSColorTable) { + copyRgba(rgbaArr, kCSSColorTable[str]); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } // #abc and #abc123 syntax. + + + if (str.charAt(0) === '#') { + if (str.length === 4) { + var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing. + + if (!(iv >= 0 && iv <= 0xfff)) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; // Covers NaN. + } + + setRgba(rgbaArr, (iv & 0xf00) >> 4 | (iv & 0xf00) >> 8, iv & 0xf0 | (iv & 0xf0) >> 4, iv & 0xf | (iv & 0xf) << 4, 1); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } else if (str.length === 7) { + var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing. + + if (!(iv >= 0 && iv <= 0xffffff)) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; // Covers NaN. + } + + setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } + + return; + } + + var op = str.indexOf('('); + var ep = str.indexOf(')'); + + if (op !== -1 && ep + 1 === str.length) { + var fname = str.substr(0, op); + var params = str.substr(op + 1, ep - (op + 1)).split(','); + var alpha = 1; // To allow case fallthrough. + + switch (fname) { + case 'rgba': + if (params.length !== 4) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + + alpha = parseCssFloat(params.pop()); + // jshint ignore:line + // Fall through. + + case 'rgb': + if (params.length !== 3) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + + setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha); + putToCache(colorStr, rgbaArr); + return rgbaArr; + + case 'hsla': + if (params.length !== 4) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + + params[3] = parseCssFloat(params[3]); + hsla2rgba(params, rgbaArr); + putToCache(colorStr, rgbaArr); + return rgbaArr; + + case 'hsl': + if (params.length !== 3) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + + hsla2rgba(params, rgbaArr); + putToCache(colorStr, rgbaArr); + return rgbaArr; + + default: + return; + } + } + + setRgba(rgbaArr, 0, 0, 0, 1); + return; +} +/** + * @param {Array.} hsla + * @param {Array.} rgba + * @return {Array.} rgba + */ + + +function hsla2rgba(hsla, rgba) { + var h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360; // 0 .. 1 + // NOTE(deanm): According to the CSS spec s/l should only be + // percentages, but we don't bother and let float or percentage. + + var s = parseCssFloat(hsla[1]); + var l = parseCssFloat(hsla[2]); + var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; + var m1 = l * 2 - m2; + rgba = rgba || []; + 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); + + if (hsla.length === 4) { + rgba[3] = hsla[3]; + } + + return rgba; +} +/** + * @param {Array.} rgba + * @return {Array.} hsla + */ + + +function rgba2hsla(rgba) { + if (!rgba) { + return; + } // RGB from 0 to 255 + + + var R = rgba[0] / 255; + var G = rgba[1] / 255; + var B = rgba[2] / 255; + var vMin = Math.min(R, G, B); // Min. value of RGB + + var vMax = Math.max(R, G, B); // Max. value of RGB + + var delta = vMax - vMin; // Delta RGB value + + var L = (vMax + vMin) / 2; + var H; + var S; // HSL results from 0 to 1 + + if (delta === 0) { + H = 0; + S = 0; + } else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } else { + S = delta / (2 - vMax - vMin); + } + + var deltaR = ((vMax - R) / 6 + delta / 2) / delta; + var deltaG = ((vMax - G) / 6 + delta / 2) / delta; + var deltaB = ((vMax - B) / 6 + delta / 2) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } else if (G === vMax) { + H = 1 / 3 + deltaR - deltaB; + } else if (B === vMax) { + H = 2 / 3 + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + + if (H > 1) { + H -= 1; + } + } + + var hsla = [H * 360, S, L]; + + if (rgba[3] != null) { + hsla.push(rgba[3]); + } + + return hsla; +} +/** + * @param {string} color + * @param {number} level + * @return {string} + * @memberOf module:zrender/util/color + */ + + +function lift(color, level) { + var colorArr = parse(color); + + if (colorArr) { + for (var i = 0; i < 3; i++) { + if (level < 0) { + colorArr[i] = colorArr[i] * (1 - level) | 0; + } else { + colorArr[i] = (255 - colorArr[i]) * level + colorArr[i] | 0; + } + + if (colorArr[i] > 255) { + colorArr[i] = 255; + } else if (color[i] < 0) { + colorArr[i] = 0; + } + } + + return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb'); + } +} +/** + * @param {string} color + * @return {string} + * @memberOf module:zrender/util/color + */ + + +function toHex(color) { + var colorArr = parse(color); + + if (colorArr) { + return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + +colorArr[2]).toString(16).slice(1); + } +} +/** + * Map value to color. Faster than lerp methods because color is represented by rgba array. + * @param {number} normalizedValue A float between 0 and 1. + * @param {Array.>} colors List of rgba color array + * @param {Array.} [out] Mapped gba color array + * @return {Array.} will be null/undefined if input illegal. + */ + + +function fastLerp(normalizedValue, colors, out) { + if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) { + return; + } + + out = out || []; + var value = normalizedValue * (colors.length - 1); + var leftIndex = Math.floor(value); + var rightIndex = Math.ceil(value); + var leftColor = colors[leftIndex]; + var rightColor = colors[rightIndex]; + var dv = value - leftIndex; + out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)); + out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)); + out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)); + out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)); + return out; +} +/** + * @deprecated + */ + + +var fastMapToColor = fastLerp; +/** + * @param {number} normalizedValue A float between 0 and 1. + * @param {Array.} colors Color list. + * @param {boolean=} fullOutput Default false. + * @return {(string|Object)} Result color. If fullOutput, + * return {color: ..., leftIndex: ..., rightIndex: ..., value: ...}, + * @memberOf module:zrender/util/color + */ + +function lerp(normalizedValue, colors, fullOutput) { + if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) { + return; + } + + var value = normalizedValue * (colors.length - 1); + var leftIndex = Math.floor(value); + var rightIndex = Math.ceil(value); + var leftColor = parse(colors[leftIndex]); + var rightColor = parse(colors[rightIndex]); + var dv = value - leftIndex; + 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'); + return fullOutput ? { + color: color, + leftIndex: leftIndex, + rightIndex: rightIndex, + value: value + } : color; +} +/** + * @deprecated + */ + + +var mapToColor = lerp; +/** + * @param {string} color + * @param {number=} h 0 ~ 360, ignore when null. + * @param {number=} s 0 ~ 1, ignore when null. + * @param {number=} l 0 ~ 1, ignore when null. + * @return {string} Color string in rgba format. + * @memberOf module:zrender/util/color + */ + +function modifyHSL(color, h, s, l) { + color = parse(color); + + if (color) { + color = rgba2hsla(color); + h != null && (color[0] = clampCssAngle(h)); + s != null && (color[1] = parseCssFloat(s)); + l != null && (color[2] = parseCssFloat(l)); + return stringify(hsla2rgba(color), 'rgba'); + } +} +/** + * @param {string} color + * @param {number=} alpha 0 ~ 1 + * @return {string} Color string in rgba format. + * @memberOf module:zrender/util/color + */ + + +function modifyAlpha(color, alpha) { + color = parse(color); + + if (color && alpha != null) { + color[3] = clampCssFloat(alpha); + return stringify(color, 'rgba'); + } +} +/** + * @param {Array.} arrColor like [12,33,44,0.4] + * @param {string} type 'rgba', 'hsva', ... + * @return {string} Result color. (If input illegal, return undefined). + */ + + +function stringify(arrColor, type) { + if (!arrColor || !arrColor.length) { + return; + } + + var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2]; + + if (type === 'rgba' || type === 'hsva' || type === 'hsla') { + colorStr += ',' + arrColor[3]; + } + + return type + '(' + colorStr + ')'; +} + +exports.parse = parse; +exports.lift = lift; +exports.toHex = toHex; +exports.fastLerp = fastLerp; +exports.fastMapToColor = fastMapToColor; +exports.lerp = lerp; +exports.mapToColor = mapToColor; +exports.modifyHSL = modifyHSL; +exports.modifyAlpha = modifyAlpha; +exports.stringify = stringify; + +/***/ }), + +/***/ "./node_modules/zrender/lib/tool/path.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/tool/path.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Path = __webpack_require__(/*! ../graphic/Path */ "./node_modules/zrender/lib/graphic/Path.js"); + +var PathProxy = __webpack_require__(/*! ../core/PathProxy */ "./node_modules/zrender/lib/core/PathProxy.js"); + +var transformPath = __webpack_require__(/*! ./transformPath */ "./node_modules/zrender/lib/tool/transformPath.js"); + +// command chars +// var cc = [ +// 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', +// 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' +// ]; +var mathSqrt = Math.sqrt; +var mathSin = Math.sin; +var mathCos = Math.cos; +var PI = Math.PI; + +var vMag = function (v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); +}; + +var vRatio = function (u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); +}; + +var vAngle = function (u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); +}; + +function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) { + var psi = psiDeg * (PI / 180.0); + var xp = mathCos(psi) * (x1 - x2) / 2.0 + mathSin(psi) * (y1 - y2) / 2.0; + var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0 + mathCos(psi) * (y1 - y2) / 2.0; + var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry); + + if (lambda > 1) { + rx *= mathSqrt(lambda); + ry *= mathSqrt(lambda); + } + + 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; + var cxp = f * rx * yp / ry; + var cyp = f * -ry * xp / rx; + var cx = (x1 + x2) / 2.0 + mathCos(psi) * cxp - mathSin(psi) * cyp; + var cy = (y1 + y2) / 2.0 + mathSin(psi) * cxp + mathCos(psi) * cyp; + var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]); + var u = [(xp - cxp) / rx, (yp - cyp) / ry]; + var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; + var dTheta = vAngle(u, v); + + if (vRatio(u, v) <= -1) { + dTheta = PI; + } + + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + + if (fs === 0 && dTheta > 0) { + dTheta = dTheta - 2 * PI; + } + + if (fs === 1 && dTheta < 0) { + dTheta = dTheta + 2 * PI; + } + + path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs); +} + +var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; // Consider case: +// (1) delimiter can be comma or space, where continuous commas +// or spaces should be seen as one comma. +// (2) value can be like: +// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983', +// 'l-.5E1,54', '121-23-44-11' (no delimiter) + +var numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g; // var valueSplitReg = /[\s,]+/; + +function createPathProxyFromString(data) { + if (!data) { + return new PathProxy(); + } // var data = data.replace(/-/g, ' -') + // .replace(/ /g, ' ') + // .replace(/ /g, ',') + // .replace(/,,/g, ','); + // var n; + // create pipes so that we can split the data + // for (n = 0; n < cc.length; n++) { + // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + // } + // data = data.replace(/-/g, ',-'); + // create array + // var arr = cs.split('|'); + // init context point + + + var cpx = 0; + var cpy = 0; + var subpathX = cpx; + var subpathY = cpy; + var prevCmd; + var path = new PathProxy(); + var CMD = PathProxy.CMD; // commandReg.lastIndex = 0; + // var cmdResult; + // while ((cmdResult = commandReg.exec(data)) != null) { + // var cmdStr = cmdResult[1]; + // var cmdContent = cmdResult[2]; + + var cmdList = data.match(commandReg); + + for (var l = 0; l < cmdList.length; l++) { + var cmdText = cmdList[l]; + var cmdStr = cmdText.charAt(0); + var cmd; // String#split is faster a little bit than String#replace or RegExp#exec. + // var p = cmdContent.split(valueSplitReg); + // var pLen = 0; + // for (var i = 0; i < p.length; i++) { + // // '' and other invalid str => NaN + // var val = parseFloat(p[i]); + // !isNaN(val) && (p[pLen++] = val); + // } + + var p = cmdText.match(numberReg) || []; + var pLen = p.length; + + for (var i = 0; i < pLen; i++) { + p[i] = parseFloat(p[i]); + } + + var off = 0; + + while (off < pLen) { + var ctlPtx; + var ctlPty; + var rx; + var ry; + var psi; + var fa; + var fs; + var x1 = cpx; + var y1 = cpy; // convert l, H, h, V, and v to L + + switch (cmdStr) { + case 'l': + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD.L; + path.addData(cmd, cpx, cpy); + break; + + case 'L': + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD.L; + path.addData(cmd, cpx, cpy); + break; + + case 'm': + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD.M; + path.addData(cmd, cpx, cpy); + subpathX = cpx; + subpathY = cpy; + cmdStr = 'l'; + break; + + case 'M': + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD.M; + path.addData(cmd, cpx, cpy); + subpathX = cpx; + subpathY = cpy; + cmdStr = 'L'; + break; + + case 'h': + cpx += p[off++]; + cmd = CMD.L; + path.addData(cmd, cpx, cpy); + break; + + case 'H': + cpx = p[off++]; + cmd = CMD.L; + path.addData(cmd, cpx, cpy); + break; + + case 'v': + cpy += p[off++]; + cmd = CMD.L; + path.addData(cmd, cpx, cpy); + break; + + case 'V': + cpy = p[off++]; + cmd = CMD.L; + path.addData(cmd, cpx, cpy); + break; + + case 'C': + cmd = CMD.C; + path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]); + cpx = p[off - 2]; + cpy = p[off - 1]; + break; + + case 'c': + cmd = CMD.C; + path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy); + cpx += p[off - 2]; + cpy += p[off - 1]; + break; + + case 'S': + ctlPtx = cpx; + ctlPty = cpy; + var len = path.len(); + var pathData = path.data; + + if (prevCmd === CMD.C) { + ctlPtx += cpx - pathData[len - 4]; + ctlPty += cpy - pathData[len - 3]; + } + + cmd = CMD.C; + x1 = p[off++]; + y1 = p[off++]; + cpx = p[off++]; + cpy = p[off++]; + path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); + break; + + case 's': + ctlPtx = cpx; + ctlPty = cpy; + var len = path.len(); + var pathData = path.data; + + if (prevCmd === CMD.C) { + ctlPtx += cpx - pathData[len - 4]; + ctlPty += cpy - pathData[len - 3]; + } + + cmd = CMD.C; + x1 = cpx + p[off++]; + y1 = cpy + p[off++]; + cpx += p[off++]; + cpy += p[off++]; + path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); + break; + + case 'Q': + x1 = p[off++]; + y1 = p[off++]; + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD.Q; + path.addData(cmd, x1, y1, cpx, cpy); + break; + + case 'q': + x1 = p[off++] + cpx; + y1 = p[off++] + cpy; + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD.Q; + path.addData(cmd, x1, y1, cpx, cpy); + break; + + case 'T': + ctlPtx = cpx; + ctlPty = cpy; + var len = path.len(); + var pathData = path.data; + + if (prevCmd === CMD.Q) { + ctlPtx += cpx - pathData[len - 4]; + ctlPty += cpy - pathData[len - 3]; + } + + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD.Q; + path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); + break; + + case 't': + ctlPtx = cpx; + ctlPty = cpy; + var len = path.len(); + var pathData = path.data; + + if (prevCmd === CMD.Q) { + ctlPtx += cpx - pathData[len - 4]; + ctlPty += cpy - pathData[len - 3]; + } + + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD.Q; + path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); + break; + + case 'A': + rx = p[off++]; + ry = p[off++]; + psi = p[off++]; + fa = p[off++]; + fs = p[off++]; + x1 = cpx, y1 = cpy; + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD.A; + processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path); + break; + + case 'a': + rx = p[off++]; + ry = p[off++]; + psi = p[off++]; + fa = p[off++]; + fs = p[off++]; + x1 = cpx, y1 = cpy; + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD.A; + processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path); + break; + } + } + + if (cmdStr === 'z' || cmdStr === 'Z') { + cmd = CMD.Z; + path.addData(cmd); // z may be in the middle of the path. + + cpx = subpathX; + cpy = subpathY; + } + + prevCmd = cmd; + } + + path.toStatic(); + return path; +} // TODO Optimize double memory cost problem + + +function createPathOptions(str, opts) { + var pathProxy = createPathProxyFromString(str); + opts = opts || {}; + + opts.buildPath = function (path) { + if (path.setData) { + path.setData(pathProxy.data); // Svg and vml renderer don't have context + + var ctx = path.getContext(); + + if (ctx) { + path.rebuildPath(ctx); + } + } else { + var ctx = path; + pathProxy.rebuildPath(ctx); + } + }; + + opts.applyTransform = function (m) { + transformPath(pathProxy, m); + this.dirty(true); + }; + + return opts; +} +/** + * Create a Path object from path string data + * http://www.w3.org/TR/SVG/paths.html#PathData + * @param {Object} opts Other options + */ + + +function createFromString(str, opts) { + return new Path(createPathOptions(str, opts)); +} +/** + * Create a Path class from path string data + * @param {string} str + * @param {Object} opts Other options + */ + + +function extendFromString(str, opts) { + return Path.extend(createPathOptions(str, opts)); +} +/** + * Merge multiple paths + */ +// TODO Apply transform +// TODO stroke dash +// TODO Optimize double memory cost problem + + +function mergePath(pathEls, opts) { + var pathList = []; + var len = pathEls.length; + + for (var i = 0; i < len; i++) { + var pathEl = pathEls[i]; + + if (!pathEl.path) { + pathEl.createPathProxy(); + } + + if (pathEl.__dirtyPath) { + pathEl.buildPath(pathEl.path, pathEl.shape, true); + } + + pathList.push(pathEl.path); + } + + var pathBundle = new Path(opts); // Need path proxy. + + pathBundle.createPathProxy(); + + pathBundle.buildPath = function (path) { + path.appendPath(pathList); // Svg and vml renderer don't have context + + var ctx = path.getContext(); + + if (ctx) { + path.rebuildPath(ctx); + } + }; + + return pathBundle; +} + +exports.createFromString = createFromString; +exports.extendFromString = extendFromString; +exports.mergePath = mergePath; + +/***/ }), + +/***/ "./node_modules/zrender/lib/tool/transformPath.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/tool/transformPath.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var PathProxy = __webpack_require__(/*! ../core/PathProxy */ "./node_modules/zrender/lib/core/PathProxy.js"); + +var _vector = __webpack_require__(/*! ../core/vector */ "./node_modules/zrender/lib/core/vector.js"); + +var v2ApplyTransform = _vector.applyTransform; +var CMD = PathProxy.CMD; +var points = [[], [], []]; +var mathSqrt = Math.sqrt; +var mathAtan2 = Math.atan2; + +function _default(path, m) { + var data = path.data; + var cmd; + var nPoint; + var i; + var j; + var k; + var p; + var M = CMD.M; + var C = CMD.C; + var L = CMD.L; + var R = CMD.R; + var A = CMD.A; + var Q = CMD.Q; + + for (i = 0, j = 0; i < data.length;) { + cmd = data[i++]; + j = i; + nPoint = 0; + + switch (cmd) { + case M: + nPoint = 1; + break; + + case L: + nPoint = 1; + break; + + case C: + nPoint = 3; + break; + + case Q: + nPoint = 2; + break; + + case A: + var x = m[4]; + var y = m[5]; + var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]); + var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]); + var angle = mathAtan2(-m[1] / sy, m[0] / sx); // cx + + data[i] *= sx; + data[i++] += x; // cy + + data[i] *= sy; + data[i++] += y; // Scale rx and ry + // FIXME Assume psi is 0 here + + data[i++] *= sx; + data[i++] *= sy; // Start angle + + data[i++] += angle; // end angle + + data[i++] += angle; // FIXME psi + + i += 2; + j = i; + break; + + case R: + // x0, y0 + p[0] = data[i++]; + p[1] = data[i++]; + v2ApplyTransform(p, p, m); + data[j++] = p[0]; + data[j++] = p[1]; // x1, y1 + + p[0] += data[i++]; + p[1] += data[i++]; + v2ApplyTransform(p, p, m); + data[j++] = p[0]; + data[j++] = p[1]; + } + + for (k = 0; k < nPoint; k++) { + var p = points[k]; + p[0] = data[i++]; + p[1] = data[i++]; + v2ApplyTransform(p, p, m); // Write back + + data[j++] = p[0]; + data[j++] = p[1]; + } + } +} + +module.exports = _default; + +/***/ }), + +/***/ "./src/liquidFill.js": +/*!***************************!*\ + !*** ./src/liquidFill.js ***! + \***************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Gradient = __webpack_require__(/*! ./Gradient */ \"./node_modules/zrender/lib/graphic/Gradient.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9MaW5lYXJHcmFkaWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0xpbmVhckdyYWRpZW50LmpzPzQ4YTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuLi9jb3JlL3V0aWxcIik7XG5cbnZhciBHcmFkaWVudCA9IHJlcXVpcmUoXCIuL0dyYWRpZW50XCIpO1xuXG4vKipcbiAqIHgsIHksIHgyLCB5MiBhcmUgYWxsIHBlcmNlbnQgZnJvbSAwIHRvIDFcbiAqIEBwYXJhbSB7bnVtYmVyfSBbeD0wXVxuICogQHBhcmFtIHtudW1iZXJ9IFt5PTBdXG4gKiBAcGFyYW0ge251bWJlcn0gW3gyP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GVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/LinearGradient.js\n"); +var echarts = __webpack_require__(/*! echarts/lib/echarts */ "echarts/lib/echarts"); + +__webpack_require__(/*! ./liquidFillSeries */ "./src/liquidFillSeries.js"); +__webpack_require__(/*! ./liquidFillView */ "./src/liquidFillView.js"); + + +echarts.registerVisual( + echarts.util.curry( + __webpack_require__(/*! echarts/lib/visual/dataColor */ "./node_modules/echarts/lib/visual/dataColor.js"), 'liquidFill' + ) +); + /***/ }), -/***/ "./node_modules/zrender/lib/graphic/Path.js": -/*!**************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Path.js ***! - \**************************************************/ +/***/ "./src/liquidFillLayout.js": +/*!*********************************!*\ + !*** ./src/liquidFillLayout.js ***! + \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var Displayable = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar pathContain = __webpack_require__(/*! ../contain/path */ \"./node_modules/zrender/lib/contain/path.js\");\n\nvar Pattern = __webpack_require__(/*! ./Pattern */ \"./node_modules/zrender/lib/graphic/Pattern.js\");\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\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]); // 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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9QYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvUGF0aC5qcz9jYmU1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBEaXNwbGF5YWJsZSA9IHJlcXVpcmUoXCIuL0Rpc3BsYXlhYmxlXCIpO1xuXG52YXIgenJVdGlsID0gcmVxdWlyZShcIi4uL2NvcmUvdXRpbFwiKTtcblxudmFyIFBhdGhQcm94eSA9IHJlcXVpcmUoXCIuLi9jb3JlL1BhdGhQcm94eVwiKTtcblxudmFyIHBhdGhDb250YWluID0gcmVxdWlyZShcIi4uL2NvbnRhaW4vcGF0aFwiKTtcblxudmFyIFBhdHRlcm4gPSByZXF1aXJlKFwiLi9QYXR0ZXJuXCIpO1xuXG52YXIgZ2V0Q2FudmFzUGF0dGVybiA9IFBhdHRlcm4ucHJvdG90eXBlLmdldENhbnZhc1BhdHRlcm47XG52YXIgYWJzID0gTWF0aC5hYnM7XG52YXIgcGF0aFByb3h5Rm9yRHJhdyA9IG5ldyBQYXRoUHJveHkodHJ1ZSk7XG4vKipcbiAqIEBhbGlhcyBtb2R1bGU6enJlbmRlci9ncmFwaGljL1BhdGhcbiAqIEBleHRlbmRzIG1vZHVsZTp6cmVuZGVyL2dyYXBoaWMvRGlzcGxheWFibGVcbiAqIEBjb25zdHJ1Y3RvclxuICogQHBhcmFtIHtPYmplY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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Path.js\n"); +var echarts = __webpack_require__(/*! echarts/lib/echarts */ "echarts/lib/echarts"); -/***/ }), +module.exports = echarts.graphic.extendShape({ + type: 'ec-liquid-fill', -/***/ "./node_modules/zrender/lib/graphic/Pattern.js": -/*!*****************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Pattern.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + shape: { + waveLength: 0, + radius: 0, + radiusY: 0, + cx: 0, + cy: 0, + waterLevel: 0, + amplitude: 0, + phase: 0, + inverse: false + }, -eval("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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9QYXR0ZXJuLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvUGF0dGVybi5qcz9kYzJmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXR0ZXJuID0gZnVuY3Rpb24gKGltYWdlLCByZXBlYXQpIHtcbiAgLy8gU2hvdWxkIGRvIG5vdGhpbmcgbW9yZSBpbiB0aGlzIGNvbnN0cnVjdG9yLiBCZWNhdXNlIGdyYWRpZW50IGNhbiBiZVxuICAvLyBkZWNsYXJkIGJ5IGBjb2xvcjoge2ltYWdlOiAuLi59YCwgd2hlcmUgdGhpcyBjb25zdHJ1Y3RvciB3aWxsIG5vdCBiZSBjYWxsZWQuXG4gIHRoaXMuaW1hZ2UgPSBpbWFnZTtcbiAgdGhpcy5yZXBlYXQgPSByZXBlYXQ7IC8vIENhbiBiZSBjbG9uZWRcblxuICB0aGlzLnR5cGUgPSAncGF0dGVybic7XG59O1xuXG5QYXR0ZXJuLnByb3RvdHlwZS5nZXRDYW52YXNQYXR0ZXJuID0gZnVuY3Rpb24gKGN0eCkge1xuICByZXR1cm4gY3R4LmNyZWF0ZVBhdHRlcm4odGhpcy5pbWFnZSwgdGhpcy5yZXBlYXQgfHwgJ3JlcGVhdCcpO1xufTtcblxudmFyIF9kZWZhdWx0ID0gUGF0dGVybjtcbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Pattern.js\n"); + buildPath: function (ctx, shape) { + if (shape.radiusY == null) { + shape.radiusY = shape.radius; + } -/***/ }), + /** + * We define a sine wave having 4 waves, and make sure at least 8 curves + * is drawn. Otherwise, it may cause blank area for some waves when + * wave length is large enough. + */ + var curves = Math.max( + Math.ceil(2 * shape.radius / shape.waveLength * 4) * 2, + 8 + ); -/***/ "./node_modules/zrender/lib/graphic/RadialGradient.js": -/*!************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/RadialGradient.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + // map phase to [-Math.PI * 2, 0] + while (shape.phase < -Math.PI * 2) { + shape.phase += Math.PI * 2; + } + while (shape.phase > 0) { + shape.phase -= Math.PI * 2; + } + var phase = shape.phase / Math.PI / 2 * shape.waveLength; -eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Gradient = __webpack_require__(/*! ./Gradient */ \"./node_modules/zrender/lib/graphic/Gradient.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9SYWRpYWxHcmFkaWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL1JhZGlhbEdyYWRpZW50LmpzP2RkZWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuLi9jb3JlL3V0aWxcIik7XG5cbnZhciBHcmFkaWVudCA9IHJlcXVpcmUoXCIuL0dyYWRpZW50XCIpO1xuXG4vKipcbiAqIHgsIHksIHIgYXJlIGFsbCBwZXJjZW50IGZyb20gMCB0byAxXG4gKiBAcGFyYW0ge251bWJlcn0gW3g9MC41XVxuICogQHBhcmFtIHtudW1iZXJ9IFt5PTAuNV1cbiAqIEBwYXJhbSB7bnVtYmVyfSBbcj0wLjVdXG4gKiBAcGFyYW0ge0FycmF5LjxPYmplY3Q+fSBbY29sb3JTdG9wc11cbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW2dsb2JhbENvb3JkPWZhbHNlXVxuICovXG52YXIgUmFkaWFsR3JhZGllbnQgPSBmdW5jdGlvbiAoeCwgeSwgciwgY29sb3JTdG9wcywgZ2xvYmFsQ29vcmQpIHtcbiAgLy8gU2hvdWxkIGRvIG5vdGhpbmcgbW9yZSBpbiB0aGlzIGNvbnN0cnVjdG9yLiBCZWNhdXNlIGdyYWRpZW50IGNhbiBiZVxuICAvLyBkZWNsYXJkIGJ5IGBjb2xvcjoge3R5cGU6ICdyYWRpYWwnLCBjb2xvclN0b3BzOiAuLi59YCwgd2hlcmVcbiAgLy8gdGhpcyBjb25zdHJ1Y3RvciB3aWxsIG5vdCBiZSBjYWxsZWQuXG4gIHRoaXMueCA9IHggPT0gbnVsbCA/IDAuNSA6IHg7XG4gIHRoaXMueSA9IHkgPT0gbnVsbCA/IDAuNSA6IHk7XG4gIHRoaXMuciA9IHIgPT0gbnVsbCA/IDAuNSA6IHI7IC8vIENhbiBiZSBjbG9uZWRcblxuICB0aGlzLnR5cGUgPSAncmFkaWFsJzsgLy8gSWYgdXNlIGdsb2JhbCBjb29yZFxuXG4gIHRoaXMuZ2xvYmFsID0gZ2xvYmFsQ29vcmQgfHwgZmFsc2U7XG4gIEdyYWRpZW50LmNhbGwodGhpcywgY29sb3JTdG9wcyk7XG59O1xuXG5SYWRpYWxHcmFkaWVudC5wcm90b3R5cGUgPSB7XG4gIGNvbnN0cnVjdG9yOiBSYWRpYWxHcmFkaWVudFxufTtcbnpyVXRpbC5pbmhlcml0cyhSYWRpYWxHcmFkaWVudCwgR3JhZGllbnQpO1xudmFyIF9kZWZhdWx0ID0gUmFkaWFsR3JhZGllbnQ7XG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/RadialGradient.js\n"); + var left = shape.cx - shape.radius + phase - shape.radius * 2; -/***/ }), + /** + * top-left corner as start point + * + * draws this point + * | + * \|/ + * ~~~~~~~~ + * | | + * +------+ + */ + ctx.moveTo(left, shape.waterLevel); -/***/ "./node_modules/zrender/lib/graphic/Style.js": -/*!***************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Style.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + /** + * top wave + * + * ~~~~~~~~ <- draws this sine wave + * | | + * +------+ + */ + var waveRight = 0; + for (var c = 0; c < curves; ++c) { + var stage = c % 4; + var pos = getWaterPositions(c * shape.waveLength / 4, stage, + shape.waveLength, shape.amplitude); + ctx.bezierCurveTo(pos[0][0] + left, -pos[0][1] + shape.waterLevel, + pos[1][0] + left, -pos[1][1] + shape.waterLevel, + pos[2][0] + left, -pos[2][1] + shape.waterLevel); -eval("var fixShadow = __webpack_require__(/*! ./helper/fixShadow */ \"./node_modules/zrender/lib/graphic/helper/fixShadow.js\");\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\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 * @type {Array.}\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 useful in Path and Image element\n * @type {boolean}\n */\n transformText: false,\n\n /**\n * Text rotate around position of Path or Image\n * Only useful in Path and Image element and transformText is false.\n */\n textRotation: 0,\n\n /**\n * Text origin of text rotation, like [10, 40].\n * Based on x, y of rect.\n * Useful in label rotation of circular symbol.\n * By default, this origin is textPosition.\n * Can be 'center'.\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;//# sourceURL=[module]\n//#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/***/ }), + if (shape.inverse) { + /** + * top-right corner + * 2. draws this line + * | + * +------+ + * 3. draws this line -> | | <- 1. draws this line + * ~~~~~~~~ + */ + ctx.lineTo(waveRight + left, shape.cy - shape.radiusY); + ctx.lineTo(left, shape.cy - shape.radiusY); + ctx.lineTo(left, shape.waterLevel); + } + else { + /** + * top-right corner + * + * ~~~~~~~~ + * 3. draws this line -> | | <- 1. draws this line + * +------+ + * ^ + * | + * 2. draws this line + */ + ctx.lineTo(waveRight + left, shape.cy + shape.radiusY); + ctx.lineTo(left, shape.cy + shape.radiusY); + ctx.lineTo(left, shape.waterLevel); + } -/***/ "./node_modules/zrender/lib/graphic/Text.js": -/*!**************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/Text.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + ctx.closePath(); + } +}); -eval("var Displayable = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar textContain = __webpack_require__(/*! ../contain/text */ \"./node_modules/zrender/lib/contain/text.js\");\n\nvar textHelper = __webpack_require__(/*! ./helper/text */ \"./node_modules/zrender/lib/graphic/helper/text.js\");\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9UZXh0LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvVGV4dC5qcz83NmE1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBEaXNwbGF5YWJsZSA9IHJlcXVpcmUoXCIuL0Rpc3BsYXlhYmxlXCIpO1xuXG52YXIgenJVdGlsID0gcmVxdWlyZShcIi4uL2NvcmUvdXRpbFwiKTtcblxudmFyIHRleHRDb250YWluID0gcmVxdWlyZShcIi4uL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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Text.js\n"); -/***/ }), -/***/ "./node_modules/zrender/lib/graphic/constant.js": -/*!******************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/constant.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/** + * Using Bezier curves to fit sine wave. + * There is 4 control points for each curve of wave, + * which is at 1/4 wave length of the sine wave. + * + * The control points for a wave from (a) to (d) are a-b-c-d: + * c *----* d + * b * + * | + * ... a * .................. + * + * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1) + * + * @param {number} x x position of the left-most point (a) + * @param {number} stage 0-3, stating which part of the wave it is + * @param {number} waveLength wave length of the sine wave + * @param {number} amplitude wave amplitude + */ +function getWaterPositions(x, stage, waveLength, amplitude) { + if (stage === 0) { + return [ + [x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2], + [x + 1 / 2 * waveLength / Math.PI, amplitude], + [x + waveLength / 4, amplitude] + ]; + } + else if (stage === 1) { + return [ + [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2), + amplitude], + [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1), + amplitude / 2], + [x + waveLength / 4, 0] + ] + } + else if (stage === 2) { + return [ + [x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2], + [x + 1 / 2 * waveLength / Math.PI, -amplitude], + [x + waveLength / 4, -amplitude] + ] + } + else { + return [ + [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2), + -amplitude], + [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1), + -amplitude / 2], + [x + waveLength / 4, 0] + ] + } +} -eval("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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9jb25zdGFudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2NvbnN0YW50LmpzPzgyZWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIENvbnRleHRDYWNoZWRCeSA9IHtcbiAgTk9ORTogMCxcbiAgU1RZTEVfQklORDogMSxcbiAgUExBSU5fVEVYVDogMlxufTsgLy8gQXZvaWQgY29uZnVzZWQgd2l0aCAwL2ZhbHNlLlxuXG52YXIgV0lMTF9CRV9SRVNUT1JFRCA9IDk7XG5leHBvcnRzLkNvbnRleHRDYWNoZWRCeSA9IENvbnRleHRDYWNoZWRCeTtcbmV4cG9ydHMuV0lMTF9CRV9SRVNUT1JFRCA9IFdJTExfQkVfUkVTVE9SRUQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/constant.js\n"); /***/ }), -/***/ "./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js": -/*!**********************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js ***! - \**********************************************************************/ +/***/ "./src/liquidFillSeries.js": +/*!*********************************!*\ + !*** ./src/liquidFillSeries.js ***! + \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var env = __webpack_require__(/*! ../../core/env */ \"./node_modules/zrender/lib/core/env.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvZml4Q2xpcFdpdGhTaGFkb3cuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvZml4Q2xpcFdpdGhTaGFkb3cuanM/ODk3YSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZW52ID0gcmVxdWlyZShcIi4uLy4uL2NvcmUvZW52XCIpO1xuXG4vLyBGaXggd2VpcmQgYnVnIGluIHNvbWUgdmVyc2lvbiBvZiBJRTExIChsaWtlIDExLjAuOTYwMC4xNzgqKiksXG4vLyB3aGVyZSBleGNlcHRpb24gXCJ1bmV4cGVjdGVkIGNhbGwgdG8gbWV0aG9kIG9yIHByb3BlcnR5IGFjY2Vzc1wiXG4vLyBtaWdodCBiZSB0aHJvd24gd2hlbiBjYWxsaW5nIGN0eC5maWxsIG9yIGN0eC5zdHJva2UgYWZ0ZXIgYSBwYXRoXG4vLyB3aG9zZSBhcmVhIHNpemUgaXMgemVybyBpcyBkcmF3biBhbmQgY3R4LmNsaXAoKSBpcyBjYWxsZWQgYW5kXG4vLyBzaGFkb3dCbHVyIGlzIHNldC4gU2VlICM0NTcyLCAjMzExMiwgIzU3NzcuXG4vLyAoZS5nLixcbi8vICBjdHgubW92ZVRvKDEwLCAxMCk7XG4vLyAgY3R4LmxpbmVUbygyMCwgMTApO1xuLy8gIGN0eC5jbG9zZVBhdGgoKTtcbi8vICBjdHguY2xpcCgpO1xuLy8gIGN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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js\n"); +var completeDimensions = __webpack_require__(/*! echarts/lib/data/helper/completeDimensions */ "./node_modules/echarts/lib/data/helper/completeDimensions.js"); +var echarts = __webpack_require__(/*! echarts/lib/echarts */ "echarts/lib/echarts"); -/***/ }), +echarts.extendSeriesModel({ -/***/ "./node_modules/zrender/lib/graphic/helper/fixShadow.js": -/*!**************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/fixShadow.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + type: 'series.liquidFill', -eval("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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvZml4U2hhZG93LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvaGVscGVyL2ZpeFNoYWRvdy5qcz83ZDZkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBTSEFET1dfUFJPUFMgPSB7XG4gICdzaGFkb3dCbHVyJzogMSxcbiAgJ3NoYWRvd09mZnNldFgnOiAxLFxuICAnc2hhZG93T2Zmc2V0WSc6IDEsXG4gICd0ZXh0U2hhZG93Qmx1cic6IDEsXG4gICd0ZXh0U2hhZG93T2Zmc2V0WCc6IDEsXG4gICd0ZXh0U2hhZG93T2Zmc2V0WSc6IDEsXG4gICd0ZXh0Qm94U2hhZG93Qmx1cic6IDEsXG4gICd0ZXh0Qm94U2hhZG93T2Zmc2V0WCc6IDEsXG4gICd0ZXh0Qm94U2hhZG93T2Zmc2V0WSc6IDFcbn07XG5cbmZ1bmN0aW9uIF9kZWZhdWx0KGN0eCwgcHJvcE5hbWUsIHZhbHVlKSB7XG4gIGlmIChTSEFET1dfUFJPUFMuaGFzT3duUHJvcGVydHkocHJvcE5hbWUpKSB7XG4gICAgcmV0dXJuIHZhbHVlICo9IGN0eC5kcHI7XG4gIH1cblxuICByZXR1cm4gdmFsdWU7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/fixShadow.js\n"); + visualColorAccessPath: 'textStyle.normal.color', -/***/ }), + optionUpdated: function () { + var option = this.option; + option.gridSize = Math.max(Math.floor(option.gridSize), 4); + }, -/***/ "./node_modules/zrender/lib/graphic/helper/image.js": -/*!**********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/image.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + getInitialData: function (option, ecModel) { + var dimensions = completeDimensions(['value'], option.data); + var list = new echarts.List(dimensions, this); + list.initData(option.data); + return list; + }, -eval("var LRU = __webpack_require__(/*! ../../core/LRU */ \"./node_modules/zrender/lib/core/LRU.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvaW1hZ2UuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvaW1hZ2UuanM/NWU3NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgTFJVID0gcmVxdWlyZShcIi4uLy4uL2NvcmUvTFJVXCIpO1xuXG52YXIgZ2xvYmFsSW1hZ2VDYWNoZSA9IG5ldyBMUlUoNTApO1xuLyoqXG4gKiBAcGFyYW0ge3N0cmluZ3xIVE1MSW1hZ2VFbGVtZW50fEhUTUxDYW52YXNFbGVtZW50fENhbnZhc30gbmV3SW1hZ2VPclNyY1xuICogQHJldHVybiB7SFRNTEltYWdlRWxlbWVudHxIVE1MQ2FudmFzRWxlbWVudHxDYW52YXN9IGltYWdlXG4gKi9cblxuZnVuY3Rpb24gZmluZEV4aXN0SW1hZ2UobmV3SW1hZ2VPclNyYykge1xuICBpZiAodHlwZW9mIG5ld0ltYWdlT3JTcmMgPT09ICdzdHJpbmcnKSB7XG4gICAgdmFyIGNhY2hlZEltZ09iaiA9IGdsb2JhbEltYWdl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lUmVhZHkgPSBpc0ltYWdlUmVhZHk7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/image.js\n"); + defaultOption: { + color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'], + center: ['50%', '50%'], + radius: '50%', + amplitude: '8%', + waveLength: '80%', + phase: 'auto', + period: 'auto', + direction: 'right', + shape: 'circle', -/***/ }), + waveAnimation: true, + animationEasing: 'linear', + animationEasingUpdate: 'linear', + animationDuration: 2000, + animationDurationUpdate: 1000, -/***/ "./node_modules/zrender/lib/graphic/helper/poly.js": -/*!*********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/poly.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + outline: { + show: true, + borderDistance: 8, + itemStyle: { + color: 'none', + borderColor: '#294D99', + borderWidth: 8, + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.25)' + } + }, -eval("var smoothSpline = __webpack_require__(/*! ./smoothSpline */ \"./node_modules/zrender/lib/graphic/helper/smoothSpline.js\");\n\nvar smoothBezier = __webpack_require__(/*! ./smoothBezier */ \"./node_modules/zrender/lib/graphic/helper/smoothBezier.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvcG9seS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2hlbHBlci9wb2x5LmpzPzRmYWMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHNtb290aFNwbGluZSA9IHJlcXVpcmUoXCIuL3Ntb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HBvaW50c1swXVsxXSk7XG5cbiAgICAgIGZvciAodmFyIGkgPSAxLCBsID0gcG9pbnRzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICBjdHgubGluZVRvKHBvaW50c1tpXVswXSwgcG9pbnRzW2ldWzFdKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBjbG9zZVBhdGggJiYgY3R4LmNsb3NlUGF0aCgpO1xuICB9XG59XG5cbmV4cG9ydHMuYnVpbGRQYXRoID0gYnVpbGRQYXRoOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/poly.js\n"); + backgroundStyle: { + color: '#E3F7FF' + }, -/***/ }), + itemStyle: { + opacity: 0.95, + shadowBlur: 50, + shadowColor: 'rgba(0, 0, 0, 0.4)' + }, -/***/ "./node_modules/zrender/lib/graphic/helper/roundRect.js": -/*!**************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/roundRect.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + label: { + show: true, + color: '#294D99', + insideColor: '#fff', + fontSize: 50, + fontWeight: 'bold', + + align: 'center', + baseline: 'middle', + position: 'inside' + }, + + emphasis: { + itemStyle: { + opacity: 0.8 + } + } + } +}); -eval("/**\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/roundRect.js\n"); /***/ }), -/***/ "./node_modules/zrender/lib/graphic/helper/smoothBezier.js": -/*!*****************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/smoothBezier.js ***! - \*****************************************************************/ +/***/ "./src/liquidFillView.js": +/*!*******************************!*\ + !*** ./src/liquidFillView.js ***! + \*******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var _vector = __webpack_require__(/*! ../../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvc21vb3RoQmV6aWVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYX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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/smoothBezier.js\n"); +var echarts = __webpack_require__(/*! echarts/lib/echarts */ "echarts/lib/echarts"); +var numberUtil = echarts.number; +var symbolUtil = __webpack_require__(/*! echarts/lib/util/symbol */ "./node_modules/echarts/lib/util/symbol.js"); +var parsePercent = numberUtil.parsePercent; -/***/ }), +var LiquidLayout = __webpack_require__(/*! ./liquidFillLayout */ "./src/liquidFillLayout.js"); -/***/ "./node_modules/zrender/lib/graphic/helper/smoothSpline.js": -/*!*****************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/smoothSpline.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +function getShallow(model, path) { + return model && model.getShallow(path); +} -eval("var _vector = __webpack_require__(/*! ../../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvc21vb3RoU3BsaW5lLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvaGVscGVyL3Ntb290aFNwbGluZS5qcz82MjBiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBfdmVjdG9yID0gcmVxdWlyZShcIi4uLy4uL2NvcmUvdmVjdG9yXCIpO1xuXG52YXIgdjJEaXN0YW5jZSA9IF92ZWN0b3IuZGlzdGFuY2U7XG5cbi8qKlxuICogQ2F0bXVsbC1Sb20gc3BsaW5lIOaPkuWAvOaKmOe6v1xuICogQG1vZHVsZSB6cmVuZGVyL3NoYXBlL3V0aWwvc21vb3RoU3BsaW5lXG4gKiBAYXV0aG9yIHBpc3NhbmcgKGh0dHBzOi8vd3d3LmdpdGh1Yi5jb20vcGlzc2FuZylcbiAqICAgICAgICAgS2VuZXIgKEBLZW5lci3mnpfls7AsIGtlbmV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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/smoothSpline.js\n"); +echarts.extendChartView({ -/***/ }), + type: 'liquidFill', -/***/ "./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js": -/*!*********************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + render: function (seriesModel, ecModel, api) { + var group = this.group; + group.removeAll(); -eval("/**\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]\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\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\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n } else {\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n } else {\n outputShape.y1 = y1;\n outputShape.y2 = y2;\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]\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\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 = 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 Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvc3ViUGl4ZWxPcHRpbWl6ZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2hlbHBlci9zdWJQaXhlbE9wdGltaXplLmpzPzljZjkiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBTdWItcGl4ZWwgb3B0aW1pemUgZm9yIGNhbnZhcyByZW5kZXJpbmcsIHByZXZlbnQgZnJvbSBibHVyXG4gKiB3aGVuIHJlbmRlcmluZyBhIHRoaW4gdmVydGljYWwvaG9yaXpvbnRhbCBsaW5lLlxuICovXG52YXIgcm91bmQgPSBNYXRoLnJvdW5kO1xuLyoqXG4gKiBTdWIgcGl4ZWwgb3B0aW1pemUgbGluZSBmb3IgY2FudmFzXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IG91dHB1dFNoYXBlIFRoZSBtb2RpZmljYXRpb24gd2lsbCBiZSBwZXJmb3JtZWQgb24gYG91dHB1dFNoYXBlYC5cbiAqICAgICAgICAgICAgICAgICBgb3V0cHV0U2hhcGVgIGFuZCBgaW5wdXRTaGFwZWAgY2FuIGJlIHRoZSBzYW1lIG9iamVjdC5cbiAqICAgICAgICAgICAgICAgICBgb3V0cHV0U2hhcGVgIG9iamVjdCBjYW4gYmUgdXNlZCByZXBlYXRseSwgYmVjYXVzZSBhbGwgb2ZcbiAqICAgICAgICAgICAgICAgICB0aGUgYHgxYCwgYHgyYCwgYHkxYCwgYHkyYCB3aWxsIGJlIGFzc2lnbmVkIGluIHRo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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\n"); + var data = seriesModel.getData(); -/***/ }), + var itemModel = data.getItemModel(0); -/***/ "./node_modules/zrender/lib/graphic/helper/text.js": -/*!*********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/helper/text.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var center = itemModel.get('center'); + var radius = itemModel.get('radius'); -eval("var _util = __webpack_require__(/*! ../../core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 = __webpack_require__(/*! ../../contain/text */ \"./node_modules/zrender/lib/contain/text.js\");\n\nvar roundRectHelper = __webpack_require__(/*! ./roundRect */ \"./node_modules/zrender/lib/graphic/helper/roundRect.js\");\n\nvar imageHelper = __webpack_require__(/*! ./image */ \"./node_modules/zrender/lib/graphic/helper/image.js\");\n\nvar fixShadow = __webpack_require__(/*! ./fixShadow */ \"./node_modules/zrender/lib/graphic/helper/fixShadow.js\");\n\nvar _constant = __webpack_require__(/*! ../constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\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']];\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(outerHeight, 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(outerHeight, 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(blockHeiht, 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 = textContain.adjustTextPositionOnRect(textPosition, rect, style.textDistance);\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 return {\n baseX: baseX,\n baseY: baseY,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\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.getStroke = getStroke;\nexports.getFill = getFill;\nexports.needDrawText = needDrawText;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvdGV4dC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2hlbHBlci90ZXh0LmpzP2E3M2MiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIF91dGlsID0gcmVxdW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th(); + var height = api.getHeight(); + var size = Math.min(width, height); + // itemStyle + var outlineDistance = 0; + var outlineBorderWidth = 0; + var showOutline = seriesModel.get('outline.show'); -/***/ }), + if (showOutline) { + outlineDistance = seriesModel.get('outline.borderDistance'); + outlineBorderWidth = parsePercent( + seriesModel.get('outline.itemStyle.borderWidth'), size + ); + } -/***/ "./node_modules/zrender/lib/graphic/mixin/RectText.js": -/*!************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/mixin/RectText.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var cx = parsePercent(center[0], width); + var cy = parsePercent(center[1], height); -eval("var textHelper = __webpack_require__(/*! ../helper/text */ \"./node_modules/zrender/lib/graphic/helper/text.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar _constant = __webpack_require__(/*! ../constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9taXhpbi9SZWN0VGV4dC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL21peGluL1JlY3RUZXh0LmpzPzllMmUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRleHRIZWxwZXIgPSByZXF1aXJlKFwiLi4vaGVscGVyL3RleHRcIik7XG5cbnZhciBCb3VuZGluZ1JlY3QgPSByZXF1aXJlKFwiLi4vLi4vY29yZS9Cb3VuZGluZ1JlY3RcIik7XG5cbnZhciBfY29uc3RhbnQgPSByZXF1aXJlKFwiLi4vY29uc3RhbnRcIik7XG5cbnZhciBXSUxMX0JFX1JFU1RPUkVEID0gX2NvbnN0YW50LldJTExfQkVfUkVTVE9SRUQ7XG5cbi8qKlxuICogTWl4aW4gZm9yIGRyYXdpbmcgdGV4dCBpbiBhIGVsZW1lbnQgYm91bmRpbmcgcmVjdFxuICogQG1vZHVsZSB6cmVuZGVyL21peGluL1JlY3RUZXh0XG4gKi9cbnZhciB0bXBSZWN0ID0gbmV3IEJvdW5kaW5nUmVjdCgpO1xuXG52YXIgUmVjdFRleHQgPSBmdW5jdGlvbiAoKSB7fTtcblxuUmVjdFRleHQucHJvdG90eXBlID0ge1xuICBjb25zdHJ1Y3RvcjogUmVjdFRleHQsXG5cbiAgLyoqXG4gICAqIERyYXcgdGV4dCBpbiBhIHJlY3Qgd2l0aCBzcGVjaWZpZWQgcG9zaXRpb24uX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ceURL=webpack-internal:///./node_modules/zrender/lib/graphic/mixin/RectText.js\n"); + var outterRadius; + var innerRadius; + var paddingRadius; -/***/ }), + var isFillContainer = false; -/***/ "./node_modules/zrender/lib/graphic/shape/Arc.js": -/*!*******************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Arc.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var symbol = seriesModel.get('shape'); + if (symbol === 'container') { + // a shape that fully fills the container + isFillContainer = true; -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9BcmMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9BcmMuanM/OGQzMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuLi9QYXRoXCIpO1xuXG4vKipcbiAqIOWchuW8p1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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Arc.js\n"); + outterRadius = [ + width / 2, + height / 2 + ]; + innerRadius = [ + outterRadius[0] - outlineBorderWidth / 2, + outterRadius[1] - outlineBorderWidth / 2 + ]; + paddingRadius = [ + parsePercent(outlineDistance, width), + parsePercent(outlineDistance, height) + ]; -/***/ }), + radius = [ + Math.max(innerRadius[0] - paddingRadius[0], 0), + Math.max(innerRadius[1] - paddingRadius[1], 0) + ]; + } + else { + outterRadius = parsePercent(radius, size) / 2; + innerRadius = outterRadius - outlineBorderWidth / 2; + paddingRadius = parsePercent(outlineDistance, size); -/***/ "./node_modules/zrender/lib/graphic/shape/BezierCurve.js": -/*!***************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/BezierCurve.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + radius = Math.max(innerRadius - paddingRadius, 0); + } -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar vec2 = __webpack_require__(/*! ../../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar _curve = __webpack_require__(/*! ../../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9CZXppZXJDdXJ2ZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL3NoYXBlL0JlemllckN1cnZlLmpzP2FjMGYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIFBhdGggPSByZXF1aXJlKFwiLi4vUGF0aFwiKTtcblxudmFyIHZlYzIgPSByZXF1aXJlKFwiLi4vLi4vY29yZS92ZWN0b3JcIik7XG5cbnZhciBfY3VydmUgPSByZXF1aXJlKFwiLi4vLi4vY29yZS9jdXJ2ZVwiKTtcblxudmFyIHF1YWRyYXRpY1N1YmRpdmlkZSA9IF9jdXJ2ZS5xdWFkcmF0aWNTdWJkaXZpZGU7XG52YXIgY3ViaWNTdWJkaXZpZGUgPSBfY3VydmUuY3ViaWNTdWJkaXZpZGU7XG52YXIgcXVhZHJhdGljQXQgPSBfY3VydmUucXVhZHJhdGljQXQ7XG52YXIgY3ViaWNBdCA9IF9jdXJ2ZS5jdWJpY0F0O1xudmFyIHF1YWRyYXRpY0Rlcml2YXRpdmVBdCA9IF9jdXJ2ZS5xdWFkcmF0aWNEZXJpdmF0aXZlQXQ7XG52YXIgY3ViaWNEZXJpdmF0aXZlQXQgPSBfY3VydmUuY3ViaWNEZXJpdmF0aXZlQXQ7XG5cbi8qKlxuICog6LSd5aGe5b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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/BezierCurve.js\n"); + if (showOutline) { + var outline = getOutline(); + outline.style.lineWidth = outlineBorderWidth; + group.add(getOutline()); + } -/***/ }), + var left = isFillContainer ? 0 : cx - radius; + var top = isFillContainer ? 0 : cy - radius; -/***/ "./node_modules/zrender/lib/graphic/shape/Circle.js": -/*!**********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Circle.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var wavePath = null; -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9DaXJjbGUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9DaXJjbGUuanM/ZDlmYyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuLi9QYXRoXCIpO1xuXG4vKipcbiAqIOWchuW9olxuICogQG1vZHVsZSB6cmVuZGVyL3NoYXBlL0NpcmNsZVxuICovXG52YXIgX2RlZmF1bHQgPSBQYXRoLmV4dGVuZCh7XG4gIHR5cGU6ICdjaXJjbGUnLFxuICBzaGFwZToge1xuICAgIGN4OiAwLFxuICAgIGN5OiAwLFxuICAgIHI6IDBcbiAgfSxcbiAgYnVpbGRQYXRoOiBmdW5jdGlvbiAoY3R4LCBzaGFwZSwgaW5CdW5kbGUpIHtcbiAgICAvLyBCZXR0ZXIgc3Ryb2tpbmcgaW4gU2hhcGVCdW5kbGVcbiAgICAvLyBBbHdheXMgZG8gaXQgbWF5IGhhdmUgcGVyZm9ybWVuY2UgaXNzdWUgKCBmaWxsIG1heSBiZSAyeCBtb3JlIGNvc3QpXG4gICAgaWYgKGluQnVuZGxlKSB7XG4gICAgICBjdHgubW92ZVRvKHNoYXBlLmN4ICsgc2hhcGUuciwgc2hhcGUuY3kpO1xuICAgIH0gLy8gZWxzZSB7XG4gICAgLy8gICAgIGlmIChjdHguYWxsb2NhdGUgJiYgIWN0eC5kYXRhLmxlbmd0aCkge1xuICAgIC8vICAgICAgICAgY3R4LmFsbG9jYXRlKGN0eC5DTURfTUVNX1NJWkUuQSk7XG4gICAgLy8gICAgIH1cbiAgICAvLyB9XG4gICAgLy8gQmV0dGVyIHN0cm9raW5nIGluIFNoYXBlQnVuZGxlXG4gICAgLy8gY3R4Lm1vdmVUbyhzaGFwZS5jeCArIHNoYXBlLnIsIHNoYXBlLmN5KTtcblxuXG4gICAgY3R4LmFyYyhzaGFwZS5jeCwgc2hhcGUuY3ksIHNoYXBlLnIsIDAsIE1hdGguUEkgKiAyLCB0cnVlKTtcbiAgfVxufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Circle.js\n"); + group.add(getBackground()); -/***/ }), + // each data item for a wave + var oldData = this._data; + var waves = []; + data.diff(oldData) + .add(function (idx) { + var wave = getWave(idx, false); -/***/ "./node_modules/zrender/lib/graphic/shape/Line.js": -/*!********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Line.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var waterLevel = wave.shape.waterLevel; + wave.shape.waterLevel = isFillContainer ? height / 2 : radius; + echarts.graphic.initProps(wave, { + shape: { + waterLevel: waterLevel + } + }, seriesModel); -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar _subPixelOptimize = __webpack_require__(/*! ../helper/subPixelOptimize */ \"./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9MaW5lLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvTGluZS5qcz9jYjExIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbnZhciBfc3ViUGl4ZWxPcHRpbWl6ZSA9IHJlcXVpcmUoXCIuLi9oZWxwZXIvc3ViUGl4ZWxPcHRpbWl6ZVwiKTtcblxudmFyIHN1YlBpeGVsT3B0aW1pemVMaW5lID0gX3N1YlBpeGVsT3B0aW1pemUuc3ViUGl4ZWxPcHRpbWl6ZUxpbmU7XG5cbi8qKlxuICog55u057q/XG4gKiBAbW9kdWxlIHpyZW5kZXIvZ3JhcGhpYy9zaGFwZS9MaW5lXG4gKi9cbi8vIEF2b2lkIGNyZWF0ZSByZXBlYXRseS5cbnZhciBzdWJQaXhlbE9wdGltaXplT3V0cHV0U2hhcGUgPSB7fTtcblxudmFyIF9kZWZhdWx0ID0gUGF0aC5leHRlbmQoe1xuICB0eXBlOiAnbGluZScsXG4gIHNoYXBlOiB7XG4gICAgLy8gU3RhcnQgcG9pbnRcbiAgICB4MTogMCxcbiAgICB5MTogMCxcbiAgICAvLyBFbmQgcG9pbnRcbiAgICB4MjogMCxcbiAgICB5MjogMCxcbiAgICBwZXJjZW50OiAxXG4gIH0sXG4gIHN0eWxlOiB7XG4gICAgc3Ryb2tlOiAnIzAwMCcsXG4gICAgZmlsbDogbnVs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WJlcn0gcGVyY2VudFxuICAgKiBAcmV0dXJuIHtBcnJheS48bnVtYmVyPn1cbiAgICovXG4gIHBvaW50QXQ6IGZ1bmN0aW9uIChwKSB7XG4gICAgdmFyIHNoYXBlID0gdGhpcy5zaGFwZTtcbiAgICByZXR1cm4gW3NoYXBlLngxICogKDEgLSBwKSArIHNoYXBlLngyICogcCwgc2hhcGUueTEgKiAoMSAtIHApICsgc2hhcGUueTIgKiBwXTtcbiAgfVxufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Line.js\n"); + wave.z2 = 2; + setWaveAnimation(idx, wave, null); -/***/ }), + group.add(wave); + data.setItemGraphicEl(idx, wave); + waves.push(wave); + }) + .update(function (newIdx, oldIdx) { + var waveElement = oldData.getItemGraphicEl(oldIdx); -/***/ "./node_modules/zrender/lib/graphic/shape/Polygon.js": -/*!***********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Polygon.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + // new wave is used to calculate position, but not added + var newWave = getWave(newIdx, false, waveElement); -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar polyHelper = __webpack_require__(/*! ../helper/poly */ \"./node_modules/zrender/lib/graphic/helper/poly.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9Qb2x5Z29uLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvUG9seWdvbi5qcz84N2IxIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbnZhciBwb2x5SGVscGVyID0gcmVxdWlyZShcIi4uL2hlbHBlci9wb2x5XCIpO1xuXG4vKipcbiAqIOWkmui+ueW9olxuICogQG1vZHVsZSB6cmVuZGVyL3NoYXBlL1BvbHlnb25cbiAqL1xudmFyIF9kZWZhdWx0ID0gUGF0aC5leHRlbmQoe1xuICB0eXBlOiAncG9seWdvbicsXG4gIHNoYXBlOiB7XG4gICAgcG9pbnRzOiBudWxsLFxuICAgIHNtb290aDogZmFsc2UsXG4gICAgc21vb3RoQ29uc3RyYWludDogbnVsbFxuICB9LFxuICBidWlsZFBhdGg6IGZ1bmN0aW9uIChjdHgsIHNoYXBlKSB7XG4gICAgcG9seUhlbHBlci5idWlsZFBhdGgoY3R4LCBzaGFwZSwgdHJ1ZSk7XG4gIH1cbn0pO1xuXG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Polygon.js\n"); + // changes with animation + var shape = {}; + var shapeAttrs = ['amplitude', 'cx', 'cy', 'phase', 'radius', 'radiusY', 'waterLevel', 'waveLength']; + for (var i = 0; i < shapeAttrs.length; ++i) { + var attr = shapeAttrs[i]; + if (newWave.shape.hasOwnProperty(attr)) { + shape[attr] = newWave.shape[attr]; + } + } -/***/ }), + var style = {}; + var styleAttrs = ['fill', 'opacity', 'shadowBlur', 'shadowColor']; + for (var i = 0; i < styleAttrs.length; ++i) { + var attr = styleAttrs[i]; + if (newWave.style.hasOwnProperty(attr)) { + style[attr] = newWave.style[attr]; + } + } -/***/ "./node_modules/zrender/lib/graphic/shape/Polyline.js": -/*!************************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Polyline.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + if (isFillContainer) { + shape.radiusY = height / 2; + } -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar polyHelper = __webpack_require__(/*! ../helper/poly */ \"./node_modules/zrender/lib/graphic/helper/poly.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9Qb2x5bGluZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL3NoYXBlL1BvbHlsaW5lLmpzP2Q0OTgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIFBhdGggPSByZXF1aXJlKFwiLi4vUGF0aFwiKTtcblxudmFyIHBvbHlIZWxwZXIgPSByZXF1aXJlKFwiLi4vaGVscGVyL3BvbHlcIik7XG5cbi8qKlxuICogQG1vZHVsZSB6cmVuZGVyL2dyYXBoaWMvc2hhcGUvUG9seWxpbmVcbiAqL1xudmFyIF9kZWZhdWx0ID0gUGF0aC5leHRlbmQoe1xuICB0eXBlOiAncG9seWxpbmUnLFxuICBzaGFwZToge1xuICAgIHBvaW50czogbnVsbCxcbiAgICBzbW9vdGg6IGZhbHNlLFxuICAgIHNtb290aENvbnN0cmFpbnQ6IG51bGxcbiAgfSxcbiAgc3R5bGU6IHtcbiAgICBzdHJva2U6ICcjMDAwJyxcbiAgICBmaWxsOiBudWxsXG4gIH0sXG4gIGJ1aWxkUGF0aDogZnVuY3Rpb24gKGN0eCwgc2hhcGUpIHtcbiAgICBwb2x5SGVscGVyLmJ1aWxkUGF0aChjdHgsIHNoYXBlLCBmYWxzZSk7XG4gIH1cbn0pO1xuXG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Polyline.js\n"); + // changes with animation + echarts.graphic.updateProps(waveElement, { + shape: shape + }, seriesModel); -/***/ }), + waveElement.useStyle(style); -/***/ "./node_modules/zrender/lib/graphic/shape/Rect.js": -/*!********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Rect.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + // instant changes + waveElement.position = newWave.position; + waveElement.setClipPath(newWave.clipPath); + waveElement.shape.inverse = newWave.inverse; -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar roundRectHelper = __webpack_require__(/*! ../helper/roundRect */ \"./node_modules/zrender/lib/graphic/helper/roundRect.js\");\n\nvar _subPixelOptimize = __webpack_require__(/*! ../helper/subPixelOptimize */ \"./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9SZWN0LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvUmVjdC5qcz9jN2EyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbnZhciByb3VuZFJlY3RIZWxwZXIgPSByZXF1aXJlKFwiLi4vaGVscGVyL3JvdW5kUmVjdFwiKTtcblxudmFyIF9zdWJQaXhlbE9wdGltaXplID0gcmVxdWlyZShcIi4uL2hlbHBlci9zdWJQaXhlbE9wdGltaXplXCIpO1xuXG52YXIgc3ViUGl4ZWxPcHRpbWl6ZVJlY3QgPSBfc3ViUGl4ZWxPcHRpbWl6ZS5zdWJQaXhlbE9wdGltaXplUmVjdDtcblxuLyoqXG4gKiDnn6nlvaJcbiAqIEBtb2R1bGUgenJlbmRlci9ncmFwaGljL3NoYXBlL1JlY3RcbiAqL1xuLy8gQXZvaWQgY3JlYXRlIHJlcGVhdGx5LlxudmFyIHN1YlBpeGVsT3B0aW1pemV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pack-internal:///./node_modules/zrender/lib/graphic/shape/Rect.js\n"); + setWaveAnimation(newIdx, waveElement, waveElement); + group.add(waveElement); + data.setItemGraphicEl(newIdx, waveElement); + waves.push(waveElement); + }) + .remove(function (idx) { + var wave = oldData.getItemGraphicEl(idx); + group.remove(wave); + }) + .execute(); -/***/ }), + if (itemModel.get('label.show')) { + group.add(getText(waves)); + } -/***/ "./node_modules/zrender/lib/graphic/shape/Ring.js": -/*!********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Ring.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + this._data = data; -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9SaW5nLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvUmluZy5qcz80NTczIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbi8qKlxuICog5ZyG546vXG4gKiBAbW9kdWxlIHpyZW5kZXIvZ3JhcGhpYy9zaGFwZS9SaW5nXG4gKi9cbnZhciBfZGVmYXVsdCA9IFBhdGguZXh0ZW5kKHtcbiAgdHlwZTogJ3JpbmcnLFxuICBzaGFwZToge1xuICAgIGN4OiAwLFxuICAgIGN5OiAwLFxuICAgIHI6IDAsXG4gICAgcjA6IDBcbiAgfSxcbiAgYnVpbGRQYXRoOiBmdW5jdGlvbiAoY3R4LCBzaGFwZSkge1xuICAgIHZhciB4ID0gc2hhcGUuY3g7XG4gICAgdmFyIHkgPSBzaGFwZS5jeTtcbiAgICB2YXIgUEkyID0gTWF0aC5QSSAqIDI7XG4gICAgY3R4Lm1vdmVUbyh4ICsgc2hhcGUuciwgeSk7XG4gICAgY3R4LmFyYyh4LCB5LCBzaGFwZS5yLCAwLCBQSTIsIGZhbHNlKTtcbiAgICBjdHgubW92ZVRvKHggKyBzaGFwZS5yMCwgeSk7XG4gICAgY3R4LmFyYyh4LCB5LCBzaGFwZS5yMCwgMCwgUEkyLCB0cnVlKTtcbiAgfVxufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Ring.js\n"); + /** + * Get path for outline, background and clipping + * + * @param {number} r outter radius of shape + * @param {boolean|undefined} isForClipping if the shape is used + * for clipping + */ + function getPath(r, isForClipping) { + if (symbol) { + // customed symbol path + if (symbol.indexOf('path://') === 0) { + var path = echarts.graphic.makePath(symbol.slice(7), {}); + var bouding = path.getBoundingRect(); + var w = bouding.width; + var h = bouding.height; + if (w > h) { + h = r * 2 / w * h; + w = r * 2; + } + else { + w = r * 2 / h * w; + h = r * 2; + } -/***/ }), + var left = isForClipping ? 0 : cx - w / 2; + var top = isForClipping ? 0 : cy - h / 2; + path = echarts.graphic.makePath( + symbol.slice(7), + {}, + new echarts.graphic.BoundingRect(left, top, w, h) + ); + if (isForClipping) { + path.position = [-w / 2, -h / 2]; + } + return path; + } + else if (isFillContainer) { + // fully fill the container + var x = isForClipping ? -r[0] : cx - r[0]; + var y = isForClipping ? -r[1] : cy - r[1]; + return symbolUtil.createSymbol( + 'rect', x, y, r[0] * 2, r[1] * 2 + ); + } + else { + var x = isForClipping ? -r : cx - r; + var y = isForClipping ? -r : cy - r; + if (symbol === 'pin') { + y += r; + } + else if (symbol === 'arrow') { + y -= r; + } + return symbolUtil.createSymbol(symbol, x, y, r * 2, r * 2); + } + } -/***/ "./node_modules/zrender/lib/graphic/shape/Sector.js": -/*!**********************************************************!*\ - !*** ./node_modules/zrender/lib/graphic/shape/Sector.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + return new echarts.graphic.Circle({ + shape: { + cx: isForClipping ? 0 : cx, + cy: isForClipping ? 0 : cy, + r: r + } + }); + } + /** + * Create outline + */ + function getOutline() { + var outlinePath = getPath(outterRadius); + outlinePath.style.fill = null; -eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar fixClipWithShadow = __webpack_require__(/*! ../helper/fixClipWithShadow */ \"./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9TZWN0b3IuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9TZWN0b3IuanM/NGFhMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuLi9QYXRoXCIpO1xuXG52YXIgZml4Q2xpcFdpdGhTaGFkb3cgPSByZXF1aXJlKFwiLi4vaGVscGVyL2ZpeENsaXBXaXRoU2hhZG93XCIpO1xuXG4vKipcbiAqIOaJh+W9olxuICogQG1vZHVsZSB6cmVuZGVyL2dyYXBoaWMvc2hhcGUvU2VjdG9yXG4gKi9cbnZhciBfZGVmYXVsdCA9IFBhdGguZXh0ZW5kKHtcbiAgdHlwZTogJ3NlY3RvcicsXG4gIHNoYXBlOiB7XG4gICAgY3g6IDAsXG4gICAgY3k6IDAsXG4gICAgcjA6IDAsXG4gICAgcjogMCxcbiAgICBzdGFydEFuZ2xlOiAwLFxuICAgIGVuZEFuZ2xlOiBNYXRoLlBJICogMixcbiAgICBjbG9ja3d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UE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Sector.js\n"); + outlinePath.setStyle(seriesModel.getModel('outline.itemStyle') + .getItemStyle()); -/***/ }), + return outlinePath; + } -/***/ "./node_modules/zrender/lib/mixin/Animatable.js": -/*!******************************************************!*\ - !*** ./node_modules/zrender/lib/mixin/Animatable.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Create background + */ + function getBackground() { + // Seperate stroke and fill, so we can use stroke to cover the alias of clipping. + var strokePath = getPath(radius); + strokePath.setStyle(seriesModel.getModel('backgroundStyle') + .getItemStyle()); + strokePath.style.fill = null; -eval("var Animator = __webpack_require__(/*! ../animation/Animator */ \"./node_modules/zrender/lib/animation/Animator.js\");\n\nvar log = __webpack_require__(/*! ../core/log */ \"./node_modules/zrender/lib/core/log.js\");\n\nvar _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\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 modue: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 log('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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vQW5pbWF0YWJsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9taXhpbi9BbmltYXRhYmxlLmpzP2JkNmIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIEFuaW1hdG9yID0gcmVxdWlyZShcIi4uL2FuaW1hdGlvbi9BbmltYXRvclwiKTtcblxudmFyIGxvZyA9IHJlcXVpcmUoXCIuLi9jb3JlL2xvZ1wiKTtcblxudmFyIF91dGlsID0gcmVxdWlyZShcIi4uL2NvcmUvdXRpbFwiKTtcblxudmFyIGlzU3RyaW5nID0gX3V0aWwuaXN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jZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/mixin/Animatable.js\n"); + // Stroke is front of wave + strokePath.z2 = 5; -/***/ }), + var fillPath = getPath(radius); + fillPath.setStyle(seriesModel.getModel('backgroundStyle') + .getItemStyle()); + fillPath.style.stroke = null; -/***/ "./node_modules/zrender/lib/mixin/Eventful.js": -/*!****************************************************!*\ - !*** ./node_modules/zrender/lib/mixin/Eventful.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + var group = new echarts.graphic.Group(); + group.add(strokePath); + group.add(fillPath); -eval("/**\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] Call 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 * @param {Function} [handler] The event handler.\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vRXZlbnRmdWwuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vRXZlbnRmdWwuanM/MWZhYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV2ZW50IE1peGluXG4gKiBAbW9kdWxlIHpyZW5kZXIvbWl4aW4vRXZlbnRmdWxcbiAqIEBhdXRob3IgS2VuZXIgKEBLZW5lci3mnpfls7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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/mixin/Eventful.js\n"); + return group; + } -/***/ }), + /** + * wave shape + */ + function getWave(idx, isInverse, oldWave) { + var radiusX = isFillContainer ? radius[0] : radius; + var radiusY = isFillContainer ? height / 2 : radius; -/***/ "./node_modules/zrender/lib/mixin/Transformable.js": -/*!*********************************************************!*\ - !*** ./node_modules/zrender/lib/mixin/Transformable.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var itemModel = data.getItemModel(idx); + var itemStyleModel = itemModel.getModel('itemStyle'); + var phase = itemModel.get('phase'); + var amplitude = parsePercent(itemModel.get('amplitude'), + radiusY * 2); + var waveLength = parsePercent(itemModel.get('waveLength'), + radiusX * 2); -eval("var matrix = __webpack_require__(/*! ../core/matrix */ \"./node_modules/zrender/lib/core/matrix.js\");\n\nvar vector = __webpack_require__(/*! ../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vVHJhbnNmb3JtYWJsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9taXhpbi9UcmFuc2Zvcm1hYmxlLmpzPzBjZGUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1hdHJpeCA9IHJlcXVpcmUoXCIuLi9jb3JlL21hdHJpeFwiKTtcblxudmFyIHZlY3RvciA9IHJlcXVpcmUoXCIuLi9jb3JlL3ZlY3RvclwiKTtcblxuLyoqXG4gKiDmj5Dkvpvlj5jmjaLmianlsZVcbiAqIEBtb2R1bGUgenJlbmRlci9taXhpbi9UcmFuc2Zvcm1hYmxlXG4gKiBAYXV0aG9yIHBpc3NhbmcgKGh0dHBzOi8vd3d3LmdpdGh1Yi5jb20vcGlzc2FuZylcbiAqL1xudmFyIG1JZGVudGl0eSA9IG1hdHJpeC5pZGVudGl0eTtcbnZhciBFUFNJTE9OID0gNWUtNTtcblxuZnVuY3Rpb24gaXNOb3RBcm91bmRaZXJvKHZhbCkge1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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/mixin/Transformable.js\n"); + var value = data.get('value', idx); + var waterLevel = radiusY - value * radiusY * 2; + phase = oldWave ? oldWave.shape.phase + : (phase === 'auto' ? idx * Math.PI / 4 : phase); + var normalStyle = itemStyleModel.getItemStyle(); + if (!normalStyle.fill) { + var seriesColor = seriesModel.get('color'); + var id = idx % seriesColor.length; + normalStyle.fill = seriesColor[id]; + } -/***/ }), + var x = radiusX * 2; + var wave = new LiquidLayout({ + shape: { + waveLength: waveLength, + radius: radiusX, + radiusY: radiusY, + cx: x, + cy: 0, + waterLevel: waterLevel, + amplitude: amplitude, + phase: phase, + inverse: isInverse + }, + style: normalStyle, + position: [cx, cy] + }); + wave.shape._waterLevel = waterLevel; -/***/ "./node_modules/zrender/lib/tool/color.js": -/*!************************************************!*\ - !*** ./node_modules/zrender/lib/tool/color.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var hoverStyle = itemModel.getModel('emphasis.itemStyle') + .getItemStyle(); + hoverStyle.lineWidth = 0; + echarts.graphic.setHoverStyle(wave, hoverStyle); -eval("var LRU = __webpack_require__(/*! ../core/LRU */ \"./node_modules/zrender/lib/core/LRU.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvdG9vbC9jb2xvci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi90b29sL2NvbG9yLmpzPzQxZWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIExSVSA9IHJlcXVpcmUoXCIuLi9jb3JlL0xSVVwiKTtcblxudmFyIGtDU1NDb2xvclRhYmxlID0ge1xuICAndHJhbnNwYXJlbnQnOiBbMCwgMCwgMCwgMF0sXG4gICdhbGljZWJsdWUnOiBbMjQwLCAyNDgsIDI1NSwgMV0sXG4gICdhbnRpcXVld2hpdGUnOiBbMjUwLCAyMzUsIDIxNSwgMV0sXG4gICdhcXVhJzogWzAsIDI1NSwgMjU1LCAxXSxcbiAgJ2FxdWFtYXJpbmUnOiBbMTI3LCAyNTUsIDIxMiwgMV0sXG4gICdhenVyZSc6IFsyNDAsIDI1NSwgMjU1LCAxXSxcbiAgJ2JlaWdlJzogWzI0NSwgMjQ1LCAyMjAsIDFdLFxuICAnYmlzcXVlJzogWzI1NSwgMjI4LCAxOTYsIDFdLFxuICAnYmxhY2snOiBbMCwgMCwgMCwgMV0sXG4gICdibGFuY2hlZGFsbW9uZCc6IFsyNTUsIDIzNSwgMjA1LCAxXSxcbiAgJ2JsdWUnOiBbMCwgMCwgMjU1LCAxXSxcbiAgJ2JsdWV2aW9sZXQnOiBbMTM4LCA0MywgMjI2LCAxXSxcbiAgJ2Jyb3duJzogWzE2NSwgNDIsIDQyLCAxXSxcbiAgJ2J1cmx5d29vZCc6IFsyMjIsIDE4NCwgMTM1LCAxXSxc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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/tool/color.js\n"); + // clip out the part outside the circle + var clip = getPath(radius, true); + // set fill for clipPath, otherwise it will not trigger hover event + clip.setStyle({ + fill: 'white' + }); + wave.setClipPath(clip); -/***/ }), + return wave; + } -/***/ "./node_modules/zrender/lib/tool/path.js": -/*!***********************************************!*\ - !*** ./node_modules/zrender/lib/tool/path.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + function setWaveAnimation(idx, wave, oldWave) { + var itemModel = data.getItemModel(idx); -eval("var Path = __webpack_require__(/*! ../graphic/Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar transformPath = __webpack_require__(/*! ./transformPath */ \"./node_modules/zrender/lib/tool/transformPath.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvdG9vbC9wYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL3Rvb2wvcGF0aC5qcz8zNDJkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL2dyYXBoaWMvUGF0aFwiKTtcblxudmFyIFBhdGhQcm94eSA9IHJlcXVpcmUoXCIuLi9jb3JlL1BhdGhQcm94eVwiKTtcblxudmFyIHRyYW5zZm9ybVBhdGggPSByZXF1aXJlKFwiLi90cmFuc2Zvcm1QYXRoXCIpO1xuXG4vLyBjb21tYW5kIGNoYXJzXG4vLyB2YXIgY2MgPSBbXG4vLyAgICAgJ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HBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdMJzpcbiAgICAgICAgICBjcHggPSBwW29mZisrXTtcbiAgICAgICAgICBjcHkgPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTDtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgY3B4ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSArPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTTtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgc3VicGF0aFggPSBjcHg7XG4gICAgICAgICAgc3VicGF0aFkgPSBjcHk7XG4gICAgICAgICAgY21kU3RyID0gJ2wnO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgIGNweCA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5NO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBzdWJwYXRoWCA9IGNweDtcbiAgICAgICAgICBzdWJwYXRoWSA9IGNweTtcbiAgICAgICAgICBjbWRTdHIgPSAnTCc7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgY3B4ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5MO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdIJzpcbiAgICAgICAgICBjcHggPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTDtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAndic6XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5MO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdWJzpcbiAgICAgICAgICBjcHkgPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTDtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQyc6XG4gICAgICAgICAgY21kID0gQ01ELkM7XG4gICAgICAgICAgcGF0aC5hZGREYXRhKGNtZCwgcFtvZmYrK10sIHBbb2ZmKytdLCBwW29mZisrXSwgcFtvZmYrK10sIHBbb2ZmKytdLCBwW29mZisrXSk7XG4gICAgICAgICAgY3B4ID0gcFtvZmYgLSAyXTtcbiAgICAgICAgICBjcHkgPSBwW29mZiAtIDFdO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ2MnOlxuICAgICAgICAgIGNtZCA9IENNRC5DO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIHBbb2ZmKytdICsgY3B4LCBwW29mZisrXSArIGNweSwgcFtvZmYrK10gKyBjcHgsIHBbb2ZmKytdICsgY3B5LCBwW29mZisrXSArIGNweCwgcFtvZmYrK10gKyBjcHkpO1xuICAgICAgICAgIGNweCArPSBwW29mZiAtIDJdO1xuICAgICAgICAgIGNweSArPSBwW29mZiAtIDFdO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ1MnOlxuICAgICAgICAgIGN0bFB0eCA9IGNweDtcbiAgICAgICAgICBjdGxQdHkgPSBjcHk7XG4gICAgICAgICAgdmFyIGxlbiA9IHBhdGgubGVuKCk7XG4gICAgICAgICAgdmFyIHBhdGhEYXRhID0gcGF0aC5kYXRhO1xuXG4gICAgICAgICAgaWYgKHByZXZDbWQgPT09IENNRC5DKSB7XG4gICAgICAgICAgICBjdGxQdHggKz0gY3B4IC0gcGF0aERhdGFbbGVuIC0gNF07XG4gICAgICAgICAgICBjdGxQdHkgKz0gY3B5IC0gcGF0aERhdGFbbGVuIC0gM107XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY21kID0gQ01ELkM7XG4gICAgICAgICAgeDEgPSBwW29mZisrXTtcbiAgICAgICAgICB5MSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweCA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSA9IHBbb2ZmKytdO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGN0bFB0eCwgY3RsUHR5LCB4MSwgeTEsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICBjdGxQdHggPSBjcHg7XG4gICAgICAgICAgY3RsUHR5ID0gY3B5O1xuICAgICAgICAgIHZhciBsZW4gPSBwYXRoLmxlbigpO1xuICAgICAgICAgIHZhciBwYXRoRGF0YSA9IHBhdGguZGF0YTtcblxuICAgICAgICAgIGlmIChwcmV2Q21kID09PSBDTUQuQykge1xuICAgICAgICAgICAgY3RsUHR4ICs9IGNweCAtIHBhdGhEYXRhW2xlbiAtIDRdO1xuICAgICAgICAgICAgY3RsUHR5ICs9IGNweSAtIHBhdGhEYXRhW2xlbiAtIDNdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNtZCA9IENNRC5DO1xuICAgICAgICAgIHgxID0gY3B4ICsgcFtvZmYrK107XG4gICAgICAgICAgeTEgPSBjcHkgKyBwW29mZisrXTtcbiAgICAgICAgICBjcHggKz0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGN0bFB0eCwgY3RsUHR5LCB4MSwgeTEsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdRJzpcbiAgICAgICAgICB4MSA9IHBbb2ZmKytdO1xuICAgICAgICAgIHkxID0gcFtvZmYrK107XG4gICAgICAgICAgY3B4ID0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ID0gcFtvZmYrK107XG4gICAgICAgICAgY21kID0gQ01ELlE7XG4gICAgICAgICAgcGF0aC5hZGREYXRhKGNtZCwgeDEsIHkxLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAncSc6XG4gICAgICAgICAgeDEgPSBwW29mZisrXSArIGNweDtcbiAgICAgICAgICB5MSA9IHBbb2ZmKytdICsgY3B5O1xuICAgICAgICAgIGNweCArPSBwW29mZisrXTtcbiAgICAgICAgICBjcHkgKz0gcFtvZmYrK107XG4gICAgICAgICAgY21kID0gQ01ELlE7XG4gICAgICAgICAgcGF0aC5hZGREYXRhKGNtZCwgeDEsIHkxLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnVCc6XG4gICAgICAgICAgY3RsUHR4ID0gY3B4O1xuICAgICAgICAgIGN0bFB0eSA9IGNweTtcbiAgICAgICAgICB2YXIgbGVuID0gcGF0aC5sZW4oKTtcbiAgICAgICAgICB2YXIgcGF0aERhdGEgPSBwYXRoLmRhdGE7XG5cbiAgICAgICAgICBpZiAocHJldkNtZCA9PT0gQ01ELlEpIHtcbiAgICAgICAgICAgIGN0bFB0eCArPSBjcHggLSBwYXRoRGF0YVtsZW4gLSA0XTtcbiAgICAgICAgICAgIGN0bFB0eSArPSBjcHkgLSBwYXRoRGF0YVtsZW4gLSAzXTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjcHggPSBwW29mZisrXTtcbiAgICAgICAgICBjcHkgPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuUTtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjdGxQdHgsIGN0bFB0eSwgY3B4LCBjcHkpO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ3QnOlxuICAgICAgICAgIGN0bFB0eCA9IGNweDtcbiAgICAgICAgICBjdGxQdHkgPSBjcHk7XG4gICAgICAgICAgdmFyIGxlbiA9IHBhdGgubGVuKCk7XG4gICAgICAgICAgdmFyIHBhdGhEYXRhID0gcGF0aC5kYXRhO1xuXG4gICAgICAgICAgaWYgKHByZXZDbWQgPT09IENNRC5RKSB7XG4gICAgICAgICAgICBjdGxQdHggKz0gY3B4IC0gcGF0aERhdGFbbGVuIC0gNF07XG4gICAgICAgICAgICBjdGxQdHkgKz0gY3B5IC0gcGF0aERhdGFbbGVuIC0gM107XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY3B4ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSArPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuUTtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjdGxQdHgsIGN0bFB0eSwgY3B4LCBjcHkpO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ0EnOlxuICAgICAgICAgIHJ4ID0gcFtvZmYrK107XG4gICAgICAgICAgcnkgPSBwW29mZisrXTtcbiAgICAgICAgICBwc2kgPSBwW29mZisrXTtcbiAgICAgICAgICBmYSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGZzID0gcFtvZmYrK107XG4gICAgICAgICAgeDEgPSBjcHgsIHkxID0gY3B5O1xuICAgICAgICAgIGNweCA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5BO1xuICAgICAgICAgIHByb2Nlc3NBcmMoeDEsIHkxLCBjcHgsIGNweSwgZmEsIGZzLCByeCwgcnksIHBzaSwgY21kLCBwYXRoKTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdhJzpcbiAgICAgICAgICByeCA9IHBbb2ZmKytdO1xuICAgICAgICAgIHJ5ID0gcFtvZmYrK107XG4gICAgICAgICAgcHNpID0gcFtvZmYrK107XG4gICAgICAgICAgZmEgPSBwW29mZisrXTtcbiAgICAgICAgICBmcyA9IHBbb2ZmKytdO1xuICAgICAgICAgIHgxID0gY3B4LCB5MSA9IGNweTtcbiAgICAgICAgICBjcHggKz0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5BO1xuICAgICAgICAgIHByb2Nlc3NBcmMoeDEsIHkxLCBjcHgsIGNweSwgZmEsIGZzLCByeCwgcnksIHBzaSwgY21kLCBwYXRoKTtcbiAgICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoY21kU3RyID09PSAneicgfHwgY21kU3RyID09PSAnWicpIHtcbiAgICAgIGNtZCA9IENNRC5aO1xuICAgICAgcGF0aC5hZGREYXRhKGNtZCk7IC8vIHogbWF5IGJlIGluIHRoZSBtaWRkbGUgb2YgdGhlIHBhdGguXG5cbiAgICAgIGNweCA9IHN1YnBhdGhYO1xuICAgICAgY3B5ID0gc3VicGF0aFk7XG4gICAgfVxuXG4gICAgcHJldkNtZCA9IGNtZDtcbiAgfVxuXG4gIHBhdGgudG9TdGF0aWMoKTtcbiAgcmV0dXJuIHBhdGg7XG59IC8vIFRPRE8gT3B0aW1pemUgZG91YmxlIG1lbW9yeSBjb3N0IHByb2JsZW1cblxuXG5mdW5jdGlvbiBjcmVhdGVQYXRoT3B0aW9ucyhzdHIsIG9wdHMpIHtcbiAgdmFyIHBhdGhQcm94eSA9IGNyZWF0ZVBhdGhQcm94eUZyb21TdHJpbmcoc3RyKTtcbiAgb3B0cyA9IG9wdHMgfHwge307XG5cbiAgb3B0cy5idWlsZFBhdGgg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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/tool/path.js\n"); + var maxSpeed = itemModel.get('period'); + var direction = itemModel.get('direction'); -/***/ }), + var value = data.get('value', idx); -/***/ "./node_modules/zrender/lib/tool/transformPath.js": -/*!********************************************************!*\ - !*** ./node_modules/zrender/lib/tool/transformPath.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var phase = itemModel.get('phase'); + phase = oldWave ? oldWave.shape.phase + : (phase === 'auto' ? idx * Math.PI / 4 : phase); -eval("var PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar _vector = __webpack_require__(/*! ../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\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;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvdG9vbC90cmFuc2Zvcm1QYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL3Rvb2wvdHJhbnNmb3JtUGF0aC5qcz9lZTg0Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoUHJveHkgPSByZXF1aXJlKFwiLi4vY29yZS9QYXRoUHJveHlcIik7XG5cbnZhciB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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/tool/transformPath.js\n"); + var defaultSpeed = function (maxSpeed) { + var cnt = data.count(); + return cnt === 0 ? maxSpeed : maxSpeed * + (0.2 + (cnt - idx) / cnt * 0.8); + }; + var speed = 0; + if (maxSpeed === 'auto') { + speed = defaultSpeed(5000); + } + else { + speed = typeof maxSpeed === 'function' + ? maxSpeed(value, idx) : maxSpeed; + } -/***/ }), + // phase for moving left/right + var phaseOffset = 0; + if (direction === 'right' || direction == null) { + phaseOffset = Math.PI; + } + else if (direction === 'left') { + phaseOffset = -Math.PI; + } + else if (direction === 'none') { + phaseOffset = 0; + } + else { + console.error('Illegal direction value for liquid fill.'); + } -/***/ "./src/liquidFill.js": -/*!***************************!*\ - !*** ./src/liquidFill.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + // wave animation of moving left/right + if (direction !== 'none' && itemModel.get('waveAnimation')) { + wave + .animate('shape', true) + .when(0, { + phase: phase + }) + .when(speed / 2, { + phase: phaseOffset + phase + }) + .when(speed, { + phase: phaseOffset * 2 + phase + }) + .during(function () { + if (wavePath) { + wavePath.dirty(true); + } + }) + .start(); + } + } -eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\n\n__webpack_require__(/*! ./liquidFillSeries */ \"./src/liquidFillSeries.js\");\n__webpack_require__(/*! ./liquidFillView */ \"./src/liquidFillView.js\");\n\n\necharts.registerVisual(\n echarts.util.curry(\n __webpack_require__(/*! echarts/lib/visual/dataColor */ \"./node_modules/echarts/lib/visual/dataColor.js\"), 'liquidFill'\n )\n);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL3NyYy9saXF1aWRGaWxsLmpzP2NhOGIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGVjaGFydHMgPSByZXF1aXJlKCdlY2hhcnRzL2xpYi9lY2hhcnRzJyk7XG5cbnJlcXVpcmUoJy4vbGlxdWlkRmlsbFNlcmllcycpO1xucmVxdWlyZSgnLi9saXF1aWRGaWxsVmlldycpO1xuXG5cbmVjaGFydHMucmVnaXN0ZXJWaXN1YWwoXG4gICAgZWNoYXJ0cy51dGlsLmN1cnJ5KFxuICAgICAgICByZXF1aXJlKCdlY2hhcnRzL2xpYi92aXN1YWwvZGF0YUNvbG9yJyksICdsaXF1aWRGaWxsJ1xuICAgIClcbik7XG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/liquidFill.js\n"); + /** + * text on wave + */ + function getText(waves) { + var labelModel = itemModel.getModel('label'); -/***/ }), + function formatLabel() { + var formatted = seriesModel.getFormattedLabel(0, 'normal'); + var defaultVal = (data.get('value', 0) * 100); + var defaultLabel = data.getName(0) || seriesModel.name; + if (!isNaN(defaultVal)) { + defaultLabel = defaultVal.toFixed(0) + '%'; + } + return formatted == null ? defaultLabel : formatted; + } -/***/ "./src/liquidFillLayout.js": -/*!*********************************!*\ - !*** ./src/liquidFillLayout.js ***! - \*********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var textOption = { + z2: 10, + shape: { + x: left, + y: top, + width: (isFillContainer ? radius[0] : radius) * 2, + height: (isFillContainer ? radius[1] : radius) * 2 + }, + style: { + fill: 'transparent', + text: formatLabel(), + textAlign: labelModel.get('align'), + textVerticalAlign: labelModel.get('baseline') + }, + silent: true + }; -eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\n\nmodule.exports = echarts.graphic.extendShape({\n type: 'ec-liquid-fill',\n\n shape: {\n waveLength: 0,\n radius: 0,\n radiusY: 0,\n cx: 0,\n cy: 0,\n waterLevel: 0,\n amplitude: 0,\n phase: 0,\n inverse: false\n },\n\n buildPath: function (ctx, shape) {\n if (shape.radiusY == null) {\n shape.radiusY = shape.radius;\n }\n\n /**\n * We define a sine wave having 4 waves, and make sure at least 8 curves\n * is drawn. Otherwise, it may cause blank area for some waves when\n * wave length is large enough.\n */\n var curves = Math.max(\n Math.ceil(2 * shape.radius / shape.waveLength * 4) * 2,\n 8\n );\n\n // map phase to [-Math.PI * 2, 0]\n while (shape.phase < -Math.PI * 2) {\n shape.phase += Math.PI * 2;\n }\n while (shape.phase > 0) {\n shape.phase -= Math.PI * 2;\n }\n var phase = shape.phase / Math.PI / 2 * shape.waveLength;\n\n var left = shape.cx - shape.radius + phase - shape.radius * 2;\n\n /**\n * top-left corner as start point\n *\n * draws this point\n * |\n * \\|/\n * ~~~~~~~~\n * | |\n * +------+\n */\n ctx.moveTo(left, shape.waterLevel);\n\n /**\n * top wave\n *\n * ~~~~~~~~ <- draws this sine wave\n * | |\n * +------+\n */\n var waveRight = 0;\n for (var c = 0; c < curves; ++c) {\n var stage = c % 4;\n var pos = getWaterPositions(c * shape.waveLength / 4, stage,\n shape.waveLength, shape.amplitude);\n ctx.bezierCurveTo(pos[0][0] + left, -pos[0][1] + shape.waterLevel,\n pos[1][0] + left, -pos[1][1] + shape.waterLevel,\n pos[2][0] + left, -pos[2][1] + shape.waterLevel);\n\n if (c === curves - 1) {\n waveRight = pos[2][0];\n }\n }\n\n if (shape.inverse) {\n /**\n * top-right corner\n * 2. draws this line\n * |\n * +------+\n * 3. draws this line -> | | <- 1. draws this line\n * ~~~~~~~~\n */\n ctx.lineTo(waveRight + left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n else {\n /**\n * top-right corner\n *\n * ~~~~~~~~\n * 3. draws this line -> | | <- 1. draws this line\n * +------+\n * ^\n * |\n * 2. draws this line\n */\n ctx.lineTo(waveRight + left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n\n ctx.closePath();\n }\n});\n\n\n\n/**\n * Using Bezier curves to fit sine wave.\n * There is 4 control points for each curve of wave,\n * which is at 1/4 wave length of the sine wave.\n *\n * The control points for a wave from (a) to (d) are a-b-c-d:\n * c *----* d\n * b *\n * |\n * ... a * ..................\n *\n * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1)\n *\n * @param {number} x x position of the left-most point (a)\n * @param {number} stage 0-3, stating which part of the wave it is\n * @param {number} waveLength wave length of the sine wave\n * @param {number} amplitude wave amplitude\n */\nfunction getWaterPositions(x, stage, waveLength, amplitude) {\n if (stage === 0) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, amplitude],\n [x + waveLength / 4, amplitude]\n ];\n }\n else if (stage === 1) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n else if (stage === 2) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, -amplitude],\n [x + waveLength / 4, -amplitude]\n ]\n }\n else {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n -amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n -amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJm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ICAqL1xuICAgICAgICB2YXIgY3VydmVzID0gTWF0aC5tYXgoXG4gICAgICAgICAgICBNYXRoLmNlaWwoMiAqIHNoYXBlLnJhZGl1cyAvIHNoYXBlLndhdmVMZW5ndGggKiA0KSAqIDIsXG4gICAgICAgICAgICA4XG4gICAgICAgICk7XG5cbiAgICAgICAgLy8gbWFwIHBoYXNlIHRvIFstTWF0aC5QSSAqIDIsIDBdXG4gICAgICAgIHdoaWxlIChzaGFwZS5waGFzZSA8IC1NYXRoLlBJICogMikge1xuICAgICAgICAgICAgc2hhcGUucGhhc2UgKz0gTWF0aC5QSSAqIDI7XG4gICAgICAgIH1cbiAgICAgICAgd2hpbGUgKHNoYXBlLnBoYXNlID4gMCkge1xuICAgICAgICAgICAgc2hhcGUucGhhc2UgLT0gTWF0aC5QSSAqIDI7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHBoYXNlID0gc2hhcGUucGhhc2UgLyBNYXRoLlBJIC8gMiAqIHNoYXBlLndhdmVMZW5ndGg7XG5cbiAgICAgICAgdmFyIGxlZnQgPSBzaGFwZS5jeCAtIHNoYXBlLnJhZGl1cyArIHBoYXNlIC0gc2hhcGUucmFkaXVzICogMjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogdG9wLWxlZnQgY29ybmVyIGFzIHN0YXJ0IHBvaW50XG4gICAgICAgICAqXG4gICAgICAgICAqIGRyYXdzIHRoaXMgcG9pbnRcbiAgICAgICAgICogIHxcbiAgICAgICAgICogXFx8L1xuICAgICAgICAgKiAgfn5+fn5+fn5cbiAgICAgICAgICogIHwgICAgICB8XG4gICAgICAgICAqICArLS0tLS0tK1xuICAgICAgICAgKi9cbiAgICAgICAgY3R4Lm1vdmVUbyhsZWZ0LCBzaGFwZS53YXRlckxldmVsKTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogdG9wIHdhdmVcbiAgICAgICAgICpcbiAgICAgICAgICogfn5+fn5+fn4gPC0gZHJhd3MgdGhpcyBzaW5lIHdhdmVcbiAgICAgICAgICogfCAgICAgIHxcbiAgICAgICAgICogKy0tLS0tLStcbiAgICAgICAgICovXG4gICAgICAgIHZhciB3YXZlUmlnaHQgPSAwO1xuICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8IGN1cnZlczsgKytjKSB7XG4gICAgICAgICAgICB2YXIgc3RhZ2UgPSBjICUgNDtcbiAgICAgICAgICAgIHZhciBwb3MgPSBnZXRXYXRlclBvc2l0aW9ucyhjICogc2hhcGUud2F2ZUxlbmd0aCAvIDQsIHN0YWdlLFxuICAgICAgICAgICAgICAgIHNoYXBlLndhdmVMZW5ndGgsIHNoYXBlLmFtcGxpdHVkZSk7XG4gICAgICAgICAgICBjdHguYmV6aWVyQ3VydmVUbyhwb3NbMF1bMF0gKyBsZWZ0LCAtcG9zWzBdWzFdICsgc2hhcGUud2F0ZXJMZXZlbCxcbiAgICAgICAgICAgICAgICBwb3NbMV1bMF0gKyBsZWZ0LCAtcG9zWzFdWzFdICsgc2hhcGUud2F0ZXJMZXZlbCxcbiAgICAgICAgICAgICAgICBwb3NbMl1bMF0gKyBsZWZ0LCAtcG9zWzJdWzFdICsgc2hhcGUud2F0ZXJMZXZlbCk7XG5cbiAgICAgICAgICAgIGlmIChjID09PSBjdXJ2ZXMgLSAxKSB7XG4gICAgICAgICAgICAgICAgd2F2ZVJpZ2h0ID0gcG9zWzJdWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNoYXBlLmludmVyc2UpIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogdG9wLXJpZ2h0IGNvcm5lclxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAyLiBkcmF3cyB0aGlzIGxpbmVcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLStcbiAgICAgICAgICAgICAqIDMuIGRyYXdzIHRoaXMgbGluZSAtPiB8ICAgICAgfCA8LSAxLiBkcmF3cyB0aGlzIGxpbmVcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICB+fn5+fn5+flxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBjdHgubGluZVRvKHdhdmVSaWdodCArIGxlZnQsIHNoYXBlLmN5IC0gc2hhcGUucmFkaXVzWSk7XG4gICAgICAgICAgICBjdHgubGluZVRvKGxlZnQsIHNoYXBlLmN5IC0gc2hhcGUucmFkaXVzWSk7XG4gICAgICAgICAgICBjdHgubGluZVRvKGxlZnQsIHNoYXBlLndhdGVyTGV2ZWwpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiB0b3AtcmlnaHQgY29ybmVyXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIH5+fn5+fn5+XG4gICAgICAgICAgICAgKiAzLiBkcmF3cyB0aGlzIGxpbmUgLT4gfCAgICAgIHwgPC0gMS4gZHJhd3MgdGhpcyBsaW5lXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLStcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBeXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAyLiBkcmF3cyB0aGlzIGxpbmVcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgY3R4LmxpbmVUbyh3YXZlUmlnaHQgKyBsZWZ0LCBzaGFwZS5jeSArIHNoYXBlLnJhZGl1c1kpO1xuICAgICAgICAgICAgY3R4LmxpbmVUbyhsZWZ0LCBzaGFwZS5jeSArIHNoYXBlLnJhZGl1c1kpO1xuICAgICAgICAgICAgY3R4LmxpbmVUbyhsZWZ0LCBzaGFwZS53YXRlckxldmVsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGN0e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EkgLyAyLCBhbXBsaXR1ZGUgLyAyXSxcbiAgICAgICAgICAgIFt4ICsgMSAvIDIgKiB3YXZlTGVuZ3RoIC8gTWF0aC5QSSwgICAgIGFtcGxpdHVkZV0sXG4gICAgICAgICAgICBbeCArIHdhdmVMZW5ndGggLyA0LCAgICAgICAgICAgICAgICAgICBhbXBsaXR1ZGVdXG4gICAgICAgIF07XG4gICAgfVxuICAgIGVsc2UgaWYgKHN0YWdlID09PSAxKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBbeCArIDEgLyAyICogd2F2ZUxlbmd0aCAvIE1hdGguUEkgLyAyICogKE1hdGguUEkgLSAyKSxcbiAgICAgICAgICAgIGFtcGxpdHVkZV0sXG4gICAgICAgICAgICBbeCArIDEgLyAyICogd2F2ZUxlbmd0aCAvIE1hdGguUEkgLyAyICogKE1hdGguUEkgLSAxKSxcbiAgICAgICAgICAgIGFtcGxpdHVkZSAvIDJdLFxuICAgICAgICAgICAgW3ggKyB3YXZlTGVuZ3RoIC8gNCwgICAgICAgICAgICAgICAgICAgMF1cbiAgICAgICAgXVxuICAgIH1cbiAgICBlbHNlIGlmIChzdGFnZSA9PT0gMikge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgW3ggKyAxIC8gMiAqIHdhdmVMZW5ndGggLyBNYXRoLlBJIC8gMiwgLWFtcGxpdHVkZSAvIDJdLFxuICAgICAgICAgICAgW3ggKyAxIC8gMiAqIHdhdmVMZW5ndGggLyBNYXRoLlBJLCAgICAgLWFtcGxpdHVkZV0sXG4gICAgICAgICAgICBbeCArIHdhdmVMZW5ndGggLyA0LCAgICAgICAgICAgICAgICAgICAtYW1wbGl0dWRlXVxuICAgICAgICBdXG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgW3ggKyAxIC8gMiAqIHdhdmVMZW5ndGggLyBNYXRoLlBJIC8gMiAqIChNYXRoLlBJIC0gMiksXG4gICAgICAgICAgIC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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/liquidFillLayout.js\n"); + var outsideTextRect = new echarts.graphic.Rect(textOption); + var color = labelModel.get('color'); + echarts.graphic.setText(outsideTextRect.style, labelModel, color); -/***/ }), + var insideTextRect = new echarts.graphic.Rect(textOption); + var insColor = labelModel.get('insideColor'); + echarts.graphic.setText(insideTextRect.style, labelModel, insColor); + insideTextRect.style.textFill = insColor; -/***/ "./src/liquidFillSeries.js": -/*!*********************************!*\ - !*** ./src/liquidFillSeries.js ***! - \*********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + var group = new echarts.graphic.Group(); + group.add(outsideTextRect); + group.add(insideTextRect); -eval("var completeDimensions = __webpack_require__(/*! echarts/lib/data/helper/completeDimensions */ \"./node_modules/echarts/lib/data/helper/completeDimensions.js\");\nvar echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\n\necharts.extendSeriesModel({\n\n type: 'series.liquidFill',\n\n visualColorAccessPath: 'textStyle.normal.color',\n\n optionUpdated: function () {\n var option = this.option;\n option.gridSize = Math.max(Math.floor(option.gridSize), 4);\n },\n\n getInitialData: function (option, ecModel) {\n var dimensions = completeDimensions(['value'], option.data);\n var list = new echarts.List(dimensions, this);\n list.initData(option.data);\n return list;\n },\n\n defaultOption: {\n color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'],\n center: ['50%', '50%'],\n radius: '50%',\n amplitude: '8%',\n waveLength: '80%',\n phase: 'auto',\n period: 'auto',\n direction: 'right',\n shape: 'circle',\n\n waveAnimation: true,\n animationEasing: 'linear',\n animationEasingUpdate: 'linear',\n animationDuration: 2000,\n animationDurationUpdate: 1000,\n\n outline: {\n show: true,\n borderDistance: 8,\n itemStyle: {\n color: 'none',\n borderColor: '#294D99',\n borderWidth: 8,\n shadowBlur: 20,\n shadowColor: 'rgba(0, 0, 0, 0.25)'\n }\n },\n\n backgroundStyle: {\n color: '#E3F7FF'\n },\n\n itemStyle: {\n opacity: 0.95,\n shadowBlur: 50,\n shadowColor: 'rgba(0, 0, 0, 0.4)'\n },\n\n label: {\n show: true,\n color: '#294D99',\n insideColor: '#fff',\n fontSize: 50,\n fontWeight: 'bold',\n\n align: 'center',\n baseline: 'middle',\n position: 'inside'\n },\n\n emphasis: {\n itemStyle: {\n opacity: 0.8\n }\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbFNlcmllcy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL3NyYy9saXF1aWRGaWxsU2VyaWVzLmpzP2VkYjEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNvbXBsZXRlRGltZW5zaW9ucyA9IHJlcXVpcmUoJ2VjaGFydHMvbGliL2RhdGEvaGVscGVyL2NvbXBsZXRlRGltZW5zaW9ucycpO1xudmFyIGVjaGFydHMgPSByZXF1aXJlKCdlY2hhcnRzL2xpYi9lY2hhcnRzJyk7XG5cbmVjaGFydHMuZXh0ZW5kU2VyaWVzTW9kZWwoe1xuXG4gICAgdHlwZTogJ3Nlcmllcy5saXF1aWRGaW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pbmdVcGRhdGU6ICdsaW5lYXInLFxuICAgICAgICBhbmltYXRpb25EdXJhdGlvbjogMjAwMCxcbiAgICAgICAgYW5pbWF0aW9uRHVyYXRpb25VcGRhdGU6IDEwMDAsXG5cbiAgICAgICAgb3V0bGluZToge1xuICAgICAgICAgICAgc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGJvcmRlckRpc3RhbmNlOiA4LFxuICAgICAgICAgICAgaXRlbVN0eWxlOiB7XG4gICAgICAgICAgICAgICAgY29sb3I6ICdub25lJyxcbiAgICAgICAgICAgICAgICBib3JkZXJDb2xvcjogJyMyOTREOTknLFxuICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA4LFxuICAgICAgICAgICAgICAgIHNoYWRvd0JsdXI6IDIwLFxuICAgICAgICAgICAgICAgIHNoYWRvd0NvbG9yOiAncmdiYSgwLCAwLCAwLCAwLjI1KSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBiYWNrZ3JvdW5kU3R5bGU6IHtcbiAgICAgICAgICAgIGNvbG9yOiAnI0UzRjdGRidcbiAgICAgICAgfSxcblxuICAgICAgICBpdGVtU3R5bGU6IHtcbiAgICAgICAgICAgIG9wYWNpdHk6IDAuOTUsXG4gICAgICAgICAgICBzaGFkb3dCbHVyOiA1MCxcbiAgICAgICAgICAgIHNoYWRvd0NvbG9yOiAncmdiYSgwLCAwLCAwLCAwLjQpJ1xuICAgICAgICB9LFxuXG4gICAgICAgIGxhYmVsOiB7XG4gICAgICAgICAgICBzaG93OiB0cnVlLFxuICAgICAgICAgICAgY29sb3I6ICcjMjk0RDk5JyxcbiAgICAgICAgICAgIGluc2lkZUNvbG9yOiAnI2ZmZicsXG4gICAgICAgICAgICBmb250U2l6ZTogNTAsXG4gICAgICAgICAgICBmb250V2VpZ2h0OiAnYm9sZCcsXG5cbiAgICAgICAgICAgIGFsaWduOiAnY2VudGVyJyxcbiAgICAgICAgICAgIGJhc2VsaW5lOiAnbWlkZGxlJyxcbiAgICAgICAgICAgIHBvc2l0aW9uOiAnaW5zaWRlJ1xuICAgICAgICB9LFxuXG4gICAgICAgIGVtcGhhc2lzOiB7XG4gICAgICAgICAgICBpdGVtU3R5bGU6IHtcbiAgICAgICAgICAgICAgICBvcGFjaXR5OiAwLjhcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn0pO1xuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/liquidFillSeries.js\n"); + // clip out waves for insideText + var boundingCircle = getPath(radius, true); -/***/ }), + wavePath = new echarts.graphic.CompoundPath({ + shape: { + paths: waves + }, + position: [cx, cy] + }); -/***/ "./src/liquidFillView.js": -/*!*******************************!*\ - !*** ./src/liquidFillView.js ***! - \*******************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + wavePath.setClipPath(boundingCircle); + insideTextRect.setClipPath(wavePath); + + return group; + } + }, + + dispose: function () { + // dispose nothing here + } +}); -eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\nvar numberUtil = echarts.number;\nvar symbolUtil = __webpack_require__(/*! echarts/lib/util/symbol */ \"./node_modules/echarts/lib/util/symbol.js\");\nvar parsePercent = numberUtil.parsePercent;\n\nvar LiquidLayout = __webpack_require__(/*! ./liquidFillLayout */ \"./src/liquidFillLayout.js\");\n\nfunction getShallow(model, path) {\n return model && model.getShallow(path);\n}\n\necharts.extendChartView({\n\n type: 'liquidFill',\n\n render: function (seriesModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n var data = seriesModel.getData();\n\n var itemModel = data.getItemModel(0);\n\n var center = itemModel.get('center');\n var radius = itemModel.get('radius');\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n // itemStyle\n var outlineDistance = 0;\n var outlineBorderWidth = 0;\n var showOutline = seriesModel.get('outline.show');\n\n if (showOutline) {\n outlineDistance = seriesModel.get('outline.borderDistance');\n outlineBorderWidth = parsePercent(\n seriesModel.get('outline.itemStyle.borderWidth'), size\n );\n }\n\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n\n var outterRadius;\n var innerRadius;\n var paddingRadius;\n\n var isFillContainer = false;\n\n var symbol = seriesModel.get('shape');\n if (symbol === 'container') {\n // a shape that fully fills the container\n isFillContainer = true;\n\n outterRadius = [\n width / 2,\n height / 2\n ];\n innerRadius = [\n outterRadius[0] - outlineBorderWidth / 2,\n outterRadius[1] - outlineBorderWidth / 2\n ];\n paddingRadius = [\n parsePercent(outlineDistance, width),\n parsePercent(outlineDistance, height)\n ];\n\n radius = [\n Math.max(innerRadius[0] - paddingRadius[0], 0),\n Math.max(innerRadius[1] - paddingRadius[1], 0)\n ];\n }\n else {\n outterRadius = parsePercent(radius, size) / 2;\n innerRadius = outterRadius - outlineBorderWidth / 2;\n paddingRadius = parsePercent(outlineDistance, size);\n\n radius = Math.max(innerRadius - paddingRadius, 0);\n }\n\n if (showOutline) {\n var outline = getOutline();\n outline.style.lineWidth = outlineBorderWidth;\n group.add(getOutline());\n }\n\n var left = isFillContainer ? 0 : cx - radius;\n var top = isFillContainer ? 0 : cy - radius;\n\n var wavePath = null;\n\n group.add(getBackground());\n\n // each data item for a wave\n var oldData = this._data;\n var waves = [];\n data.diff(oldData)\n .add(function (idx) {\n var wave = getWave(idx, false);\n\n var waterLevel = wave.shape.waterLevel;\n wave.shape.waterLevel = isFillContainer ? height / 2 : radius;\n echarts.graphic.initProps(wave, {\n shape: {\n waterLevel: waterLevel\n }\n }, seriesModel);\n\n wave.z2 = 2;\n setWaveAnimation(idx, wave, null);\n\n group.add(wave);\n data.setItemGraphicEl(idx, wave);\n waves.push(wave);\n })\n .update(function (newIdx, oldIdx) {\n var waveElement = oldData.getItemGraphicEl(oldIdx);\n\n // new wave is used to calculate position, but not added\n var newWave = getWave(newIdx, false, waveElement);\n\n // changes with animation\n var shape = {};\n var shapeAttrs = ['amplitude', 'cx', 'cy', 'phase', 'radius', 'radiusY', 'waterLevel', 'waveLength'];\n for (var i = 0; i < shapeAttrs.length; ++i) {\n var attr = shapeAttrs[i];\n if (newWave.shape.hasOwnProperty(attr)) {\n shape[attr] = newWave.shape[attr];\n }\n }\n\n var style = {};\n var styleAttrs = ['fill', 'opacity', 'shadowBlur', 'shadowColor'];\n for (var i = 0; i < styleAttrs.length; ++i) {\n var attr = styleAttrs[i];\n if (newWave.style.hasOwnProperty(attr)) {\n style[attr] = newWave.style[attr];\n }\n }\n\n if (isFillContainer) {\n shape.radiusY = height / 2;\n }\n\n // changes with animation\n echarts.graphic.updateProps(waveElement, {\n shape: shape,\n style: style\n }, seriesModel);\n\n // instant changes\n waveElement.position = newWave.position;\n waveElement.setClipPath(newWave.clipPath);\n waveElement.shape.inverse = newWave.inverse;\n\n setWaveAnimation(newIdx, waveElement, waveElement);\n group.add(waveElement);\n data.setItemGraphicEl(newIdx, waveElement);\n waves.push(waveElement);\n })\n .remove(function (idx) {\n var wave = oldData.getItemGraphicEl(idx);\n group.remove(wave);\n })\n .execute();\n\n if (itemModel.get('label.show')) {\n group.add(getText(waves));\n }\n\n this._data = data;\n\n /**\n * Get path for outline, background and clipping\n *\n * @param {number} r outter radius of shape\n * @param {boolean|undefined} isForClipping if the shape is used\n * for clipping\n */\n function getPath(r, isForClipping) {\n if (symbol) {\n // customed symbol path\n if (symbol.indexOf('path://') === 0) {\n var path = echarts.graphic.makePath(symbol.slice(7), {});\n var bouding = path.getBoundingRect();\n var w = bouding.width;\n var h = bouding.height;\n if (w > h) {\n h = r * 2 / w * h;\n w = r * 2;\n }\n else {\n w = r * 2 / h * w;\n h = r * 2;\n }\n\n var left = isForClipping ? 0 : cx - w / 2;\n var top = isForClipping ? 0 : cy - h / 2;\n path = echarts.graphic.makePath(\n symbol.slice(7),\n {},\n new echarts.graphic.BoundingRect(left, top, w, h)\n );\n if (isForClipping) {\n path.position = [-w / 2, -h / 2];\n }\n return path;\n }\n else if (isFillContainer) {\n // fully fill the container\n var x = isForClipping ? -r[0] : cx - r[0];\n var y = isForClipping ? -r[1] : cy - r[1];\n return symbolUtil.createSymbol(\n 'rect', x, y, r[0] * 2, r[1] * 2\n );\n }\n else {\n var x = isForClipping ? -r : cx - r;\n var y = isForClipping ? -r : cy - r;\n if (symbol === 'pin') {\n y += r;\n }\n else if (symbol === 'arrow') {\n y -= r;\n }\n return symbolUtil.createSymbol(symbol, x, y, r * 2, r * 2);\n }\n }\n\n return new echarts.graphic.Circle({\n shape: {\n cx: isForClipping ? 0 : cx,\n cy: isForClipping ? 0 : cy,\n r: r\n }\n });\n }\n /**\n * Create outline\n */\n function getOutline() {\n var outlinePath = getPath(outterRadius);\n outlinePath.style.fill = null;\n\n outlinePath.setStyle(seriesModel.getModel('outline.itemStyle')\n .getItemStyle());\n\n return outlinePath;\n }\n\n /**\n * Create background\n */\n function getBackground() {\n // Seperate stroke and fill, so we can use stroke to cover the alias of clipping.\n var strokePath = getPath(radius);\n strokePath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n strokePath.style.fill = null;\n\n // Stroke is front of wave\n strokePath.z2 = 5;\n\n var fillPath = getPath(radius);\n fillPath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n fillPath.style.stroke = null;\n\n var group = new echarts.graphic.Group();\n group.add(strokePath);\n group.add(fillPath);\n\n return group;\n }\n\n /**\n * wave shape\n */\n function getWave(idx, isInverse, oldWave) {\n var radiusX = isFillContainer ? radius[0] : radius;\n var radiusY = isFillContainer ? height / 2 : radius;\n\n var itemModel = data.getItemModel(idx);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var phase = itemModel.get('phase');\n var amplitude = parsePercent(itemModel.get('amplitude'),\n radiusY * 2);\n var waveLength = parsePercent(itemModel.get('waveLength'),\n radiusX * 2);\n\n var value = data.get('value', idx);\n var waterLevel = radiusY - value * radiusY * 2;\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n var normalStyle = itemStyleModel.getItemStyle();\n if (!normalStyle.fill) {\n var seriesColor = seriesModel.get('color');\n var id = idx % seriesColor.length;\n normalStyle.fill = seriesColor[id];\n }\n\n var x = radiusX * 2;\n var wave = new LiquidLayout({\n shape: {\n waveLength: waveLength,\n radius: radiusX,\n radiusY: radiusY,\n cx: x,\n cy: 0,\n waterLevel: waterLevel,\n amplitude: amplitude,\n phase: phase,\n inverse: isInverse\n },\n style: normalStyle,\n position: [cx, cy]\n });\n wave.shape._waterLevel = waterLevel;\n\n var hoverStyle = itemModel.getModel('emphasis.itemStyle')\n .getItemStyle();\n hoverStyle.lineWidth = 0;\n echarts.graphic.setHoverStyle(wave, hoverStyle);\n\n // clip out the part outside the circle\n var clip = getPath(radius, true);\n // set fill for clipPath, otherwise it will not trigger hover event\n clip.setStyle({\n fill: 'white'\n });\n wave.setClipPath(clip);\n\n return wave;\n }\n\n function setWaveAnimation(idx, wave, oldWave) {\n var itemModel = data.getItemModel(idx);\n\n var maxSpeed = itemModel.get('period');\n var direction = itemModel.get('direction');\n\n var value = data.get('value', idx);\n\n var phase = itemModel.get('phase');\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n\n var defaultSpeed = function (maxSpeed) {\n var cnt = data.count();\n return cnt === 0 ? maxSpeed : maxSpeed *\n (0.2 + (cnt - idx) / cnt * 0.8);\n };\n var speed = 0;\n if (maxSpeed === 'auto') {\n speed = defaultSpeed(5000);\n }\n else {\n speed = typeof maxSpeed === 'function'\n ? maxSpeed(value, idx) : maxSpeed;\n }\n\n // phase for moving left/right\n var phaseOffset = 0;\n if (direction === 'right' || direction == null) {\n phaseOffset = Math.PI;\n }\n else if (direction === 'left') {\n phaseOffset = -Math.PI;\n }\n else if (direction === 'none') {\n phaseOffset = 0;\n }\n else {\n console.error('Illegal direction value for liquid fill.');\n }\n\n // wave animation of moving left/right\n if (direction !== 'none' && itemModel.get('waveAnimation')) {\n wave\n .animate('shape', true)\n .when(0, {\n phase: phase\n })\n .when(speed / 2, {\n phase: phaseOffset + phase\n })\n .when(speed, {\n phase: phaseOffset * 2 + phase\n })\n .during(function () {\n if (wavePath) {\n wavePath.dirty(true);\n }\n })\n .start();\n }\n }\n\n /**\n * text on wave\n */\n function getText(waves) {\n var labelModel = itemModel.getModel('label');\n\n function formatLabel() {\n var formatted = seriesModel.getFormattedLabel(0, 'normal');\n var defaultVal = (data.get('value', 0) * 100);\n var defaultLabel = data.getName(0) || seriesModel.name;\n if (!isNaN(defaultVal)) {\n defaultLabel = defaultVal.toFixed(0) + '%';\n }\n return formatted == null ? defaultLabel : formatted;\n }\n\n var textOption = {\n z2: 10,\n shape: {\n x: left,\n y: top,\n width: (isFillContainer ? radius[0] : radius) * 2,\n height: (isFillContainer ? radius[1] : radius) * 2\n },\n style: {\n fill: 'transparent',\n text: formatLabel(),\n textAlign: labelModel.get('align'),\n textVerticalAlign: labelModel.get('baseline')\n },\n silent: true\n };\n\n var outsideTextRect = new echarts.graphic.Rect(textOption);\n var color = labelModel.get('color');\n echarts.graphic.setText(outsideTextRect.style, labelModel, color);\n\n var insideTextRect = new echarts.graphic.Rect(textOption);\n var insColor = labelModel.get('insideColor');\n echarts.graphic.setText(insideTextRect.style, labelModel, insColor);\n insideTextRect.style.textFill = insColor;\n\n var group = new echarts.graphic.Group();\n group.add(outsideTextRect);\n group.add(insideTextRect);\n\n // clip out waves for insideText\n var boundingCircle = getPath(radius, true);\n\n wavePath = new echarts.graphic.CompoundPath({\n shape: {\n paths: waves\n },\n position: [cx, cy]\n });\n\n wavePath.setClipPath(boundingCircle);\n insideTextRect.setClipPath(wavePath);\n\n return group;\n }\n },\n\n dispose: function () {\n // dispose nothing here\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbFZpZXcuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9zcmMvbGlxdWlkRmlsbFZpZXcuanM/NmE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZWNoYXJ0cyA9IHJlcXVpcmUoJ2VjaGFydHMvbGliL2VjaGFydHMnKTtcbnZhciBudW1iZXJVdGlsID0gZWNoYXJ0cy5udW1iZXI7XG52YXIgc3ltYm9sVXRpbCA9IHJlcXVpcmUoJ2VjaGFydHMvbGliL3V0aWwvc3ltYm9sJyk7XG52YXIgcGFyc2VQZXJjZW50ID0gbnVtYmVyVXRpbC5wYXJzZVBlcmNlbnQ7XG5cbnZhciBMaXF1aWRMYXlvdXQgPSByZXF1aXJlKCcuL2xpcXVpZEZpbGxMYXlvdXQnKTtcblxuZnVuY3Rpb24gZ2V0U2hhbGxvdyhtb2RlbCwgcGF0aCkge1xuICAgIHJldHVybiBtb2RlbCAmJiBtb2RlbC5nZXRTaG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ZGVsLmdldCgnb3V0bGluZS5pdGVtU3R5bGUuYm9yZGVyV2lkdGgnKSwgc2l6ZVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBjeCA9IHBhcnNlUGVyY2VudChjZW50ZXJbMF0sIHdpZHRoKTtcbiAgICAgICAgdmFyIGN5ID0gcGFyc2VQZXJjZW50KGNlbnRlclsxXSwgaGVpZ2h0KTtcblxuICAgICAgICB2YXIgb3V0dGVyUmFkaXVzO1xuICAgICAgICB2YXIgaW5uZXJSYWRpdXM7XG4gICAgICAgIHZhciBwYWRkaW5nUmFkaXVzO1xuXG4gICAgICAgIHZhciBpc0ZpbGxDb250YWluZXIgPSBmYWxzZTtcblxuICAgICAgICB2YXIgc3ltYm9sID0gc2VyaWVzTW9kZWwuZ2V0KCdzaGFwZScpO1xuICAgICAgICBpZiAoc3ltYm9sID09PSAnY29udGFpbmVyJykge1xuICAgICAgICAgICAgLy8gYSBzaGFwZSB0aGF0IGZ1bGx5IGZpbGxzIHRoZSBjb250YWluZXJcbiAgICAgICAgICAgIGlzRmlsbENvbnRhaW5lciA9IHRydWU7XG5cbiAgICAgICAgICAgIG91dHRlclJhZGl1cyA9IFtcbiAgICAgICAgICAgICAgICB3aWR0aCAvIDIsXG4gICAgICAgICAgICAgICAgaGVpZ2h0IC8gMlxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGlubmVyUmFkaXVzID0gW1xuICAgICAgICAgICAgICAgIG91dHRlclJhZGl1c1swXSAtIG91dGxpbmVCb3JkZXJXaWR0aCAvIDIsXG4gICAgICAgICAgICAgICAgb3V0dGVyUmFkaXVzWzFdIC0gb3V0bGluZUJvcmRlcldpZHRoIC8gMlxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIHBhZGRpbmdSYWRpdXMgPSBbXG4gICAgICAgICAgICAgICAgcGFyc2VQZXJjZW50KG91dGxpbmVEaXN0YW5jZSwgd2lkdGgpLFxuICAgICAgICAgICAgICAgIHBhcnNlUGVyY2VudChvdXRsaW5lRGlzdGFuY2UsIGhlaWdodClcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHJhZGl1cyA9IFtcbiAgICAgICAgICAgICAgICBNYXRoLm1heChpbm5lclJhZGl1c1swXSAtIHBhZGRpbmdSYWRpdXNbMF0sIDApLFxuICAgICAgICAgICAgICAgIE1hdGgubWF4KGlubmVyUmFkaXVzWzFdIC0gcGFkZGluZ1JhZGl1c1sxXSwgMClcbiAgICAgICAgICAgIF07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBvdXR0ZXJSYWRpdXMgPSBwYXJzZVBlcmNlbnQocmFkaXVzLCBzaXplKSAvIDI7XG4gICAgICAgICAgICBpbm5lclJhZGl1cyA9IG91dHRlclJhZGl1cyAtIG91dGxpbmVCb3JkZXJXaWR0aCAvIDI7XG4gICAgICAgICAgICBwYWRkaW5nUmFkaXVzID0gcGFyc2VQZXJjZW50KG91dGxpbmVEaXN0YW5jZSwgc2l6ZSk7XG5cbiAgICAgICAgICAgIHJhZGl1cyA9IE1hdGgubWF4KGlubmVyUmFkaXVzIC0gcGFkZGluZ1JhZGl1cywgMCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc2hvd091dGxpbmUpIHtcbiAgICAgICAgICAgIHZhciBvdXRsaW5lID0gZ2V0T3V0bGluZSgpO1xuICAgICAgICAgICAgb3V0bGluZS5zdHlsZS5saW5lV2lkdGggPSBvdXRsaW5lQm9yZGVyV2lkdGg7XG4gICAgICAgICAgICBncm91cC5hZGQoZ2V0T3V0bGluZSgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBsZWZ0ID0gaXNGaWxsQ29udGFpbmVyID8gMCA6IGN4IC0gcmFkaXVzO1xuICAgICAgICB2YXIgdG9wID0gaXNGaWxsQ29udGFpbmVyID8gMCA6IGN5IC0gcmFkaXVzO1xuXG4gICAgICAgIHZhciB3YXZlUGF0aCA9IG51bGw7XG5cbiAgICAgICAgZ3JvdXAuYWRkKGdldEJhY2tncm91bmQoKSk7XG5cbiAgICAgICAgLy8gZWFjaCBkYXRhIGl0ZW0gZm9yIGEgd2F2ZVxuICAgICAgICB2YXIgb2xkRGF0YSA9IHRoaXMuX2RhdGE7XG4gICAgICAgIHZhciB3YXZlcyA9IFtdO1xuICAgICAgICBkYXRhLmRpZmYob2xkRGF0YSlcbiAgICAgICAgICAgIC5hZGQoZnVuY3Rpb24gKGlkeCkge1xuICAgICAgICAgICAgICAgIHZhciB3YXZlID0gZ2V0V2F2ZShpZHgsIGZhbHNlKTtcblxuICAgICAgICAgICAgICAgIHZhciB3YXRlckxldmVsID0gd2F2ZS5zaGFwZS53YXRlckxldmVsO1xuICAgICAgICAgICAgICAgIHdhdmUuc2hhcGUud2F0ZXJMZXZlbCA9IGlzRmlsbENvbnRhaW5lciA/IGhlaWdodCAvIDIgOiByYWRpdXM7XG4gICAgICAgICAgICAgICAgZWNoYXJ0cy5ncmFwaGljLmluaXRQcm9wcyh3YXZlLCB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXBlOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YXRlckxldmVsOiB3YXRlckxldmVsXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCBzZXJpZXNNb2RlbCk7XG5cbiAgICAgICAgICAgICAgICB3YXZlLnoyID0gMjtcbiAgICAgICAgICAgICAgICBzZXRXYXZlQW5pbWF0aW9uKGlkeCwgd2F2ZSwgbnVsbCk7XG5cbiAgICAgICAgICAgICAgICBncm91cC5hZGQod2F2ZSk7XG4gICAgICAgICAgICAgICAgZGF0YS5zZXRJdGVtR3JhcGhpY0VsKGlkeCwgd2F2ZSk7XG4gICAgICAgICAgICAgICAgd2F2ZXMucHVzaCh3YXZlKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAudXBkYXRlKGZ1bmN0aW9uIChuZXdJZHgsIG9sZElkeCkge1xuICAgICAgICAgICAgICAgIHZhciB3YXZlRWxlbWVudCA9IG9sZERhdGEuZ2V0SXRlbUdyYXBoaWNFbChvbGRJZHgpO1xuXG4gICAgICAgICAgICAgICAgLy8gbmV3IHdhdmUgaXMgdXNlZCB0byBjYWxjdWxhdGUgcG9zaXRpb24sIGJ1dCBub3QgYWRkZWRcbiAgICAgICAgICAgICAgICB2YXIgbmV3V2F2ZSA9IGdldFdhdmUobmV3SWR4LCBmYWxzZSwgd2F2ZUVsZW1lbnQpO1xuXG4gICAgICAgICAgICAgICAgLy8gY2hhbmdlcyB3aXRoIGFuaW1hdGlvblxuICAgICAgICAgICAgICAgIHZhciBzaGFwZSA9IHt9O1xuICAgICAgICAgICAgICAgIHZhciBzaGFwZUF0dHJzID0gWydhbXBsaXR1ZGUnLCAnY3gnLCAnY3knLCAncGhhc2UnLCAncmFkaXVzJywgJ3JhZGl1c1knLCAnd2F0ZXJMZXZlbCcsICd3YXZlTGVuZ3RoJ107XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaGFwZUF0dHJzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhdHRyID0gc2hhcGVBdHRyc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1dhdmUuc2hhcGUuaGFzT3duUHJvcGVydHkoYXR0cikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlW2F0dHJdID0gbmV3V2F2ZS5zaGFwZVthdHRyXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBzdHlsZSA9IHt9O1xuICAgICAgICAgICAgICAgIHZhciBzdHlsZUF0dHJzID0gWydmaWxsJywgJ29wYWNpdHknLCAnc2hhZG93Qmx1cicsICdzaGFkb3dDb2xvciddO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3R5bGVBdHRycy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYXR0ciA9IHN0eWxlQXR0cnNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXdXYXZlLnN0eWxlLmhhc093blByb3BlcnR5KGF0dHIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZVthdHRyXSA9IG5ld1dhdmUuc3R5bGVbYXR0cl07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoaXNGaWxsQ29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXBlLnJhZGl1c1kgPSBoZWlnaHQgLyAyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGNoYW5nZXMgd2l0aCBhbmltYXRpb25cbiAgICAgICAgICAgICAgICBlY2hhcnRzLmdyYXBoaWMudXBkYXRlUHJvcHMod2F2ZUVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgICAgc2hhcGU6IHNoYXBlLFxuICAgICAgICAgICAgICAgICAgICBzdHlsZTogc3R5bGVcbiAgICAgICAgICAgICAgICB9LCBzZXJpZXNNb2RlbCk7XG5cbiAgICAgICAgICAgICAgICAvLyBpbnN0YW50IGNoYW5nZXNcbiAgICAgICAgICAgICAgICB3YXZlRWxlbWVudC5wb3NpdGlvbiA9IG5ld1dhdmUucG9zaXRpb247XG4gICAgICAgICAgICAgICAgd2F2ZUVsZW1lbnQuc2V0Q2xpcFBhdGgobmV3V2F2ZS5jbGlwUGF0aCk7XG4gICAgICAgICAgICAgICAgd2F2ZUVsZW1lbnQuc2hhcGUuaW52ZXJzZSA9IG5ld1dhdmUuaW52ZXJzZTtcblxuICAgICAgICAgICAgICAgIHNldFdhdmVBbmltYXRpb24obmV3SWR4LCB3YXZlRWxlbWVudCwgd2F2ZUVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIGdyb3VwLmFkZCh3YXZlRWxlbWVudCk7XG4gICAgICAgIC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2wuaW5kZXhPZigncGF0aDovLycpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gZWNoYXJ0cy5ncmFwaGljLm1ha2VQYXRoKHN5bWJvbC5zbGljZSg3KSwge30pO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYm91ZGluZyA9IHBhdGguZ2V0Qm91bmRpbmdSZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciB3ID0gYm91ZGluZy53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGggPSBib3VkaW5nLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHcgPiBoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gciAqIDIgLyB3ICogaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHcgPSByICogMjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHcgPSByICogMiAvIGggKiB3O1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IHIgKiAyO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlZnQgPSBpc0ZvckNsaXBwaW5nID8gMCA6IGN4IC0gdyAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0b3AgPSBpc0ZvckNsaXBwaW5nID8gMCA6IGN5IC0gaCAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBlY2hhcnRzLmdyYXBoaWMubWFrZVBhdGgoXG4gICAgICAgICAgICAgICAgICAgICAgICBzeW1ib2wuc2xpY2UoNyksXG4gICAgICAgICAgICAgICAgICAgICAgICB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBlY2hhcnRzLmdyYXBoaWMuQm91bmRpbmdSZWN0KGxlZnQsIHRvcCwgdywgaClcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRm9yQ2xpcHBpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGgucG9zaXRpb24gPSBbLXcgLyAyLCAtaCAvIDJdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwYXRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0ZpbGxDb250YWluZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZnVsbHkgZmlsbCB0aGUgY29udGFpbmVyXG4gICAgICAgICAgICAgICAgICAgIHZhciB4ID0gaXNGb3JDbGlwcGluZyA/IC1yWzBdIDogY3ggLSByWzBdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgeSA9IGlzRm9yQ2xpcHBpbmcgPyAtclsxXSA6IGN5IC0gclsxXTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbFV0aWwuY3JlYXRlU3ltYm9sKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY3QnLCB4LCB5LCByWzBdICogMiwgclsxXSAqIDJcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4ID0gaXNGb3JDbGlwcGluZyA/IC1yIDogY3ggLSByO1xuICAgICAgICAgICAgICAgICAgICB2YXIgeSA9IGlzRm9yQ2xpcHBpbmcgPyAtciA6IGN5IC0gcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN5bWJvbCA9PT0gJ3BpbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkgKz0gcjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzeW1ib2wgPT09ICdhcnJvdycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkgLT0gcjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sVXRpbC5jcmVhdGVTeW1ib2woc3ltYm9sLCB4LCB5LCByICogMiwgciAqIDIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBlY2hhcnRzLmdyYXBoaWMuQ2lyY2xlKHtcbiAgICAgICAgICAgICAgICBzaGFwZToge1xuICAgICAgICAgICAgICAgICAgICBjeDogaXNGb3JDbGlwcGluZyA/IDAgOiBjeCxcbiAgICAgICAgICAgICAgICAgICAgY3k6IGlzRm9yQ2xpcHBpbmcgPyAwIDogY3ksXG4gICAgICAgICAgICAgICAgICAgIHI6IHJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogQ3JlYXRlIG91dGxpbmVcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldE91dGxpbmUoKSB7XG4gICAgICAgICAgICB2YXIgb3V0bGluZVBhdGggPSBnZXRQYXRoKG91dHRlclJhZGl1cyk7XG4gICAgICAgICAgICBvdXRsaW5lUGF0aC5zdHlsZS5maWxsID0gbnVsbDtcblxuICAgICAgICAgICAgb3V0bGluZVBhdGguc2V0U3R5bGUoc2VyaWVzTW9kZWwuZ2V0TW9kZWwoJ291dGxpbmUuaXRlbVN0eWxlJylcbiAgICAgICAgICAgICAgICAuZ2V0SXRlbVN0eWxlKCkpO1xuXG4gICAgICAgICAgICByZXR1cm4gb3V0bGluZVBhdGg7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogQ3JlYXRlIGJhY2tncm91bmRcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldEJhY2tncm91bmQoKSB7XG4gICAgICAgICAgICAvLyBTZXBlcmF0ZSBzdHJva2UgYW5kIGZpbGwsIHNvIHdlIGNhbiB1c2Ugc3Ryb2tlIHRvIGN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gICAgICB2YXIgaWQgPSBpZHggJSBzZXJpZXNDb2xvci5sZW5ndGg7XG4gICAgICAgICAgICAgICAgbm9ybWFsU3R5bGUuZmlsbCA9IHNlcmllc0NvbG9yW2lkXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHggPSByYWRpdXNYICogMjtcbiAgICAgICAgICAgIHZhciB3YXZlID0gbmV3IExpcXVpZExheW91dCh7XG4gICAgICAgICAgICAgICAgc2hhcGU6IHtcbiAgICAgICAgICAgICAgICAgICAgd2F2ZUxlbmd0aDogd2F2ZUxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgcmFkaXVzOiByYWRpdXNYLFxuICAgICAgICAgICAgICAgICAgICByYWRpdXNZOiByYWRpdXNZLFxuICAgICAgICAgICAgICAgICAgICBjeDogeCxcbiAgICAgICAgICAgICAgICAgICAgY3k6IDAsXG4gICAgICAgICAgICAgICAgICAgIHdhdGVyTGV2ZWw6IHdhdGVyTGV2ZWwsXG4gICAgICAgICAgICAgICAgICAgIGFtcGxpdHVkZTogYW1wbGl0dWRlLFxuICAgICAgICAgICAgICAgICAgICBwaGFzZTogcGhhc2UsXG4gICAgICAgICAgICAgICAgICAgIGludmVyc2U6IGlzSW52ZXJzZVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc3R5bGU6IG5vcm1hbFN0eWxlLFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBbY3gsIGN5XVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB3YXZlLnNoYXBlLl93YXRlckxldmVsID0gd2F0ZXJMZXZlbDtcblxuICAgICAgICAgICAgdmFyIGhvdmVyU3R5bGUgPSBpdGVtTW9kZWwuZ2V0TW9kZWwoJ2VtcGhhc2lzLml0ZW1TdHlsZScpXG4gICAgICAgICAgICAgICAgLmdldEl0ZW1TdHlsZSgpO1xuICAgICAgICAgICAgaG92ZXJTdHlsZS5saW5lV2lkdGggPSAwO1xuICAgICAgICAgICAgZW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GFzZSk7XG5cbiAgICAgICAgICAgIHZhciBkZWZhdWx0U3BlZWQgPSBmdW5jdGlvbiAobWF4U3BlZWQpIHtcbiAgICAgICAgICAgICAgICB2YXIgY250ID0gZGF0YS5jb3VudCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBjbnQgPT09IDAgPyBtYXhTcGVlZCA6IG1heFNwZWVkICpcbiAgICAgICAgICAgICAgICAgICAgKDAuMiArIChjbnQgLSBpZHgpIC8gY250ICogMC44KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgc3BlZWQgPSAwO1xuICAgICAgICAgICAgaWYgKG1heFNwZWVkID09PSAnYXV0bycpIHtcbiAgICAgICAgICAgICAgICBzcGVlZCA9IGRlZmF1bHRTcGVlZCg1MDAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHNwZWVkID0gdHlwZW9mIG1heFNwZWVkID09PSAnZnVuY3Rpb24nXG4gICAgICAgICAgICAgICAgICAgID8gbWF4U3BlZWQodmFsdWUsIGlkeCkgOiBtYXhTcGVlZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gcGhhc2UgZm9yIG1vdmluZyBsZWZ0L3JpZ2h0XG4gICAgICAgICAgICB2YXIgcGhhc2VPZmZzZXQgPSAwO1xuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA9PT0gJ3JpZ2h0JyB8fCBkaXJlY3Rpb24gPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHBoYXNlT2Zmc2V0ID0gTWF0aC5QSTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGRpcmVjdGlvbiA9PT0gJ2xlZnQnKSB7XG4gICAgICAgICAgICAgICAgcGhhc2VPZmZzZXQgPSAtTWF0aC5QSTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGRpcmVjdGlvbiA9PT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgcGhhc2VPZmZzZXQgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignSWxsZWdhbCBkaXJlY3Rpb24gdmFsdWUgZm9yIGxpcXVpZCBmaWxsLicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyB3YXZlIGFuaW1hdGlvbiBvZiBtb3ZpbmcgbGVmdC9yaWdodFxuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiAhPT0gJ25vbmUnICYmIGl0ZW1Nb2RlbC5nZXQoJ3dhdmVBbmltYXRpb24nKSkge1xuICAgICAgICAgICAgICAgIHdhdmVcbiAgICAgICAgICAgICAgICAgICAgLmFuaW1hdGUoJ3NoYXBlJywgdHJ1ZSlcbiAgICAgICAgICAgICAgICAgICAgLndoZW4oMCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGhhc2U6IHBoYXNlXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC53aGVuKHNwZWVkIC8gMiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGhhc2U6IHBoYXNlT2Zmc2V0ICsgcGhhc2VcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLndoZW4oc3BlZWQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBoYXNlOiBwaGFzZU9mZnNldCAqIDIgKyBwaGFzZVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZHVyaW5nKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3YXZlUGF0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhdmVQYXRoLmRpcnR5KHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuc3RhcnQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiB0ZXh0IG9uIHdhdmVcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldFRleHQod2F2ZXMpIHtcbiAgICAgICAgICAgIHZhciBsYWJlbE1vZGVsID0gaXRlbU1vZGVsLmdldE1vZGVsKCdsYWJlbCcpO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBmb3JtYXRMYWJlbCgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZm9ybWF0dGVkID0gc2VyaWVzTW9kZWwuZ2V0Rm9ybWF0dGVkTGFiZWwoMCwgJ25vcm1hbCcpO1xuICAgICAgICAgICAgICAgIHZhciBkZWZhdWx0VmFsID0gKGRhdGEuZ2V0KCd2YWx1ZScsIDApICogMTAwKTtcbiAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdExhYmVsID0gZGF0YS5nZXROYW1lKDApIHx8IHNlcmllc01vZGVsLm5hbWU7XG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihkZWZhdWx0VmFsKSkge1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0TGFiZWwgPSBkZWZhdWx0VmFsLnRvRml4ZWQoMCkgKyAnJSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmb3JtYXR0ZWQgPT0gbnVsbCA/IGRlZmF1bHRMYWJlbCA6IGZvcm1hdHRlZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHRleHRPcHRpb24gPSB7XG4gICAgICAgICAgICAgICAgejI6IDEwLFxuICAgICAgICAgICAgICAgIHNoYXBlOiB7XG4gICAgICAgICAgICAgICAgICAgIHg6IGxlZnQsXG4gICAgICAgICAgICAgICAgICAgIHk6IHRvcCxcbiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IChpc0ZpbGxDb250YWluZXIgPyByYWRpdXNbMF0gOiByYWRpdXMpICogMixcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAoaXNGaWxsQ29udGFpbmVyID8gcmFkaXVzWzFdIDogcmFkaXVzKSAqIDJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHN0eWxlOiB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGw6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgICAgICAgICAgICAgIHRleHQ6IGZvcm1hdExhYmVsKCksXG4gICAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogbGFiZWxNb2RlbC5nZXQoJ2FsaWduJyksXG4gICAgICAgICAgICAgICAgICAgIHRleHRWZXJ0aWNhbEFsaWduOiBsYWJlbE1vZGVsLmdldCgnYmFzZWxpbmUnKVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc2lsZW50OiB0cnVlXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB2YXIgb3V0c2lkZVRleHRSZWN0ID0gbmV3IGVjaGFydHMuZ3JhcGhpYy5SZWN0KHRleHRPcHRpb24pO1xuICAgICAgICAgICAgdmFyIGNvbG9yID0gbGFiZWxNb2RlbC5nZXQoJ2NvbG9yJyk7XG4gICAgICAgICAgICBlY2hhcnRzLmdyYXBoaWMuc2V0VGV4dChvdXRzaWRlVGV4dFJlY3Quc3R5bGUsIGxhYmVsTW9kZWwsIGNvbG9yKTtcblxuICAgICAgICAgICAgdmFyIGluc2lkZVRleHRSZWN0ID0gbmV3IGVjaGFydHMuZ3JhcGhpYy5SZWN0KHRleHRPcHRpb24pO1xuICAgICAgICAgICAgdmFyIGluc0NvbG9yID0gbGFiZWxNb2RlbC5nZXQoJ2luc2lkZUNvbG9yJyk7XG4gICAgICAgICAgICBlY2hhcnRzLmdyYXBoaWMuc2V0VGV4dChpbnNpZGVUZXh0UmVjdC5zdHlsZSwgbGFiZWxNb2RlbCwgaW5zQ29sb3IpO1xuICAgICAgICAgICAgaW5zaWRlVGV4dFJlY3Qu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UFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/liquidFillView.js\n"); /***/ }), @@ -983,9 +17824,10 @@ eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = __WEBPACK_EXTERNAL_MODULE_echarts_lib_echarts__;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWNoYXJ0cy9saWIvZWNoYXJ0cy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC9leHRlcm5hbCBcImVjaGFydHNcIj84YzY3Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gX19XRUJQQUNLX0VYVEVSTkFMX01PRFVMRV9lY2hhcnRzX2xpYl9lY2hhcnRzX187Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///echarts/lib/echarts\n"); +module.exports = __WEBPACK_EXTERNAL_MODULE_echarts_lib_echarts__; /***/ }) /******/ }); -}); \ No newline at end of file +}); +//# sourceMappingURL=echarts-liquidfill.js.map \ No newline at end of file diff --git a/dist/echarts-liquidfill.js.map b/dist/echarts-liquidfill.js.map new file mode 100644 index 0000000..0b7aef9 --- /dev/null +++ b/dist/echarts-liquidfill.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://echarts-liquidfill/webpack/universalModuleDefinition","webpack://echarts-liquidfill/webpack/bootstrap","webpack://echarts-liquidfill/./index.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/config.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/data/DataDimensionInfo.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/data/Source.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/data/helper/completeDimensions.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/data/helper/dimensionHelper.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/data/helper/sourceHelper.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/data/helper/sourceType.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/util/clazz.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/util/graphic.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/util/model.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/util/symbol.js","webpack://echarts-liquidfill/./node_modules/echarts/lib/visual/dataColor.js","webpack://echarts-liquidfill/(webpack)/buildin/global.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/Element.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/animation/Animator.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/animation/Clip.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/animation/easing.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/config.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/arc.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/cubic.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/line.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/path.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/quadratic.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/text.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/util.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/contain/windingLine.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/container/Group.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/BoundingRect.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/LRU.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/PathProxy.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/bbox.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/curve.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/env.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/guid.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/log.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/matrix.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/util.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/core/vector.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/CompoundPath.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Displayable.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Gradient.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Image.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/IncrementalDisplayable.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/LinearGradient.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Path.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Pattern.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/RadialGradient.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Style.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/Text.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/constant.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/fixShadow.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/image.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/poly.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/roundRect.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/smoothBezier.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/smoothSpline.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/helper/text.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/mixin/RectText.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Arc.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/BezierCurve.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Circle.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Line.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Polygon.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Polyline.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Rect.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Ring.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/graphic/shape/Sector.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/mixin/Animatable.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/mixin/Eventful.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/mixin/Transformable.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/tool/color.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/tool/path.js","webpack://echarts-liquidfill/./node_modules/zrender/lib/tool/transformPath.js","webpack://echarts-liquidfill/./src/liquidFill.js","webpack://echarts-liquidfill/./src/liquidFillLayout.js","webpack://echarts-liquidfill/./src/liquidFillSeries.js","webpack://echarts-liquidfill/./src/liquidFillView.js","webpack://echarts-liquidfill/external \"echarts\""],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,6CAAkB;;;;;;;;;;;;;ACC3C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,sEAAuB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,0B;;;;;;;;;;;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,sEAAuB;;AAE3C;AACA;;AAEA,aAAa,mBAAO,CAAC,+DAAe;;AAEpC;;AAEA,kBAAkB,mBAAO,CAAC,iFAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAmD;AAC3D,QAAQ,+CAA+C;AACvD,QAAQ,mDAAmD;AAC3D,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,sBAAsB;AACjC,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA,sFAAsF;AACtF;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,0B;;;;;;;;;;;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,sEAAuB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,kEAAkB;;AAEvC;;AAEA,oBAAoB,mBAAO,CAAC,8EAAgB;;AAE5C;AACA;;AAEA,aAAa,mBAAO,CAAC,4DAAW;;AAEhC,uBAAuB,mBAAO,CAAC,oFAAmB;;AAElD;;AAEA,wBAAwB,mBAAO,CAAC,kFAAsB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA;AACA;AACA,UAAU,8BAA8B;AACxC;AACA,UAAU,YAAY;AACtB,WAAW,wCAAwC;AACnD,WAAW,OAAO;AAClB,WAAW,sBAAsB;AACjC,+BAA+B,WAAW;AAC1C,WAAW,eAAe,uCAAuC;AACjE,WAAW,SAAS;AACpB;AACA,sBAAsB;AACtB,wBAAwB;AACxB,gBAAgB,OAAO;AACvB,WAAW,OAAO;AAClB;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA,qEAAqE;;AAErE,iBAAiB,cAAc;AAC/B,2CAA2C;AAC3C;AACA,KAAK;AACL;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,uCAAuC;;AAEvC;AACA,kDAAkD;AAClD,SAAS,SAAS,aAAa;AAC/B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG,EAAE;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;;AAEA,2CAA2C;;AAE3C;AACA;AACA;;AAEA,8CAA8C;;AAE9C;AACA,qBAAqB,0DAA0D;AAC/E;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO,kDAAkD,YAAY;;;AAGrE;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC,4BAA4B,yBAAyB;AACrD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,YAAY;AACZ,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;;AClUA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,sEAAuB;;AAE3C;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,0DAAc;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA,iDAAiD;AACjD;;AAEA;AACA,GAAG;AACH;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;;AAGA;AACA;AACA,wD;;;;;;;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,0DAAc;;AAEpC;;AAEA,aAAa,mBAAO,CAAC,kEAAkB;;AAEvC;AACA;;AAEA,YAAY,mBAAO,CAAC,sEAAuB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,4DAAW;;AAEhC,kBAAkB,mBAAO,CAAC,0EAAc;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,WAAW,8CAA8C;AACzD,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,sCAAsC,SAAS;AAC/C;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,QAAQ;AACR,oBAAoB,IAAI;AACxB;AACA;AACA,QAAQ;AACR;AACA;AACA,YAAY,2BAA2B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS,YAAY,GAAG,SAAS,YAAY,GAAG,SAAS,YAAY;AAClF;AACA;AACA,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC,YAAY;;;AAGb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;;AAET,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA,KAAK,EAAE;AACP;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA,mBAAmB,gCAAgC;AACnD;AACA;AACA,GAAG;AACH;;AAEA,mBAAmB,kCAAkC;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oEAAoE;;;AAGpE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB,mBAAmB,iDAAiD;AACrG,WAAW,oBAAoB;AAC/B,WAAW,mBAAmB;AAC9B,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA,kDAAkD;;AAElD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG,EAAE;AACL;;AAEA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA,WAAW,oBAAoB;AAC/B,WAAW,mBAAmB;AAC9B,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA,kDAAkD;;AAElD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG,gBAAgB,KAAK;;;AAGxB;AACA;AACA;AACA,0BAA0B;;AAE1B,gDAAgD,SAAS;AACzD;AACA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,+BAA+B;;AAE/B,2FAA2F;AAC3F;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA,kCAAkC;AAClC;AACA,sCAAsC,SAAS,SAAS;AACxD,2CAA2C,SAAS,YAAY,EAAE;AAClE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,WAAW,OAAO;AAClB,YAAY,WAAW;AACvB;;;AAGA;AACA;AACA,CAAC;AACD,WAAW;;;AAGX;AACA,aAAa;;AAEb;;AAEA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,0CAA0C;AAC/D;AACA;AACA;AACA;AACA,KAAK;AACL,qBAAqB,gCAAgC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA,mBAAmB,gCAAgC;AACnD;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,mBAAmB,kCAAkC;AACrD;AACA;AACA;AACA;AACA,GAAG;AACH,mBAAmB,gCAAgC;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;;;;;;AChrBA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oD;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,uDAAW;;AAEjC;;AAEA,aAAa,mBAAO,CAAC,sEAAuB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;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WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,iCAAiC;AAC5C,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,YAAY,OAAO;AACnB;;;AAGA;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB,qCAAqC,2BAA2B;AAChE;AACA,WAAW,eAAe;AAC1B;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,mFAAmF;AACnF,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB,kBAAkB,OAAO;AACzB;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;;;AAGA;AACA,uCAAuC;AACvC;;AAEA;AACA,8CAA8C;AAC9C;;AAEA;AACA,wCAAwC;;AAExC,uFAAuF;;AAEvF,2FAA2F;;AAE3F;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,gBAAgB;AAC3B,WAAW,2BAA2B;AACtC;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6CAA6C;AAC7E;;AAEA;AACA,sDAAsD;AACtD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6LAA6L;;AAE7L;AACA;AACA;AACA;AACA,uCAAuC,SAAS,WAAW,aAAa,YAAY,MAAM;AAC1F,wCAAwC,SAAS,sCAAsC,MAAM;AAC7F;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;;;AAGA;AACA;AACA,qEAAqE;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC,WAAW,eAAe;AAC1B;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL,6FAA6F;AAC7F;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,oEAAoE;AACpE,oCAAoC,aAAa,KAAK,yBAAyB,OAAO;AACtF;AACA;AACA;;AAEA,+CAA+C;AAC/C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,eAAe;AACf;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA;AACA;AACA,QAAQ,uCAAuC,gCAAgC,EAAE;AACjF;AACA;AACA;AACA,QAAQ,4BAA4B,gCAAgC,EAAE;AACtE;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mCAAmC;AAC9C,WAAW,mCAAmC;AAC9C;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,0CAA0C;AACrD;AACA,WAAW,0BAA0B;AACrC,WAAW,SAAS;AACpB,YAAY,eAAe;AAC3B;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,SAAS;AACpB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA,WAAW,uBAAuB;AAClC,WAAW,OAAO,OAAO;AACzB,YAAY,uBAAuB;AACnC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,WAAW,OAAO,aAAa;AAC/B,WAAW,OAAO,OAAO;AACzB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO,SAAS;AAC3B,YAAY,uBAAuB;AACnC;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,uBAAuB;AAClC,YAAY;AACZ;;;AAGA;AACA,iDAAiD,mBAAmB;AACpE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8C;;;;;;;;;;;;ACr/CA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,sEAAuB;;AAE5C,UAAU,mBAAO,CAAC,oEAAsB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,EAAE;AACd,YAAY,MAAM;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,oBAAoB;AACpB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;AACA,gDAAgD;;AAEhD,yCAAyC,SAAS;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,8aAA8a;AAC9a;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B,WAAW,eAAe,eAAe;AACtE;AACA,WAAW,gCAAgC;AAC3C,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA,6BAA6B,WAAW,eAAe,eAAe;AACtE;AACA,WAAW,gCAAgC;AAC3C;;;AAGA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sDAAsD;AACjE,WAAW,sBAAsB;AACjC,YAAY,eAAe,gBAAgB,wBAAwB,IAAI;AACvE;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE;;AAEL;AACA;AACA;AACA,KAAK;;;AAGL,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAmB;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe,gBAAgB,wBAAwB,IAAI;AACtE;AACA,YAAY,eAAe;AAC3B;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,uCAAuC;AACvC,GAAG,EAAE;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,qBAAqB,UAAU,GAAG,UAAU,GAAG,GAAG;AAClD,oBAAoB,GAAG,GAAG,UAAU,GAAG,UAAU;AACjD;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe,gBAAgB,mCAAmC;AAC7E,WAAW,eAAe,gBAAgB,mCAAmC;AAC7E,YAAY,uCAAuC;AACnD;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;;AAEA,gDAAgD,UAAU;AAC1D;;AAEA;AACA;AACA,SAAS;AACT,+CAA+C;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB;AACA,YAAY,sBAAsB;AAClC;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;;AAEA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,cAAc;AACzB,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,iBAAiB,EAAE;AACnB,kBAAkB,OAAO;AACzB,YAAY,OAAO;AACnB,WAAW,MAAM;AACjB,WAAW,iCAAiC,WAAW;AACvD;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8B;;;;;;;;;;;;ACjiBA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,sEAAuB;;AAE5C,cAAc,mBAAO,CAAC,6DAAW;;AAEjC,mBAAmB,mBAAO,CAAC,sFAA+B;;AAE1D,YAAY,mBAAO,CAAC,4EAA0B;;AAE9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,gCAAgC;;AAEhC;AACA,kBAAkB;;AAElB;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC,EAAE;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH,yDAAyD;AACzD,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oC;;;;;;;;;;;;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,sEAAuB;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,yCAAyC;;AAEzC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,+KAA+K;;AAE/K;AACA;AACA;AACA;;AAEA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA,0B;;;;;;;;;;;ACjGA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;ACnBA,WAAW,mBAAO,CAAC,4DAAa;;AAEhC,eAAe,mBAAO,CAAC,sEAAkB;;AAEzC,oBAAoB,mBAAO,CAAC,gFAAuB;;AAEnD,iBAAiB,mBAAO,CAAC,0EAAoB;;AAE7C,aAAa,mBAAO,CAAC,4DAAa;;AAElC;AACA;AACA;AACA,aAAa;AACb,aAAa;AACb,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc,SAAS;AACvB,eAAe;AACf;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,cAAc;AAC3B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,4BAA4B;AACzC;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA,mBAAmB;;AAEnB;;AAEA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA,qBAAqB;;AAErB;;AAEA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;;AAEA;AACA;AACA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,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;;AAEA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA,GAAG;AACH;;AAEA,mBAAmB,SAAS;AAC5B,qBAAqB,UAAU;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA,mBAAmB;;AAEnB;AACA;AACA,GAAG;AACH,8CAA8C;;AAE9C,sBAAsB;;AAEtB;AACA;AACA;;AAEA,iBAAiB,cAAc;AAC/B,sDAAsD;;AAEtD,mCAAmC;;AAEnC;AACA;AACA;;AAEA,sBAAsB;;AAEtB;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAyC;;AAEzC,iBAAiB,kBAAkB;AACnC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA,iFAAiF;AACjF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,yBAAyB,YAAY;AACrC;AACA;AACA;AACA,OAAO;;;AAGP;AACA,KAAK;AACL,6BAA6B,kBAAkB;AAC/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B;;AAE9B;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA,mBAAmB,2BAA2B;AAC9C;AACA;;AAEA;AACA,GAAG;AACH;AACA,mBAAmB,2BAA2B;AAC9C;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,gBAAgB;AAC9B,uBAAuB;AACvB,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,oBAAoB;;AAEpB;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;;AAEA,uBAAuB,8BAA8B;AACrD;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;ACnoBA,kBAAkB,mBAAO,CAAC,gEAAU;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;;AAEhC,oCAAoC;;AAEpC,mCAAmC;AACnC,0DAA0D;;AAE1D,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iFAAiF;;AAEjF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA,OAAO;AACP;;;AAGA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAE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AEA;AACA;;AAEA,sC;;;;;;;;;;;ACtCA,gBAAgB,mBAAO,CAAC,uEAAmB;;AAE3C,WAAW,mBAAO,CAAC,0DAAQ;;AAE3B,YAAY,mBAAO,CAAC,4DAAS;;AAE7B,gBAAgB,mBAAO,CAAC,oEAAa;;AAErC,UAAU,mBAAO,CAAC,wDAAO;;AAEzB,YAAY,mBAAO,CAAC,0DAAQ;;AAE5B;;AAEA,YAAY,mBAAO,CAAC,+DAAe;;AAEnC,kBAAkB,mBAAO,CAAC,wEAAe;;AAEzC;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,mBAAmB,YAAY;AAC/B,uBAAuB;;AAEvB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA,qBAAqB,YAAY;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,OAAO;AACxB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC,wBAAwB;;AAExB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;;;AAGT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sC;;;;;;;;;;;AC3YA,aAAa,mBAAO,CAAC,+DAAe;;AAEpC;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sC;;;;;;;;;;;AChCA,mBAAmB,mBAAO,CAAC,6EAAsB;;AAEjD,kBAAkB,mBAAO,CAAC,mFAAyB;;AAEnD,YAAY,mBAAO,CAAC,6DAAc;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAqB,KAAK;AAC7C,qCAAqC;;AAErC;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO,EAAE;AACrB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,6BAA6B;AACxC,WAAW,OAAO,OAAO,oBAAoB;AAC7C,YAAY,OAAO,wBAAwB;AAC3C;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,OAAO;AACzB,WAAW,OAAO;AAClB,YAAY,OAAO,EAAE;AACrB;;;AAGA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,4EAA4E;AAC5E;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,gEAAgE;AAChE;;AAEA,4CAA4C;AAC5C;;AAEA;AACA,2DAA2D;AAC3D;;AAEA,sEAAsE;;AAEtE,iBAAiB,6CAA6C;AAC9D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,6BAA6B,iCAAiC;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO,SAAS;AAC5B;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO,EAAE;AACT;;AAEA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,YAAY,WAAW,YAAY,IAAI,GAAG;AACtE,uBAAuB,WAAW;AAClC;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH,iBAAiB,kBAAkB;AACnC;AACA;AACA;;AAEA,mBAAmB,wBAAwB;AAC3C;AACA,4EAA4E;;AAE5E,mEAAmE;;AAEnE,4DAA4D;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+EAA+E;AAC/E;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,OAAO;AACP;AACA,uCAAuC;AACvC;;AAEA;AACA,uEAAuE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA,0CAA0C;;AAE1C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA,OAAO,UAAU;AACjB;AACA;AACA,iDAAiD,GAAG;AACpD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4B;;;;;;;;;;;AC9sBA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,0C;;;;;;;;;;;ACZA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA,+BAA+B;;AAE/B;AACA;AACA;;AAEA,8BAA8B;;AAE9B;AACA;;AAEA,6B;;;;;;;;;;;ACtBA,aAAa,mBAAO,CAAC,6DAAc;;AAEnC,cAAc,mBAAO,CAAC,yDAAY;;AAElC,mBAAmB,mBAAO,CAAC,6EAAsB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,uBAAuB;AACpC,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,qBAAqB;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,SAAS;AACvB,eAAe;AACf;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,SAAS;AACvB,eAAe;AACf;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA,mBAAmB,2BAA2B;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,mBAAmB,2BAA2B;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;ACvTA,WAAW,mBAAO,CAAC,2DAAU;;AAE7B,aAAa,mBAAO,CAAC,2DAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,aAAa,iCAAiC;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,iCAAiC;AAC/C,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,0CAA0C;AACvD,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,wCAAwC;AACnD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;ACtLA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,aAAa;AACb,aAAa;AACb;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;;AAEzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,0B;;;;;;;;;;;ACzMA,YAAY,mBAAO,CAAC,yDAAS;;AAE7B,WAAW,mBAAO,CAAC,2DAAU;;AAE7B,WAAW,mBAAO,CAAC,uDAAQ;;AAE3B,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C,cAAc,mBAAO,CAAC,uDAAW;;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;;AAEH;AACA,cAAc,yBAAyB;AACvC,cAAc;AACd;AACA;AACA;AACA;AACA,gCAAgC;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,yBAAyB;AACtC,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,yBAAyB;AACtC,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,qBAAqB;AAC1C;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,oEAAoE;AACjF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;;AAEA,qBAAqB,2BAA2B;AAChD;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,qBAAqB,eAAe;AACpC;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB;;AAEtB,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;;;AAGL,UAAU,aAAa;AACvB;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qCAAqC;AACrC;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;;AAEhD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;ACjwBA,WAAW,mBAAO,CAAC,2DAAU;;AAE7B,YAAY,mBAAO,CAAC,yDAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAmB;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA,qBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;AC5NA,cAAc,mBAAO,CAAC,2DAAU;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,eAAe;AAC3B,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,0BAA0B;;AAE1B,sBAAsB;;AAEtB;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,eAAe;AAC3B,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,eAAe;AAC3B;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA,kBAAkB,QAAQ;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,eAAe;;AAEf,iBAAiB,QAAQ;AACzB;AACA;AACA;;AAEA;AACA,wBAAwB;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,eAAe;AAC3B,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,eAAe;AAC3B;;;AAGA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA,kBAAkB,QAAQ;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,eAAe;;AAEf,iBAAiB,QAAQ;AACzB;AACA;AACA;;AAEA;AACA,4BAA4B;;AAE5B;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sD;;;;;;;;;;;ACnhBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,eAAe;AACf,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,eAAe;AACf,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA,mBAAmB;AACnB;AACA;;AAEA;AACA;AACA,mBAAmB,yCAAyC,IAAI;AAChE,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C;;AAEA,2DAA2D;AAC3D;AACA,wCAAwC;;AAExC,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,YAAY;AACZ,+DAA+D;AAC/D,QAAQ;AACR;AACA;AACA;;;AAGA,0B;;;;;;;;;;;ACzKA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0B;;;;;;;;;;;ACXA,cAAc,mBAAO,CAAC,uDAAW;;AAEjC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;ACXA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sB;;;;;;;;;;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;;AAErC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY,EAAE;AACd;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,YAAY,EAAE;AACd;;;AAGA;AACA;;AAEA,gDAAgD,SAAS;AACzD;AACA;;AAEA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;;AAGF;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;;;AAGA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,gBAAgB;AAC3B,WAAW,QAAQ;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,qCAAqC,SAAS;AAC9C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA,qCAAqC,SAAS;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,qCAAqC,SAAS;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,EAAE;AACd;;;AAGA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;;AAGA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,gEAAgE;AAChE;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA;;AAEA;;AAEA,aAAa,cAAc;AAC3B;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oB;;;;;;;;;;;ACnuBA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;;AAGA;A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AAClB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kB;;;;;;;;;;;ACzTA,WAAW,mBAAO,CAAC,0DAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA,mBAAmB,kBAAkB;AACrC;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,sCAAsC;;AAEtC,mBAAmB,kBAAkB;AACrC;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;;AAEA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;ACvDA,aAAa,mBAAO,CAAC,6DAAc;;AAEnC,YAAY,mBAAO,CAAC,4DAAS;;AAE7B,cAAc,mBAAO,CAAC,yDAAY;;AAElC,eAAe,mBAAO,CAAC,8EAAkB;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA,oBAAoB;AACpB;AACA;;AAEA,0BAA0B;AAC1B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA,gCAAgC;AAChC,+BAA+B;;AAE/B;AACA;AACA,aAAa,yBAAyB;AACtC;AACA;AACA,kCAAkC;;AAElC;AACA;AACA,cAAc;AACd;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc,SAAS;AACvB,eAAe;AACf;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA,aAAa,cAAc;AAC3B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA,aAAa,6BAA6B;AAC1C,aAAa,OAAO,OAAO;AAC3B,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA,0B;;;;;;;;;;;ACpRA;AACA,WAAW,eAAe;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,0B;;;;;;;;;;;ACjBA,kBAAkB,mBAAO,CAAC,wEAAe;;AAEzC,mBAAmB,mBAAO,CAAC,6EAAsB;;AAEjD,aAAa,mBAAO,CAAC,6DAAc;;AAEnC,kBAAkB,mBAAO,CAAC,0EAAgB;;AAE1C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;AC3FA,YAAY,mBAAO,CAAC,6DAAc;;AAElC;;AAEA,iBAAiB,mBAAO,CAAC,wEAAe;;AAExC,mBAAmB,mBAAO,CAAC,6EAAsB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AAC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;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,wCAAwC;;AAExC;AACA,mEAAmE;AACnE;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;;AAE1B;AACA;AACA;AACA;;AAEA,8CAA8C;;AAE9C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,kDAAkD;AAClD;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;;AAElC,gCAAgC;;AAEhC,sEAAsE;;AAEtE;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sEAAsE;;AAEtE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA,aAAa,cAAc;AAC3B,aAAa,EAAE;AACf;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,0B;;;;;;;;;;;ACzXA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA,uBAAuB;;AAEvB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;ACdA,aAAa,mBAAO,CAAC,6DAAc;;AAEnC,eAAe,mBAAO,CAAC,kEAAY;;AAEnC;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB;AACA;AACA;AACA,yBAAyB,gCAAgC;AACzD;AACA;AACA;AACA,+BAA+B;;AAE/B,uBAAuB;;AAEvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;AC/BA,gBAAgB,mBAAO,CAAC,kFAAoB;;AAE5C,gBAAgB,mBAAO,CAAC,kEAAY;;AAEpC;AACA,kLAAkL;AAClL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,MAAM;AACN,YAAY;AACZ;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,aAAa,yBAAyB;AACtC;AACA;AACA;AACA,2CAA2C;AAC3C;;AAEA;AACA;;AAEA,mBAAmB,+BAA+B;AAClD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,sBAAsB;AACnC,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,cAAc;AAC3B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,sBAAsB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,mBAAmB,uBAAuB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;;AAEA,eAAe,+BAA+B;AAC9C;;AAEA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA,0B;;;;;;;;;;;AC5dA,kBAAkB,mBAAO,CAAC,wEAAe;;AAEzC,aAAa,mBAAO,CAAC,6DAAc;;AAEnC,kBAAkB,mBAAO,CAAC,mEAAiB;;AAE3C,iBAAiB,mBAAO,CAAC,wEAAe;;AAExC,gBAAgB,mBAAO,CAAC,kEAAY;;AAEpC;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B,+DAA+D;;AAE/D;AACA,0BAA0B;;AAE1B,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,2BAA2B;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,4C;;;;;;;;;;;ACRA,UAAU,mBAAO,CAAC,8DAAgB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;;AAEA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA,GAAG;AACH;;AAEA,0B;;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0B;;;;;;;;;;;ACpBA,UAAU,mBAAO,CAAC,8DAAgB;;AAElC;AACA;AACA,WAAW,iDAAiD;AAC5D,YAAY,0CAA0C;AACtD;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iDAAiD;AAC5D,WAAW,0CAA0C;AACrD,WAAW,uBAAuB;AAClC,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,YAAY,0CAA0C;AACtD;;;AAGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iCAAiC;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oC;;;;;;;;;;;ACvFA,mBAAmB,mBAAO,CAAC,iFAAgB;;AAE3C,mBAAmB,mBAAO,CAAC,iFAAgB;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,wCAAwC,OAAO;AAC/C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8B;;;;;;;;;;;ACpCA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8B;;;;;;;;;;;ACzFA,cAAc,mBAAO,CAAC,oEAAmB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,MAAM;AACjB;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,SAAS;AACjD;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA,sCAAsC,SAAS;AAC/C;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA,mCAAmC;;AAEnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,0B;;;;;;;;;;;ACxGA,cAAc,mBAAO,CAAC,oEAAmB;;AAEzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,YAAY;AACZ;;;AAGA;AACA;AACA;AACA;;AAEA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;;AAEA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0B;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,4C;;;;;;;;;;;AChHA,YAAY,mBAAO,CAAC,gEAAiB;;AAErC;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,sEAAoB;;AAE9C,sBAAsB,mBAAO,CAAC,2EAAa;;AAE3C,kBAAkB,mBAAO,CAAC,mEAAS;;AAEnC,gBAAgB,mBAAO,CAAC,2EAAa;;AAErC,gBAAgB,mBAAO,CAAC,mEAAa;;AAErC;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC,YAAY,6BAA6B;AACzC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4FAA4F;;AAE5F;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,WAAW,6BAA6B;AACxC,WAAW,eAAe,SAAS;AACnC;AACA,WAAW,gEAAgE;AAC3E;;;AAGA;AACA;AACA,CAAC;AACD;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,qEAAqE;;AAErE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA,4BAA4B;AAC5B;;AAEA,8BAA8B;;AAE9B,uCAAuC;;AAEvC,iBAAiB,sCAAsC;AACvD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,GAAG;AACH,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,+BAA+B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,wBAAwB;;AAExB;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;AACA;AACA;AACA;AACA,qFAAqF;;AAErF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,YAAY;AACb,WAAW;;;AAGX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kDAAkD;;AAElD;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB;;AAEpB;AACA;AACA,KAAK;AACL;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC,YAAY;AACZ;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;;;;;ACliBA,iBAAiB,mBAAO,CAAC,yEAAgB;;AAEzC,mBAAmB,mBAAO,CAAC,gFAAyB;;AAEpD,gBAAgB,mBAAO,CAAC,mEAAa;;AAErC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,yBAAyB;AACvC,cAAc,OAAO;AACrB;AACA;AACA;AACA,kCAAkC;;AAElC;AACA,0BAA0B;;AAE1B;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA,eAAe;;AAEf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA,0B;;;;;;;;;;;AC7DA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;AClCA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B,WAAW,mBAAO,CAAC,oEAAmB;;AAEtC,aAAa,mBAAO,CAAC,kEAAkB;;AAEvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;AChHA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;AC/BA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B,wBAAwB,mBAAO,CAAC,iGAA4B;;AAE5D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;AC1EA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B,iBAAiB,mBAAO,CAAC,yEAAgB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;ACpBA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B,iBAAiB,mBAAO,CAAC,yEAAgB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;ACvBA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B,sBAAsB,mBAAO,CAAC,mFAAqB;;AAEnD,wBAAwB,mBAAO,CAAC,iGAA4B;;AAE5D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;AC7DA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;ACzBA,WAAW,mBAAO,CAAC,2DAAS;;AAE5B,wBAAwB,mBAAO,CAAC,mGAA6B;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED,0B;;;;;;;;;;;AC3CA,eAAe,mBAAO,CAAC,+EAAuB;;AAE9C,eAAe,mBAAO,CAAC,2DAAa;;AAEpC,YAAY,mBAAO,CAAC,6DAAc;;AAElC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA,0BAA0B,MAAM;AAChC,8BAA8B,oBAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;;AAEpB;;AAEA,8CAA8C,OAAO;AACrD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,6BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAe,UAAU;AAChC;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,OAAO,qCAAqC,UAAU;AACtD;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;;;AAGX;AACA,6EAA6E;AAC7E;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA,GAAG;AACH;;;AAGA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;AClRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,SAAS;AACpB,kBAAkB,cAAc;AAChC,mBAAmB,cAAc;AACjC,WAAW,SAAS;AACpB;AACA,kBAAkB,OAAO;AACzB,kBAAkB,cAAc;AAChC,mBAAmB;AACnB,WAAW,SAAS;AACpB,kBAAkB,OAAO;AACzB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,cAAc;AAC3B,aAAa,SAAS;AACtB,aAAa,OAAO;AACpB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,cAAc;AAC3B,aAAa,SAAS;AACtB,aAAa,OAAO;AACpB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,qBAAqB,SAAS;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;;AAGA;AACA,0B;;;;;;;;;;;AClXA,aAAa,mBAAO,CAAC,iEAAgB;;AAErC,aAAa,mBAAO,CAAC,iEAAgB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;;;AAGH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;;AAGH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0B;;;;;;;;;;;ACnUA,UAAU,mBAAO,CAAC,2DAAa;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;;AAEpB;AACA;;AAEA;AACA;AACA,oBAAoB;;AAEpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH,2BAA2B;;AAE3B,qDAAqD;;AAErD;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA;AACA,KAAK;AACL,2CAA2C;;AAE3C;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,eAAe;AAC1B,YAAY,eAAe;AAC3B;;;AAGA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY,eAAe;AAC3B;;;AAGA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,+BAA+B;;AAE/B,+BAA+B;;AAE/B,0BAA0B;;AAE1B;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;;AAGA;AACA;;AAEA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,uBAAuB;AAClC,WAAW,eAAe;AAC1B,YAAY,eAAe;AAC3B;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B,WAAW,SAAS;AACpB,YAAY,gBAAgB;AAC5B,qCAAqC,wDAAwD;AAC7F;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;AAGA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8B;;;;;;;;;;;AClnBA,WAAW,mBAAO,CAAC,mEAAiB;;AAEpC,gBAAgB,mBAAO,CAAC,uEAAmB;;AAE3C,oBAAoB,mBAAO,CAAC,yEAAiB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;;AAEA,sDAAsD;;AAEtD;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;;AAEA,iBAAiB,oBAAoB;AACrC;AACA;AACA,YAAY;AACZ;AACA;AACA,sBAAsB,cAAc;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,UAAU;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;;AAEA;AACA;AACA,mCAAmC;;AAEnC;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,iBAAiB,SAAS;AAC1B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC;;AAElC;;AAEA;AACA,8BAA8B;;AAE9B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8B;;;;;;;;;;;ACvbA,gBAAgB,mBAAO,CAAC,uEAAmB;;AAE3C,cAAc,mBAAO,CAAC,iEAAgB;;AAEtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qDAAqD;;AAErD;AACA,uBAAuB;;AAEvB;AACA,uBAAuB;AACvB;;AAEA;AACA,wBAAwB;;AAExB,2BAA2B;;AAE3B,2BAA2B;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,YAAY;AAC3B;AACA;AACA;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;;AAEA,0B;;;;;;;;;;;ACnGA,cAAc,mBAAO,CAAC,gDAAqB;;AAE3C,mBAAO,CAAC,qDAAoB;AAC5B,mBAAO,CAAC,iDAAkB;;;AAG1B;AACA;AACA,QAAQ,mBAAO,CAAC,oFAA8B;AAC9C;AACA;;;;;;;;;;;;ACVA,cAAc,mBAAO,CAAC,gDAAqB;;AAE3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;AAID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClKA,yBAAyB,mBAAO,CAAC,gHAA4C;AAC7E,cAAc,mBAAO,CAAC,gDAAqB;;AAE3C;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;AC9ED,cAAc,mBAAO,CAAC,gDAAqB;AAC3C;AACA,iBAAiB,mBAAO,CAAC,0EAAyB;AAClD;;AAEA,mBAAmB,mBAAO,CAAC,qDAAoB;;AAE/C;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACldD,iE","file":"echarts-liquidfill.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"echarts\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"echarts\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"echarts-liquidfill\"] = factory(require(\"echarts\"));\n\telse\n\t\troot[\"echarts-liquidfill\"] = factory(root[\"echarts\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE_echarts_lib_echarts__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./src/liquidFill');\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* 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/*\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 _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 _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 _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 _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\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 _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\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 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 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 _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\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// Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nfunction _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true);\n var itemModel;\n\n if (!singleDataColor || !singleDataBorderColor) {\n // FIXME Performance\n itemModel = dataAll.getItemModel(rawIdx);\n }\n\n if (!singleDataColor) {\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n }\n\n if (!singleDataBorderColor) {\n var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'borderColor', borderColor);\n }\n }\n });\n }\n };\n}\n\nmodule.exports = _default;","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","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 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 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;","/**\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 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 _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;","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;","/**\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 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 _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 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;","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;","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 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;","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;","// 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 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;","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 _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;","/**\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 * zrender: 生成唯一id\n *\n * @author errorrik (errorrik@gmail.com)\n */\nvar idStart = 0x0907;\n\nfunction _default() {\n return idStart++;\n}\n\nmodule.exports = _default;","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;","/**\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;","/**\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;","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;","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;","/**\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 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 _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;","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 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 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 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 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 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 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 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 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 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 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;","/**\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 _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 _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;","/**\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 _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 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\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/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 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 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;","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\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 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 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;","/**\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;","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;","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 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 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 echarts = require('echarts/lib/echarts');\n\nrequire('./liquidFillSeries');\nrequire('./liquidFillView');\n\n\necharts.registerVisual(\n echarts.util.curry(\n require('echarts/lib/visual/dataColor'), 'liquidFill'\n )\n);\n","var echarts = require('echarts/lib/echarts');\n\nmodule.exports = echarts.graphic.extendShape({\n type: 'ec-liquid-fill',\n\n shape: {\n waveLength: 0,\n radius: 0,\n radiusY: 0,\n cx: 0,\n cy: 0,\n waterLevel: 0,\n amplitude: 0,\n phase: 0,\n inverse: false\n },\n\n buildPath: function (ctx, shape) {\n if (shape.radiusY == null) {\n shape.radiusY = shape.radius;\n }\n\n /**\n * We define a sine wave having 4 waves, and make sure at least 8 curves\n * is drawn. Otherwise, it may cause blank area for some waves when\n * wave length is large enough.\n */\n var curves = Math.max(\n Math.ceil(2 * shape.radius / shape.waveLength * 4) * 2,\n 8\n );\n\n // map phase to [-Math.PI * 2, 0]\n while (shape.phase < -Math.PI * 2) {\n shape.phase += Math.PI * 2;\n }\n while (shape.phase > 0) {\n shape.phase -= Math.PI * 2;\n }\n var phase = shape.phase / Math.PI / 2 * shape.waveLength;\n\n var left = shape.cx - shape.radius + phase - shape.radius * 2;\n\n /**\n * top-left corner as start point\n *\n * draws this point\n * |\n * \\|/\n * ~~~~~~~~\n * | |\n * +------+\n */\n ctx.moveTo(left, shape.waterLevel);\n\n /**\n * top wave\n *\n * ~~~~~~~~ <- draws this sine wave\n * | |\n * +------+\n */\n var waveRight = 0;\n for (var c = 0; c < curves; ++c) {\n var stage = c % 4;\n var pos = getWaterPositions(c * shape.waveLength / 4, stage,\n shape.waveLength, shape.amplitude);\n ctx.bezierCurveTo(pos[0][0] + left, -pos[0][1] + shape.waterLevel,\n pos[1][0] + left, -pos[1][1] + shape.waterLevel,\n pos[2][0] + left, -pos[2][1] + shape.waterLevel);\n\n if (c === curves - 1) {\n waveRight = pos[2][0];\n }\n }\n\n if (shape.inverse) {\n /**\n * top-right corner\n * 2. draws this line\n * |\n * +------+\n * 3. draws this line -> | | <- 1. draws this line\n * ~~~~~~~~\n */\n ctx.lineTo(waveRight + left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n else {\n /**\n * top-right corner\n *\n * ~~~~~~~~\n * 3. draws this line -> | | <- 1. draws this line\n * +------+\n * ^\n * |\n * 2. draws this line\n */\n ctx.lineTo(waveRight + left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n\n ctx.closePath();\n }\n});\n\n\n\n/**\n * Using Bezier curves to fit sine wave.\n * There is 4 control points for each curve of wave,\n * which is at 1/4 wave length of the sine wave.\n *\n * The control points for a wave from (a) to (d) are a-b-c-d:\n * c *----* d\n * b *\n * |\n * ... a * ..................\n *\n * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1)\n *\n * @param {number} x x position of the left-most point (a)\n * @param {number} stage 0-3, stating which part of the wave it is\n * @param {number} waveLength wave length of the sine wave\n * @param {number} amplitude wave amplitude\n */\nfunction getWaterPositions(x, stage, waveLength, amplitude) {\n if (stage === 0) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, amplitude],\n [x + waveLength / 4, amplitude]\n ];\n }\n else if (stage === 1) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n else if (stage === 2) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, -amplitude],\n [x + waveLength / 4, -amplitude]\n ]\n }\n else {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n -amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n -amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n}\n","var completeDimensions = require('echarts/lib/data/helper/completeDimensions');\nvar echarts = require('echarts/lib/echarts');\n\necharts.extendSeriesModel({\n\n type: 'series.liquidFill',\n\n visualColorAccessPath: 'textStyle.normal.color',\n\n optionUpdated: function () {\n var option = this.option;\n option.gridSize = Math.max(Math.floor(option.gridSize), 4);\n },\n\n getInitialData: function (option, ecModel) {\n var dimensions = completeDimensions(['value'], option.data);\n var list = new echarts.List(dimensions, this);\n list.initData(option.data);\n return list;\n },\n\n defaultOption: {\n color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'],\n center: ['50%', '50%'],\n radius: '50%',\n amplitude: '8%',\n waveLength: '80%',\n phase: 'auto',\n period: 'auto',\n direction: 'right',\n shape: 'circle',\n\n waveAnimation: true,\n animationEasing: 'linear',\n animationEasingUpdate: 'linear',\n animationDuration: 2000,\n animationDurationUpdate: 1000,\n\n outline: {\n show: true,\n borderDistance: 8,\n itemStyle: {\n color: 'none',\n borderColor: '#294D99',\n borderWidth: 8,\n shadowBlur: 20,\n shadowColor: 'rgba(0, 0, 0, 0.25)'\n }\n },\n\n backgroundStyle: {\n color: '#E3F7FF'\n },\n\n itemStyle: {\n opacity: 0.95,\n shadowBlur: 50,\n shadowColor: 'rgba(0, 0, 0, 0.4)'\n },\n\n label: {\n show: true,\n color: '#294D99',\n insideColor: '#fff',\n fontSize: 50,\n fontWeight: 'bold',\n\n align: 'center',\n baseline: 'middle',\n position: 'inside'\n },\n\n emphasis: {\n itemStyle: {\n opacity: 0.8\n }\n }\n }\n});\n","var echarts = require('echarts/lib/echarts');\nvar numberUtil = echarts.number;\nvar symbolUtil = require('echarts/lib/util/symbol');\nvar parsePercent = numberUtil.parsePercent;\n\nvar LiquidLayout = require('./liquidFillLayout');\n\nfunction getShallow(model, path) {\n return model && model.getShallow(path);\n}\n\necharts.extendChartView({\n\n type: 'liquidFill',\n\n render: function (seriesModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n var data = seriesModel.getData();\n\n var itemModel = data.getItemModel(0);\n\n var center = itemModel.get('center');\n var radius = itemModel.get('radius');\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n // itemStyle\n var outlineDistance = 0;\n var outlineBorderWidth = 0;\n var showOutline = seriesModel.get('outline.show');\n\n if (showOutline) {\n outlineDistance = seriesModel.get('outline.borderDistance');\n outlineBorderWidth = parsePercent(\n seriesModel.get('outline.itemStyle.borderWidth'), size\n );\n }\n\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n\n var outterRadius;\n var innerRadius;\n var paddingRadius;\n\n var isFillContainer = false;\n\n var symbol = seriesModel.get('shape');\n if (symbol === 'container') {\n // a shape that fully fills the container\n isFillContainer = true;\n\n outterRadius = [\n width / 2,\n height / 2\n ];\n innerRadius = [\n outterRadius[0] - outlineBorderWidth / 2,\n outterRadius[1] - outlineBorderWidth / 2\n ];\n paddingRadius = [\n parsePercent(outlineDistance, width),\n parsePercent(outlineDistance, height)\n ];\n\n radius = [\n Math.max(innerRadius[0] - paddingRadius[0], 0),\n Math.max(innerRadius[1] - paddingRadius[1], 0)\n ];\n }\n else {\n outterRadius = parsePercent(radius, size) / 2;\n innerRadius = outterRadius - outlineBorderWidth / 2;\n paddingRadius = parsePercent(outlineDistance, size);\n\n radius = Math.max(innerRadius - paddingRadius, 0);\n }\n\n if (showOutline) {\n var outline = getOutline();\n outline.style.lineWidth = outlineBorderWidth;\n group.add(getOutline());\n }\n\n var left = isFillContainer ? 0 : cx - radius;\n var top = isFillContainer ? 0 : cy - radius;\n\n var wavePath = null;\n\n group.add(getBackground());\n\n // each data item for a wave\n var oldData = this._data;\n var waves = [];\n data.diff(oldData)\n .add(function (idx) {\n var wave = getWave(idx, false);\n\n var waterLevel = wave.shape.waterLevel;\n wave.shape.waterLevel = isFillContainer ? height / 2 : radius;\n echarts.graphic.initProps(wave, {\n shape: {\n waterLevel: waterLevel\n }\n }, seriesModel);\n\n wave.z2 = 2;\n setWaveAnimation(idx, wave, null);\n\n group.add(wave);\n data.setItemGraphicEl(idx, wave);\n waves.push(wave);\n })\n .update(function (newIdx, oldIdx) {\n var waveElement = oldData.getItemGraphicEl(oldIdx);\n\n // new wave is used to calculate position, but not added\n var newWave = getWave(newIdx, false, waveElement);\n\n // changes with animation\n var shape = {};\n var shapeAttrs = ['amplitude', 'cx', 'cy', 'phase', 'radius', 'radiusY', 'waterLevel', 'waveLength'];\n for (var i = 0; i < shapeAttrs.length; ++i) {\n var attr = shapeAttrs[i];\n if (newWave.shape.hasOwnProperty(attr)) {\n shape[attr] = newWave.shape[attr];\n }\n }\n\n var style = {};\n var styleAttrs = ['fill', 'opacity', 'shadowBlur', 'shadowColor'];\n for (var i = 0; i < styleAttrs.length; ++i) {\n var attr = styleAttrs[i];\n if (newWave.style.hasOwnProperty(attr)) {\n style[attr] = newWave.style[attr];\n }\n }\n\n if (isFillContainer) {\n shape.radiusY = height / 2;\n }\n\n // changes with animation\n echarts.graphic.updateProps(waveElement, {\n shape: shape\n }, seriesModel);\n\n waveElement.useStyle(style);\n\n // instant changes\n waveElement.position = newWave.position;\n waveElement.setClipPath(newWave.clipPath);\n waveElement.shape.inverse = newWave.inverse;\n\n setWaveAnimation(newIdx, waveElement, waveElement);\n group.add(waveElement);\n data.setItemGraphicEl(newIdx, waveElement);\n waves.push(waveElement);\n })\n .remove(function (idx) {\n var wave = oldData.getItemGraphicEl(idx);\n group.remove(wave);\n })\n .execute();\n\n if (itemModel.get('label.show')) {\n group.add(getText(waves));\n }\n\n this._data = data;\n\n /**\n * Get path for outline, background and clipping\n *\n * @param {number} r outter radius of shape\n * @param {boolean|undefined} isForClipping if the shape is used\n * for clipping\n */\n function getPath(r, isForClipping) {\n if (symbol) {\n // customed symbol path\n if (symbol.indexOf('path://') === 0) {\n var path = echarts.graphic.makePath(symbol.slice(7), {});\n var bouding = path.getBoundingRect();\n var w = bouding.width;\n var h = bouding.height;\n if (w > h) {\n h = r * 2 / w * h;\n w = r * 2;\n }\n else {\n w = r * 2 / h * w;\n h = r * 2;\n }\n\n var left = isForClipping ? 0 : cx - w / 2;\n var top = isForClipping ? 0 : cy - h / 2;\n path = echarts.graphic.makePath(\n symbol.slice(7),\n {},\n new echarts.graphic.BoundingRect(left, top, w, h)\n );\n if (isForClipping) {\n path.position = [-w / 2, -h / 2];\n }\n return path;\n }\n else if (isFillContainer) {\n // fully fill the container\n var x = isForClipping ? -r[0] : cx - r[0];\n var y = isForClipping ? -r[1] : cy - r[1];\n return symbolUtil.createSymbol(\n 'rect', x, y, r[0] * 2, r[1] * 2\n );\n }\n else {\n var x = isForClipping ? -r : cx - r;\n var y = isForClipping ? -r : cy - r;\n if (symbol === 'pin') {\n y += r;\n }\n else if (symbol === 'arrow') {\n y -= r;\n }\n return symbolUtil.createSymbol(symbol, x, y, r * 2, r * 2);\n }\n }\n\n return new echarts.graphic.Circle({\n shape: {\n cx: isForClipping ? 0 : cx,\n cy: isForClipping ? 0 : cy,\n r: r\n }\n });\n }\n /**\n * Create outline\n */\n function getOutline() {\n var outlinePath = getPath(outterRadius);\n outlinePath.style.fill = null;\n\n outlinePath.setStyle(seriesModel.getModel('outline.itemStyle')\n .getItemStyle());\n\n return outlinePath;\n }\n\n /**\n * Create background\n */\n function getBackground() {\n // Seperate stroke and fill, so we can use stroke to cover the alias of clipping.\n var strokePath = getPath(radius);\n strokePath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n strokePath.style.fill = null;\n\n // Stroke is front of wave\n strokePath.z2 = 5;\n\n var fillPath = getPath(radius);\n fillPath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n fillPath.style.stroke = null;\n\n var group = new echarts.graphic.Group();\n group.add(strokePath);\n group.add(fillPath);\n\n return group;\n }\n\n /**\n * wave shape\n */\n function getWave(idx, isInverse, oldWave) {\n var radiusX = isFillContainer ? radius[0] : radius;\n var radiusY = isFillContainer ? height / 2 : radius;\n\n var itemModel = data.getItemModel(idx);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var phase = itemModel.get('phase');\n var amplitude = parsePercent(itemModel.get('amplitude'),\n radiusY * 2);\n var waveLength = parsePercent(itemModel.get('waveLength'),\n radiusX * 2);\n\n var value = data.get('value', idx);\n var waterLevel = radiusY - value * radiusY * 2;\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n var normalStyle = itemStyleModel.getItemStyle();\n if (!normalStyle.fill) {\n var seriesColor = seriesModel.get('color');\n var id = idx % seriesColor.length;\n normalStyle.fill = seriesColor[id];\n }\n\n var x = radiusX * 2;\n var wave = new LiquidLayout({\n shape: {\n waveLength: waveLength,\n radius: radiusX,\n radiusY: radiusY,\n cx: x,\n cy: 0,\n waterLevel: waterLevel,\n amplitude: amplitude,\n phase: phase,\n inverse: isInverse\n },\n style: normalStyle,\n position: [cx, cy]\n });\n wave.shape._waterLevel = waterLevel;\n\n var hoverStyle = itemModel.getModel('emphasis.itemStyle')\n .getItemStyle();\n hoverStyle.lineWidth = 0;\n echarts.graphic.setHoverStyle(wave, hoverStyle);\n\n // clip out the part outside the circle\n var clip = getPath(radius, true);\n // set fill for clipPath, otherwise it will not trigger hover event\n clip.setStyle({\n fill: 'white'\n });\n wave.setClipPath(clip);\n\n return wave;\n }\n\n function setWaveAnimation(idx, wave, oldWave) {\n var itemModel = data.getItemModel(idx);\n\n var maxSpeed = itemModel.get('period');\n var direction = itemModel.get('direction');\n\n var value = data.get('value', idx);\n\n var phase = itemModel.get('phase');\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n\n var defaultSpeed = function (maxSpeed) {\n var cnt = data.count();\n return cnt === 0 ? maxSpeed : maxSpeed *\n (0.2 + (cnt - idx) / cnt * 0.8);\n };\n var speed = 0;\n if (maxSpeed === 'auto') {\n speed = defaultSpeed(5000);\n }\n else {\n speed = typeof maxSpeed === 'function'\n ? maxSpeed(value, idx) : maxSpeed;\n }\n\n // phase for moving left/right\n var phaseOffset = 0;\n if (direction === 'right' || direction == null) {\n phaseOffset = Math.PI;\n }\n else if (direction === 'left') {\n phaseOffset = -Math.PI;\n }\n else if (direction === 'none') {\n phaseOffset = 0;\n }\n else {\n console.error('Illegal direction value for liquid fill.');\n }\n\n // wave animation of moving left/right\n if (direction !== 'none' && itemModel.get('waveAnimation')) {\n wave\n .animate('shape', true)\n .when(0, {\n phase: phase\n })\n .when(speed / 2, {\n phase: phaseOffset + phase\n })\n .when(speed, {\n phase: phaseOffset * 2 + phase\n })\n .during(function () {\n if (wavePath) {\n wavePath.dirty(true);\n }\n })\n .start();\n }\n }\n\n /**\n * text on wave\n */\n function getText(waves) {\n var labelModel = itemModel.getModel('label');\n\n function formatLabel() {\n var formatted = seriesModel.getFormattedLabel(0, 'normal');\n var defaultVal = (data.get('value', 0) * 100);\n var defaultLabel = data.getName(0) || seriesModel.name;\n if (!isNaN(defaultVal)) {\n defaultLabel = defaultVal.toFixed(0) + '%';\n }\n return formatted == null ? defaultLabel : formatted;\n }\n\n var textOption = {\n z2: 10,\n shape: {\n x: left,\n y: top,\n width: (isFillContainer ? radius[0] : radius) * 2,\n height: (isFillContainer ? radius[1] : radius) * 2\n },\n style: {\n fill: 'transparent',\n text: formatLabel(),\n textAlign: labelModel.get('align'),\n textVerticalAlign: labelModel.get('baseline')\n },\n silent: true\n };\n\n var outsideTextRect = new echarts.graphic.Rect(textOption);\n var color = labelModel.get('color');\n echarts.graphic.setText(outsideTextRect.style, labelModel, color);\n\n var insideTextRect = new echarts.graphic.Rect(textOption);\n var insColor = labelModel.get('insideColor');\n echarts.graphic.setText(insideTextRect.style, labelModel, insColor);\n insideTextRect.style.textFill = insColor;\n\n var group = new echarts.graphic.Group();\n group.add(outsideTextRect);\n group.add(insideTextRect);\n\n // clip out waves for insideText\n var boundingCircle = getPath(radius, true);\n\n wavePath = new echarts.graphic.CompoundPath({\n shape: {\n paths: waves\n },\n position: [cx, cy]\n });\n\n wavePath.setClipPath(boundingCircle);\n insideTextRect.setClipPath(wavePath);\n\n return group;\n }\n },\n\n dispose: function () {\n // dispose nothing here\n }\n});\n","module.exports = __WEBPACK_EXTERNAL_MODULE_echarts_lib_echarts__;"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/echarts-liquidfill.min.js b/dist/echarts-liquidfill.min.js index 91844ee..f8ab5d8 100644 --- a/dist/echarts-liquidfill.min.js +++ b/dist/echarts-liquidfill.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],e):"object"==typeof exports?exports["echarts-liquidfill"]=e(require("echarts")):t["echarts-liquidfill"]=e(t.echarts)}(window,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var i in t)e.d(n,i,function(e){return t[e]}.bind(null,i));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=29)}([function(t,e){function r(t){if(null==t||"object"!=typeof t)return t;var e=t,n=v.call(t);if("[object Array]"===n){if(!c(t)){e=[];for(var i=0,a=t.length;i1e-10&&(i.width+=a/s,i.height+=a/s,i.x-=a/s/2,i.y-=a/s/2)}return i}return t},contain:function(t,e){var r=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),i=this.style;if(t=r[0],e=r[1],n.contain(t,e)){var a=this.path.data;if(i.hasStroke()){var o=i.lineWidth,l=i.strokeNoScale?this.getLineScale():1;if(l>1e-10&&(i.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),s.containStroke(a,o/l,t,e)))return!0}if(i.hasFill())return s.contain(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):i.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var r=this.shape;if(r){if(a.isObject(t))for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);else r[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&h(t[0]-1)>1e-10&&h(t[3]-1)>1e-10?Math.sqrt(h(t[0]*t[3]-t[2]*t[1])):1}},n.extend=function(t){var e=function(e){n.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var r=t.shape;if(r){this.shape=this.shape||{};var i=this.shape;for(var a in r)!i.hasOwnProperty(a)&&r.hasOwnProperty(a)&&(i[a]=r[a])}t.init&&t.init.call(this,e)};for(var r in a.inherits(e,n),t)"style"!==r&&"shape"!==r&&(e.prototype[r]=t[r]);return e},a.inherits(n,i);var c=n;t.exports=c},function(t,e){function r(t){return Math.sqrt(n(t))}function n(t){return t[0]*t[0]+t[1]*t[1]}function i(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function a(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var o="undefined"==typeof Float32Array?Array:Float32Array,s=r,l=n,h=i,u=a;e.create=function(t,e){var r=new o(2);return null==t&&(t=0),null==e&&(e=0),r[0]=t,r[1]=e,r},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.clone=function(t){var e=new o(2);return e[0]=t[0],e[1]=t[1],e},e.set=function(t,e,r){return t[0]=e,t[1]=r,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},e.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},e.len=r,e.length=s,e.lenSquare=n,e.lengthSquare=l,e.mul=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},e.div=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},e.normalize=function(t,e){var n=r(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t},e.distance=i,e.dist=h,e.distanceSquare=a,e.distSquare=u,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.lerp=function(t,e,r,n){return t[0]=e[0]+n*(r[0]-e[0]),t[1]=e[1]+n*(r[1]-e[1]),t},e.applyTransform=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}},function(t,e,r){function n(t,e,r,n){r<0&&(t+=r,r=-r),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=r,this.height=n}var i=r(2),a=r(10),o=i.applyTransform,s=Math.min,l=Math.max;n.prototype={constructor:n,union:function(t){var e=s(t.x,this.x),r=s(t.y,this.y);this.width=l(t.x+t.width,this.x+this.width)-e,this.height=l(t.y+t.height,this.y+this.height)-r,this.x=e,this.y=r},applyTransform:function(){var t=[],e=[],r=[],n=[];return function(i){if(i){t[0]=r[0]=this.x,t[1]=n[1]=this.y,e[0]=n[0]=this.x+this.width,e[1]=r[1]=this.y+this.height,o(t,t,i),o(e,e,i),o(r,r,i),o(n,n,i),this.x=s(t[0],e[0],r[0],n[0]),this.y=s(t[1],e[1],r[1],n[1]);var a=l(t[0],e[0],r[0],n[0]),h=l(t[1],e[1],r[1],n[1]);this.width=a-this.x,this.height=h-this.y}}}(),calculateTransform:function(t){var e=this,r=t.width/e.width,n=t.height/e.height,i=a.create();return a.translate(i,i,[-e.x,-e.y]),a.scale(i,i,[r,n]),a.translate(i,i,[t.x,t.y]),i},intersect:function(t){if(!t)return!1;t instanceof n||(t=n.create(t));var e=this,r=e.x,i=e.x+e.width,a=e.y,o=e.y+e.height,s=t.x,l=t.x+t.width,h=t.y,u=t.y+t.height;return!(i=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},clone:function(){return new n(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},n.create=function(t){return new n(t.x,t.y,t.width,t.height)};var h=n;t.exports=h},function(t,e,r){function n(t){return t>-f&&tf||t<-f}function a(t,e,r,n,i){var a=1-i;return a*a*(a*t+3*i*e)+i*i*(i*n+3*a*r)}function o(t,e,r,n){var i=1-n;return i*(i*t+2*n*e)+n*n*r}var s=r(2),l=s.create,h=s.distSquare,u=Math.pow,c=Math.sqrt,f=1e-8,d=1e-4,p=c(3),v=1/3,g=l(),y=l(),m=l();e.cubicAt=a,e.cubicDerivativeAt=function(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)},e.cubicRootAt=function(t,e,r,i,a,o){var s=i+3*(e-r)-t,l=3*(r-2*e+t),h=3*(e-t),f=t-a,d=l*l-3*s*h,g=l*h-9*s*f,y=h*h-3*l*f,m=0;if(n(d)&&n(g))n(l)?o[0]=0:(C=-h/l)>=0&&C<=1&&(o[m++]=C);else{var x=g*g-4*d*y;if(n(x)){var _=g/d,b=-_/2;(C=-l/s+_)>=0&&C<=1&&(o[m++]=C),b>=0&&b<=1&&(o[m++]=b)}else if(x>0){var w=c(x),S=d*l+1.5*s*(-g+w),T=d*l+1.5*s*(-g-w);(C=(-l-((S=S<0?-u(-S,v):u(S,v))+(T=T<0?-u(-T,v):u(T,v))))/(3*s))>=0&&C<=1&&(o[m++]=C)}else{var M=(2*d*l-3*s*g)/(2*c(d*d*d)),P=Math.acos(M)/3,k=c(d),O=Math.cos(P),C=(-l-2*k*O)/(3*s),A=(b=(-l+k*(O+p*Math.sin(P)))/(3*s),(-l+k*(O-p*Math.sin(P)))/(3*s));C>=0&&C<=1&&(o[m++]=C),b>=0&&b<=1&&(o[m++]=b),A>=0&&A<=1&&(o[m++]=A)}}return m},e.cubicExtrema=function(t,e,r,a,o){var s=6*r-12*e+6*t,l=9*e+3*a-3*t-9*r,h=3*e-3*t,u=0;if(n(l))i(s)&&(d=-h/s)>=0&&d<=1&&(o[u++]=d);else{var f=s*s-4*l*h;if(n(f))o[0]=-s/(2*l);else if(f>0){var d,p=c(f),v=(-s-p)/(2*l);(d=(-s+p)/(2*l))>=0&&d<=1&&(o[u++]=d),v>=0&&v<=1&&(o[u++]=v)}}return u},e.cubicSubdivide=function(t,e,r,n,i,a){var o=(e-t)*i+t,s=(r-e)*i+e,l=(n-r)*i+r,h=(s-o)*i+o,u=(l-s)*i+s,c=(u-h)*i+h;a[0]=t,a[1]=o,a[2]=h,a[3]=c,a[4]=c,a[5]=u,a[6]=l,a[7]=n},e.cubicProjectPoint=function(t,e,r,n,i,o,s,l,u,f,p){var v,x,_,b,w,S=.005,T=1/0;g[0]=u,g[1]=f;for(var M=0;M<1;M+=.05)y[0]=a(t,r,i,s,M),y[1]=a(e,n,o,l,M),(b=h(g,y))=0&&b=0&&d<=1&&(o[u++]=d);else{var f=l*l-4*s*h;if(n(f))(d=-l/(2*s))>=0&&d<=1&&(o[u++]=d);else if(f>0){var d,p=c(f),v=(-l-p)/(2*s);(d=(-l+p)/(2*s))>=0&&d<=1&&(o[u++]=d),v>=0&&v<=1&&(o[u++]=v)}}return u},e.quadraticExtremum=function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n},e.quadraticSubdivide=function(t,e,r,n,i){var a=(e-t)*n+t,o=(r-e)*n+e,s=(o-a)*n+a;i[0]=t,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r},e.quadraticProjectPoint=function(t,e,r,n,i,a,s,l,u){var f,p=.005,v=1/0;g[0]=s,g[1]=l;for(var x=0;x<1;x+=.05)y[0]=o(t,r,i,x),y[1]=o(e,n,a,x),(S=h(g,y))=0&&Sthis._ux||m(e-this._yi)>this._uy||this._len<5;return this.addData(l.L,t,e),this._ctx&&r&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,r,n,i,a){return this.addData(l.C,t,e,r,n,i,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,r,n,i,a):this._ctx.bezierCurveTo(t,e,r,n,i,a)),this._xi=i,this._yi=a,this},quadraticCurveTo:function(t,e,r,n){return this.addData(l.Q,t,e,r,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,r,n):this._ctx.quadraticCurveTo(t,e,r,n)),this._xi=r,this._yi=n,this},arc:function(t,e,r,n,i,a){return this.addData(l.A,t,e,r,r,n,i-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,r,n,i,a),this._xi=v(i)*r+t,this._yi=g(i)*r+e,this},arcTo:function(t,e,r,n,i){return this._ctx&&this._ctx.arcTo(t,e,r,n,i),this},rect:function(t,e,r,n){return this._ctx&&this._ctx.rect(t,e,r,n),this.addData(l.R,t,e,r,n),this},closePath:function(){this.addData(l.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,r=0;re.length&&(this._expandData(),e=this.data);for(var r=0;r0&&v<=t||u<0&&v>=t||0===u&&(c>0&&g<=e||c<0&&g>=e);)v+=u*(r=o[n=this._dashIdx]),g+=c*r,this._dashIdx=(n+1)%m,u>0&&vl||c>0&&gh||s[n%2?"moveTo":"lineTo"](u>=0?d(v,t):p(v,t),c>=0?d(g,e):p(g,e));u=v-t,c=g-e,this._dashOffset=-y(u*u+c*c)},_dashedBezierTo:function(t,e,r,i,a,o){var s,l,h,u,c,f=this._dashSum,d=this._dashOffset,p=this._lineDash,v=this._ctx,g=this._xi,m=this._yi,x=n.cubicAt,_=0,b=this._dashIdx,w=p.length,S=0;for(d<0&&(d=f+d),d%=f,s=0;s<1;s+=.1)l=x(g,t,r,a,s+.1)-x(g,t,r,a,s),h=x(m,e,i,o,s+.1)-x(m,e,i,o,s),_+=y(l*l+h*h);for(;bd);b++);for(s=(S-d)/_;s<=1;)u=x(g,t,r,a,s),c=x(m,e,i,o,s),b%2?v.moveTo(u,c):v.lineTo(u,c),s+=p[b]/_,b=(b+1)%w;b%2!=0&&v.lineTo(a,o),l=a-u,h=o-c,this._dashOffset=-y(l*l+h*h)},_dashedQuadraticTo:function(t,e,r,n){var i=r,a=n;r=(r+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,r,n,i,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,x&&(this.data=new Float32Array(t)))},getBoundingRect:function(){h[0]=h[1]=c[0]=c[1]=Number.MAX_VALUE,u[0]=u[1]=f[0]=f[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,r=0,n=0,s=0,d=0;dh||m(o-i)>u||f===c-1)&&(t.lineTo(a,o),n=a,i=o);break;case l.C:t.bezierCurveTo(s[f++],s[f++],s[f++],s[f++],s[f++],s[f++]),n=s[f-2],i=s[f-1];break;case l.Q:t.quadraticCurveTo(s[f++],s[f++],s[f++],s[f++]),n=s[f-2],i=s[f-1];break;case l.A:var p=s[f++],y=s[f++],x=s[f++],_=s[f++],b=s[f++],w=s[f++],S=s[f++],T=s[f++],M=x>_?x:_,P=x>_?1:x/_,k=x>_?_/x:1,O=b+w;Math.abs(x-_)>.001?(t.translate(p,y),t.rotate(S),t.scale(P,k),t.arc(0,0,M,b,O,1-T),t.scale(1/P,1/k),t.rotate(-S),t.translate(-p,-y)):t.arc(p,y,M,b,O,1-T),1===f&&(e=v(b)*x+p,r=g(b)*_+y),n=v(O)*x+p,i=g(O)*_+y;break;case l.R:e=n=s[f],r=i=s[f+1],t.rect(s[f++],s[f++],s[f++],s[f++]);break;case l.Z:t.closePath(),n=e,i=r}}}},_.CMD=l;var b=_;t.exports=b},function(t,e){function r(){var t=new a(6);return n(t),t}function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}var a="undefined"==typeof Float32Array?Array:Float32Array;e.create=r,e.identity=n,e.copy=i,e.mul=function(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t},e.translate=function(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t},e.rotate=function(t,e,r){var n=e[0],i=e[2],a=e[4],o=e[1],s=e[3],l=e[5],h=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*h,t[1]=-n*h+o*u,t[2]=i*u+s*h,t[3]=-i*h+u*s,t[4]=u*a+h*l,t[5]=u*l-h*a,t},e.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t},e.invert=function(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*n;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*i)*l,t[5]=(a*i-r*s)*l,t):null},e.clone=function(t){var e=r();return i(e,t),e}},function(t,e,r){function n(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=r.length&&r.push({option:t})}}),r},e.makeIdAndName=function(t){var e=o.createHashMap();l(t,function(t,r){var n=t.exist;n&&e.set(n.id,t)}),l(t,function(t,r){var n=t.option;o.assert(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),l(t,function(t,r){var n=t.exist,i=t.option,a=t.keyInfo;if(h(i)){if(a.name=null!=i.name?i.name+"":n?n.name:c+r,n)a.id=n.id;else if(null!=i.id)a.id=i.id+"";else{var o=0;do{a.id="\0"+a.name+"\0"+o++}while(e.get(a.id))}e.set(a.id,t)}})},e.isNameSpecified=function(t){var e=t.name;return!(!e||!e.indexOf(c))},e.isIdInner=i,e.compressBatches=function(t,e){function r(t,e,r){for(var i=0,a=t.length;i=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent);t.exports=r},function(t,e,r){function n(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===d?{}:[]),this.sourceFormat=t.sourceFormat||c,this.seriesLayoutBy=t.seriesLayoutBy||u,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&a(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}var i=r(0),a=i.createHashMap,o=i.isTypedArray,s=r(36).enableClassCheck,l=r(15),h=l.SOURCE_FORMAT_ORIGINAL,u=l.SERIES_LAYOUT_BY_COLUMN,c=l.SOURCE_FORMAT_UNKNOWN,f=l.SOURCE_FORMAT_TYPED_ARRAY,d=l.SOURCE_FORMAT_KEYED_COLUMNS;n.seriesDataToSource=function(t){return new n({data:t,sourceFormat:o(t)?f:h,fromDataset:!1})},s(n);var p=n;t.exports=p},function(t,e){e.SOURCE_FORMAT_ORIGINAL="original",e.SOURCE_FORMAT_ARRAY_ROWS="arrayRows",e.SOURCE_FORMAT_OBJECT_ROWS="objectRows",e.SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",e.SOURCE_FORMAT_UNKNOWN="unknown",e.SOURCE_FORMAT_TYPED_ARRAY="typedArray",e.SERIES_LAYOUT_BY_COLUMN="column",e.SERIES_LAYOUT_BY_ROW="row"},function(t,e){var r={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};t.exports=function(t,e,n){return r.hasOwnProperty(e)?n*=t.dpr:n}},function(t,e,r){var n=r(43),i=r(44),a=r(18),o=r(45),s=r(0),l=function(t){a.call(this,t),i.call(this,t),o.call(this,t),this.id=t.id||n()};l.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=t,r[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var r=this[t];r||(r=this[t]=[]),r[0]=e[0],r[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(s.isObject(t))for(var r in t)t.hasOwnProperty(r)&&this.attrKV(r,t[r]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var r=0;rs||t<-s}var i=r(10),a=r(2),o=i.identity,s=5e-5,l=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},h=l.prototype;h.transform=null,h.needLocalTransform=function(){return n(this.rotation)||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)};var u=[];h.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),n=this.transform;if(r||e){n=n||i.create(),r?this.getLocalTransform(n):o(n),e&&(r?i.mul(n,t.transform,n):i.copy(n,t.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(u);var s=u[0]<0?-1:1,l=u[1]<0?-1:1,h=((u[0]-s)*a+s)/u[0]||0,c=((u[1]-l)*a+l)/u[1]||0;n[0]*=h,n[1]*=h,n[2]*=c,n[3]*=c}this.invTransform=this.invTransform||i.create(),i.invert(this.invTransform,n)}else n&&o(n)},h.getLocalTransform=function(t){return l.getLocalTransform(this,t)},h.setTransform=function(t){var e=this.transform,r=t.dpr||1;e?t.setTransform(r*e[0],r*e[1],r*e[2],r*e[3],r*e[4],r*e[5]):t.setTransform(r,0,0,r,0,0)},h.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var c=[],f=i.create();h.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],i=this.position,a=this.scale;n(e-1)&&(e=Math.sqrt(e)),n(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),i[0]=t[4],i[1]=t[5],a[0]=e,a[1]=r,this.rotation=Math.atan2(-t[1]/r,t[0]/e)}},h.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(i.mul(c,t.invTransform,e),e=c);var r=this.origin;r&&(r[0]||r[1])&&(f[4]=r[0],f[5]=r[1],i.mul(c,e,f),c[4]-=r[0],c[5]-=r[1],e=c),this.setLocalTransform(e)}},h.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},h.transformCoordToLocal=function(t,e){var r=[t,e],n=this.invTransform;return n&&a.applyTransform(r,r,n),r},h.transformCoordToGlobal=function(t,e){var r=[t,e],n=this.transform;return n&&a.applyTransform(r,r,n),r},l.getLocalTransform=function(t,e){o(e=e||[]);var r=t.origin,n=t.scale||[1,1],a=t.rotation||0,s=t.position||[0,0];return r&&(e[4]-=r[0],e[5]-=r[1]),i.scale(e,e,n),a&&i.rotate(e,e,a),r&&(e[4]+=r[0],e[5]+=r[1]),e[4]+=s[0],e[5]+=s[1],e};var d=l;t.exports=d},function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function o(t){return i(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t,e,r){return t+(e-t)*r}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function c(t,e){x&&u(x,e),x=m.put(t,x||e.slice())}function f(t,e){if(t){e=e||[];var r=m.get(t);if(r)return u(e,r);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in y)return u(e,y[n]),c(t,e),e;if("#"!==n.charAt(0)){var i=n.indexOf("("),s=n.indexOf(")");if(-1!==i&&s+1===n.length){var l=n.substr(0,i),f=n.substr(i+1,s-(i+1)).split(","),p=1;switch(l){case"rgba":if(4!==f.length)return void h(e,0,0,0,1);p=o(f.pop());case"rgb":return 3!==f.length?void h(e,0,0,0,1):(h(e,a(f[0]),a(f[1]),a(f[2]),p),c(t,e),e);case"hsla":return 4!==f.length?void h(e,0,0,0,1):(f[3]=o(f[3]),d(f,e),c(t,e),e);case"hsl":return 3!==f.length?void h(e,0,0,0,1):(d(f,e),c(t,e),e);default:return}}h(e,0,0,0,1)}else{var v;if(4===n.length)return(v=parseInt(n.substr(1),16))>=0&&v<=4095?(h(e,(3840&v)>>4|(3840&v)>>8,240&v|(240&v)>>4,15&v|(15&v)<<4,1),c(t,e),e):void h(e,0,0,0,1);if(7===n.length)return(v=parseInt(n.substr(1),16))>=0&&v<=16777215?(h(e,(16711680&v)>>16,(65280&v)>>8,255&v,1),c(t,e),e):void h(e,0,0,0,1)}}}function d(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=o(t[1]),a=o(t[2]),l=a<=.5?a*(i+1):a+i-a*i,u=2*a-l;return h(e=e||[],n(255*s(u,l,r+1/3)),n(255*s(u,l,r)),n(255*s(u,l,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function p(t,e,r){if(e&&e.length&&t>=0&&t<=1){r=r||[];var a=t*(e.length-1),o=Math.floor(a),s=Math.ceil(a),h=e[o],u=e[s],c=a-o;return r[0]=n(l(h[0],u[0],c)),r[1]=n(l(h[1],u[1],c)),r[2]=n(l(h[2],u[2],c)),r[3]=i(l(h[3],u[3],c)),r}}function v(t,e,r){if(e&&e.length&&t>=0&&t<=1){var a=t*(e.length-1),o=Math.floor(a),s=Math.ceil(a),h=f(e[o]),u=f(e[s]),c=a-o,d=g([n(l(h[0],u[0],c)),n(l(h[1],u[1],c)),n(l(h[2],u[2],c)),i(l(h[3],u[3],c))],"rgba");return r?{color:d,leftIndex:o,rightIndex:s,value:a}:d}}function g(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}var y={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},m=new(r(20))(20),x=null,_=p,b=v;e.parse=f,e.lift=function(t,e){var r=f(t);if(r){for(var n=0;n<3;n++)r[n]=e<0?r[n]*(1-e)|0:(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:t[n]<0&&(r[n]=0);return g(r,4===r.length?"rgba":"rgb")}},e.toHex=function(t){var e=f(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},e.fastLerp=p,e.fastMapToColor=_,e.lerp=v,e.mapToColor=b,e.modifyHSL=function(t,e,r,n){if(t=f(t))return t=function(t){if(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o,h=(s+o)/2;if(0===l)e=0,r=0;else{r=h<.5?l/(s+o):l/(2-s-o);var u=((s-n)/6+l/2)/l,c=((s-i)/6+l/2)/l,f=((s-a)/6+l/2)/l;n===s?e=f-c:i===s?e=1/3+u-f:a===s&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,r,h];return null!=t[3]&&d.push(t[3]),d}}(t),null!=e&&(t[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=r&&(t[1]=o(r)),null!=n&&(t[2]=o(n)),g(d(t),"rgba")},e.modifyAlpha=function(t,e){if((t=f(t))&&null!=e)return t[3]=i(e),g(t,"rgba")},e.stringify=g},function(t,e){var r=function(){this.head=null,this.tail=null,this._len=0},n=r.prototype;n.insert=function(t){var e=new i(t);return this.insertEntry(e),e},n.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},n.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};var i=function(t){this.value=t,this.next,this.prev},a=function(t){this._list=new r,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(t,e){var r=this._list,n=this._map,a=null;if(null==n[t]){var o=r.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=r.head;r.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new i(e),s.key=t,r.insertEntry(s),n[t]=s}return a},o.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;t.exports=s},function(t,e){var r=1;"undefined"!=typeof window&&(r=Math.max(window.devicePixelRatio||1,1));var n=r;e.debugMode=0,e.devicePixelRatio=n},function(t,e,r){function n(t){if(t){t.font=w.makeFont(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||A[e]?e:"left";var r=t.textVerticalAlign||t.textBaseline;"center"===r&&(r="middle"),t.textVerticalAlign=null==r||I[r]?r:"top",t.textPadding&&(t.textPadding=x(t.textPadding))}}function i(t,e,r,n,i){if(r&&e.textRotation){var a=e.textOrigin;"center"===a?(n=r.width/2+r.x,i=r.height/2+r.y):a&&(n=a[0]+r.x,i=a[1]+r.y),t.translate(n,i),t.rotate(-e.textRotation),t.translate(-n,-i)}}function a(t,e,r,n,i,a,l,h){var d=n.rich[r.styleName]||{};d.text=r.text;var v=r.textVerticalAlign,m=a+i/2;"top"===v?m=a+r.height/2:"bottom"===v&&(m=a+i-r.height/2),!r.isLineHolder&&o(d)&&s(t,e,d,"right"===h?l-r.width:"center"===h?l-r.width/2:l,m-r.height/2,r.width,r.height);var x=r.textPadding;x&&(l=p(l,h,x),m-=r.height/2-x[2]-r.textHeight/2),u(e,"shadowBlur",y(d.textShadowBlur,n.textShadowBlur,0)),u(e,"shadowColor",d.textShadowColor||n.textShadowColor||"transparent"),u(e,"shadowOffsetX",y(d.textShadowOffsetX,n.textShadowOffsetX,0)),u(e,"shadowOffsetY",y(d.textShadowOffsetY,n.textShadowOffsetY,0)),u(e,"textAlign",h),u(e,"textBaseline","middle"),u(e,"font",r.font||C);var _=c(d.textStroke||n.textStroke,w),b=f(d.textFill||n.textFill),w=g(d.textStrokeWidth,n.textStrokeWidth);_&&(u(e,"lineWidth",w),u(e,"strokeStyle",_),e.strokeText(r.text,l,m)),b&&(u(e,"fillStyle",b),e.fillText(r.text,l,m))}function o(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function s(t,e,r,n,i,a,o){var s=r.textBackgroundColor,h=r.textBorderWidth,c=r.textBorderColor,f=_(s);if(u(e,"shadowBlur",r.textBoxShadowBlur||0),u(e,"shadowColor",r.textBoxShadowColor||"transparent"),u(e,"shadowOffsetX",r.textBoxShadowOffsetX||0),u(e,"shadowOffsetY",r.textBoxShadowOffsetY||0),f||h&&c){e.beginPath();var d=r.textBorderRadius;d?S.buildPath(e,{x:n,y:i,width:a,height:o,r:d}):e.rect(n,i,a,o),e.closePath()}if(f)if(u(e,"fillStyle",s),null!=r.fillOpacity){var p=e.globalAlpha;e.globalAlpha=r.fillOpacity*r.opacity,e.fill(),e.globalAlpha=p}else e.fill();else if(b(s)){var v=s.image;(v=T.createOrUpdateImage(v,null,t,l,s))&&T.isImageReady(v)&&e.drawImage(v,n,i,a,o)}if(h&&c)if(u(e,"lineWidth",h),u(e,"strokeStyle",c),null!=r.strokeOpacity){p=e.globalAlpha;e.globalAlpha=r.strokeOpacity*r.opacity,e.stroke(),e.globalAlpha=p}else e.stroke()}function l(t,e){e.image=t}function h(t,e,r){var n=e.x||0,i=e.y||0,a=e.textAlign,o=e.textVerticalAlign;if(r){var s=e.textPosition;if(s instanceof Array)n=r.x+d(s[0],r.width),i=r.y+d(s[1],r.height);else{var l=w.adjustTextPositionOnRect(s,r,e.textDistance);n=l.x,i=l.y,a=a||l.textAlign,o=o||l.textVerticalAlign}var h=e.textOffset;h&&(n+=h[0],i+=h[1])}return{baseX:n,baseY:i,textAlign:a,textVerticalAlign:o}}function u(t,e,r){return t[e]=M(t,e,r),t[e]}function c(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function f(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function d(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function p(t,e,r){return"right"===e?t-r[1]:"center"===e?t+r[3]/2-r[1]/2:t+r[3]}var v=r(0),g=v.retrieve2,y=v.retrieve3,m=v.each,x=v.normalizeCssArray,_=v.isString,b=v.isObject,w=r(23),S=r(24),T=r(11),M=r(16),P=r(8),k=P.ContextCachedBy,O=P.WILL_BE_RESTORED,C=w.DEFAULT_FONT,A={left:1,right:1,center:1},I={top:1,bottom:1,middle:1},D=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]];e.normalizeTextStyle=function(t){return n(t),m(t.rich,n),t},e.renderText=function(t,e,r,n,l,u){n.rich?function(t,e,r,n,l,u){u!==O&&(e.__attrCachedBy=k.NONE);var c=t.__textCotentBlock;c&&!t.__dirtyText||(c=t.__textCotentBlock=w.parseRichText(r,n)),function(t,e,r,n,l){var u=r.width,c=r.outerWidth,f=r.outerHeight,d=n.textPadding,p=h(0,n,l),v=p.baseX,g=p.baseY,y=p.textAlign,m=p.textVerticalAlign;i(e,n,l,v,g);var x=w.adjustTextX(v,c,y),_=w.adjustTextY(g,f,m),b=x,S=_;d&&(b+=d[3],S+=d[0]);var T=b+u;o(n)&&s(t,e,n,x,_,c,f);for(var M=0;M=0&&"right"===(P=O[B]).textAlign;)a(t,e,P,n,A,S,L,"right"),I-=P.width,L-=P.width,B--;for(R+=(u-(R-b)-(T-L)-I)/2;D<=B;)P=O[D],a(t,e,P,n,A,S,R+P.width/2,"center"),R+=P.width,D++;S+=A}}(t,e,c,n,l)}(t,e,r,n,l,u):function(t,e,r,n,a,l){"use strict";var u,d=o(n),v=!1,g=e.__attrCachedBy===k.PLAIN_TEXT;l!==O?(l&&(u=l.style,v=!d&&g&&u),e.__attrCachedBy=d?k.NONE:k.PLAIN_TEXT):g&&(e.__attrCachedBy=k.NONE);var y=n.font||C;v&&y===(u.font||C)||(e.font=y);var m=t.__computedFont;t.__styleFont!==y&&(t.__styleFont=y,m=t.__computedFont=e.font);var x=n.textPadding,_=n.textLineHeight,b=t.__textCotentBlock;b&&!t.__dirtyText||(b=t.__textCotentBlock=w.parsePlainText(r,m,x,_,n.truncate));var S=b.outerHeight,T=b.lines,P=b.lineHeight,A=h(0,n,a),I=A.baseX,R=A.baseY,L=A.textAlign||"left",B=A.textVerticalAlign;i(e,n,a,I,R);var E=w.adjustTextY(R,S,B),F=I,z=E;if(d||x){var N=w.getWidth(r,m),W=N;x&&(W+=x[1]+x[3]);var q=w.adjustTextX(I,W,L);d&&s(t,e,n,q,E,W,S),x&&(F=p(I,L,x),z+=x[0])}e.textAlign=L,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(var j=0;jk&&(P=0,M={}),P++,M[r]=i,i}function i(t,e,r,i,a,l,h){var u=p(t,e,a,l,h),c=n(t,e);a&&(c+=a[1]+a[3]);var f=u.outerHeight,d=o(0,c,r),v=s(0,f,i),g=new y(d,v,c,f);return g.lineHeight=u.lineHeight,g}function a(t,e,r,n,i,a,l,h){var u=v(t,{rich:l,truncate:h,font:e,textAlign:r,textPadding:i,textLineHeight:a}),c=u.outerWidth,f=u.outerHeight,d=o(0,c,r),p=s(0,f,n);return new y(d,p,c,f)}function o(t,e,r){return"right"===r?t-=e:"center"===r&&(t-=e/2),t}function s(t,e,r){return"middle"===r?t-=e/2:"bottom"===r&&(t-=e),t}function l(t,e,r,n,i){if(!e)return"";var a=(t+"").split("\n");i=h(e,r,n,i);for(var o=0,s=a.length;o=o;l++)s-=o;var h=n(r,e);return h>s&&(r="",h=0),s=t-h,i.ellipsis=r,i.ellipsisWidth=h,i.contentWidth=s,i.containerWidth=t,i}function u(t,e){var r=e.containerWidth,i=e.font,a=e.contentWidth;if(!r)return"";var o=n(t,i);if(o<=r)return t;for(var s=0;;s++){if(o<=a||s>=e.maxIterations){t+=e.ellipsis;break}var l=0===s?c(t,a,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*a/o):0;o=n(t=t.substr(0,l),i)}return""===t&&(t=e.placeholder),t}function c(t,e,r,n){for(var i=0,a=0,o=t.length;ac)t="",o=[];else if(null!=d)for(var p=h(d-(r?r[1]+r[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),v=0,g=o.length;va&&g(r,t.substring(a,o)),g(r,i[2],i[1]),a=O.lastIndex}ay)return{lines:[],width:0,height:0};F.textWidth=n(F.text,C);var I=P.textWidth,D=null==I||"auto"===I;if("string"==typeof I&&"%"===I.charAt(I.length-1))F.percentWidth=I,c.push(F),I=0;else{if(D){I=F.textWidth;var R=P.textBackgroundColor,L=R&&R.image;L&&(L=m.findExistImage(L),m.isImageReady(L)&&(I=Math.max(I,L.width*A/L.height)))}var B=k?k[1]+k[3]:0;I+=B;var E=null!=v?v-T:null;null!=E&&Eh&&(r*=h/(o=r+n),n*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),n+i>u&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),t.moveTo(s+r,l),t.lineTo(s+h-n,l),0!==n&&t.arc(s+h-n,l+n,n,-Math.PI/2,0),t.lineTo(s+h,l+u-i),0!==i&&t.arc(s+h-i,l+u-i,i,0,Math.PI/2),t.lineTo(s+a,l+u),0!==a&&t.arc(s+a,l+u-a,a,Math.PI/2,Math.PI),t.lineTo(s,l+r),0!==r&&t.arc(s+r,l+r,r,Math.PI,1.5*Math.PI)}},function(t,e){var r=2*Math.PI;e.normalizeRadian=function(t){return(t%=r)<0&&(t+=r),t}},function(t,e,r){var n=r(68),i=r(69);e.buildPath=function(t,e,r){var a=e.points,o=e.smooth;if(a&&a.length>=2){if(o&&"spline"!==o){var s=i(a,o,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var l=a.length,h=0;h<(r?l:l-1);h++){var u=s[2*h],c=s[2*h+1],f=a[(h+1)%l];t.bezierCurveTo(u[0],u[1],c[0],c[1],f[0],f[1])}}else{"spline"===o&&(a=n(a,r)),t.moveTo(a[0][0],a[0][1]),h=1;for(var d=a.length;hs?(s*=2*t/o,o=2*t):(o*=2*t/s,s=2*t);var l=e?0:M-o/2,h=e?0:P-s/2;return r=n.graphic.makePath(O.slice(7),{},new n.graphic.BoundingRect(l,h,o,s)),e&&(r.position=[-o/2,-s/2]),r}if(k){var u=e?-t[0]:M-t[0],c=e?-t[1]:P-t[1];return a.createSymbol("rect",u,c,2*t[0],2*t[1])}u=e?-t:M-t,c=e?-t:P-t;return"pin"===O?c+=t:"arrow"===O&&(c-=t),a.createSymbol(O,u,c,2*t,2*t)}return new n.graphic.Circle({shape:{cx:e?0:M,cy:e?0:P,r:t}})}function l(){var e=i(w);return e.style.fill=null,e.setStyle(t.getModel("outline.itemStyle").getItemStyle()),e}function h(e,r,a){var l=k?v[0]:v,h=k?y/2:v,u=f.getItemModel(e),c=u.getModel("itemStyle"),d=u.get("phase"),p=o(u.get("amplitude"),2*h),g=o(u.get("waveLength"),2*l),m=h-f.get("value",e)*h*2;d=a?a.shape.phase:"auto"===d?e*Math.PI/4:d;var x=c.getItemStyle();if(!x.fill){var _=t.get("color"),b=e%_.length;x.fill=_[b]}var w=new s({shape:{waveLength:g,radius:l,radiusY:h,cx:2*l,cy:0,waterLevel:m,amplitude:p,phase:d,inverse:r},style:x,position:[M,P]});w.shape._waterLevel=m;var S=u.getModel("emphasis.itemStyle").getItemStyle();S.lineWidth=0,n.graphic.setHoverStyle(w,S);var T=i(v,!0);return T.setStyle({fill:"white"}),w.setClipPath(T),w}function u(t,e,r){var n=f.getItemModel(t),i=n.get("period"),a=n.get("direction"),o=f.get("value",t),s=n.get("phase");s=r?r.shape.phase:"auto"===s?t*Math.PI/4:s;var l;l="auto"===i?function(e){var r=f.count();return 0===r?e:e*(.2+(r-t)/r*.8)}(5e3):"function"==typeof i?i(o,t):i;var h=0;"right"===a||null==a?h=Math.PI:"left"===a?h=-Math.PI:"none"===a?h=0:console.error("Illegal direction value for liquid fill."),"none"!==a&&n.get("waveAnimation")&&e.animate("shape",!0).when(0,{phase:s}).when(l/2,{phase:h+s}).when(l,{phase:2*h+s}).during(function(){I&&I.dirty(!0)}).start()}var c=this.group;c.removeAll();var f=t.getData(),d=f.getItemModel(0),p=d.get("center"),v=d.get("radius"),g=r.getWidth(),y=r.getHeight(),m=Math.min(g,y),x=0,_=0,b=t.get("outline.show");b&&(x=t.get("outline.borderDistance"),_=o(t.get("outline.itemStyle.borderWidth"),m));var w,S,T,M=o(p[0],g),P=o(p[1],y),k=!1,O=t.get("shape");("container"===O?(k=!0,S=[(w=[g/2,y/2])[0]-_/2,w[1]-_/2],T=[o(x,g),o(x,y)],v=[Math.max(S[0]-T[0],0),Math.max(S[1]-T[1],0)]):(S=(w=o(v,m)/2)-_/2,T=o(x,m),v=Math.max(S-T,0)),b)&&(l().style.lineWidth=_,c.add(l()));var C=k?0:M-v,A=k?0:P-v,I=null;c.add(function(){var e=i(v);e.setStyle(t.getModel("backgroundStyle").getItemStyle()),e.style.fill=null,e.z2=5;var r=i(v);r.setStyle(t.getModel("backgroundStyle").getItemStyle()),r.style.stroke=null;var a=new n.graphic.Group;return a.add(e),a.add(r),a}());var D=this._data,R=[];f.diff(D).add(function(e){var r=h(e,!1),i=r.shape.waterLevel;r.shape.waterLevel=k?y/2:v,n.graphic.initProps(r,{shape:{waterLevel:i}},t),r.z2=2,u(e,r,null),c.add(r),f.setItemGraphicEl(e,r),R.push(r)}).update(function(e,r){for(var i=D.getItemGraphicEl(r),a=h(e,!1,i),o={},s=["amplitude","cx","cy","phase","radius","radiusY","waterLevel","waveLength"],l=0;l=0)?(r={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=a,null==t.textStrokeWidth&&(t.textStrokeWidth=2))):null!=a&&(r={textFill:null},t.textFill=a),r&&(t.insideRollback=r)}}function S(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function T(t,e,r,n,i,a){if("function"==typeof i&&(a=i,i=null),n&&n.isAnimationEnabled()){var o=t?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),h=n.getShallow("animationDelay"+o);"function"==typeof h&&(h=h(i,n.getAnimationDelayParams?n.getAnimationDelayParams(e,i):null)),"function"==typeof s&&(s=s(i)),s>0?e.animateTo(r,s,h||0,l,a,!!a):(e.stopAnimation(),e.attr(r),a&&a())}else e.stopAnimation(),e.attr(r),a&&a()}function M(t,e,r,n,i){T(!0,t,e,r,n,i)}function P(t,e,r){return e&&!k.isArrayLike(e)&&(e=R.getLocalTransform(e)),r&&(e=A.invert([],e)),I.applyTransform([],t,e)}var k=r(0),O=r(41),C=r(19),A=r(10),I=r(2),D=r(1),R=r(18),L=r(60);e.Image=L;var B=r(61);e.Group=B;var E=r(62);e.Text=E;var F=r(63);e.Circle=F;var z=r(64);e.Sector=z;var N=r(66);e.Ring=N;var W=r(67);e.Polygon=W;var q=r(70);e.Polyline=q;var j=r(71);e.Rect=j;var H=r(72);e.Line=H;var Y=r(73);e.BezierCurve=Y;var U=r(74);e.Arc=U;var V=r(75);e.CompoundPath=V;var G=r(76);e.LinearGradient=G;var X=r(77);e.RadialGradient=X;var Z=r(3);e.BoundingRect=Z;var Q=r(78);e.IncrementalDisplayable=Q;var $=Math.round,K=Math.max,J=Math.min,tt={},et=1,rt=O.mergePath,nt=k.createHashMap(),it=0;e.Z2_EMPHASIS_LIFT=et,e.extendShape=function(t){return D.extend(t)},e.extendPath=function(t,e){return O.extendFromString(t,e)},e.makePath=n,e.makeImage=function(t,e,r){var n=new L({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===r){var a={width:t.width,height:t.height};n.setStyle(i(e,a))}}});return n},e.mergePath=rt,e.resizePath=a,e.subPixelOptimizeLine=function(t){var e=t.shape,r=t.style.lineWidth;return $(2*e.x1)===$(2*e.x2)&&(e.x1=e.x2=o(e.x1,r,!0)),$(2*e.y1)===$(2*e.y2)&&(e.y1=e.y2=o(e.y1,r,!0)),t},e.subPixelOptimizeRect=function(t){var e=t.shape,r=t.style.lineWidth,n=e.x,i=e.y,a=e.width,s=e.height;return e.x=o(e.x,r,!0),e.y=o(e.y,r,!0),e.width=Math.max(o(n+a,r,!1)-e.x,0===a?0:1),e.height=Math.max(o(i+s,r,!1)-e.y,0===s?0:1),t},e.subPixelOptimize=o,e.setElementHoverStyle=f,e.isInEmphasis=function(t){return t&&t.__isEmphasisEntered},e.setHoverStyle=function(t,e,r){t.isGroup?t.traverse(function(t){!t.isGroup&&f(t,t.hoverStyle||e)}):f(t,t.hoverStyle||e),y(t,r)},e.setAsHoverStyleTrigger=y,e.setLabelStyle=function(t,e,r,n,i,a,o){var s,l=(i=i||tt).labelFetcher,h=i.labelDataIndex,u=i.labelDimIndex,c=r.getShallow("show"),f=n.getShallow("show");(c||f)&&(l&&(s=l.getFormattedLabel(h,"normal",null,u)),null==s&&(s=k.isFunction(i.defaultText)?i.defaultText(h,i):i.defaultText));var d=c?s:null,p=f?k.retrieve2(l?l.getFormattedLabel(h,"emphasis",null,u):null,s):null;null==d&&null==p||(m(t,r,a,i),m(e,n,o,i,!0)),t.text=d,e.text=p},e.setTextStyle=m,e.setText=function(t,e,r){var n,i={isRectText:!0};!1===r?n=!0:i.autoColor=r,x(t,e,i,n)},e.getFont=function(t,e){var r=e||e.getModel("textStyle");return k.trim([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))},e.updateProps=M,e.initProps=function(t,e,r,n,i){T(!1,t,e,r,n,i)},e.getTransform=function(t,e){for(var r=A.identity([]);t&&t!==e;)A.mul(r,t.getLocalTransform(),r),t=t.parent;return r},e.applyTransform=P,e.transformDirection=function(t,e,r){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),i=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-i:"bottom"===t?i:0];return a=P(a,e,r),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},e.groupTransition=function(t,e,r,n){function i(t){var e={position:I.clone(t.position),rotation:t.rotation};return t.shape&&(e.shape=k.extend({},t.shape)),e}if(t&&e){var a=function(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=a[t.anid];if(e){var n=i(t);t.attr(i(e)),M(t,n,r,t.dataIndex)}}})}},e.clipPointsByRect=function(t,e){return k.map(t,function(t){var r=t[0];r=K(r,e.x),r=J(r,e.x+e.width);var n=t[1];return n=K(n,e.y),[r,n=J(n,e.y+e.height)]})},e.clipRectByRect=function(t,e){var r=K(t.x,e.x),n=J(t.x+t.width,e.x+e.width),i=K(t.y,e.y),a=J(t.y+t.height,e.y+e.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}},e.createIcon=function(t,e,r){var i=(e=k.extend({rectHover:!0},e)).style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(i.image=t.slice(8),k.defaults(i,r),new L(e)):n(t.replace("path://",""),e,r,"center")}},function(t,e,r){function n(t,e,r,n,i,a,o,s,f,v,g){var y=f*(c/180),m=u(y)*(t-r)/2+h(y)*(e-n)/2,x=-1*h(y)*(t-r)/2+u(y)*(e-n)/2,_=m*m/(o*o)+x*x/(s*s);_>1&&(o*=l(_),s*=l(_));var b=(i===a?-1:1)*l((o*o*(s*s)-o*o*(x*x)-s*s*(m*m))/(o*o*(x*x)+s*s*(m*m)))||0,w=b*o*x/s,S=b*-s*m/o,T=(t+r)/2+u(y)*w-h(y)*S,M=(e+n)/2+h(y)*w+u(y)*S,P=p([1,0],[(m-w)/o,(x-S)/s]),k=[(m-w)/o,(x-S)/s],O=[(-1*m-w)/o,(-1*x-S)/s],C=p(k,O);d(k,O)<=-1&&(C=c),d(k,O)>=1&&(C=0),0===a&&C>0&&(C-=2*c),1===a&&C<0&&(C+=2*c),g.addData(v,T,M,o,s,P,C,y,a)}function i(t,e){var r=function(t){if(!t)return new o;for(var e,r=0,i=0,a=r,s=i,l=new o,h=o.CMD,u=t.match(v),c=0;c0},extendFrom:function(t,e){if(t)for(var r in t)!t.hasOwnProperty(r)||!0!==e&&(!1===e?this.hasOwnProperty(r):null==t[r])||(this[r]=t[r])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,r){for(var a=("radial"===e.type?i:n)(t,e,r),o=e.colorStops,s=0;s3&&(i=n.call(i,1));for(var o=e.length,s=0;s4&&(i=n.call(i,1,i.length-1));for(var o=i[i.length-1],s=e.length,l=0;l0&&t.animate(e,!1).when(null==o?500:o,h).delay(s||0)}function a(t,e,r,n){if(e){var i={};i[e]={},i[e][r]=n,t.attr(i)}else t.attr(r,n)}var o=r(46),s=r(49),l=r(0),h=l.isString,u=l.isFunction,c=l.isObject,f=l.isArrayLike,d=l.indexOf,p=function(){this.animators=[]};p.prototype={constructor:p,animate:function(t,e){var r,n=!1,i=this,a=this.__zr;if(t){var l=t.split("."),h=i;n="shape"===l[0];for(var u=0,c=l.length;u.5?e:t}function s(t,e,r,n,i){var o=t.length;if(1===i)for(var s=0;si)t.length=i;else for(var a=n;a=0&&!(k[r]<=e);r--);r=Math.min(r,_-2)}else{for(r=W;r<_&&!(k[r]>e);r++);r=Math.min(r-1,_-2)}W=r,q=e;var n=k[r+1]-k[r];if(0!==n)if(B=(e-k[r])/n,x)if(F=O[r],E=O[0===r?r:r-1],z=O[r>_-2?_-1:r+1],N=O[r>_-3?_-1:r+2],S)u(E,F,z,N,B,B*B,B*B*B,p(t,i),P);else{if(T)l=u(E,F,z,N,B,B*B,B*B*B,j,1),l=d(j);else{if(M)return o(F,z,B);l=c(E,F,z,N,B,B*B,B*B*B)}m(t,i,l)}else if(S)s(O[r],O[r+1],B,p(t,i),P);else{var l;if(T)s(O[r],O[r+1],B,j,1),l=d(j);else{if(M)return o(O[r],O[r+1],B);l=a(O[r],O[r+1],B)}m(t,i,l)}},ondestroy:r});return e&&"spline"!==e&&(H.easing=e),H}}}var v=r(47),g=r(19),y=r(0).isArrayLike,m=Array.prototype.slice,x=function(t,e,r,a){this._tracks={},this._target=t,this._loop=e||!1,this._getter=r||n,this._setter=a||i,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};x.prototype={when:function(t,e){var r=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!r[n]){r[n]=[];var i=this._getter(this._target,n);if(null==i)continue;0!==t&&r[n].push({time:0,value:f(i)})}r[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t1&&(i=function(){for(var t in arguments)console.log(arguments[t])});var a=i;t.exports=a},function(t,e,r){var n=r(22),i=r(3),a=r(8).WILL_BE_RESTORED,o=new i,s=function(){};s.prototype={constructor:s,drawRectText:function(t,e){var r=this.style;e=r.textRect||e,this.__dirty&&n.normalizeTextStyle(r,!0);var i=r.text;if(null!=i&&(i+=""),n.needDrawText(i,r)){t.save();var s=this.transform;r.transformText?this.setTransform(t):s&&(o.copy(e),o.applyTransform(s),e=o),n.renderText(this,t,i,r,e,a),t.restore()}}};var l=s;t.exports=l},function(t,e,r){var n=r(2),i=r(4),a=Math.min,o=Math.max,s=Math.sin,l=Math.cos,h=2*Math.PI,u=n.create(),c=n.create(),f=n.create(),d=[],p=[];e.fromPoints=function(t,e,r){if(0!==t.length){var n,i=t[0],s=i[0],l=i[0],h=i[1],u=i[1];for(n=1;n1e-4)return p[0]=t-r,p[1]=e-i,v[0]=t+r,void(v[1]=e+i);if(u[0]=l(a)*r+t,u[1]=s(a)*i+e,c[0]=l(o)*r+t,c[1]=s(o)*i+e,g(p,u,c),y(v,u,c),(a%=h)<0&&(a+=h),(o%=h)<0&&(o+=h),a>o&&!d?o+=h:aa&&(f[0]=l(_)*r+t,f[1]=s(_)*i+e,g(p,f,p),y(v,f,v))}},function(t,e,r){function n(t,e){return Math.abs(t-e)e&&u>n&&u>o&&u>l||u1&&i(),f=v.cubicAt(e,n,o,l,b[0]),g>1&&(d=v.cubicAt(e,n,o,l,b[1]))),p+=2===g?me&&s>n&&s>a||s=0&&h<=1){for(var u=0,c=v.quadraticAt(e,n,a,h),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);_[0]=-l,_[1]=l;var h=Math.abs(n-i);if(h<1e-4)return 0;if(h%m<1e-4){n=0,i=m;var u=a?1:-1;return o>=_[0]+t&&o<=_[1]+t?u:0}if(a){l=n;n=p(i),i=p(l)}else n=p(n),i=p(i);n>i&&(i+=m);for(var c=0,f=0;f<2;f++){var d=_[f];if(d+t>o){var v=Math.atan2(s,d);u=a?1:-1;v<0&&(v=m+v),(v>=n&&v<=i||v+m>=n&&v+m<=i)&&(v>Math.PI/2&&v<1.5*Math.PI&&(u=-u),c+=u)}}return c}function l(t,e,r,i,l){for(var h=0,p=0,v=0,m=0,x=0,_=0;_1&&(r||(h+=g(p,v,m,x,i,l))),1===_&&(m=p=t[_],x=v=t[_+1]),b){case y.M:p=m=t[_++],v=x=t[_++];break;case y.L:if(r){if(u.containStroke(p,v,t[_],t[_+1],e,i,l))return!0}else h+=g(p,v,t[_],t[_+1],i,l)||0;p=t[_++],v=t[_++];break;case y.C:if(r){if(c.containStroke(p,v,t[_++],t[_++],t[_++],t[_++],t[_],t[_+1],e,i,l))return!0}else h+=a(p,v,t[_++],t[_++],t[_++],t[_++],t[_],t[_+1],i,l)||0;p=t[_++],v=t[_++];break;case y.Q:if(r){if(f.containStroke(p,v,t[_++],t[_++],t[_],t[_+1],e,i,l))return!0}else h+=o(p,v,t[_++],t[_++],t[_],t[_+1],i,l)||0;p=t[_++],v=t[_++];break;case y.A:var w=t[_++],S=t[_++],T=t[_++],M=t[_++],P=t[_++],k=t[_++];_+=1;var O=1-t[_++],C=Math.cos(P)*T+w,A=Math.sin(P)*M+S;_>1?h+=g(p,v,C,A,i,l):(m=C,x=A);var I=(i-w)*M/T+w;if(r){if(d.containStroke(w,S,M,P,P+k,O,e,I,l))return!0}else h+=s(w,S,M,P,P+k,O,I,l);p=Math.cos(P+k)*T+w,v=Math.sin(P+k)*M+S;break;case y.R:m=p=t[_++],x=v=t[_++];C=m+t[_++],A=x+t[_++];if(r){if(u.containStroke(m,x,C,x,e,i,l)||u.containStroke(C,x,C,A,e,i,l)||u.containStroke(C,A,m,A,e,i,l)||u.containStroke(m,A,m,x,e,i,l))return!0}else h+=g(C,x,C,A,i,l),h+=g(m,A,m,x,i,l);break;case y.Z:if(r){if(u.containStroke(p,v,m,x,e,i,l))return!0}else h+=g(p,v,m,x,i,l);p=m,v=x}}return r||n(v,x)||(h+=g(p,v,m,x,i,l)||0),0!==h}var h=r(9),u=r(53),c=r(54),f=r(55),d=r(56),p=r(25).normalizeRadian,v=r(4),g=r(57),y=h.CMD,m=2*Math.PI,x=1e-4,_=[-1,-1,-1],b=[-1,-1];e.contain=function(t,e,r){return l(t,0,!1,e,r)},e.containStroke=function(t,e,r,n){return l(t,e,!0,r,n)}},function(t,e){e.containStroke=function(t,e,r,n,i,a,o){if(0===i)return!1;var s,l=i;if(o>e+l&&o>n+l||ot+l&&a>r+l||ae+f&&c>i+f&&c>o+f&&c>l+f||ct+f&&u>r+f&&u>a+f&&u>s+f||ue+u&&h>i+u&&h>o+u||ht+u&&l>r+u&&l>a+u||lr||f+co&&(o+=i);var p=Math.atan2(u,h);return p<0&&(p+=i),p>=a&&p<=o||p+i>=a&&p+i<=o}},function(t,e){t.exports=function(t,e,r,n,i,a){if(a>e&&a>n||ai?o:0}},function(t,e){var r=function(t,e){this.image=t,this.repeat=e,this.type="pattern"};r.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")};var n=r;t.exports=n},function(t,e,r){var n=r(9),i=r(2).applyTransform,a=n.CMD,o=[[],[],[]],s=Math.sqrt,l=Math.atan2;t.exports=function(t,e){var r,n,h,u,c,f=t.data,d=a.M,p=a.C,v=a.L,g=a.R,y=a.A,m=a.Q;for(h=0,u=0;h=0&&(r.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,r=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof o&&t.addChildrenToStorage(e)),r&&r.refresh()},remove:function(t){var e=this.__zr,r=this.__storage,i=this._children,a=n.indexOf(i,t);return a<0?this:(i.splice(a,1),t.parent=null,r&&(r.delFromStorage(t),t instanceof o&&t.delChildrenFromStorage(r)),e&&e.refresh(),this)},removeAll:function(){var t,e,r=this._children,n=this.__storage;for(e=0;e=11?function(){var e,r=this.__clipPaths,n=this.style;if(r)for(var a=0;ar-2?r-1:d+1],c=t[d>r-3?r-1:d+2]);var g=p*p,y=p*g;a.push([n(h[0],v[0],u[0],c[0],p,g,y),n(h[1],v[1],u[1],c[1],p,g,y)])}return a}},function(t,e,r){var n=r(2),i=n.min,a=n.max,o=n.scale,s=n.distance,l=n.add,h=n.clone,u=n.sub;t.exports=function(t,e,r,n){var c,f,d,p,v=[],g=[],y=[],m=[];if(n){d=[1/0,1/0],p=[-1/0,-1/0];for(var x=0,_=t.length;x<_;x++)i(d,d,t[x]),a(p,p,t[x]);i(d,d,n[0]),a(p,p,n[1])}for(x=0,_=t.length;x<_;x++){var b=t[x];if(r)c=t[x?x-1:_-1],f=t[(x+1)%_];else{if(0===x||x===_-1){v.push(h(t[x]));continue}c=t[x-1],f=t[x+1]}u(g,f,c),o(g,g,e);var w=s(b,c),S=s(b,f),T=w+S;0!==T&&(w/=T,S/=T),o(y,g,-w),o(m,g,S);var M=l([],b,y),P=l([],b,m);n&&(a(M,M,d),i(M,M,p),a(P,P,d),i(P,P,p)),v.push(M),v.push(P)}return r&&v.push(v.shift()),v}},function(t,e,r){var n=r(1),i=r(26),a=n.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){i.buildPath(t,e,!1)}});t.exports=a},function(t,e,r){var n=r(1),i=r(24),a=r(27).subPixelOptimizeRect,o={},s=n.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var r,n,s,l;this.subPixelOptimize?(a(o,e,this.style),r=o.x,n=o.y,s=o.width,l=o.height,o.r=e.r,e=o):(r=e.x,n=e.y,s=e.width,l=e.height),e.r?i.buildPath(t,e):t.rect(r,n,s,l),t.closePath()}});t.exports=s},function(t,e,r){var n=r(1),i=r(27).subPixelOptimizeLine,a={},o=n.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r,n,o,s;this.subPixelOptimize?(i(a,e,this.style),r=a.x1,n=a.y1,o=a.x2,s=a.y2):(r=e.x1,n=e.y1,o=e.x2,s=e.y2);var l=e.percent;0!==l&&(t.moveTo(r,n),l<1&&(o=r*(1-l)+o*l,s=n*(1-l)+s*l),t.lineTo(o,s))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}});t.exports=o},function(t,e,r){function n(t,e,r){var n=t.cpx2,i=t.cpy2;return null===n||null===i?[(r?f:u)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?f:u)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?c:h)(t.x1,t.cpx1,t.x2,e),(r?c:h)(t.y1,t.cpy1,t.y2,e)]}var i=r(1),a=r(2),o=r(4),s=o.quadraticSubdivide,l=o.cubicSubdivide,h=o.quadraticAt,u=o.cubicAt,c=o.quadraticDerivativeAt,f=o.cubicDerivativeAt,d=[],p=i.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2,o=e.cpx1,h=e.cpy1,u=e.cpx2,c=e.cpy2,f=e.percent;0!==f&&(t.moveTo(r,n),null==u||null==c?(f<1&&(s(r,o,i,f,d),o=d[1],i=d[2],s(n,h,a,f,d),h=d[1],a=d[2]),t.quadraticCurveTo(o,h,i,a)):(f<1&&(l(r,o,u,i,f,d),o=d[1],u=d[2],i=d[3],l(n,h,c,a,f,d),h=d[1],c=d[2],a=d[3]),t.bezierCurveTo(o,h,u,c,i,a)))},pointAt:function(t){return n(this.shape,t,!1)},tangentAt:function(t){var e=n(this.shape,t,!0);return a.normalize(e,e)}});t.exports=p},function(t,e,r){var n=r(1).extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r=e.cx,n=e.cy,i=Math.max(e.r,0),a=e.startAngle,o=e.endAngle,s=e.clockwise,l=Math.cos(a),h=Math.sin(a);t.moveTo(l*i+r,h*i+n),t.arc(r,n,i,a,o,!s)}});t.exports=n},function(t,e,r){var n=r(1),i=n.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,r=0;r0;)e.phase-=2*Math.PI;var i=e.phase/Math.PI/2*e.waveLength,a=e.cx-e.radius+i-2*e.radius;t.moveTo(a,e.waterLevel);for(var o=0,s=0;s1e-10&&(i.width+=o/s,i.height+=o/s,i.x-=o/s/2,i.y-=o/s/2)}return i}return t},contain:function(t,e){var r=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),i=this.style;if(t=r[0],e=r[1],n.contain(t,e)){var a=this.path.data;if(i.hasStroke()){var s=i.lineWidth,l=i.strokeNoScale?this.getLineScale():1;if(l>1e-10&&(i.hasFill()||(s=Math.max(s,this.strokeContainThreshold)),o.containStroke(a,s/l,t,e)))return!0}if(i.hasFill())return o.contain(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):n.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var r=this.shape;if(r){if(i.isObject(t))for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);else r[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&l(t[0]-1)>1e-10&&l(t[3]-1)>1e-10?Math.sqrt(l(t[0]*t[3]-t[2]*t[1])):1}},u.extend=function(t){var e=function(e){u.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var r=t.shape;if(r){this.shape=this.shape||{};var n=this.shape;for(var i in r)!n.hasOwnProperty(i)&&r.hasOwnProperty(i)&&(n[i]=r[i])}t.init&&t.init.call(this,e)};for(var r in i.inherits(e,u),t)"style"!==r&&"shape"!==r&&(e.prototype[r]=t[r]);return e},i.inherits(u,n);var c=u;t.exports=c},function(t,e){var r="undefined"==typeof Float32Array?Array:Float32Array;function n(t){return Math.sqrt(a(t))}var i=n;function a(t){return t[0]*t[0]+t[1]*t[1]}var o=a;function s(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var l=s;function h(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var u=h;e.create=function(t,e){var n=new r(2);return null==t&&(t=0),null==e&&(e=0),n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.clone=function(t){var e=new r(2);return e[0]=t[0],e[1]=t[1],e},e.set=function(t,e,r){return t[0]=e,t[1]=r,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},e.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},e.len=n,e.length=i,e.lenSquare=a,e.lengthSquare=o,e.mul=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},e.div=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},e.normalize=function(t,e){var r=n(e);return 0===r?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t},e.distance=s,e.dist=l,e.distanceSquare=h,e.distSquare=u,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.lerp=function(t,e,r,n){return t[0]=e[0]+n*(r[0]-e[0]),t[1]=e[1]+n*(r[1]-e[1]),t},e.applyTransform=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}},function(t,e,r){var n,i,a,o,s=r(2),l=r(10),h=s.applyTransform,u=Math.min,c=Math.max;function f(t,e,r,n){r<0&&(t+=r,r=-r),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=r,this.height=n}f.prototype={constructor:f,union:function(t){var e=u(t.x,this.x),r=u(t.y,this.y);this.width=c(t.x+t.width,this.x+this.width)-e,this.height=c(t.y+t.height,this.y+this.height)-r,this.x=e,this.y=r},applyTransform:(n=[],i=[],a=[],o=[],function(t){if(t){n[0]=a[0]=this.x,n[1]=o[1]=this.y,i[0]=o[0]=this.x+this.width,i[1]=a[1]=this.y+this.height,h(n,n,t),h(i,i,t),h(a,a,t),h(o,o,t),this.x=u(n[0],i[0],a[0],o[0]),this.y=u(n[1],i[1],a[1],o[1]);var e=c(n[0],i[0],a[0],o[0]),r=c(n[1],i[1],a[1],o[1]);this.width=e-this.x,this.height=r-this.y}}),calculateTransform:function(t){var e=this,r=t.width/e.width,n=t.height/e.height,i=l.create();return l.translate(i,i,[-e.x,-e.y]),l.scale(i,i,[r,n]),l.translate(i,i,[t.x,t.y]),i},intersect:function(t){if(!t)return!1;t instanceof f||(t=f.create(t));var e=this,r=e.x,n=e.x+e.width,i=e.y,a=e.y+e.height,o=t.x,s=t.x+t.width,l=t.y,h=t.y+t.height;return!(n=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height},clone:function(){return new f(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},f.create=function(t){return new f(t.x,t.y,t.width,t.height)};var d=f;t.exports=d},function(t,e,r){var n=r(2),i=n.create,a=n.distSquare,o=Math.pow,s=Math.sqrt,l=s(3),h=i(),u=i(),c=i();function f(t){return t>-1e-8&&t<1e-8}function d(t){return t>1e-8||t<-1e-8}function p(t,e,r,n,i){var a=1-i;return a*a*(a*t+3*i*e)+i*i*(i*n+3*a*r)}function v(t,e,r,n){var i=1-n;return i*(i*t+2*n*e)+n*n*r}e.cubicAt=p,e.cubicDerivativeAt=function(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)},e.cubicRootAt=function(t,e,r,n,i,a){var h=n+3*(e-r)-t,u=3*(r-2*e+t),c=3*(e-t),d=t-i,p=u*u-3*h*c,v=u*c-9*h*d,g=c*c-3*u*d,y=0;if(f(p)&&f(v)){if(f(u))a[0]=0;else(k=-c/u)>=0&&k<=1&&(a[y++]=k)}else{var m=v*v-4*p*g;if(f(m)){var x=v/p,_=-x/2;(k=-u/h+x)>=0&&k<=1&&(a[y++]=k),_>=0&&_<=1&&(a[y++]=_)}else if(m>0){var b=s(m),w=p*u+1.5*h*(-v+b),S=p*u+1.5*h*(-v-b);(k=(-u-((w=w<0?-o(-w,1/3):o(w,1/3))+(S=S<0?-o(-S,1/3):o(S,1/3))))/(3*h))>=0&&k<=1&&(a[y++]=k)}else{var T=(2*p*u-3*h*v)/(2*s(p*p*p)),P=Math.acos(T)/3,M=s(p),O=Math.cos(P),k=(-u-2*M*O)/(3*h),C=(_=(-u+M*(O+l*Math.sin(P)))/(3*h),(-u+M*(O-l*Math.sin(P)))/(3*h));k>=0&&k<=1&&(a[y++]=k),_>=0&&_<=1&&(a[y++]=_),C>=0&&C<=1&&(a[y++]=C)}}return y},e.cubicExtrema=function(t,e,r,n,i){var a=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,l=3*e-3*t,h=0;if(f(o)){if(d(a))(c=-l/a)>=0&&c<=1&&(i[h++]=c)}else{var u=a*a-4*o*l;if(f(u))i[0]=-a/(2*o);else if(u>0){var c,p=s(u),v=(-a-p)/(2*o);(c=(-a+p)/(2*o))>=0&&c<=1&&(i[h++]=c),v>=0&&v<=1&&(i[h++]=v)}}return h},e.cubicSubdivide=function(t,e,r,n,i,a){var o=(e-t)*i+t,s=(r-e)*i+e,l=(n-r)*i+r,h=(s-o)*i+o,u=(l-s)*i+s,c=(u-h)*i+h;a[0]=t,a[1]=o,a[2]=h,a[3]=c,a[4]=c,a[5]=u,a[6]=l,a[7]=n},e.cubicProjectPoint=function(t,e,r,n,i,o,l,f,d,v,g){var y,m,x,_,b,w=.005,S=1/0;h[0]=d,h[1]=v;for(var T=0;T<1;T+=.05)u[0]=p(t,r,i,l,T),u[1]=p(e,n,o,f,T),(_=a(h,u))=0&&_=0&&c<=1&&(i[h++]=c)}else{var u=o*o-4*a*l;if(f(u))(c=-o/(2*a))>=0&&c<=1&&(i[h++]=c);else if(u>0){var c,p=s(u),v=(-o-p)/(2*a);(c=(-o+p)/(2*a))>=0&&c<=1&&(i[h++]=c),v>=0&&v<=1&&(i[h++]=v)}}return h},e.quadraticExtremum=function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n},e.quadraticSubdivide=function(t,e,r,n,i){var a=(e-t)*n+t,o=(r-e)*n+e,s=(o-a)*n+a;i[0]=t,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r},e.quadraticProjectPoint=function(t,e,r,n,i,o,l,f,d){var p,g=.005,y=1/0;h[0]=l,h[1]=f;for(var m=0;m<1;m+=.05){u[0]=v(t,r,i,m),u[1]=v(e,n,o,m),(w=a(h,u))=0&&wthis._ux||m(e-this._yi)>this._uy||this._len<5;return this.addData(l.L,t,e),this._ctx&&r&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,r,n,i,a){return this.addData(l.C,t,e,r,n,i,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,r,n,i,a):this._ctx.bezierCurveTo(t,e,r,n,i,a)),this._xi=i,this._yi=a,this},quadraticCurveTo:function(t,e,r,n){return this.addData(l.Q,t,e,r,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,r,n):this._ctx.quadraticCurveTo(t,e,r,n)),this._xi=r,this._yi=n,this},arc:function(t,e,r,n,i,a){return this.addData(l.A,t,e,r,r,n,i-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,r,n,i,a),this._xi=v(i)*r+t,this._yi=g(i)*r+e,this},arcTo:function(t,e,r,n,i){return this._ctx&&this._ctx.arcTo(t,e,r,n,i),this},rect:function(t,e,r,n){return this._ctx&&this._ctx.rect(t,e,r,n),this.addData(l.R,t,e,r,n),this},closePath:function(){this.addData(l.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,r=0;re.length&&(this._expandData(),e=this.data);for(var r=0;r0&&v<=t||u<0&&v>=t||0===u&&(c>0&&g<=e||c<0&&g>=e);)v+=u*(r=o[n=this._dashIdx]),g+=c*r,this._dashIdx=(n+1)%m,u>0&&vl||c>0&&gh||s[n%2?"moveTo":"lineTo"](u>=0?d(v,t):p(v,t),c>=0?d(g,e):p(g,e));u=v-t,c=g-e,this._dashOffset=-y(u*u+c*c)},_dashedBezierTo:function(t,e,r,i,a,o){var s,l,h,u,c,f=this._dashSum,d=this._dashOffset,p=this._lineDash,v=this._ctx,g=this._xi,m=this._yi,x=n.cubicAt,_=0,b=this._dashIdx,w=p.length,S=0;for(d<0&&(d=f+d),d%=f,s=0;s<1;s+=.1)l=x(g,t,r,a,s+.1)-x(g,t,r,a,s),h=x(m,e,i,o,s+.1)-x(m,e,i,o,s),_+=y(l*l+h*h);for(;bd);b++);for(s=(S-d)/_;s<=1;)u=x(g,t,r,a,s),c=x(m,e,i,o,s),b%2?v.moveTo(u,c):v.lineTo(u,c),s+=p[b]/_,b=(b+1)%w;b%2!=0&&v.lineTo(a,o),l=a-u,h=o-c,this._dashOffset=-y(l*l+h*h)},_dashedQuadraticTo:function(t,e,r,n){var i=r,a=n;r=(r+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,r,n,i,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,x&&(this.data=new Float32Array(t)))},getBoundingRect:function(){h[0]=h[1]=c[0]=c[1]=Number.MAX_VALUE,u[0]=u[1]=f[0]=f[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,r=0,n=0,s=0,d=0;dh||m(o-i)>u||f===c-1)&&(t.lineTo(a,o),n=a,i=o);break;case l.C:t.bezierCurveTo(s[f++],s[f++],s[f++],s[f++],s[f++],s[f++]),n=s[f-2],i=s[f-1];break;case l.Q:t.quadraticCurveTo(s[f++],s[f++],s[f++],s[f++]),n=s[f-2],i=s[f-1];break;case l.A:var p=s[f++],y=s[f++],x=s[f++],_=s[f++],b=s[f++],w=s[f++],S=s[f++],T=s[f++],P=x>_?x:_,M=x>_?1:x/_,O=x>_?_/x:1,k=b+w;Math.abs(x-_)>.001?(t.translate(p,y),t.rotate(S),t.scale(M,O),t.arc(0,0,P,b,k,1-T),t.scale(1/M,1/O),t.rotate(-S),t.translate(-p,-y)):t.arc(p,y,P,b,k,1-T),1===f&&(e=v(b)*x+p,r=g(b)*_+y),n=v(k)*x+p,i=g(k)*_+y;break;case l.R:e=n=s[f],r=i=s[f+1],t.rect(s[f++],s[f++],s[f++],s[f++]);break;case l.Z:t.closePath(),n=e,i=r}}}},_.CMD=l;var b=_;t.exports=b},function(t,e,r){(function(t){var r;"undefined"!=typeof window?r=window.__DEV__:void 0!==t&&(r=t.__DEV__),void 0===r&&(r=!0);var n=r;e.__DEV__=n}).call(this,r(34))},function(t,e){var r="undefined"==typeof Float32Array?Array:Float32Array;function n(){var t=new r(6);return i(t),t}function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}e.create=n,e.identity=i,e.copy=a,e.mul=function(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t},e.translate=function(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t},e.rotate=function(t,e,r){var n=e[0],i=e[2],a=e[4],o=e[1],s=e[3],l=e[5],h=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*h,t[1]=-n*h+o*u,t[2]=i*u+s*h,t[3]=-i*h+u*s,t[4]=u*a+h*l,t[5]=u*l-h*a,t},e.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t},e.invert=function(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*n;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*i)*l,t[5]=(a*i-r*s)*l,t):null},e.clone=function(t){var e=n();return a(e,t),e}},function(t,e,r){var n=r(3),i=r(12),a=r(0),o=a.getContext,s=a.extend,l=a.retrieve2,h=a.retrieve3,u=a.trim,c={},f=0,d=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,p={};function v(t,e){var r=t+":"+(e=e||"12px sans-serif");if(c[r])return c[r];for(var n=(t+"").split("\n"),i=0,a=0,o=n.length;a5e3&&(f=0,c={}),f++,c[r]=i,i}function g(t,e,r){return"right"===r?t-=e:"center"===r&&(t-=e/2),t}function y(t,e,r){return"middle"===r?t-=e/2:"bottom"===r&&(t-=e),t}function m(t,e,r){var n=e.textPosition,i=e.textDistance,a=r.x,o=r.y;i=i||0;var s=r.height,l=r.width,h=s/2,u="left",c="top";switch(n){case"left":a-=i,o+=h,u="right",c="middle";break;case"right":a+=i+l,o+=h,c="middle";break;case"top":a+=l/2,o-=i,u="center",c="bottom";break;case"bottom":a+=l/2,o+=s+i,u="center";break;case"inside":a+=l/2,o+=h,u="center",c="middle";break;case"insideLeft":a+=i,o+=h,c="middle";break;case"insideRight":a+=l-i,o+=h,u="right",c="middle";break;case"insideTop":a+=l/2,o+=i,u="center";break;case"insideBottom":a+=l/2,o+=s-i,u="center",c="bottom";break;case"insideTopLeft":a+=i,o+=i;break;case"insideTopRight":a+=l-i,o+=i,u="right";break;case"insideBottomLeft":a+=i,o+=s-i,c="bottom";break;case"insideBottomRight":a+=l-i,o+=s-i,u="right",c="bottom"}return(t=t||{}).x=a,t.y=o,t.textAlign=u,t.textVerticalAlign=c,t}function x(t,e,r,n,i){if(!e)return"";var a=(t+"").split("\n");i=_(e,r,n,i);for(var o=0,s=a.length;o=a;h++)o-=a;var u=v(r,e);return u>o&&(r="",u=0),o=t-u,n.ellipsis=r,n.ellipsisWidth=u,n.contentWidth=o,n.containerWidth=t,n}function b(t,e){var r=e.containerWidth,n=e.font,i=e.contentWidth;if(!r)return"";var a=v(t,n);if(a<=r)return t;for(var o=0;;o++){if(a<=i||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?w(t,i,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*i/a):0;a=v(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function w(t,e,r,n){for(var i=0,a=0,o=t.length;ac)t="",o=[];else if(null!=f)for(var d=_(f-(r?r[1]+r[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),p=0,v=o.length;pa&&O(r,t.substring(a,o)),O(r,n[2],n[1]),a=d.lastIndex}am)return{lines:[],width:0,height:0};E.textWidth=v(E.text,C);var D=M.textWidth,I=null==D||"auto"===D;if("string"==typeof D&&"%"===D.charAt(D.length-1))E.percentWidth=D,f.push(E),D=0;else{if(I){D=E.textWidth;var L=M.textBackgroundColor,R=L&&L.image;R&&(R=i.findExistImage(R),i.isImageReady(R)&&(D=Math.max(D,R.width*A/R.height)))}var B=k?k[1]+k[3]:0;D+=B;var F=null!=y?y-T:null;null!=F&&F=r.length&&r.push({option:t})}})),r},e.makeIdAndName=function(t){var e=n.createHashMap();a(t,(function(t,r){var n=t.exist;n&&e.set(n.id,t)})),a(t,(function(t,r){var i=t.option;n.assert(!i||null==i.id||!e.get(i.id)||e.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&null!=i.id&&e.set(i.id,t),!t.keyInfo&&(t.keyInfo={})})),a(t,(function(t,r){var n=t.exist,i=t.option,a=t.keyInfo;if(o(i)){if(a.name=null!=i.name?i.name+"":n?n.name:"series\0"+r,n)a.id=n.id;else if(null!=i.id)a.id=i.id+"";else{var s=0;do{a.id="\0"+a.name+"\0"+s++}while(e.get(a.id))}e.set(a.id,t)}}))},e.isNameSpecified=function(t){var e=t.name;return!(!e||!e.indexOf("series\0"))},e.isIdInner=h,e.compressBatches=function(t,e){var r={},n={};return i(t||[],r),i(e||[],n,r),[a(r),a(n)];function i(t,e,r){for(var n=0,i=t.length;n=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent);t.exports=r},function(t,e,r){var n=r(0),i=n.createHashMap,a=n.isTypedArray,o=r(35).enableClassCheck,s=r(17),l=s.SOURCE_FORMAT_ORIGINAL,h=s.SERIES_LAYOUT_BY_COLUMN,u=s.SOURCE_FORMAT_UNKNOWN,c=s.SOURCE_FORMAT_TYPED_ARRAY,f=s.SOURCE_FORMAT_KEYED_COLUMNS;function d(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===f?{}:[]),this.sourceFormat=t.sourceFormat||u,this.seriesLayoutBy=t.seriesLayoutBy||h,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&i(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}d.seriesDataToSource=function(t){return new d({data:t,sourceFormat:a(t)?c:l,fromDataset:!1})},o(d);var p=d;t.exports=p},function(t,e){e.SOURCE_FORMAT_ORIGINAL="original",e.SOURCE_FORMAT_ARRAY_ROWS="arrayRows",e.SOURCE_FORMAT_OBJECT_ROWS="objectRows",e.SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",e.SOURCE_FORMAT_UNKNOWN="unknown",e.SOURCE_FORMAT_TYPED_ARRAY="typedArray",e.SERIES_LAYOUT_BY_COLUMN="column",e.SERIES_LAYOUT_BY_ROW="row"},function(t,e){var r={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};t.exports=function(t,e,n){return r.hasOwnProperty(e)?n*t.dpr:n}},function(t,e,r){var n=r(43),i=r(44),a=r(20),o=r(45),s=r(0),l=function(t){a.call(this,t),i.call(this,t),o.call(this,t),this.id=t.id||n()};l.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=t,r[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var r=this[t];r||(r=this[t]=[]),r[0]=e[0],r[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(s.isObject(t))for(var r in t)t.hasOwnProperty(r)&&this.attrKV(r,t[r]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var r=0;r5e-5||t<-5e-5}var s=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},l=s.prototype;l.transform=null,l.needLocalTransform=function(){return o(this.rotation)||o(this.position[0])||o(this.position[1])||o(this.scale[0]-1)||o(this.scale[1]-1)};var h=[];l.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),i=this.transform;if(r||e){i=i||n.create(),r?this.getLocalTransform(i):a(i),e&&(r?n.mul(i,t.transform,i):n.copy(i,t.transform)),this.transform=i;var o=this.globalScaleRatio;if(null!=o&&1!==o){this.getGlobalScale(h);var s=h[0]<0?-1:1,l=h[1]<0?-1:1,u=((h[0]-s)*o+s)/h[0]||0,c=((h[1]-l)*o+l)/h[1]||0;i[0]*=u,i[1]*=u,i[2]*=c,i[3]*=c}this.invTransform=this.invTransform||n.create(),n.invert(this.invTransform,i)}else i&&a(i)},l.getLocalTransform=function(t){return s.getLocalTransform(this,t)},l.setTransform=function(t){var e=this.transform,r=t.dpr||1;e?t.setTransform(r*e[0],r*e[1],r*e[2],r*e[3],r*e[4],r*e[5]):t.setTransform(r,0,0,r,0,0)},l.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var u=[],c=n.create();l.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],n=this.position,i=this.scale;o(e-1)&&(e=Math.sqrt(e)),o(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),n[0]=t[4],n[1]=t[5],i[0]=e,i[1]=r,this.rotation=Math.atan2(-t[1]/r,t[0]/e)}},l.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(n.mul(u,t.invTransform,e),e=u);var r=this.origin;r&&(r[0]||r[1])&&(c[4]=r[0],c[5]=r[1],n.mul(u,e,c),u[4]-=r[0],u[5]-=r[1],e=u),this.setLocalTransform(e)}},l.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},l.transformCoordToLocal=function(t,e){var r=[t,e],n=this.invTransform;return n&&i.applyTransform(r,r,n),r},l.transformCoordToGlobal=function(t,e){var r=[t,e],n=this.transform;return n&&i.applyTransform(r,r,n),r},s.getLocalTransform=function(t,e){a(e=e||[]);var r=t.origin,i=t.scale||[1,1],o=t.rotation||0,s=t.position||[0,0];return r&&(e[4]-=r[0],e[5]-=r[1]),n.scale(e,e,i),o&&n.rotate(e,e,o),r&&(e[4]+=r[0],e[5]+=r[1]),e[4]+=s[0],e[5]+=s[1],e};var f=s;t.exports=f},function(t,e,r){var n=r(22),i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(t){return(t=Math.round(t))<0?0:t>255?255:t}function o(t){return t<0?0:t>1?1:t}function s(t){return t.length&&"%"===t.charAt(t.length-1)?a(parseFloat(t)/100*255):a(parseInt(t,10))}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100):o(parseFloat(t))}function h(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t,e,r){return t+(e-t)*r}function c(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var d=new n(20),p=null;function v(t,e){p&&f(p,e),p=d.put(t,p||e.slice())}function g(t,e){if(t){e=e||[];var r=d.get(t);if(r)return f(e,r);var n,a=(t+="").replace(/ /g,"").toLowerCase();if(a in i)return f(e,i[a]),v(t,e),e;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(c(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),v(t,e),e):void c(e,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(c(e,(16711680&n)>>16,(65280&n)>>8,255&n,1),v(t,e),e):void c(e,0,0,0,1):void 0;var o=a.indexOf("("),h=a.indexOf(")");if(-1!==o&&h+1===a.length){var u=a.substr(0,o),p=a.substr(o+1,h-(o+1)).split(","),g=1;switch(u){case"rgba":if(4!==p.length)return void c(e,0,0,0,1);g=l(p.pop());case"rgb":return 3!==p.length?void c(e,0,0,0,1):(c(e,s(p[0]),s(p[1]),s(p[2]),g),v(t,e),e);case"hsla":return 4!==p.length?void c(e,0,0,0,1):(p[3]=l(p[3]),y(p,e),v(t,e),e);case"hsl":return 3!==p.length?void c(e,0,0,0,1):(y(p,e),v(t,e),e);default:return}}c(e,0,0,0,1)}}function y(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=l(t[1]),i=l(t[2]),o=i<=.5?i*(n+1):i+n-i*n,s=2*i-o;return c(e=e||[],a(255*h(s,o,r+1/3)),a(255*h(s,o,r)),a(255*h(s,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function m(t,e,r){if(e&&e.length&&t>=0&&t<=1){r=r||[];var n=t*(e.length-1),i=Math.floor(n),s=Math.ceil(n),l=e[i],h=e[s],c=n-i;return r[0]=a(u(l[0],h[0],c)),r[1]=a(u(l[1],h[1],c)),r[2]=a(u(l[2],h[2],c)),r[3]=o(u(l[3],h[3],c)),r}}var x=m;function _(t,e,r){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),i=Math.floor(n),s=Math.ceil(n),l=g(e[i]),h=g(e[s]),c=n-i,f=w([a(u(l[0],h[0],c)),a(u(l[1],h[1],c)),a(u(l[2],h[2],c)),o(u(l[3],h[3],c))],"rgba");return r?{color:f,leftIndex:i,rightIndex:s,value:n}:f}}var b=_;function w(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}e.parse=g,e.lift=function(t,e){var r=g(t);if(r){for(var n=0;n<3;n++)r[n]=e<0?r[n]*(1-e)|0:(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:t[n]<0&&(r[n]=0);return w(r,4===r.length?"rgba":"rgb")}},e.toHex=function(t){var e=g(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},e.fastLerp=m,e.fastMapToColor=x,e.lerp=_,e.mapToColor=b,e.modifyHSL=function(t,e,r,n){if(t=g(t))return t=function(t){if(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o,h=(s+o)/2;if(0===l)e=0,r=0;else{r=h<.5?l/(s+o):l/(2-s-o);var u=((s-n)/6+l/2)/l,c=((s-i)/6+l/2)/l,f=((s-a)/6+l/2)/l;n===s?e=f-c:i===s?e=1/3+u-f:a===s&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,r,h];return null!=t[3]&&d.push(t[3]),d}}(t),null!=e&&(t[0]=(i=e,(i=Math.round(i))<0?0:i>360?360:i)),null!=r&&(t[1]=l(r)),null!=n&&(t[2]=l(n)),w(y(t),"rgba");var i},e.modifyAlpha=function(t,e){if((t=g(t))&&null!=e)return t[3]=o(e),w(t,"rgba")},e.stringify=w},function(t,e){var r=function(){this.head=null,this.tail=null,this._len=0},n=r.prototype;n.insert=function(t){var e=new i(t);return this.insertEntry(e),e},n.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},n.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};var i=function(t){this.value=t,this.next,this.prev},a=function(t){this._list=new r,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(t,e){var r=this._list,n=this._map,a=null;if(null==n[t]){var o=r.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=r.head;r.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new i(e),s.key=t,r.insertEntry(s),n[t]=s}return a},o.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;t.exports=s},function(t,e){var r=1;"undefined"!=typeof window&&(r=Math.max(window.devicePixelRatio||1,1));var n=r;e.debugMode=0,e.devicePixelRatio=n},function(t,e,r){var n=r(0),i=n.retrieve2,a=n.retrieve3,o=n.each,s=n.normalizeCssArray,l=n.isString,h=n.isObject,u=r(11),c=r(25),f=r(12),d=r(18),p=r(7),v=p.ContextCachedBy,g=p.WILL_BE_RESTORED,y=u.DEFAULT_FONT,m={left:1,right:1,center:1},x={top:1,bottom:1,middle:1},_=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],b={},w={};function S(t){if(t){t.font=u.makeFont(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||m[e]?e:"left";var r=t.textVerticalAlign||t.textBaseline;"center"===r&&(r="middle"),t.textVerticalAlign=null==r||x[r]?r:"top",t.textPadding&&(t.textPadding=s(t.textPadding))}}function T(t,e,r,n,i){if(r&&e.textRotation){var a=e.textOrigin;"center"===a?(n=r.width/2+r.x,i=r.height/2+r.y):a&&(n=a[0]+r.x,i=a[1]+r.y),t.translate(n,i),t.rotate(-e.textRotation),t.translate(-n,-i)}}function P(t,e,r,n,o,s,l,h){var u=n.rich[r.styleName]||{};u.text=r.text;var c=r.textVerticalAlign,f=s+o/2;"top"===c?f=s+r.height/2:"bottom"===c&&(f=s+o-r.height/2),!r.isLineHolder&&M(u)&&O(t,e,u,"right"===h?l-r.width:"center"===h?l-r.width/2:l,f-r.height/2,r.width,r.height);var d=r.textPadding;d&&(l=R(l,h,d),f-=r.height/2-d[2]-r.textHeight/2),A(e,"shadowBlur",a(u.textShadowBlur,n.textShadowBlur,0)),A(e,"shadowColor",u.textShadowColor||n.textShadowColor||"transparent"),A(e,"shadowOffsetX",a(u.textShadowOffsetX,n.textShadowOffsetX,0)),A(e,"shadowOffsetY",a(u.textShadowOffsetY,n.textShadowOffsetY,0)),A(e,"textAlign",h),A(e,"textBaseline","middle"),A(e,"font",r.font||y);var p=D(u.textStroke||n.textStroke,g),v=I(u.textFill||n.textFill),g=i(u.textStrokeWidth,n.textStrokeWidth);p&&(A(e,"lineWidth",g),A(e,"strokeStyle",p),e.strokeText(r.text,l,f)),v&&(A(e,"fillStyle",v),e.fillText(r.text,l,f))}function M(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function O(t,e,r,n,i,a,o){var s=r.textBackgroundColor,u=r.textBorderWidth,d=r.textBorderColor,p=l(s);if(A(e,"shadowBlur",r.textBoxShadowBlur||0),A(e,"shadowColor",r.textBoxShadowColor||"transparent"),A(e,"shadowOffsetX",r.textBoxShadowOffsetX||0),A(e,"shadowOffsetY",r.textBoxShadowOffsetY||0),p||u&&d){e.beginPath();var v=r.textBorderRadius;v?c.buildPath(e,{x:n,y:i,width:a,height:o,r:v}):e.rect(n,i,a,o),e.closePath()}if(p)if(A(e,"fillStyle",s),null!=r.fillOpacity){var g=e.globalAlpha;e.globalAlpha=r.fillOpacity*r.opacity,e.fill(),e.globalAlpha=g}else e.fill();else if(h(s)){var y=s.image;(y=f.createOrUpdateImage(y,null,t,k,s))&&f.isImageReady(y)&&e.drawImage(y,n,i,a,o)}if(u&&d)if(A(e,"lineWidth",u),A(e,"strokeStyle",d),null!=r.strokeOpacity){g=e.globalAlpha;e.globalAlpha=r.strokeOpacity*r.opacity,e.stroke(),e.globalAlpha=g}else e.stroke()}function k(t,e){e.image=t}function C(t,e,r,n){var i=r.x||0,a=r.y||0,o=r.textAlign,s=r.textVerticalAlign;if(n){var l=r.textPosition;if(l instanceof Array)i=n.x+L(l[0],n.width),a=n.y+L(l[1],n.height);else{var h=e&&e.calculateTextPosition?e.calculateTextPosition(b,r,n):u.calculateTextPosition(b,r,n);i=h.x,a=h.y,o=o||h.textAlign,s=s||h.textVerticalAlign}var c=r.textOffset;c&&(i+=c[0],a+=c[1])}return(t=t||{}).baseX=i,t.baseY=a,t.textAlign=o,t.textVerticalAlign=s,t}function A(t,e,r){return t[e]=d(t,e,r),t[e]}function D(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function I(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function L(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function R(t,e,r){return"right"===e?t-r[1]:"center"===e?t+r[3]/2-r[1]/2:t+r[3]}e.normalizeTextStyle=function(t){return S(t),o(t.rich,S),t},e.renderText=function(t,e,r,n,i,a){n.rich?function(t,e,r,n,i,a){a!==g&&(e.__attrCachedBy=v.NONE);var o=t.__textCotentBlock;o&&!t.__dirtyText||(o=t.__textCotentBlock=u.parseRichText(r,n));!function(t,e,r,n,i){var a=r.width,o=r.outerWidth,s=r.outerHeight,l=n.textPadding,h=C(w,t,n,i),c=h.baseX,f=h.baseY,d=h.textAlign,p=h.textVerticalAlign;T(e,n,i,c,f);var v=u.adjustTextX(c,o,d),g=u.adjustTextY(f,s,p),y=v,m=g;l&&(y+=l[3],m+=l[0]);var x=y+a;M(n)&&O(t,e,n,v,g,o,s);for(var _=0;_=0&&"right"===(b=k[F]).textAlign;)P(t,e,b,n,D,m,B,"right"),I-=b.width,B-=b.width,F--;for(R+=(a-(R-y)-(x-B)-I)/2;L<=F;)b=k[L],P(t,e,b,n,D,m,R+b.width/2,"center"),R+=b.width,L++;m+=D}}(t,e,o,n,i)}(t,e,r,n,i,a):function(t,e,r,n,i,a){"use strict";var o,s=M(n),l=!1,h=e.__attrCachedBy===v.PLAIN_TEXT;a!==g?(a&&(o=a.style,l=!s&&h&&o),e.__attrCachedBy=s?v.NONE:v.PLAIN_TEXT):h&&(e.__attrCachedBy=v.NONE);var c=n.font||y;l&&c===(o.font||y)||(e.font=c);var f=t.__computedFont;t.__styleFont!==c&&(t.__styleFont=c,f=t.__computedFont=e.font);var p=n.textPadding,m=n.textLineHeight,x=t.__textCotentBlock;x&&!t.__dirtyText||(x=t.__textCotentBlock=u.parsePlainText(r,f,p,m,n.truncate));var b=x.outerHeight,S=x.lines,P=x.lineHeight,k=C(w,t,n,i),A=k.baseX,L=k.baseY,B=k.textAlign||"left",F=k.textVerticalAlign;T(e,n,i,A,L);var E=u.adjustTextY(L,b,F),N=A,z=E;if(s||p){var W=u.getWidth(r,f);p&&(W+=p[1]+p[3]);var q=u.adjustTextX(A,W,B);s&&O(t,e,n,q,E,W,b),p&&(N=R(A,B,p),z+=p[0])}e.textAlign=B,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(var H=0;H<_.length;H++){var j=_[H],Y=j[0],U=j[1],V=n[Y];l&&V===o[Y]||(e[U]=d(e,U,V||j[2]))}z+=P/2;var G=n.textStrokeWidth,X=l?o.textStrokeWidth:null,Z=!l||G!==X,Q=!l||Z||n.textStroke!==o.textStroke,$=D(n.textStroke,G),K=I(n.textFill);$&&(Z&&(e.lineWidth=G),Q&&(e.strokeStyle=$));K&&(l&&n.textFill===o.textFill||(e.fillStyle=K));if(1===S.length)$&&e.strokeText(S[0],N,z),K&&e.fillText(S[0],N,z);else for(H=0;Hh&&(r*=h/(o=r+n),n*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),n+i>u&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),t.moveTo(s+r,l),t.lineTo(s+h-n,l),0!==n&&t.arc(s+h-n,l+n,n,-Math.PI/2,0),t.lineTo(s+h,l+u-i),0!==i&&t.arc(s+h-i,l+u-i,i,0,Math.PI/2),t.lineTo(s+a,l+u),0!==a&&t.arc(s+a,l+u-a,a,Math.PI/2,Math.PI),t.lineTo(s,l+r),0!==r&&t.arc(s+r,l+r,r,Math.PI,1.5*Math.PI)}},function(t,e){var r=2*Math.PI;e.normalizeRadian=function(t){return(t%=r)<0&&(t+=r),t}},function(t,e,r){var n=r(68),i=r(69);e.buildPath=function(t,e,r){var a=e.points,o=e.smooth;if(a&&a.length>=2){if(o&&"spline"!==o){var s=i(a,o,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var l=a.length,h=0;h<(r?l:l-1);h++){var u=s[2*h],c=s[2*h+1],f=a[(h+1)%l];t.bezierCurveTo(u[0],u[1],c[0],c[1],f[0],f[1])}}else{"spline"===o&&(a=n(a,r)),t.moveTo(a[0][0],a[0][1]);h=1;for(var d=a.length;hs?(s*=2*t/o,o=2*t):(o*=2*t/s,s=2*t);var l=e?0:b-o/2,h=e?0:w-s/2;return r=n.graphic.makePath(T.slice(7),{},new n.graphic.BoundingRect(l,h,o,s)),e&&(r.position=[-o/2,-s/2]),r}if(S){var u=e?-t[0]:b-t[0],c=e?-t[1]:w-t[1];return a.createSymbol("rect",u,c,2*t[0],2*t[1])}u=e?-t:b-t,c=e?-t:w-t;return"pin"===T?c+=t:"arrow"===T&&(c-=t),a.createSymbol(T,u,c,2*t,2*t)}return new n.graphic.Circle({shape:{cx:e?0:b,cy:e?0:w,r:t}})}function D(){var e=A(m);return e.style.fill=null,e.setStyle(t.getModel("outline.itemStyle").getItemStyle()),e}function I(e,r,i){var a=S?c[0]:c,h=S?d/2:c,u=l.getItemModel(e),f=u.getModel("itemStyle"),p=u.get("phase"),v=o(u.get("amplitude"),2*h),g=o(u.get("waveLength"),2*a),y=h-l.get("value",e)*h*2;p=i?i.shape.phase:"auto"===p?e*Math.PI/4:p;var m=f.getItemStyle();if(!m.fill){var x=t.get("color"),_=e%x.length;m.fill=x[_]}var T=new s({shape:{waveLength:g,radius:a,radiusY:h,cx:2*a,cy:0,waterLevel:y,amplitude:v,phase:p,inverse:r},style:m,position:[b,w]});T.shape._waterLevel=y;var P=u.getModel("emphasis.itemStyle").getItemStyle();P.lineWidth=0,n.graphic.setHoverStyle(T,P);var M=A(c,!0);return M.setStyle({fill:"white"}),T.setClipPath(M),T}function L(t,e,r){var n=l.getItemModel(t),i=n.get("period"),a=n.get("direction"),o=l.get("value",t),s=n.get("phase");s=r?r.shape.phase:"auto"===s?t*Math.PI/4:s;var h=0;h="auto"===i?function(e){var r=l.count();return 0===r?e:e*(.2+(r-t)/r*.8)}(5e3):"function"==typeof i?i(o,t):i;var u=0;"right"===a||null==a?u=Math.PI:"left"===a?u=-Math.PI:"none"===a?u=0:console.error("Illegal direction value for liquid fill."),"none"!==a&&n.get("waveAnimation")&&e.animate("shape",!0).when(0,{phase:s}).when(h/2,{phase:u+s}).when(h,{phase:2*u+s}).during((function(){O&&O.dirty(!0)})).start()}l.diff(k).add((function(e){var r=I(e,!1),a=r.shape.waterLevel;r.shape.waterLevel=S?d/2:c,n.graphic.initProps(r,{shape:{waterLevel:a}},t),r.z2=2,L(e,r,null),i.add(r),l.setItemGraphicEl(e,r),C.push(r)})).update((function(e,r){for(var a=k.getItemGraphicEl(r),o=I(e,!1,a),s={},h=["amplitude","cx","cy","phase","radius","radiusY","waterLevel","waveLength"],u=0;u=0),l=!s&&null!=i;(s||l)&&(e={textFill:t.textFill,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth}),s&&(t.textFill="#fff",null==t.textStroke&&(t.textStroke=i,null==t.textStrokeWidth&&(t.textStrokeWidth=2))),l&&(t.textFill=i)}t.insideRollback=e}function at(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function ot(t,e,r,n,i,a){if("function"==typeof i&&(a=i,i=null),n&&n.isAnimationEnabled()){var o=t?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),h=n.getShallow("animationDelay"+o);"function"==typeof h&&(h=h(i,n.getAnimationDelayParams?n.getAnimationDelayParams(e,i):null)),"function"==typeof s&&(s=s(i)),s>0?e.animateTo(r,s,h||0,l,a,!!a):(e.stopAnimation(),e.attr(r),a&&a())}else e.stopAnimation(),e.attr(r),a&&a()}function st(t,e,r,n,i){ot(!0,t,e,r,n,i)}function lt(t,e,r){return e&&!n.isArrayLike(e)&&(e=h.getLocalTransform(e)),r&&(e=o.invert([],e)),s.applyTransform([],t,e)}function ht(t,e,r,n,i,a,o,s){var l,h=r-t,u=n-e,c=o-i,f=s-a,d=ut(c,f,h,u);if((l=d)<=1e-6&&l>=-1e-6)return!1;var p=t-i,v=e-a,g=ut(p,v,h,u)/d;if(g<0||g>1)return!1;var y=ut(p,v,c,f)/d;return!(y<0||y>1)}function ut(t,e,r,n){return t*n-r*e}R("circle",d),R("sector",p),R("ring",v),R("polygon",g),R("polyline",y),R("rect",m),R("line",x),R("bezierCurve",_),R("arc",b),e.Z2_EMPHASIS_LIFT=1,e.CACHED_LABEL_STYLE_PROPERTIES={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},e.extendShape=function(t){return l.extend(t)},e.extendPath=function(t,e){return i.extendFromString(t,e)},e.registerShape=R,e.getShapeClass=function(t){if(L.hasOwnProperty(t))return L[t]},e.makePath=B,e.makeImage=function(t,e,r){var n=new u({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===r){var i={width:t.width,height:t.height};n.setStyle(F(e,i))}}});return n},e.mergePath=E,e.resizePath=N,e.subPixelOptimizeLine=function(t){return O.subPixelOptimizeLine(t.shape,t.shape,t.style),t},e.subPixelOptimizeRect=function(t){return O.subPixelOptimizeRect(t.shape,t.shape,t.style),t},e.subPixelOptimize=z,e.setElementHoverStyle=G,e.setHoverStyle=function(t,e){J(t,!0),V(t,G,e)},e.setAsHighDownDispatcher=J,e.isHighDownDispatcher=function(t){return!(!t||!t.__highDownDispatcher)},e.getHighlightDigit=function(t){var e=I[t];return null==e&&D<=32&&(e=I[t]=D++),e},e.setLabelStyle=function(t,e,r,i,a,o,s){var l,h=(a=a||A).labelFetcher,u=a.labelDataIndex,c=a.labelDimIndex,f=a.labelProp,d=r.getShallow("show"),p=i.getShallow("show");(d||p)&&(h&&(l=h.getFormattedLabel(u,"normal",null,c,f)),null==l&&(l=n.isFunction(a.defaultText)?a.defaultText(u,a):a.defaultText));var v=d?l:null,g=p?n.retrieve2(h?h.getFormattedLabel(u,"emphasis",null,c,f):null,l):null;null==v&&null==g||(tt(t,r,o,a),tt(e,i,s,a,!0)),t.text=v,e.text=g},e.modifyLabelStyle=function(t,e,r){var i=t.style;e&&(at(i),t.setStyle(e),it(i)),i=t.__hoverStl,r&&i&&(at(i),n.extend(i,r),it(i))},e.setTextStyle=tt,e.setText=function(t,e,r){var n,i={isRectText:!0};!1===r?n=!0:i.autoColor=r,et(t,e,i,n)},e.getFont=function(t,e){var r=e&&e.getModel("textStyle");return n.trim([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))},e.updateProps=st,e.initProps=function(t,e,r,n,i){ot(!1,t,e,r,n,i)},e.getTransform=function(t,e){for(var r=o.identity([]);t&&t!==e;)o.mul(r,t.getLocalTransform(),r),t=t.parent;return r},e.applyTransform=lt,e.transformDirection=function(t,e,r){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),i=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-i:"bottom"===t?i:0];return a=lt(a,e,r),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},e.groupTransition=function(t,e,r,i){if(t&&e){var a,o=(a={},t.traverse((function(t){!t.isGroup&&t.anid&&(a[t.anid]=t)})),a);e.traverse((function(t){if(!t.isGroup&&t.anid){var e=o[t.anid];if(e){var n=l(t);t.attr(l(e)),st(t,n,r,t.dataIndex)}}}))}function l(t){var e={position:s.clone(t.position),rotation:t.rotation};return t.shape&&(e.shape=n.extend({},t.shape)),e}},e.clipPointsByRect=function(t,e){return n.map(t,(function(t){var r=t[0];r=k(r,e.x),r=C(r,e.x+e.width);var n=t[1];return n=k(n,e.y),[r,n=C(n,e.y+e.height)]}))},e.clipRectByRect=function(t,e){var r=k(t.x,e.x),n=C(t.x+t.width,e.x+e.width),i=k(t.y,e.y),a=C(t.y+t.height,e.y+e.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}},e.createIcon=function(t,e,r){var i=(e=n.extend({rectHover:!0},e)).style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(i.image=t.slice(8),n.defaults(i,r),new u(e)):B(t.replace("path://",""),e,r,"center")},e.linePolygonIntersect=function(t,e,r,n,i){for(var a=0,o=i[i.length-1];a1&&(u*=o(_),d*=o(_));var b=(i===a?-1:1)*o((u*u*(d*d)-u*u*(x*x)-d*d*(m*m))/(u*u*(x*x)+d*d*(m*m)))||0,w=b*u*x/d,S=b*-d*m/u,T=(t+r)/2+l(y)*w-s(y)*S,P=(e+n)/2+s(y)*w+l(y)*S,M=f([1,0],[(m-w)/u,(x-S)/d]),O=[(m-w)/u,(x-S)/d],k=[(-1*m-w)/u,(-1*x-S)/d],C=f(O,k);c(O,k)<=-1&&(C=h),c(O,k)>=1&&(C=0),0===a&&C>0&&(C-=2*h),1===a&&C<0&&(C+=2*h),g.addData(v,T,P,u,d,M,C,y,a)}var p=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,v=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function g(t,e){var r=function(t){if(!t)return new i;for(var e,r=0,n=0,a=r,o=n,s=new i,l=i.CMD,h=t.match(p),u=0;u0},extendFrom:function(t,e){if(t)for(var r in t)!t.hasOwnProperty(r)||!0!==e&&(!1===e?this.hasOwnProperty(r):null==t[r])||(this[r]=t[r])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,r){for(var n=("radial"===e.type?l:s)(t,e,r),i=e.colorStops,a=0;a3&&(i=r.call(i,1));for(var o=e.length,s=0;s4&&(i=r.call(i,1,i.length-1));for(var o=i[i.length-1],s=e.length,l=0;l0&&e.animate(r,!1).when(null==a?500:a,u).delay(o||0)}(t,"",t,e,r,n,c);var f=t.animators.slice(),p=f.length;function v(){--p||a&&a()}p||a&&a();for(var g=0;g.5?e:t}function c(t,e,r,n,i){var a=t.length;if(1===i)for(var o=0;oi)t.length=i;else for(var a=n;a=0&&!(O[r]<=e);r--);r=Math.min(r,_-2)}else{for(r=W;r<_&&!(O[r]>e);r++);r=Math.min(r-1,_-2)}W=r,q=e;var n=O[r+1]-O[r];if(0!==n)if(B=(e-O[r])/n,x)if(E=k[r],F=k[0===r?r:r-1],N=k[r>_-2?_-1:r+1],z=k[r>_-3?_-1:r+2],S)p(F,E,N,z,B,B*B,B*B*B,g(t,s),M);else{if(T)i=p(F,E,N,z,B,B*B,B*B*B,H,1),i=y(H);else{if(P)return u(E,N,B);i=v(F,E,N,z,B,B*B,B*B*B)}m(t,s,i)}else if(S)c(k[r],k[r+1],B,g(t,s),M);else{var i;if(T)c(k[r],k[r+1],B,H,1),i=y(H);else{if(P)return u(k[r],k[r+1],B);i=h(k[r],k[r+1],B)}m(t,s,i)}},ondestroy:r});return e&&"spline"!==e&&(j.easing=e),j}}}var x=function(t,e,r,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=r||s,this._setter=n||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};x.prototype={when:function(t,e){var r=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!r[n]){r[n]=[];var i=this._getter(this._target,n);if(null==i)continue;0!==t&&r[n].push({time:0,value:g(i)})}r[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t1e-4)return p[0]=t-r,p[1]=e-i,v[0]=t+r,void(v[1]=e+i);if(u[0]=l(a)*r+t,u[1]=s(a)*i+e,c[0]=l(o)*r+t,c[1]=s(o)*i+e,g(p,u,c),y(v,u,c),(a%=h)<0&&(a+=h),(o%=h)<0&&(o+=h),a>o&&!d?o+=h:aa&&(f[0]=l(_)*r+t,f[1]=s(_)*i+e,g(p,f,p),y(v,f,v))}},function(t,e,r){var n=r(8),i=r(53),a=r(54),o=r(55),s=r(56),l=r(26).normalizeRadian,h=r(4),u=r(57),c=n.CMD,f=2*Math.PI;var d=[-1,-1,-1],p=[-1,-1];function v(t,e,r,n,i,a,o,s,l,u){if(u>e&&u>n&&u>a&&u>s||u1&&(c=void 0,c=p[0],p[0]=p[1],p[1]=c),v=h.cubicAt(e,n,a,s,p[0]),m>1&&(g=h.cubicAt(e,n,a,s,p[1]))),2===m?_e&&s>n&&s>a||s=0&&u<=1){for(var c=0,f=h.quadraticAt(e,n,a,u),p=0;pr||s<-r)return 0;var h=Math.sqrt(r*r-s*s);d[0]=-h,d[1]=h;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u%f<1e-4){n=0,i=f;var c=a?1:-1;return o>=d[0]+t&&o<=d[1]+t?c:0}if(a){h=n;n=l(i),i=l(h)}else n=l(n),i=l(i);n>i&&(i+=f);for(var p=0,v=0;v<2;v++){var g=d[v];if(g+t>o){var y=Math.atan2(s,g);c=a?1:-1;y<0&&(y=f+y),(y>=n&&y<=i||y+f>=n&&y+f<=i)&&(y>Math.PI/2&&y<1.5*Math.PI&&(c=-c),p+=c)}}return p}function m(t,e,r,n,l){for(var h,f,d=0,p=0,m=0,x=0,_=0,b=0;b1&&(r||(d+=u(p,m,x,_,n,l))),1===b&&(x=p=t[b],_=m=t[b+1]),w){case c.M:p=x=t[b++],m=_=t[b++];break;case c.L:if(r){if(i.containStroke(p,m,t[b],t[b+1],e,n,l))return!0}else d+=u(p,m,t[b],t[b+1],n,l)||0;p=t[b++],m=t[b++];break;case c.C:if(r){if(a.containStroke(p,m,t[b++],t[b++],t[b++],t[b++],t[b],t[b+1],e,n,l))return!0}else d+=v(p,m,t[b++],t[b++],t[b++],t[b++],t[b],t[b+1],n,l)||0;p=t[b++],m=t[b++];break;case c.Q:if(r){if(o.containStroke(p,m,t[b++],t[b++],t[b],t[b+1],e,n,l))return!0}else d+=g(p,m,t[b++],t[b++],t[b],t[b+1],n,l)||0;p=t[b++],m=t[b++];break;case c.A:var S=t[b++],T=t[b++],P=t[b++],M=t[b++],O=t[b++],k=t[b++];b+=1;var C=1-t[b++],A=Math.cos(O)*P+S,D=Math.sin(O)*M+T;b>1?d+=u(p,m,A,D,n,l):(x=A,_=D);var I=(n-S)*M/P+S;if(r){if(s.containStroke(S,T,M,O,O+k,C,e,I,l))return!0}else d+=y(S,T,M,O,O+k,C,I,l);p=Math.cos(O+k)*P+S,m=Math.sin(O+k)*M+T;break;case c.R:x=p=t[b++],_=m=t[b++];A=x+t[b++],D=_+t[b++];if(r){if(i.containStroke(x,_,A,_,e,n,l)||i.containStroke(A,_,A,D,e,n,l)||i.containStroke(A,D,x,D,e,n,l)||i.containStroke(x,D,x,_,e,n,l))return!0}else d+=u(A,_,A,D,n,l),d+=u(x,D,x,_,n,l);break;case c.Z:if(r){if(i.containStroke(p,m,x,_,e,n,l))return!0}else d+=u(p,m,x,_,n,l);p=x,m=_}}return r||(h=m,f=_,Math.abs(h-f)<1e-4)||(d+=u(p,m,x,_,n,l)||0),0!==d}e.contain=function(t,e,r){return m(t,0,!1,e,r)},e.containStroke=function(t,e,r,n){return m(t,e,!0,r,n)}},function(t,e){e.containStroke=function(t,e,r,n,i,a,o){if(0===i)return!1;var s=i,l=0;if(o>e+s&&o>n+s||ot+s&&a>r+s||ae+f&&c>i+f&&c>o+f&&c>l+f||ct+f&&u>r+f&&u>a+f&&u>s+f||ue+u&&h>i+u&&h>o+u||ht+u&&l>r+u&&l>a+u||lr||f+co&&(o+=i);var p=Math.atan2(u,h);return p<0&&(p+=i),p>=a&&p<=o||p+i>=a&&p+i<=o}},function(t,e){t.exports=function(t,e,r,n,i,a){if(a>e&&a>n||ai?o:0}},function(t,e){var r=function(t,e){this.image=t,this.repeat=e,this.type="pattern"};r.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")};var n=r;t.exports=n},function(t,e,r){var n=r(8),i=r(2).applyTransform,a=n.CMD,o=[[],[],[]],s=Math.sqrt,l=Math.atan2;t.exports=function(t,e){var r,n,h,u,c,f=t.data,d=a.M,p=a.C,v=a.L,g=a.R,y=a.A,m=a.Q;for(h=0,u=0;h=0&&(r.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,r=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof o&&t.addChildrenToStorage(e)),r&&r.refresh()},remove:function(t){var e=this.__zr,r=this.__storage,i=this._children,a=n.indexOf(i,t);return a<0||(i.splice(a,1),t.parent=null,r&&(r.delFromStorage(t),t instanceof o&&t.delChildrenFromStorage(r)),e&&e.refresh()),this},removeAll:function(){var t,e,r=this._children,n=this.__storage;for(e=0;e=11?function(){var e,r=this.__clipPaths,n=this.style;if(r)for(var a=0;ar-2?r-1:d+1],c=t[d>r-3?r-1:d+2]);var g=p*p,y=p*g;a.push([i(h[0],v[0],u[0],c[0],p,g,y),i(h[1],v[1],u[1],c[1],p,g,y)])}return a}},function(t,e,r){var n=r(2),i=n.min,a=n.max,o=n.scale,s=n.distance,l=n.add,h=n.clone,u=n.sub;t.exports=function(t,e,r,n){var c,f,d,p,v=[],g=[],y=[],m=[];if(n){d=[1/0,1/0],p=[-1/0,-1/0];for(var x=0,_=t.length;x<_;x++)i(d,d,t[x]),a(p,p,t[x]);i(d,d,n[0]),a(p,p,n[1])}for(x=0,_=t.length;x<_;x++){var b=t[x];if(r)c=t[x?x-1:_-1],f=t[(x+1)%_];else{if(0===x||x===_-1){v.push(h(t[x]));continue}c=t[x-1],f=t[x+1]}u(g,f,c),o(g,g,e);var w=s(b,c),S=s(b,f),T=w+S;0!==T&&(w/=T,S/=T),o(y,g,-w),o(m,g,S);var P=l([],b,y),M=l([],b,m);n&&(a(P,P,d),i(P,P,p),a(M,M,d),i(M,M,p)),v.push(P),v.push(M)}return r&&v.push(v.shift()),v}},function(t,e,r){var n=r(1),i=r(27),a=n.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){i.buildPath(t,e,!1)}});t.exports=a},function(t,e,r){var n=r(1),i=r(25),a=r(13).subPixelOptimizeRect,o={},s=n.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var r,n,s,l;this.subPixelOptimize?(a(o,e,this.style),r=o.x,n=o.y,s=o.width,l=o.height,o.r=e.r,e=o):(r=e.x,n=e.y,s=e.width,l=e.height),e.r?i.buildPath(t,e):t.rect(r,n,s,l),t.closePath()}});t.exports=s},function(t,e,r){var n=r(1),i=r(13).subPixelOptimizeLine,a={},o=n.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r,n,o,s;this.subPixelOptimize?(i(a,e,this.style),r=a.x1,n=a.y1,o=a.x2,s=a.y2):(r=e.x1,n=e.y1,o=e.x2,s=e.y2);var l=e.percent;0!==l&&(t.moveTo(r,n),l<1&&(o=r*(1-l)+o*l,s=n*(1-l)+s*l),t.lineTo(o,s))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}});t.exports=o},function(t,e,r){var n=r(1),i=r(2),a=r(4),o=a.quadraticSubdivide,s=a.cubicSubdivide,l=a.quadraticAt,h=a.cubicAt,u=a.quadraticDerivativeAt,c=a.cubicDerivativeAt,f=[];function d(t,e,r){var n=t.cpx2,i=t.cpy2;return null===n||null===i?[(r?c:h)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?c:h)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?u:l)(t.x1,t.cpx1,t.x2,e),(r?u:l)(t.y1,t.cpy1,t.y2,e)]}var p=n.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2,l=e.cpx1,h=e.cpy1,u=e.cpx2,c=e.cpy2,d=e.percent;0!==d&&(t.moveTo(r,n),null==u||null==c?(d<1&&(o(r,l,i,d,f),l=f[1],i=f[2],o(n,h,a,d,f),h=f[1],a=f[2]),t.quadraticCurveTo(l,h,i,a)):(d<1&&(s(r,l,u,i,d,f),l=f[1],u=f[2],i=f[3],s(n,h,c,a,d,f),h=f[1],c=f[2],a=f[3]),t.bezierCurveTo(l,h,u,c,i,a)))},pointAt:function(t){return d(this.shape,t,!1)},tangentAt:function(t){var e=d(this.shape,t,!0);return i.normalize(e,e)}});t.exports=p},function(t,e,r){var n=r(1).extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r=e.cx,n=e.cy,i=Math.max(e.r,0),a=e.startAngle,o=e.endAngle,s=e.clockwise,l=Math.cos(a),h=Math.sin(a);t.moveTo(l*i+r,h*i+n),t.arc(r,n,i,a,o,!s)}});t.exports=n},function(t,e,r){var n=r(1),i=n.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,r=0;r0;)e.phase-=2*Math.PI;var n=e.phase/Math.PI/2*e.waveLength,a=e.cx-e.radius+n-2*e.radius;t.moveTo(a,e.waterLevel);for(var o=0,s=0;s [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\n for (var key in this.data) {\n this.data.hasOwnProperty(key) && cb(this.data[key], key);\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;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Displayable = __webpack_require__(7);\n\nvar zrUtil = __webpack_require__(0);\n\nvar PathProxy = __webpack_require__(9);\n\nvar pathContain = __webpack_require__(52);\n\nvar Pattern = __webpack_require__(58);\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\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]); // 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;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\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;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar vec2 = __webpack_require__(2);\n\nvar matrix = __webpack_require__(10);\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;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _vector = __webpack_require__(2);\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;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__5__;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {\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/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(34)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar zrUtil = __webpack_require__(0);\n\nvar Style = __webpack_require__(42);\n\nvar Element = __webpack_require__(17);\n\nvar RectText = __webpack_require__(50);\n\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\n this.__clipPaths = []; // 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 * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制\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 * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件\n * If ignore drawing of the displayable object. Mouse event will still be triggered\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 * z层level,决定绘画在哪层canvas中\n * @name module:/zrender/graphic/Displayable#zlevel\n * @type {number}\n * @default 0\n */\n zlevel: 0,\n\n /**\n * 是否可拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n draggable: false,\n\n /**\n * 是否正在拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n dragging: false,\n\n /**\n * 是否相应鼠标事件\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 * 图形绘制方法\n * @param {CanvasRenderingContext2D} ctx\n */\n // Interface\n brush: function (ctx, prevEl) {},\n\n /**\n * 获取最小包围盒\n * @return {module:zrender/core/BoundingRect}\n */\n // Interface\n getBoundingRect: function () {},\n\n /**\n * 判断坐标 x, y 是否在图形上\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 * 判断坐标 x, y 是否在图形的包围盒上\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 * 标记图形元素为脏,并且在下一帧重绘\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 * 图形是否会触发事件\n * If displayable object binded any event\n * @return {boolean}\n */\n // TODO, 通过 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};\nzrUtil.inherits(Displayable, Element);\nzrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);\n\nvar _default = Displayable;\nmodule.exports = _default;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\nvar 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;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar curve = __webpack_require__(4);\n\nvar vec2 = __webpack_require__(2);\n\nvar bbox = __webpack_require__(51);\n\nvar BoundingRect = __webpack_require__(3);\n\nvar _config = __webpack_require__(21);\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\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) {\n this._ux = mathAbs(1 / dpr / sx) || 0;\n this._uy = mathAbs(1 / 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, y0;\n var xi, yi;\n var x, 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/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n/**\n * 3x2矩阵操作类\n * @exports zrender/tool/matrix\n */\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;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar LRU = __webpack_require__(20);\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;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar zrUtil = __webpack_require__(0);\n\nvar env = __webpack_require__(13);\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/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n/**\n * echarts设备环境识别\n *\n * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。\n * @author firede[firede@firede.us]\n * @desc thanks zepto.\n */\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: 'onpointerdown' in window // 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 // 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 && (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\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _util = __webpack_require__(0);\n\nvar createHashMap = _util.createHashMap;\nvar isTypedArray = _util.isTypedArray;\n\nvar _clazz = __webpack_require__(36);\n\nvar enableClassCheck = _clazz.enableClassCheck;\n\nvar _sourceType = __webpack_require__(15);\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/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\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* 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/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\nvar 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;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar guid = __webpack_require__(43);\n\nvar Eventful = __webpack_require__(44);\n\nvar Transformable = __webpack_require__(18);\n\nvar Animatable = __webpack_require__(45);\n\nvar zrUtil = __webpack_require__(0);\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;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar matrix = __webpack_require__(10);\n\nvar vector = __webpack_require__(2);\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\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar LRU = __webpack_require__(20);\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;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n// 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;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nvar 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日志选项:catchBrushException为true下有效\n * 0 : 不生成debug数据,发布用\n * 1 : 异常抛出,调试用\n * 2 : 控制台输出,调试用\n */\n\n\nvar debugMode = 0; // retina 屏幕优化\n\nvar devicePixelRatio = dpr;\nexports.debugMode = debugMode;\nexports.devicePixelRatio = devicePixelRatio;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _util = __webpack_require__(0);\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 = __webpack_require__(23);\n\nvar roundRectHelper = __webpack_require__(24);\n\nvar imageHelper = __webpack_require__(11);\n\nvar fixShadow = __webpack_require__(16);\n\nvar _constant = __webpack_require__(8);\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']];\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(outerHeight, 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(outerHeight, 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(blockHeiht, 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 = textContain.adjustTextPositionOnRect(textPosition, rect, style.textDistance);\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 return {\n baseX: baseX,\n baseY: baseY,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\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.getStroke = getStroke;\nexports.getFill = getFill;\nexports.needDrawText = needDrawText;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar BoundingRect = __webpack_require__(3);\n\nvar imageHelper = __webpack_require__(11);\n\nvar _util = __webpack_require__(0);\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 * @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 x = rect.x;\n var y = rect.y;\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 return {\n x: x,\n y: y,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\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}\n * Notice: for performance, do not calculate outerWidth util needed.\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\n if (padding) {\n outerHeight += padding[0] + padding[2];\n }\n\n if (text && truncate) {\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 };\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.adjustTextPositionOnRect = adjustTextPositionOnRect;\nexports.truncateText = truncateText;\nexports.getLineHeight = getLineHeight;\nexports.measureText = measureText;\nexports.parsePlainText = parsePlainText;\nexports.parseRichText = parseRichText;\nexports.makeFont = makeFont;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\n/**\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;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\nvar 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;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar smoothSpline = __webpack_require__(68);\n\nvar smoothBezier = __webpack_require__(69);\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;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports) {\n\n/**\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]\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\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\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n } else {\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n } else {\n outputShape.y1 = y1;\n outputShape.y2 = y2;\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]\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\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 = 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 Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\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;\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\n/**\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;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(30);\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar echarts = __webpack_require__(5);\n\n__webpack_require__(31);\n__webpack_require__(38);\n\n\necharts.registerVisual(\n echarts.util.curry(\n __webpack_require__(80), 'liquidFill'\n )\n);\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar completeDimensions = __webpack_require__(32);\nvar echarts = __webpack_require__(5);\n\necharts.extendSeriesModel({\n\n type: 'series.liquidFill',\n\n visualColorAccessPath: 'textStyle.normal.color',\n\n optionUpdated: function () {\n var option = this.option;\n option.gridSize = Math.max(Math.floor(option.gridSize), 4);\n },\n\n getInitialData: function (option, ecModel) {\n var dimensions = completeDimensions(['value'], option.data);\n var list = new echarts.List(dimensions, this);\n list.initData(option.data);\n return list;\n },\n\n defaultOption: {\n color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'],\n center: ['50%', '50%'],\n radius: '50%',\n amplitude: '8%',\n waveLength: '80%',\n phase: 'auto',\n period: 'auto',\n direction: 'right',\n shape: 'circle',\n\n waveAnimation: true,\n animationEasing: 'linear',\n animationEasingUpdate: 'linear',\n animationDuration: 2000,\n animationDurationUpdate: 1000,\n\n outline: {\n show: true,\n borderDistance: 8,\n itemStyle: {\n color: 'none',\n borderColor: '#294D99',\n borderWidth: 8,\n shadowBlur: 20,\n shadowColor: 'rgba(0, 0, 0, 0.25)'\n }\n },\n\n backgroundStyle: {\n color: '#E3F7FF'\n },\n\n itemStyle: {\n opacity: 0.95,\n shadowBlur: 50,\n shadowColor: 'rgba(0, 0, 0, 0.4)'\n },\n\n label: {\n show: true,\n color: '#294D99',\n insideColor: '#fff',\n fontSize: 50,\n fontWeight: 'bold',\n\n align: 'center',\n baseline: 'middle',\n position: 'inside'\n },\n\n emphasis: {\n itemStyle: {\n opacity: 0.8\n }\n }\n }\n});\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _util = __webpack_require__(0);\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 = __webpack_require__(12);\n\nvar normalizeToArray = _model.normalizeToArray;\n\nvar _sourceHelper = __webpack_require__(33);\n\nvar guessOrdinal = _sourceHelper.guessOrdinal;\n\nvar Source = __webpack_require__(14);\n\nvar _dimensionHelper = __webpack_require__(37);\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\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 * Complete the dimensions array, by user defined `dimension` and `encode`,\n * and guessing from the data structure.\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 {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 * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.\n * @return {Array.} [{\n * name: string mandatory,\n * displayName: string, the origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * coordDim: string mandatory,\n * coordDimIndex: number mandatory,\n * type: string optional,\n * otherDims: { never null/undefined\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * },\n * isExtraCoord: boolean true if coord is generated\n * (not specified in encode and not series specified)\n * other props ...\n * }]\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 encodeDef = createHashMap(opt.encodeDef);\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] = {\n otherDims: {}\n }; // 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 } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\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 && 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] || {};\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)) {\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/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _config = __webpack_require__(6);\n\nvar __DEV__ = _config.__DEV__;\n\nvar _model = __webpack_require__(12);\n\nvar makeInner = _model.makeInner;\nvar getDataItemValue = _model.getDataItemValue;\n\nvar _referHelper = __webpack_require__(35);\n\nvar getCoordSysDefineBySeries = _referHelper.getCoordSysDefineBySeries;\n\nvar _util = __webpack_require__(0);\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 = __webpack_require__(14);\n\nvar _sourceType = __webpack_require__(15);\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*/\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); // Note: dataset option does not have `encode`.\n\n var encodeDefine = seriesOption.encode;\n\n if (!encodeDefine && datasetModel) {\n encodeDefine = makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult);\n }\n\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 encodeDefine: encodeDefine\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 var findPotentialName;\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 findPotentialName = true;\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n findPotentialName = true;\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 var potentialNameDimIndex;\n\n if (findPotentialName) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine),\n dimensionsDetectCount: dimensionsDetectCount,\n potentialNameDimIndex: potentialNameDimIndex // TODO: potentialIdDimIdx\n\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} // ??? TODO merge to completedimensions, where also has\n// default encode making logic. And the default rule\n// should depends on series? consider 'map'.\n\n\nfunction makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult) {\n var coordSysDefine = getCoordSysDefineBySeries(seriesModel);\n var encode = {}; // var encodeTooltip = [];\n // var encodeLabel = [];\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var seriesType = seriesModel.subType; // ??? TODO refactor: provide by series itself.\n // Consider the case: 'map' series is based on geo coordSys,\n // 'graph', 'heatmap' can be based on cartesian. But can not\n // give default rule simply here.\n\n var nSeriesMap = createHashMap(['pie', 'map', 'funnel']);\n var cSeriesMap = createHashMap(['line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot']); // Usually in this case series will use the first data\n // dimension as the \"value\" dimension, or other default\n // processes respectively.\n\n if (coordSysDefine && cSeriesMap.get(seriesType) != null) {\n var ecModel = seriesModel.ecModel;\n var datasetMap = inner(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + seriesLayoutBy;\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: 1,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordSysDefine.coordSysDims, function (coordDim) {\n // In value way.\n if (coordSysDefine.firstCategoryDimIndex == null) {\n var dataDim = datasetRecord.valueWayDim++;\n encode[coordDim] = dataDim; // ??? 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\n encodeSeriesName.push(dataDim); // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n } // In category way, category axis.\n else if (coordSysDefine.categoryAxisMap.get(coordDim)) {\n encode[coordDim] = 0;\n encodeItemName.push(0);\n } // In category way, non-category axis.\n else {\n var dataDim = datasetRecord.categoryWayDim++;\n encode[coordDim] = dataDim; // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n\n encodeSeriesName.push(dataDim);\n }\n });\n } // Do not make a complex rule! Hard to code maintain and not necessary.\n // ??? TODO refactor: provide by series itself.\n // [{name: ..., value: ...}, ...] like:\n else if (nSeriesMap.get(seriesType) != null) {\n // Find the first not ordinal. (5 is an experience value)\n var firstNotOrdinal;\n\n for (var i = 0; i < 5 && firstNotOrdinal == null; i++) {\n if (!doGuessOrdinal(data, sourceFormat, seriesLayoutBy, completeResult.dimensionsDefine, completeResult.startIndex, i)) {\n firstNotOrdinal = i;\n }\n }\n\n if (firstNotOrdinal != null) {\n encode.value = firstNotOrdinal;\n var nameDimIndex = completeResult.potentialNameDimIndex || Math.max(firstNotOrdinal - 1, 0); // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encodeSeriesName.push(nameDimIndex);\n encodeItemName.push(nameDimIndex); // encodeTooltip.push(firstNotOrdinal);\n }\n } // encodeTooltip.length && (encode.tooltip = encodeTooltip);\n // encodeLabel.length && (encode.label = encodeLabel);\n\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\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 {boolean} Whether ordinal.\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\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 false;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n\n if (dimensionsDefine) {\n dimName = dimensionsDefine[dimIndex];\n dimName = isObject(dimName) ? dimName.name : dimName;\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;\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;\n }\n\n var sample = data[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return false;\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 false;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n if (val != null && isFinite(val) && val !== '') {\n return false;\n } else if (isString(val) && val !== '-') {\n return true;\n }\n }\n\n return false;\n}\n\nexports.detectSourceFormat = detectSourceFormat;\nexports.getSource = getSource;\nexports.resetSourceDefaulter = resetSourceDefaulter;\nexports.prepareSource = prepareSource;\nexports.guessOrdinal = guessOrdinal;\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _config = __webpack_require__(6);\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = __webpack_require__(0);\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 * @return {Object} 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 * // It also indicate that whether there is category axis.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction getCoordSysDefineBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = {\n coordSysName: coordSysName,\n coordSysDims: [],\n axisMap: createHashMap(),\n categoryAxisMap: createHashMap()\n };\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 = 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 = 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.getCoordSysDefineBySeries = getCoordSysDefineBySeries;\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _config = __webpack_require__(6);\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = __webpack_require__(0);\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/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _util = __webpack_require__(0);\n\nvar each = _util.each;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\n\nvar _config = __webpack_require__(6);\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 = [];\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n var coordDimArr = encode[coordDim];\n\n if (!encode.hasOwnProperty(coordDim)) {\n coordDimArr = encode[coordDim] = [];\n }\n\n coordDimArr[dimItem.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 }\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n OTHER_DIMENSIONS.each(function (v, otherDim) {\n var otherDimArr = encode[otherDim];\n\n if (!encode.hasOwnProperty(otherDim)) {\n otherDimArr = encode[otherDim] = [];\n }\n\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n otherDimArr[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 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/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar echarts = __webpack_require__(5);\nvar numberUtil = echarts.number;\nvar symbolUtil = __webpack_require__(39);\nvar parsePercent = numberUtil.parsePercent;\n\nvar LiquidLayout = __webpack_require__(79);\n\nfunction getShallow(model, path) {\n return model && model.getShallow(path);\n}\n\necharts.extendChartView({\n\n type: 'liquidFill',\n\n render: function (seriesModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n var data = seriesModel.getData();\n\n var itemModel = data.getItemModel(0);\n\n var center = itemModel.get('center');\n var radius = itemModel.get('radius');\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n // itemStyle\n var outlineDistance = 0;\n var outlineBorderWidth = 0;\n var showOutline = seriesModel.get('outline.show');\n\n if (showOutline) {\n outlineDistance = seriesModel.get('outline.borderDistance');\n outlineBorderWidth = parsePercent(\n seriesModel.get('outline.itemStyle.borderWidth'), size\n );\n }\n\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n\n var outterRadius;\n var innerRadius;\n var paddingRadius;\n\n var isFillContainer = false;\n\n var symbol = seriesModel.get('shape');\n if (symbol === 'container') {\n // a shape that fully fills the container\n isFillContainer = true;\n\n outterRadius = [\n width / 2,\n height / 2\n ];\n innerRadius = [\n outterRadius[0] - outlineBorderWidth / 2,\n outterRadius[1] - outlineBorderWidth / 2\n ];\n paddingRadius = [\n parsePercent(outlineDistance, width),\n parsePercent(outlineDistance, height)\n ];\n\n radius = [\n Math.max(innerRadius[0] - paddingRadius[0], 0),\n Math.max(innerRadius[1] - paddingRadius[1], 0)\n ];\n }\n else {\n outterRadius = parsePercent(radius, size) / 2;\n innerRadius = outterRadius - outlineBorderWidth / 2;\n paddingRadius = parsePercent(outlineDistance, size);\n\n radius = Math.max(innerRadius - paddingRadius, 0);\n }\n\n if (showOutline) {\n var outline = getOutline();\n outline.style.lineWidth = outlineBorderWidth;\n group.add(getOutline());\n }\n\n var left = isFillContainer ? 0 : cx - radius;\n var top = isFillContainer ? 0 : cy - radius;\n\n var wavePath = null;\n\n group.add(getBackground());\n\n // each data item for a wave\n var oldData = this._data;\n var waves = [];\n data.diff(oldData)\n .add(function (idx) {\n var wave = getWave(idx, false);\n\n var waterLevel = wave.shape.waterLevel;\n wave.shape.waterLevel = isFillContainer ? height / 2 : radius;\n echarts.graphic.initProps(wave, {\n shape: {\n waterLevel: waterLevel\n }\n }, seriesModel);\n\n wave.z2 = 2;\n setWaveAnimation(idx, wave, null);\n\n group.add(wave);\n data.setItemGraphicEl(idx, wave);\n waves.push(wave);\n })\n .update(function (newIdx, oldIdx) {\n var waveElement = oldData.getItemGraphicEl(oldIdx);\n\n // new wave is used to calculate position, but not added\n var newWave = getWave(newIdx, false, waveElement);\n\n // changes with animation\n var shape = {};\n var shapeAttrs = ['amplitude', 'cx', 'cy', 'phase', 'radius', 'radiusY', 'waterLevel', 'waveLength'];\n for (var i = 0; i < shapeAttrs.length; ++i) {\n var attr = shapeAttrs[i];\n if (newWave.shape.hasOwnProperty(attr)) {\n shape[attr] = newWave.shape[attr];\n }\n }\n\n var style = {};\n var styleAttrs = ['fill', 'opacity', 'shadowBlur', 'shadowColor'];\n for (var i = 0; i < styleAttrs.length; ++i) {\n var attr = styleAttrs[i];\n if (newWave.style.hasOwnProperty(attr)) {\n style[attr] = newWave.style[attr];\n }\n }\n\n if (isFillContainer) {\n shape.radiusY = height / 2;\n }\n\n // changes with animation\n echarts.graphic.updateProps(waveElement, {\n shape: shape,\n style: style\n }, seriesModel);\n\n // instant changes\n waveElement.position = newWave.position;\n waveElement.setClipPath(newWave.clipPath);\n waveElement.shape.inverse = newWave.inverse;\n\n setWaveAnimation(newIdx, waveElement, waveElement);\n group.add(waveElement);\n data.setItemGraphicEl(newIdx, waveElement);\n waves.push(waveElement);\n })\n .remove(function (idx) {\n var wave = oldData.getItemGraphicEl(idx);\n group.remove(wave);\n })\n .execute();\n\n if (itemModel.get('label.show')) {\n group.add(getText(waves));\n }\n\n this._data = data;\n\n /**\n * Get path for outline, background and clipping\n *\n * @param {number} r outter radius of shape\n * @param {boolean|undefined} isForClipping if the shape is used\n * for clipping\n */\n function getPath(r, isForClipping) {\n if (symbol) {\n // customed symbol path\n if (symbol.indexOf('path://') === 0) {\n var path = echarts.graphic.makePath(symbol.slice(7), {});\n var bouding = path.getBoundingRect();\n var w = bouding.width;\n var h = bouding.height;\n if (w > h) {\n h = r * 2 / w * h;\n w = r * 2;\n }\n else {\n w = r * 2 / h * w;\n h = r * 2;\n }\n\n var left = isForClipping ? 0 : cx - w / 2;\n var top = isForClipping ? 0 : cy - h / 2;\n path = echarts.graphic.makePath(\n symbol.slice(7),\n {},\n new echarts.graphic.BoundingRect(left, top, w, h)\n );\n if (isForClipping) {\n path.position = [-w / 2, -h / 2];\n }\n return path;\n }\n else if (isFillContainer) {\n // fully fill the container\n var x = isForClipping ? -r[0] : cx - r[0];\n var y = isForClipping ? -r[1] : cy - r[1];\n return symbolUtil.createSymbol(\n 'rect', x, y, r[0] * 2, r[1] * 2\n );\n }\n else {\n var x = isForClipping ? -r : cx - r;\n var y = isForClipping ? -r : cy - r;\n if (symbol === 'pin') {\n y += r;\n }\n else if (symbol === 'arrow') {\n y -= r;\n }\n return symbolUtil.createSymbol(symbol, x, y, r * 2, r * 2);\n }\n }\n\n return new echarts.graphic.Circle({\n shape: {\n cx: isForClipping ? 0 : cx,\n cy: isForClipping ? 0 : cy,\n r: r\n }\n });\n }\n /**\n * Create outline\n */\n function getOutline() {\n var outlinePath = getPath(outterRadius);\n outlinePath.style.fill = null;\n\n outlinePath.setStyle(seriesModel.getModel('outline.itemStyle')\n .getItemStyle());\n\n return outlinePath;\n }\n\n /**\n * Create background\n */\n function getBackground() {\n // Seperate stroke and fill, so we can use stroke to cover the alias of clipping.\n var strokePath = getPath(radius);\n strokePath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n strokePath.style.fill = null;\n\n // Stroke is front of wave\n strokePath.z2 = 5;\n\n var fillPath = getPath(radius);\n fillPath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n fillPath.style.stroke = null;\n\n var group = new echarts.graphic.Group();\n group.add(strokePath);\n group.add(fillPath);\n\n return group;\n }\n\n /**\n * wave shape\n */\n function getWave(idx, isInverse, oldWave) {\n var radiusX = isFillContainer ? radius[0] : radius;\n var radiusY = isFillContainer ? height / 2 : radius;\n\n var itemModel = data.getItemModel(idx);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var phase = itemModel.get('phase');\n var amplitude = parsePercent(itemModel.get('amplitude'),\n radiusY * 2);\n var waveLength = parsePercent(itemModel.get('waveLength'),\n radiusX * 2);\n\n var value = data.get('value', idx);\n var waterLevel = radiusY - value * radiusY * 2;\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n var normalStyle = itemStyleModel.getItemStyle();\n if (!normalStyle.fill) {\n var seriesColor = seriesModel.get('color');\n var id = idx % seriesColor.length;\n normalStyle.fill = seriesColor[id];\n }\n\n var x = radiusX * 2;\n var wave = new LiquidLayout({\n shape: {\n waveLength: waveLength,\n radius: radiusX,\n radiusY: radiusY,\n cx: x,\n cy: 0,\n waterLevel: waterLevel,\n amplitude: amplitude,\n phase: phase,\n inverse: isInverse\n },\n style: normalStyle,\n position: [cx, cy]\n });\n wave.shape._waterLevel = waterLevel;\n\n var hoverStyle = itemModel.getModel('emphasis.itemStyle')\n .getItemStyle();\n hoverStyle.lineWidth = 0;\n echarts.graphic.setHoverStyle(wave, hoverStyle);\n\n // clip out the part outside the circle\n var clip = getPath(radius, true);\n // set fill for clipPath, otherwise it will not trigger hover event\n clip.setStyle({\n fill: 'white'\n });\n wave.setClipPath(clip);\n\n return wave;\n }\n\n function setWaveAnimation(idx, wave, oldWave) {\n var itemModel = data.getItemModel(idx);\n\n var maxSpeed = itemModel.get('period');\n var direction = itemModel.get('direction');\n\n var value = data.get('value', idx);\n\n var phase = itemModel.get('phase');\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n\n var defaultSpeed = function (maxSpeed) {\n var cnt = data.count();\n return cnt === 0 ? maxSpeed : maxSpeed *\n (0.2 + (cnt - idx) / cnt * 0.8);\n };\n var speed = 0;\n if (maxSpeed === 'auto') {\n speed = defaultSpeed(5000);\n }\n else {\n speed = typeof maxSpeed === 'function'\n ? maxSpeed(value, idx) : maxSpeed;\n }\n\n // phase for moving left/right\n var phaseOffset = 0;\n if (direction === 'right' || direction == null) {\n phaseOffset = Math.PI;\n }\n else if (direction === 'left') {\n phaseOffset = -Math.PI;\n }\n else if (direction === 'none') {\n phaseOffset = 0;\n }\n else {\n console.error('Illegal direction value for liquid fill.');\n }\n\n // wave animation of moving left/right\n if (direction !== 'none' && itemModel.get('waveAnimation')) {\n wave\n .animate('shape', true)\n .when(0, {\n phase: phase\n })\n .when(speed / 2, {\n phase: phaseOffset + phase\n })\n .when(speed, {\n phase: phaseOffset * 2 + phase\n })\n .during(function () {\n if (wavePath) {\n wavePath.dirty(true);\n }\n })\n .start();\n }\n }\n\n /**\n * text on wave\n */\n function getText(waves) {\n var labelModel = itemModel.getModel('label');\n\n function formatLabel() {\n var formatted = seriesModel.getFormattedLabel(0, 'normal');\n var defaultVal = (data.get('value', 0) * 100);\n var defaultLabel = data.getName(0) || seriesModel.name;\n if (!isNaN(defaultVal)) {\n defaultLabel = defaultVal.toFixed(0) + '%';\n }\n return formatted == null ? defaultLabel : formatted;\n }\n\n var textOption = {\n z2: 10,\n shape: {\n x: left,\n y: top,\n width: (isFillContainer ? radius[0] : radius) * 2,\n height: (isFillContainer ? radius[1] : radius) * 2\n },\n style: {\n fill: 'transparent',\n text: formatLabel(),\n textAlign: labelModel.get('align'),\n textVerticalAlign: labelModel.get('baseline')\n },\n silent: true\n };\n\n var outsideTextRect = new echarts.graphic.Rect(textOption);\n var color = labelModel.get('color');\n echarts.graphic.setText(outsideTextRect.style, labelModel, color);\n\n var insideTextRect = new echarts.graphic.Rect(textOption);\n var insColor = labelModel.get('insideColor');\n echarts.graphic.setText(insideTextRect.style, labelModel, insColor);\n insideTextRect.style.textFill = insColor;\n\n var group = new echarts.graphic.Group();\n group.add(outsideTextRect);\n group.add(insideTextRect);\n\n // clip out waves for insideText\n var boundingCircle = getPath(radius, true);\n\n wavePath = new echarts.graphic.CompoundPath({\n shape: {\n paths: waves\n },\n position: [cx, cy]\n });\n\n wavePath.setClipPath(boundingCircle);\n insideTextRect.setClipPath(wavePath);\n\n return group;\n }\n },\n\n dispose: function () {\n // dispose nothing here\n }\n});\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(40);\n\nvar BoundingRect = __webpack_require__(3);\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 beforeBrush: function () {\n var style = this.style;\n var shape = this.shape; // FIXME\n\n if (shape.symbolType === 'pin' && style.textPosition === 'inside') {\n style.textPosition = ['50%', '40%'];\n style.textAlign = 'center';\n style.textVerticalAlign = 'middle';\n }\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (shape.symbolType !== 'none') {\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/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar zrUtil = __webpack_require__(0);\n\nvar pathTool = __webpack_require__(41);\n\nvar colorTool = __webpack_require__(19);\n\nvar matrix = __webpack_require__(10);\n\nvar vector = __webpack_require__(2);\n\nvar Path = __webpack_require__(1);\n\nvar Transformable = __webpack_require__(18);\n\nvar ZImage = __webpack_require__(60);\n\nexports.Image = ZImage;\n\nvar Group = __webpack_require__(61);\n\nexports.Group = Group;\n\nvar Text = __webpack_require__(62);\n\nexports.Text = Text;\n\nvar Circle = __webpack_require__(63);\n\nexports.Circle = Circle;\n\nvar Sector = __webpack_require__(64);\n\nexports.Sector = Sector;\n\nvar Ring = __webpack_require__(66);\n\nexports.Ring = Ring;\n\nvar Polygon = __webpack_require__(67);\n\nexports.Polygon = Polygon;\n\nvar Polyline = __webpack_require__(70);\n\nexports.Polyline = Polyline;\n\nvar Rect = __webpack_require__(71);\n\nexports.Rect = Rect;\n\nvar Line = __webpack_require__(72);\n\nexports.Line = Line;\n\nvar BezierCurve = __webpack_require__(73);\n\nexports.BezierCurve = BezierCurve;\n\nvar Arc = __webpack_require__(74);\n\nexports.Arc = Arc;\n\nvar CompoundPath = __webpack_require__(75);\n\nexports.CompoundPath = CompoundPath;\n\nvar LinearGradient = __webpack_require__(76);\n\nexports.LinearGradient = LinearGradient;\n\nvar RadialGradient = __webpack_require__(77);\n\nexports.RadialGradient = RadialGradient;\n\nvar BoundingRect = __webpack_require__(3);\n\nexports.BoundingRect = BoundingRect;\n\nvar IncrementalDisplayable = __webpack_require__(78);\n\nexports.IncrementalDisplayable = IncrementalDisplayable;\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 round = Math.round;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar EMPTY_OBJ = {};\nvar Z2_EMPHASIS_LIFT = 1;\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 * 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 var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n\n if (round(shape.x1 * 2) === round(shape.x2 * 2)) {\n shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);\n }\n\n if (round(shape.y1 * 2) === round(shape.y2 * 2)) {\n shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);\n }\n\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 var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n var originX = shape.x;\n var originY = shape.y;\n var originWidth = shape.width;\n var originHeight = shape.height;\n shape.x = subPixelOptimize(shape.x, lineWidth, true);\n shape.y = subPixelOptimize(shape.y, lineWidth, true);\n shape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, originWidth === 0 ? 0 : 1);\n shape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, originHeight === 0 ? 0 : 1);\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\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\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 `doSingleEnterHover`.\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 doSingleEnterHover(el) {\n var hoverStl = el.__hoverStl;\n\n if (!hoverStl || el.__highlighted) {\n return;\n }\n\n var useHoverLayer = el.useHoverLayer;\n el.__highlighted = useHoverLayer ? 'layer' : 'plain';\n var zr = el.__zr;\n\n if (!zr && 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, where\n // only properties that is not `null/undefined` can be set. The disadventage:\n // null/undefined can not be used to remove style any more in `emphasis`.\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 doSingleLeaveHover(el) {\n var highlighted = el.__highlighted;\n\n if (!highlighted) {\n return;\n }\n\n el.__highlighted = false;\n\n if (highlighted === 'layer') {\n el.__zr && el.__zr.removeHover(el);\n } else if (highlighted) {\n var style = el.style;\n var normalStl = el.__cachedNormalStl;\n\n if (normalStl) {\n rollbackDefaultTextStyle(style); // Consider null/undefined value, should use\n // `setStyle` but not `extendFrom(stl, true)`.\n\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 traverseCall(el, method) {\n el.isGroup ? el.traverse(function (child) {\n !child.isGroup && method(child);\n }) : method(el);\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|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 * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`\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 && (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 doSingleLeaveHover(el);\n doSingleEnterHover(el);\n }\n}\n/**\n * Emphasis (called by API) has higher priority than `mouseover`.\n * When element has been called to be entered emphasis, mouse over\n * should not trigger the highlight effect (for example, animation\n * scale) again, and `mouseout` should not downplay the highlight\n * effect. So the listener of `mouseover` and `mouseout` should\n * check `isInEmphasis`.\n *\n * @param {module:zrender/Element} el\n * @return {boolean}\n */\n\n\nfunction isInEmphasis(el) {\n return el && el.__isEmphasisEntered;\n}\n\nfunction onElementMouseOver(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleEnterHover);\n}\n\nfunction onElementMouseOut(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleLeaveHover);\n}\n\nfunction enterEmphasis() {\n this.__isEmphasisEntered = true;\n traverseCall(this, doSingleEnterHover);\n}\n\nfunction leaveEmphasis() {\n this.__isEmphasisEntered = false;\n traverseCall(this, doSingleLeaveHover);\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 * @param {module:zrender/Element} el\n * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.\n * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`.\n */\n\n\nfunction setHoverStyle(el, hoverStyle, opt) {\n el.isGroup ? el.traverse(function (child) {\n // If element has sepcified hoverStyle, then use it instead of given hoverStyle\n // Often used when item group has a label element and it's hoverStyle is different\n !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle);\n }) : setElementHoverStyle(el, el.hoverStyle || hoverStyle);\n setAsHoverStyleTrigger(el, opt);\n}\n/**\n * @param {Object|boolean} [opt] If `false`, means disable trigger.\n * @param {boolean} [opt.hoverSilentOnTouch=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, hoverSilentOnTouch should be used to disable hover-highlight\n * on touch device.\n */\n\n\nfunction setAsHoverStyleTrigger(el, opt) {\n var disable = opt === false;\n el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n if (!disable || el.__hoverStyleTrigger) {\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\n\n el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis);\n el.__hoverStyleTrigger = !disable;\n }\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)`\n * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\n * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\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; // 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);\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) : 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 * 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 = 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 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\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); // Save original textPosition, because style.textPosition will be repalced by\n // real location (like [10, 30]) in zrender.\n\n textStyle.insideRawTextPosition = textStyle.textPosition;\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 opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`),\n // applyDefaultTextStyle works.\n\n if (!opt || textStyle.textFill != null) {\n return;\n }\n\n var useInsideStyle = opt.useInsideStyle;\n var textPosition = textStyle.insideRawTextPosition;\n var insideRollback;\n var autoColor = opt.autoColor;\n\n if (useInsideStyle !== false && (useInsideStyle === true || opt.isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0)) {\n insideRollback = {\n textFill: null,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\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 } else if (autoColor != null) {\n insideRollback = {\n textFill: null\n };\n textStyle.textFill = autoColor;\n } // Always set `insideRollback`, for clearing previous.\n\n\n if (insideRollback) {\n textStyle.insideRollback = insideRollback;\n }\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 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 // ecModel or default text style model.\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 if 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 if 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\nexports.Z2_EMPHASIS_LIFT = Z2_EMPHASIS_LIFT;\nexports.extendShape = extendShape;\nexports.extendPath = extendPath;\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.isInEmphasis = isInEmphasis;\nexports.setHoverStyle = setHoverStyle;\nexports.setAsHoverStyleTrigger = setAsHoverStyleTrigger;\nexports.setLabelStyle = setLabelStyle;\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;\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar PathProxy = __webpack_require__(9);\n\nvar transformPath = __webpack_require__(59);\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;\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar fixShadow = __webpack_require__(16);\n\nvar _constant = __webpack_require__(8);\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 * @type {Array.}\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 useful in Path and Image element\n * @type {boolean}\n */\n transformText: false,\n\n /**\n * Text rotate around position of Path or Image\n * Only useful in Path and Image element and transformText is false.\n */\n textRotation: 0,\n\n /**\n * Text origin of text rotation, like [10, 40].\n * Based on x, y of rect.\n * Useful in label rotation of circular symbol.\n * By default, this origin is textPosition.\n * Can be 'center'.\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;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports) {\n\n/**\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\n/***/ }),\n/* 44 */\n/***/ (function(module, exports) {\n\n/**\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] Call 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 * @param {Function} [handler] The event handler.\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\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Animator = __webpack_require__(46);\n\nvar log = __webpack_require__(49);\n\nvar _util = __webpack_require__(0);\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 modue: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 log('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;\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Clip = __webpack_require__(47);\n\nvar color = __webpack_require__(19);\n\nvar _util = __webpack_require__(0);\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 * 设置动画关键帧\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 * 开始执行动画\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 * 停止动画\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 * 设置动画延迟开始的时间\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 * 添加动画结束的回调\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;\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar easingFuncs = __webpack_require__(48);\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;\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports) {\n\n/**\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;\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _config = __webpack_require__(21);\n\nvar debugMode = _config.debugMode;\n\nvar log = function () {};\n\nif (debugMode === 1) {\n log = function () {\n for (var k in arguments) {\n throw new Error(arguments[k]);\n }\n };\n} else if (debugMode > 1) {\n log = function () {\n for (var k in arguments) {\n console.log(arguments[k]);\n }\n };\n}\n\nvar _default = log;\nmodule.exports = _default;\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar textHelper = __webpack_require__(22);\n\nvar BoundingRect = __webpack_require__(3);\n\nvar _constant = __webpack_require__(8);\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;\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar vec2 = __webpack_require__(2);\n\nvar curve = __webpack_require__(4);\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;\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar PathProxy = __webpack_require__(9);\n\nvar line = __webpack_require__(53);\n\nvar cubic = __webpack_require__(54);\n\nvar quadratic = __webpack_require__(55);\n\nvar arc = __webpack_require__(56);\n\nvar _util = __webpack_require__(25);\n\nvar normalizeRadian = _util.normalizeRadian;\n\nvar curve = __webpack_require__(4);\n\nvar windingLine = __webpack_require__(57);\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;\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports) {\n\n/**\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;\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar curve = __webpack_require__(4);\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;\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _curve = __webpack_require__(4);\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;\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _util = __webpack_require__(25);\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;\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports) {\n\nfunction 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;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\nvar 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;\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar PathProxy = __webpack_require__(9);\n\nvar _vector = __webpack_require__(2);\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;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Displayable = __webpack_require__(7);\n\nvar BoundingRect = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar imageHelper = __webpack_require__(11);\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;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar zrUtil = __webpack_require__(0);\n\nvar Element = __webpack_require__(17);\n\nvar BoundingRect = __webpack_require__(3);\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;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Displayable = __webpack_require__(7);\n\nvar zrUtil = __webpack_require__(0);\n\nvar textContain = __webpack_require__(23);\n\nvar textHelper = __webpack_require__(22);\n\nvar _constant = __webpack_require__(8);\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;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\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;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar fixClipWithShadow = __webpack_require__(65);\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;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar env = __webpack_require__(13);\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;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\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;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar polyHelper = __webpack_require__(26);\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;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _vector = __webpack_require__(2);\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;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _vector = __webpack_require__(2);\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;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar polyHelper = __webpack_require__(26);\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\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar roundRectHelper = __webpack_require__(24);\n\nvar _subPixelOptimize = __webpack_require__(27);\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;\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar _subPixelOptimize = __webpack_require__(27);\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;\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\n\nvar vec2 = __webpack_require__(2);\n\nvar _curve = __webpack_require__(4);\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;\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\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;\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Path = __webpack_require__(1);\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]);\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\n/***/ }),\n/* 76 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar zrUtil = __webpack_require__(0);\n\nvar Gradient = __webpack_require__(28);\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;\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar zrUtil = __webpack_require__(0);\n\nvar Gradient = __webpack_require__(28);\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;\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _util = __webpack_require__(0);\n\nvar inherits = _util.inherits;\n\nvar Displayble = __webpack_require__(7);\n\nvar BoundingRect = __webpack_require__(3);\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/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar echarts = __webpack_require__(5);\n\nmodule.exports = echarts.graphic.extendShape({\n type: 'ec-liquid-fill',\n\n shape: {\n waveLength: 0,\n radius: 0,\n radiusY: 0,\n cx: 0,\n cy: 0,\n waterLevel: 0,\n amplitude: 0,\n phase: 0,\n inverse: false\n },\n\n buildPath: function (ctx, shape) {\n if (shape.radiusY == null) {\n shape.radiusY = shape.radius;\n }\n\n /**\n * We define a sine wave having 4 waves, and make sure at least 8 curves\n * is drawn. Otherwise, it may cause blank area for some waves when\n * wave length is large enough.\n */\n var curves = Math.max(\n Math.ceil(2 * shape.radius / shape.waveLength * 4) * 2,\n 8\n );\n\n // map phase to [-Math.PI * 2, 0]\n while (shape.phase < -Math.PI * 2) {\n shape.phase += Math.PI * 2;\n }\n while (shape.phase > 0) {\n shape.phase -= Math.PI * 2;\n }\n var phase = shape.phase / Math.PI / 2 * shape.waveLength;\n\n var left = shape.cx - shape.radius + phase - shape.radius * 2;\n\n /**\n * top-left corner as start point\n *\n * draws this point\n * |\n * \\|/\n * ~~~~~~~~\n * | |\n * +------+\n */\n ctx.moveTo(left, shape.waterLevel);\n\n /**\n * top wave\n *\n * ~~~~~~~~ <- draws this sine wave\n * | |\n * +------+\n */\n var waveRight = 0;\n for (var c = 0; c < curves; ++c) {\n var stage = c % 4;\n var pos = getWaterPositions(c * shape.waveLength / 4, stage,\n shape.waveLength, shape.amplitude);\n ctx.bezierCurveTo(pos[0][0] + left, -pos[0][1] + shape.waterLevel,\n pos[1][0] + left, -pos[1][1] + shape.waterLevel,\n pos[2][0] + left, -pos[2][1] + shape.waterLevel);\n\n if (c === curves - 1) {\n waveRight = pos[2][0];\n }\n }\n\n if (shape.inverse) {\n /**\n * top-right corner\n * 2. draws this line\n * |\n * +------+\n * 3. draws this line -> | | <- 1. draws this line\n * ~~~~~~~~\n */\n ctx.lineTo(waveRight + left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n else {\n /**\n * top-right corner\n *\n * ~~~~~~~~\n * 3. draws this line -> | | <- 1. draws this line\n * +------+\n * ^\n * |\n * 2. draws this line\n */\n ctx.lineTo(waveRight + left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n\n ctx.closePath();\n }\n});\n\n\n\n/**\n * Using Bezier curves to fit sine wave.\n * There is 4 control points for each curve of wave,\n * which is at 1/4 wave length of the sine wave.\n *\n * The control points for a wave from (a) to (d) are a-b-c-d:\n * c *----* d\n * b *\n * |\n * ... a * ..................\n *\n * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1)\n *\n * @param {number} x x position of the left-most point (a)\n * @param {number} stage 0-3, stating which part of the wave it is\n * @param {number} waveLength wave length of the sine wave\n * @param {number} amplitude wave amplitude\n */\nfunction getWaterPositions(x, stage, waveLength, amplitude) {\n if (stage === 0) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, amplitude],\n [x + waveLength / 4, amplitude]\n ];\n }\n else if (stage === 1) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n else if (stage === 2) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, -amplitude],\n [x + waveLength / 4, -amplitude]\n ]\n }\n else {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n -amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n -amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n}\n\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\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\nvar _util = __webpack_require__(0);\n\nvar createHashMap = _util.createHashMap;\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// Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nfunction _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}\n\nmodule.exports = _default;\n\n/***/ })\n/******/ ]);\n});"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 29);\n","/**\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 clazz.prototype[prop] = clazzPrototype[prop];\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 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\n for (var key in this.data) {\n this.data.hasOwnProperty(key) && cb(this.data[key], key);\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;","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\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]); // 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 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;","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 _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;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","\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__;","var zrUtil = require(\"../core/util\");\n\nvar Style = require(\"./Style\");\n\nvar Element = require(\"../Element\");\n\nvar RectText = require(\"./mixin/RectText\");\n\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\n this.__clipPaths = []; // 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 * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制\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 * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件\n * If ignore drawing of the displayable object. Mouse event will still be triggered\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 * z层level,决定绘画在哪层canvas中\n * @name module:/zrender/graphic/Displayable#zlevel\n * @type {number}\n * @default 0\n */\n zlevel: 0,\n\n /**\n * 是否可拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n draggable: false,\n\n /**\n * 是否正在拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n dragging: false,\n\n /**\n * 是否相应鼠标事件\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 * 图形绘制方法\n * @param {CanvasRenderingContext2D} ctx\n */\n // Interface\n brush: function (ctx, prevEl) {},\n\n /**\n * 获取最小包围盒\n * @return {module:zrender/core/BoundingRect}\n */\n // Interface\n getBoundingRect: function () {},\n\n /**\n * 判断坐标 x, y 是否在图形上\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 * 判断坐标 x, y 是否在图形的包围盒上\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 * 标记图形元素为脏,并且在下一帧重绘\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 * 图形是否会触发事件\n * If displayable object binded any event\n * @return {boolean}\n */\n // TODO, 通过 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};\nzrUtil.inherits(Displayable, Element);\nzrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);\n\nvar _default = Displayable;\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 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\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) {\n this._ux = mathAbs(1 / dpr / sx) || 0;\n this._uy = mathAbs(1 / 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, y0;\n var xi, yi;\n var x, 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 * 3x2矩阵操作类\n * @exports zrender/tool/matrix\n */\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 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;","\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 * echarts设备环境识别\n *\n * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。\n * @author firede[firede@firede.us]\n * @desc thanks zepto.\n */\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: 'onpointerdown' in window // 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 // 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 && (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/*\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\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;","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 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 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;","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;","// 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 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日志选项:catchBrushException为true下有效\n * 0 : 不生成debug数据,发布用\n * 1 : 异常抛出,调试用\n * 2 : 控制台输出,调试用\n */\n\n\nvar debugMode = 0; // retina 屏幕优化\n\nvar devicePixelRatio = dpr;\nexports.debugMode = debugMode;\nexports.devicePixelRatio = devicePixelRatio;","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']];\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(outerHeight, 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(outerHeight, 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(blockHeiht, 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 = textContain.adjustTextPositionOnRect(textPosition, rect, style.textDistance);\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 return {\n baseX: baseX,\n baseY: baseY,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\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.getStroke = getStroke;\nexports.getFill = getFill;\nexports.needDrawText = needDrawText;","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 * @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 x = rect.x;\n var y = rect.y;\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 return {\n x: x,\n y: y,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\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}\n * Notice: for performance, do not calculate outerWidth util needed.\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\n if (padding) {\n outerHeight += padding[0] + padding[2];\n }\n\n if (text && truncate) {\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 };\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.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 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 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;","/**\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]\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\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\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n } else {\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n } else {\n outputShape.y1 = y1;\n outputShape.y2 = y2;\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]\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\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 = 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 Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\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;","/**\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;","module.exports = require('./src/liquidFill');\n","var echarts = require('echarts/lib/echarts');\n\nrequire('./liquidFillSeries');\nrequire('./liquidFillView');\n\n\necharts.registerVisual(\n echarts.util.curry(\n require('echarts/lib/visual/dataColor'), 'liquidFill'\n )\n);\n","var completeDimensions = require('echarts/lib/data/helper/completeDimensions');\nvar echarts = require('echarts/lib/echarts');\n\necharts.extendSeriesModel({\n\n type: 'series.liquidFill',\n\n visualColorAccessPath: 'textStyle.normal.color',\n\n optionUpdated: function () {\n var option = this.option;\n option.gridSize = Math.max(Math.floor(option.gridSize), 4);\n },\n\n getInitialData: function (option, ecModel) {\n var dimensions = completeDimensions(['value'], option.data);\n var list = new echarts.List(dimensions, this);\n list.initData(option.data);\n return list;\n },\n\n defaultOption: {\n color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'],\n center: ['50%', '50%'],\n radius: '50%',\n amplitude: '8%',\n waveLength: '80%',\n phase: 'auto',\n period: 'auto',\n direction: 'right',\n shape: 'circle',\n\n waveAnimation: true,\n animationEasing: 'linear',\n animationEasingUpdate: 'linear',\n animationDuration: 2000,\n animationDurationUpdate: 1000,\n\n outline: {\n show: true,\n borderDistance: 8,\n itemStyle: {\n color: 'none',\n borderColor: '#294D99',\n borderWidth: 8,\n shadowBlur: 20,\n shadowColor: 'rgba(0, 0, 0, 0.25)'\n }\n },\n\n backgroundStyle: {\n color: '#E3F7FF'\n },\n\n itemStyle: {\n opacity: 0.95,\n shadowBlur: 50,\n shadowColor: 'rgba(0, 0, 0, 0.4)'\n },\n\n label: {\n show: true,\n color: '#294D99',\n insideColor: '#fff',\n fontSize: 50,\n fontWeight: 'bold',\n\n align: 'center',\n baseline: 'middle',\n position: 'inside'\n },\n\n emphasis: {\n itemStyle: {\n opacity: 0.8\n }\n }\n }\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\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;\n\nvar Source = require(\"../Source\");\n\nvar _dimensionHelper = require(\"./dimensionHelper\");\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\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 * Complete the dimensions array, by user defined `dimension` and `encode`,\n * and guessing from the data structure.\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 {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 * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.\n * @return {Array.} [{\n * name: string mandatory,\n * displayName: string, the origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * coordDim: string mandatory,\n * coordDimIndex: number mandatory,\n * type: string optional,\n * otherDims: { never null/undefined\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * },\n * isExtraCoord: boolean true if coord is generated\n * (not specified in encode and not series specified)\n * other props ...\n * }]\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 encodeDef = createHashMap(opt.encodeDef);\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] = {\n otherDims: {}\n }; // 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 } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\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 && 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] || {};\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)) {\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 _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 _referHelper = require(\"../../model/referHelper\");\n\nvar getCoordSysDefineBySeries = _referHelper.getCoordSysDefineBySeries;\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*/\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); // Note: dataset option does not have `encode`.\n\n var encodeDefine = seriesOption.encode;\n\n if (!encodeDefine && datasetModel) {\n encodeDefine = makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult);\n }\n\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 encodeDefine: encodeDefine\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 var findPotentialName;\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 findPotentialName = true;\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n findPotentialName = true;\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 var potentialNameDimIndex;\n\n if (findPotentialName) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine),\n dimensionsDetectCount: dimensionsDetectCount,\n potentialNameDimIndex: potentialNameDimIndex // TODO: potentialIdDimIdx\n\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} // ??? TODO merge to completedimensions, where also has\n// default encode making logic. And the default rule\n// should depends on series? consider 'map'.\n\n\nfunction makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult) {\n var coordSysDefine = getCoordSysDefineBySeries(seriesModel);\n var encode = {}; // var encodeTooltip = [];\n // var encodeLabel = [];\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var seriesType = seriesModel.subType; // ??? TODO refactor: provide by series itself.\n // Consider the case: 'map' series is based on geo coordSys,\n // 'graph', 'heatmap' can be based on cartesian. But can not\n // give default rule simply here.\n\n var nSeriesMap = createHashMap(['pie', 'map', 'funnel']);\n var cSeriesMap = createHashMap(['line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot']); // Usually in this case series will use the first data\n // dimension as the \"value\" dimension, or other default\n // processes respectively.\n\n if (coordSysDefine && cSeriesMap.get(seriesType) != null) {\n var ecModel = seriesModel.ecModel;\n var datasetMap = inner(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + seriesLayoutBy;\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: 1,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordSysDefine.coordSysDims, function (coordDim) {\n // In value way.\n if (coordSysDefine.firstCategoryDimIndex == null) {\n var dataDim = datasetRecord.valueWayDim++;\n encode[coordDim] = dataDim; // ??? 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\n encodeSeriesName.push(dataDim); // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n } // In category way, category axis.\n else if (coordSysDefine.categoryAxisMap.get(coordDim)) {\n encode[coordDim] = 0;\n encodeItemName.push(0);\n } // In category way, non-category axis.\n else {\n var dataDim = datasetRecord.categoryWayDim++;\n encode[coordDim] = dataDim; // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n\n encodeSeriesName.push(dataDim);\n }\n });\n } // Do not make a complex rule! Hard to code maintain and not necessary.\n // ??? TODO refactor: provide by series itself.\n // [{name: ..., value: ...}, ...] like:\n else if (nSeriesMap.get(seriesType) != null) {\n // Find the first not ordinal. (5 is an experience value)\n var firstNotOrdinal;\n\n for (var i = 0; i < 5 && firstNotOrdinal == null; i++) {\n if (!doGuessOrdinal(data, sourceFormat, seriesLayoutBy, completeResult.dimensionsDefine, completeResult.startIndex, i)) {\n firstNotOrdinal = i;\n }\n }\n\n if (firstNotOrdinal != null) {\n encode.value = firstNotOrdinal;\n var nameDimIndex = completeResult.potentialNameDimIndex || Math.max(firstNotOrdinal - 1, 0); // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encodeSeriesName.push(nameDimIndex);\n encodeItemName.push(nameDimIndex); // encodeTooltip.push(firstNotOrdinal);\n }\n } // encodeTooltip.length && (encode.tooltip = encodeTooltip);\n // encodeLabel.length && (encode.label = encodeLabel);\n\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\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 {boolean} Whether ordinal.\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\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 false;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n\n if (dimensionsDefine) {\n dimName = dimensionsDefine[dimIndex];\n dimName = isObject(dimName) ? dimName.name : dimName;\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;\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;\n }\n\n var sample = data[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return false;\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 false;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n if (val != null && isFinite(val) && val !== '') {\n return false;\n } else if (isString(val) && val !== '-') {\n return true;\n }\n }\n\n return false;\n}\n\nexports.detectSourceFormat = detectSourceFormat;\nexports.getSource = getSource;\nexports.resetSourceDefaulter = resetSourceDefaulter;\nexports.prepareSource = prepareSource;\nexports.guessOrdinal = guessOrdinal;","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\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\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 * @return {Object} 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 * // It also indicate that whether there is category axis.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction getCoordSysDefineBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = {\n coordSysName: coordSysName,\n coordSysDims: [],\n axisMap: createHashMap(),\n categoryAxisMap: createHashMap()\n };\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 = 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 = 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.getCoordSysDefineBySeries = getCoordSysDefineBySeries;","\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 _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 = [];\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n var coordDimArr = encode[coordDim];\n\n if (!encode.hasOwnProperty(coordDim)) {\n coordDimArr = encode[coordDim] = [];\n }\n\n coordDimArr[dimItem.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 }\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n OTHER_DIMENSIONS.each(function (v, otherDim) {\n var otherDimArr = encode[otherDim];\n\n if (!encode.hasOwnProperty(otherDim)) {\n otherDimArr = encode[otherDim] = [];\n }\n\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n otherDimArr[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 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;","var echarts = require('echarts/lib/echarts');\nvar numberUtil = echarts.number;\nvar symbolUtil = require('echarts/lib/util/symbol');\nvar parsePercent = numberUtil.parsePercent;\n\nvar LiquidLayout = require('./liquidFillLayout');\n\nfunction getShallow(model, path) {\n return model && model.getShallow(path);\n}\n\necharts.extendChartView({\n\n type: 'liquidFill',\n\n render: function (seriesModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n var data = seriesModel.getData();\n\n var itemModel = data.getItemModel(0);\n\n var center = itemModel.get('center');\n var radius = itemModel.get('radius');\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n // itemStyle\n var outlineDistance = 0;\n var outlineBorderWidth = 0;\n var showOutline = seriesModel.get('outline.show');\n\n if (showOutline) {\n outlineDistance = seriesModel.get('outline.borderDistance');\n outlineBorderWidth = parsePercent(\n seriesModel.get('outline.itemStyle.borderWidth'), size\n );\n }\n\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n\n var outterRadius;\n var innerRadius;\n var paddingRadius;\n\n var isFillContainer = false;\n\n var symbol = seriesModel.get('shape');\n if (symbol === 'container') {\n // a shape that fully fills the container\n isFillContainer = true;\n\n outterRadius = [\n width / 2,\n height / 2\n ];\n innerRadius = [\n outterRadius[0] - outlineBorderWidth / 2,\n outterRadius[1] - outlineBorderWidth / 2\n ];\n paddingRadius = [\n parsePercent(outlineDistance, width),\n parsePercent(outlineDistance, height)\n ];\n\n radius = [\n Math.max(innerRadius[0] - paddingRadius[0], 0),\n Math.max(innerRadius[1] - paddingRadius[1], 0)\n ];\n }\n else {\n outterRadius = parsePercent(radius, size) / 2;\n innerRadius = outterRadius - outlineBorderWidth / 2;\n paddingRadius = parsePercent(outlineDistance, size);\n\n radius = Math.max(innerRadius - paddingRadius, 0);\n }\n\n if (showOutline) {\n var outline = getOutline();\n outline.style.lineWidth = outlineBorderWidth;\n group.add(getOutline());\n }\n\n var left = isFillContainer ? 0 : cx - radius;\n var top = isFillContainer ? 0 : cy - radius;\n\n var wavePath = null;\n\n group.add(getBackground());\n\n // each data item for a wave\n var oldData = this._data;\n var waves = [];\n data.diff(oldData)\n .add(function (idx) {\n var wave = getWave(idx, false);\n\n var waterLevel = wave.shape.waterLevel;\n wave.shape.waterLevel = isFillContainer ? height / 2 : radius;\n echarts.graphic.initProps(wave, {\n shape: {\n waterLevel: waterLevel\n }\n }, seriesModel);\n\n wave.z2 = 2;\n setWaveAnimation(idx, wave, null);\n\n group.add(wave);\n data.setItemGraphicEl(idx, wave);\n waves.push(wave);\n })\n .update(function (newIdx, oldIdx) {\n var waveElement = oldData.getItemGraphicEl(oldIdx);\n\n // new wave is used to calculate position, but not added\n var newWave = getWave(newIdx, false, waveElement);\n\n // changes with animation\n var shape = {};\n var shapeAttrs = ['amplitude', 'cx', 'cy', 'phase', 'radius', 'radiusY', 'waterLevel', 'waveLength'];\n for (var i = 0; i < shapeAttrs.length; ++i) {\n var attr = shapeAttrs[i];\n if (newWave.shape.hasOwnProperty(attr)) {\n shape[attr] = newWave.shape[attr];\n }\n }\n\n var style = {};\n var styleAttrs = ['fill', 'opacity', 'shadowBlur', 'shadowColor'];\n for (var i = 0; i < styleAttrs.length; ++i) {\n var attr = styleAttrs[i];\n if (newWave.style.hasOwnProperty(attr)) {\n style[attr] = newWave.style[attr];\n }\n }\n\n if (isFillContainer) {\n shape.radiusY = height / 2;\n }\n\n // changes with animation\n echarts.graphic.updateProps(waveElement, {\n shape: shape,\n style: style\n }, seriesModel);\n\n // instant changes\n waveElement.position = newWave.position;\n waveElement.setClipPath(newWave.clipPath);\n waveElement.shape.inverse = newWave.inverse;\n\n setWaveAnimation(newIdx, waveElement, waveElement);\n group.add(waveElement);\n data.setItemGraphicEl(newIdx, waveElement);\n waves.push(waveElement);\n })\n .remove(function (idx) {\n var wave = oldData.getItemGraphicEl(idx);\n group.remove(wave);\n })\n .execute();\n\n if (itemModel.get('label.show')) {\n group.add(getText(waves));\n }\n\n this._data = data;\n\n /**\n * Get path for outline, background and clipping\n *\n * @param {number} r outter radius of shape\n * @param {boolean|undefined} isForClipping if the shape is used\n * for clipping\n */\n function getPath(r, isForClipping) {\n if (symbol) {\n // customed symbol path\n if (symbol.indexOf('path://') === 0) {\n var path = echarts.graphic.makePath(symbol.slice(7), {});\n var bouding = path.getBoundingRect();\n var w = bouding.width;\n var h = bouding.height;\n if (w > h) {\n h = r * 2 / w * h;\n w = r * 2;\n }\n else {\n w = r * 2 / h * w;\n h = r * 2;\n }\n\n var left = isForClipping ? 0 : cx - w / 2;\n var top = isForClipping ? 0 : cy - h / 2;\n path = echarts.graphic.makePath(\n symbol.slice(7),\n {},\n new echarts.graphic.BoundingRect(left, top, w, h)\n );\n if (isForClipping) {\n path.position = [-w / 2, -h / 2];\n }\n return path;\n }\n else if (isFillContainer) {\n // fully fill the container\n var x = isForClipping ? -r[0] : cx - r[0];\n var y = isForClipping ? -r[1] : cy - r[1];\n return symbolUtil.createSymbol(\n 'rect', x, y, r[0] * 2, r[1] * 2\n );\n }\n else {\n var x = isForClipping ? -r : cx - r;\n var y = isForClipping ? -r : cy - r;\n if (symbol === 'pin') {\n y += r;\n }\n else if (symbol === 'arrow') {\n y -= r;\n }\n return symbolUtil.createSymbol(symbol, x, y, r * 2, r * 2);\n }\n }\n\n return new echarts.graphic.Circle({\n shape: {\n cx: isForClipping ? 0 : cx,\n cy: isForClipping ? 0 : cy,\n r: r\n }\n });\n }\n /**\n * Create outline\n */\n function getOutline() {\n var outlinePath = getPath(outterRadius);\n outlinePath.style.fill = null;\n\n outlinePath.setStyle(seriesModel.getModel('outline.itemStyle')\n .getItemStyle());\n\n return outlinePath;\n }\n\n /**\n * Create background\n */\n function getBackground() {\n // Seperate stroke and fill, so we can use stroke to cover the alias of clipping.\n var strokePath = getPath(radius);\n strokePath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n strokePath.style.fill = null;\n\n // Stroke is front of wave\n strokePath.z2 = 5;\n\n var fillPath = getPath(radius);\n fillPath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n fillPath.style.stroke = null;\n\n var group = new echarts.graphic.Group();\n group.add(strokePath);\n group.add(fillPath);\n\n return group;\n }\n\n /**\n * wave shape\n */\n function getWave(idx, isInverse, oldWave) {\n var radiusX = isFillContainer ? radius[0] : radius;\n var radiusY = isFillContainer ? height / 2 : radius;\n\n var itemModel = data.getItemModel(idx);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var phase = itemModel.get('phase');\n var amplitude = parsePercent(itemModel.get('amplitude'),\n radiusY * 2);\n var waveLength = parsePercent(itemModel.get('waveLength'),\n radiusX * 2);\n\n var value = data.get('value', idx);\n var waterLevel = radiusY - value * radiusY * 2;\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n var normalStyle = itemStyleModel.getItemStyle();\n if (!normalStyle.fill) {\n var seriesColor = seriesModel.get('color');\n var id = idx % seriesColor.length;\n normalStyle.fill = seriesColor[id];\n }\n\n var x = radiusX * 2;\n var wave = new LiquidLayout({\n shape: {\n waveLength: waveLength,\n radius: radiusX,\n radiusY: radiusY,\n cx: x,\n cy: 0,\n waterLevel: waterLevel,\n amplitude: amplitude,\n phase: phase,\n inverse: isInverse\n },\n style: normalStyle,\n position: [cx, cy]\n });\n wave.shape._waterLevel = waterLevel;\n\n var hoverStyle = itemModel.getModel('emphasis.itemStyle')\n .getItemStyle();\n hoverStyle.lineWidth = 0;\n echarts.graphic.setHoverStyle(wave, hoverStyle);\n\n // clip out the part outside the circle\n var clip = getPath(radius, true);\n // set fill for clipPath, otherwise it will not trigger hover event\n clip.setStyle({\n fill: 'white'\n });\n wave.setClipPath(clip);\n\n return wave;\n }\n\n function setWaveAnimation(idx, wave, oldWave) {\n var itemModel = data.getItemModel(idx);\n\n var maxSpeed = itemModel.get('period');\n var direction = itemModel.get('direction');\n\n var value = data.get('value', idx);\n\n var phase = itemModel.get('phase');\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n\n var defaultSpeed = function (maxSpeed) {\n var cnt = data.count();\n return cnt === 0 ? maxSpeed : maxSpeed *\n (0.2 + (cnt - idx) / cnt * 0.8);\n };\n var speed = 0;\n if (maxSpeed === 'auto') {\n speed = defaultSpeed(5000);\n }\n else {\n speed = typeof maxSpeed === 'function'\n ? maxSpeed(value, idx) : maxSpeed;\n }\n\n // phase for moving left/right\n var phaseOffset = 0;\n if (direction === 'right' || direction == null) {\n phaseOffset = Math.PI;\n }\n else if (direction === 'left') {\n phaseOffset = -Math.PI;\n }\n else if (direction === 'none') {\n phaseOffset = 0;\n }\n else {\n console.error('Illegal direction value for liquid fill.');\n }\n\n // wave animation of moving left/right\n if (direction !== 'none' && itemModel.get('waveAnimation')) {\n wave\n .animate('shape', true)\n .when(0, {\n phase: phase\n })\n .when(speed / 2, {\n phase: phaseOffset + phase\n })\n .when(speed, {\n phase: phaseOffset * 2 + phase\n })\n .during(function () {\n if (wavePath) {\n wavePath.dirty(true);\n }\n })\n .start();\n }\n }\n\n /**\n * text on wave\n */\n function getText(waves) {\n var labelModel = itemModel.getModel('label');\n\n function formatLabel() {\n var formatted = seriesModel.getFormattedLabel(0, 'normal');\n var defaultVal = (data.get('value', 0) * 100);\n var defaultLabel = data.getName(0) || seriesModel.name;\n if (!isNaN(defaultVal)) {\n defaultLabel = defaultVal.toFixed(0) + '%';\n }\n return formatted == null ? defaultLabel : formatted;\n }\n\n var textOption = {\n z2: 10,\n shape: {\n x: left,\n y: top,\n width: (isFillContainer ? radius[0] : radius) * 2,\n height: (isFillContainer ? radius[1] : radius) * 2\n },\n style: {\n fill: 'transparent',\n text: formatLabel(),\n textAlign: labelModel.get('align'),\n textVerticalAlign: labelModel.get('baseline')\n },\n silent: true\n };\n\n var outsideTextRect = new echarts.graphic.Rect(textOption);\n var color = labelModel.get('color');\n echarts.graphic.setText(outsideTextRect.style, labelModel, color);\n\n var insideTextRect = new echarts.graphic.Rect(textOption);\n var insColor = labelModel.get('insideColor');\n echarts.graphic.setText(insideTextRect.style, labelModel, insColor);\n insideTextRect.style.textFill = insColor;\n\n var group = new echarts.graphic.Group();\n group.add(outsideTextRect);\n group.add(insideTextRect);\n\n // clip out waves for insideText\n var boundingCircle = getPath(radius, true);\n\n wavePath = new echarts.graphic.CompoundPath({\n shape: {\n paths: waves\n },\n position: [cx, cy]\n });\n\n wavePath.setClipPath(boundingCircle);\n insideTextRect.setClipPath(wavePath);\n\n return group;\n }\n },\n\n dispose: function () {\n // dispose nothing here\n }\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\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar graphic = require(\"./graphic\");\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\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 beforeBrush: function () {\n var style = this.style;\n var shape = this.shape; // FIXME\n\n if (shape.symbolType === 'pin' && style.textPosition === 'inside') {\n style.textPosition = ['50%', '40%'];\n style.textAlign = 'center';\n style.textVerticalAlign = 'middle';\n }\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (shape.symbolType !== 'none') {\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 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\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 round = Math.round;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar EMPTY_OBJ = {};\nvar Z2_EMPHASIS_LIFT = 1;\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 * 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 var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n\n if (round(shape.x1 * 2) === round(shape.x2 * 2)) {\n shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);\n }\n\n if (round(shape.y1 * 2) === round(shape.y2 * 2)) {\n shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);\n }\n\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 var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n var originX = shape.x;\n var originY = shape.y;\n var originWidth = shape.width;\n var originHeight = shape.height;\n shape.x = subPixelOptimize(shape.x, lineWidth, true);\n shape.y = subPixelOptimize(shape.y, lineWidth, true);\n shape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, originWidth === 0 ? 0 : 1);\n shape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, originHeight === 0 ? 0 : 1);\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\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\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 `doSingleEnterHover`.\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 doSingleEnterHover(el) {\n var hoverStl = el.__hoverStl;\n\n if (!hoverStl || el.__highlighted) {\n return;\n }\n\n var useHoverLayer = el.useHoverLayer;\n el.__highlighted = useHoverLayer ? 'layer' : 'plain';\n var zr = el.__zr;\n\n if (!zr && 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, where\n // only properties that is not `null/undefined` can be set. The disadventage:\n // null/undefined can not be used to remove style any more in `emphasis`.\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 doSingleLeaveHover(el) {\n var highlighted = el.__highlighted;\n\n if (!highlighted) {\n return;\n }\n\n el.__highlighted = false;\n\n if (highlighted === 'layer') {\n el.__zr && el.__zr.removeHover(el);\n } else if (highlighted) {\n var style = el.style;\n var normalStl = el.__cachedNormalStl;\n\n if (normalStl) {\n rollbackDefaultTextStyle(style); // Consider null/undefined value, should use\n // `setStyle` but not `extendFrom(stl, true)`.\n\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 traverseCall(el, method) {\n el.isGroup ? el.traverse(function (child) {\n !child.isGroup && method(child);\n }) : method(el);\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|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 * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`\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 && (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 doSingleLeaveHover(el);\n doSingleEnterHover(el);\n }\n}\n/**\n * Emphasis (called by API) has higher priority than `mouseover`.\n * When element has been called to be entered emphasis, mouse over\n * should not trigger the highlight effect (for example, animation\n * scale) again, and `mouseout` should not downplay the highlight\n * effect. So the listener of `mouseover` and `mouseout` should\n * check `isInEmphasis`.\n *\n * @param {module:zrender/Element} el\n * @return {boolean}\n */\n\n\nfunction isInEmphasis(el) {\n return el && el.__isEmphasisEntered;\n}\n\nfunction onElementMouseOver(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleEnterHover);\n}\n\nfunction onElementMouseOut(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleLeaveHover);\n}\n\nfunction enterEmphasis() {\n this.__isEmphasisEntered = true;\n traverseCall(this, doSingleEnterHover);\n}\n\nfunction leaveEmphasis() {\n this.__isEmphasisEntered = false;\n traverseCall(this, doSingleLeaveHover);\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 * @param {module:zrender/Element} el\n * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.\n * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`.\n */\n\n\nfunction setHoverStyle(el, hoverStyle, opt) {\n el.isGroup ? el.traverse(function (child) {\n // If element has sepcified hoverStyle, then use it instead of given hoverStyle\n // Often used when item group has a label element and it's hoverStyle is different\n !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle);\n }) : setElementHoverStyle(el, el.hoverStyle || hoverStyle);\n setAsHoverStyleTrigger(el, opt);\n}\n/**\n * @param {Object|boolean} [opt] If `false`, means disable trigger.\n * @param {boolean} [opt.hoverSilentOnTouch=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, hoverSilentOnTouch should be used to disable hover-highlight\n * on touch device.\n */\n\n\nfunction setAsHoverStyleTrigger(el, opt) {\n var disable = opt === false;\n el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n if (!disable || el.__hoverStyleTrigger) {\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\n\n el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis);\n el.__hoverStyleTrigger = !disable;\n }\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)`\n * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\n * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\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; // 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);\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) : 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 * 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 = 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 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\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); // Save original textPosition, because style.textPosition will be repalced by\n // real location (like [10, 30]) in zrender.\n\n textStyle.insideRawTextPosition = textStyle.textPosition;\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 opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`),\n // applyDefaultTextStyle works.\n\n if (!opt || textStyle.textFill != null) {\n return;\n }\n\n var useInsideStyle = opt.useInsideStyle;\n var textPosition = textStyle.insideRawTextPosition;\n var insideRollback;\n var autoColor = opt.autoColor;\n\n if (useInsideStyle !== false && (useInsideStyle === true || opt.isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0)) {\n insideRollback = {\n textFill: null,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\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 } else if (autoColor != null) {\n insideRollback = {\n textFill: null\n };\n textStyle.textFill = autoColor;\n } // Always set `insideRollback`, for clearing previous.\n\n\n if (insideRollback) {\n textStyle.insideRollback = insideRollback;\n }\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 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 // ecModel or default text style model.\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 if 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 if 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\nexports.Z2_EMPHASIS_LIFT = Z2_EMPHASIS_LIFT;\nexports.extendShape = extendShape;\nexports.extendPath = extendPath;\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.isInEmphasis = isInEmphasis;\nexports.setHoverStyle = setHoverStyle;\nexports.setAsHoverStyleTrigger = setAsHoverStyleTrigger;\nexports.setLabelStyle = setLabelStyle;\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;","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 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 * @type {Array.}\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 useful in Path and Image element\n * @type {boolean}\n */\n transformText: false,\n\n /**\n * Text rotate around position of Path or Image\n * Only useful in Path and Image element and transformText is false.\n */\n textRotation: 0,\n\n /**\n * Text origin of text rotation, like [10, 40].\n * Based on x, y of rect.\n * Useful in label rotation of circular symbol.\n * By default, this origin is textPosition.\n * Can be 'center'.\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;","/**\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 * 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] Call 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 * @param {Function} [handler] The event handler.\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;","var Animator = require(\"../animation/Animator\");\n\nvar log = 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 modue: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 log('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 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 * 设置动画关键帧\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 * 开始执行动画\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 * 停止动画\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 * 设置动画延迟开始的时间\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 * 添加动画结束的回调\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 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;","/**\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 _config = require(\"../config\");\n\nvar debugMode = _config.debugMode;\n\nvar log = function () {};\n\nif (debugMode === 1) {\n log = function () {\n for (var k in arguments) {\n throw new Error(arguments[k]);\n }\n };\n} else if (debugMode > 1) {\n log = function () {\n for (var k in arguments) {\n console.log(arguments[k]);\n }\n };\n}\n\nvar _default = log;\nmodule.exports = _default;","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 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 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;","/**\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 _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 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 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 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 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;","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 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 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\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 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 _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 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;","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]);\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;","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;","var echarts = require('echarts/lib/echarts');\n\nmodule.exports = echarts.graphic.extendShape({\n type: 'ec-liquid-fill',\n\n shape: {\n waveLength: 0,\n radius: 0,\n radiusY: 0,\n cx: 0,\n cy: 0,\n waterLevel: 0,\n amplitude: 0,\n phase: 0,\n inverse: false\n },\n\n buildPath: function (ctx, shape) {\n if (shape.radiusY == null) {\n shape.radiusY = shape.radius;\n }\n\n /**\n * We define a sine wave having 4 waves, and make sure at least 8 curves\n * is drawn. Otherwise, it may cause blank area for some waves when\n * wave length is large enough.\n */\n var curves = Math.max(\n Math.ceil(2 * shape.radius / shape.waveLength * 4) * 2,\n 8\n );\n\n // map phase to [-Math.PI * 2, 0]\n while (shape.phase < -Math.PI * 2) {\n shape.phase += Math.PI * 2;\n }\n while (shape.phase > 0) {\n shape.phase -= Math.PI * 2;\n }\n var phase = shape.phase / Math.PI / 2 * shape.waveLength;\n\n var left = shape.cx - shape.radius + phase - shape.radius * 2;\n\n /**\n * top-left corner as start point\n *\n * draws this point\n * |\n * \\|/\n * ~~~~~~~~\n * | |\n * +------+\n */\n ctx.moveTo(left, shape.waterLevel);\n\n /**\n * top wave\n *\n * ~~~~~~~~ <- draws this sine wave\n * | |\n * +------+\n */\n var waveRight = 0;\n for (var c = 0; c < curves; ++c) {\n var stage = c % 4;\n var pos = getWaterPositions(c * shape.waveLength / 4, stage,\n shape.waveLength, shape.amplitude);\n ctx.bezierCurveTo(pos[0][0] + left, -pos[0][1] + shape.waterLevel,\n pos[1][0] + left, -pos[1][1] + shape.waterLevel,\n pos[2][0] + left, -pos[2][1] + shape.waterLevel);\n\n if (c === curves - 1) {\n waveRight = pos[2][0];\n }\n }\n\n if (shape.inverse) {\n /**\n * top-right corner\n * 2. draws this line\n * |\n * +------+\n * 3. draws this line -> | | <- 1. draws this line\n * ~~~~~~~~\n */\n ctx.lineTo(waveRight + left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n else {\n /**\n * top-right corner\n *\n * ~~~~~~~~\n * 3. draws this line -> | | <- 1. draws this line\n * +------+\n * ^\n * |\n * 2. draws this line\n */\n ctx.lineTo(waveRight + left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n\n ctx.closePath();\n }\n});\n\n\n\n/**\n * Using Bezier curves to fit sine wave.\n * There is 4 control points for each curve of wave,\n * which is at 1/4 wave length of the sine wave.\n *\n * The control points for a wave from (a) to (d) are a-b-c-d:\n * c *----* d\n * b *\n * |\n * ... a * ..................\n *\n * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1)\n *\n * @param {number} x x position of the left-most point (a)\n * @param {number} stage 0-3, stating which part of the wave it is\n * @param {number} waveLength wave length of the sine wave\n * @param {number} amplitude wave amplitude\n */\nfunction getWaterPositions(x, stage, waveLength, amplitude) {\n if (stage === 0) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, amplitude],\n [x + waveLength / 4, amplitude]\n ];\n }\n else if (stage === 1) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n else if (stage === 2) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, -amplitude],\n [x + waveLength / 4, -amplitude]\n ]\n }\n else {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n -amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n -amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\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\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\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// Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nfunction _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}\n\nmodule.exports = _default;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://echarts-liquidfill/echarts-liquidfill.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__5__","modules","installedModules","__webpack_require__","moduleId","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","BUILTIN_OBJECT","[object Function]","[object RegExp]","[object Date]","[object Error]","[object CanvasGradient]","[object CanvasPattern]","[object Image]","[object Canvas]","TYPED_ARRAY","[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","objToString","toString","arrayProto","Array","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","nativeReduce","reduce","methods","clone","source","result","typeStr","isPrimitive","len","length","Ctor","constructor","from","isDom","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","defaults","overlay","_ctx","createCanvas","each","obj","cb","context","func","args","arguments","apply","concat","type","nodeType","ownerDocument","document","createElement","HashMap","isArr","this","data","thisMap","visit","set","removeKey","$override","fn","mergeAll","targetAndSources","extend","getContext","indexOf","array","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","isArrayLike","push","memo","find","curry","isFunction","isString","isTypedArray","eqNaN","retrieve","values","retrieve2","value0","value1","retrieve3","value2","Function","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","setAsPrimitive","createHashMap","concatArray","a","b","newArray","offset","noop","Displayable","zrUtil","PathProxy","pathContain","getCanvasPattern","abs","Math","pathProxyForDraw","Path","opts","path","__dirtyPath","strokeContainThreshold","segmentIgnoreThreshold","subPixelOptimize","brush","ctx","prevEl","rect","style","hasStroke","hasFill","fill","stroke","hasFillGradient","colorStops","hasStrokeGradient","hasFillPattern","image","hasStrokePattern","setTransform","__dirty","getBoundingRect","_fillGradient","getGradient","_strokeGradient","fillStyle","strokeStyle","lineDash","lineDashOffset","ctxLineDash","setLineDash","scale","getGlobalScale","setScale","beginPath","setLineDashOffset","buildPath","shape","rebuildPath","fillOpacity","originalGlobalAlpha","globalAlpha","opacity","strokeOpacity","text","restoreTransform","drawRectText","shapeCfg","inBundle","createPathProxy","_rect","needsUpdateRect","rectWithStroke","_rectWithStroke","copy","w","lineWidth","lineScale","strokeNoScale","getLineScale","max","width","height","x","y","contain","localPos","transformCoordToLocal","pathData","containStroke","dirty","dirtyPath","__dirtyText","__zr","refresh","__clipTarget","animateShape","loop","animate","attrKV","setShape","transform","sqrt","Sub","extendFrom","defaultShape","thisShape","init","_default","ArrayCtor","Float32Array","v","lenSquare","lengthSquare","distance","v1","v2","dist","distanceSquare","distSquare","out","add","scaleAndAdd","sub","mul","div","dot","normalize","negate","lerp","applyTransform","min","lt","rb","lb","rt","vec2","matrix","v2ApplyTransform","mathMin","mathMax","BoundingRect","union","other","maxX","maxY","calculateTransform","sx","sy","translate","intersect","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","plain","_vector","v2Create","v2DistSquare","mathPow","pow","mathSqrt","THREE_SQRT","_v0","_v1","_v2","isAroundZero","isNotAroundZero","cubicAt","p0","p1","p2","p3","onet","quadraticAt","cubicDerivativeAt","cubicRootAt","roots","A","B","C","t1","disc","K","t2","discSqrt","Y1","Y2","T","theta","acos","ASqrt","tmp","cos","t3","sin","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","prev","next","d1","d2","interval","Infinity","_t","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","Style","Element","RectText","__clipPaths","invisible","z","z2","zlevel","draggable","dragging","silent","culling","cursor","rectHover","progressive","incremental","globalScaleRatio","beforeBrush","afterBrush","rectContain","traverse","coord","animateStyle","setStyle","useStyle","calculateTextPosition","ContextCachedBy","NONE","STYLE_BIND","PLAIN_TEXT","WILL_BE_RESTORED","curve","bbox","dpr","devicePixelRatio","CMD","M","L","Q","Z","R","min2","max2","mathCos","mathSin","mathAbs","hasTypedArray","notSaveData","_saveData","_xi","_yi","_x0","_y0","_ux","_uy","_len","_lineDash","_dashOffset","_dashIdx","_dashSum","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","startAngle","endAngle","anticlockwise","arcTo","radius","h","closePath","toStatic","lineDashSum","setData","appendPath","appendSize","appendPathData","k","cmd","_expandData","_prevCmd","newData","dash","idx","dashSum","dx","dy","nDash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","fromLine","fromCubic","fromQuadratic","rx","ry","fromArc","ux","uy","dTheta","psi","fs","scaleX","scaleY","rotate","global","dev","__DEV__","identity","m1","m2","out0","out1","out2","out3","out4","out5","rad","aa","ac","atx","ab","ad","aty","st","ct","vx","vy","invert","det","imageHelper","_util","textWidthCache","textWidthCacheCounter","STYLE_REG","getWidth","font","textLines","split","measureText","adjustTextX","textAlign","adjustTextY","textVerticalAlign","textPosition","textDistance","halfHeight","truncateText","containerWidth","ellipsis","options","prepareTruncateOptions","truncateSingleLine","join","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","j","subLength","estimateLength","floor","substr","charCode","charCodeAt","getLineHeight","parsePlainText","padding","textLineHeight","truncate","lineHeight","lines","outerHeight","canCacheByTextString","truncOuterHeight","truncOuterWidth","outerWidth","parseRichText","contentBlock","lastIndex","exec","matchedIndex","index","pushTokens","substring","contentHeight","pendingList","stlPadding","textPadding","truncateWidth","truncateHeight","line","tokens","tokenStyle","token","styleName","rich","tokenHeight","textHeight","textWidth","tokenWidth","tokenWidthNotSpecified","charAt","percentWidth","textBackgroundColor","bgImg","findExistImage","isImageReady","paddingW","remianTruncWidth","parseInt","block","isEmptyStr","strs","isLineHolder","tokensLen","DEFAULT_FONT","getRichTextRect","getPlainTextRect","adjustTextPositionOnRect","makeFont","fontSize","fontFamily","fontStyle","fontWeight","textFont","globalImageCache","imageOnLoad","cachedImgObj","__cachedImgObj","onload","onerror","pending","pendingWrap","cbPayload","hostEl","newImageOrSrc","createOrUpdateImage","__zrImageSrc","Image","put","src","round","position","positiveOrNegative","doubledPosition","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originX","originY","originWidth","originHeight","env","normalizeToArray","isIdInner","cptOption","id","innerUniqueIndex","has","defaultEmphasis","opt","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","Date","isDataItemOption","mappingToExists","exists","newCptOptions","exist","option","makeIdAndName","mapResult","idMap","item","existCpt","keyInfo","idNum","isNameSpecified","componentModel","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","random","toFixed","hostObj","parseFinder","ecModel","finder","defaultMainType","parsedKey","match","mainType","queryType","toLowerCase","includeMainTypes","queryParam","models","queryComponents","setAttribute","dom","getAttribute","getTooltipRenderMode","renderModeOption","domSupported","groupData","getKey","buckets","keys","wx","getSystemInfoSync","browser","os","node","wxa","canvasSupported","svgSupported","touchEventsSupported","self","worker","navigator","ua","firefox","ie","edge","weChat","test","version","SVGRect","pointerEventsSupported","detect","userAgent","enableClassCheck","_sourceType","SOURCE_FORMAT_ORIGINAL","SERIES_LAYOUT_BY_COLUMN","SOURCE_FORMAT_UNKNOWN","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_KEYED_COLUMNS","Source","fields","fromDataset","sourceFormat","seriesLayoutBy","dimensionsDefine","encodeDefine","startIndex","dimensionsDetectCount","seriesDataToSource","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SERIES_LAYOUT_BY_ROW","SHADOW_PROPS","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowBlur","textShadowOffsetX","textShadowOffsetY","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","propName","guid","Eventful","Transformable","Animatable","ignore","clipPath","isGroup","drift","decomposeTransform","beforeUpdate","afterUpdate","update","updateTransform","hide","show","attr","setClipPath","zr","addSelfToZr","removeClipPath","removeSelfFromZr","animators","animation","addAnimator","removeAnimator","vector","mIdentity","rotation","origin","transformableProto","needLocalTransform","scaleTmp","parent","parentHasTransform","getLocalTransform","relX","relY","invTransform","tmpTransform","originTransform","setLocalTransform","atan2","transformCoordToGlobal","LRU","kCSSColorTable","transparent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","clampCssByte","clampCssFloat","f","parseCssInt","parseFloat","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","iv","op","ep","fname","params","alpha","pop","hsla2rgba","hsla","rgba","fastLerp","normalizedValue","colors","leftIndex","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","fullOutput","color","stringify","mapToColor","arrColor","lift","level","colorArr","toHex","modifyHSL","H","S","G","vMin","vMax","delta","deltaR","deltaG","deltaB","rgba2hsla","modifyAlpha","LinkedList","head","tail","linkedListProto","insert","entry","Entry","insertEntry","remove","clear","maxSize","_list","_map","_maxSize","_lastRemovedEntry","LRUProto","list","removed","leastUsedEntry","debugMode","textContain","roundRectHelper","fixShadow","_constant","VALID_TEXT_ALIGN","left","right","center","VALID_TEXT_VERTICAL_ALIGN","top","bottom","middle","SHADOW_STYLE_COMMON_PROPS","_tmpTextPositionResult","_tmpBoxPositionResult","normalizeStyle","textBaseline","applyTextRotation","textRotation","textOrigin","placeToken","lineTop","needDrawBackground","drawBackground","getTextXForPadding","setCtx","textShadowColor","textStroke","getStroke","textStrokeWidth","textFill","getFill","strokeText","fillText","textBorderWidth","textBorderColor","isPlainBg","textBoxShadowColor","textBorderRadius","onBgImageLoaded","drawImage","getBoxPosition","baseX","baseY","parsePercent","res","textOffset","maxValue","lastIndexOf","normalizeTextStyle","renderText","__attrCachedBy","__textCotentBlock","boxPos","boxX","boxY","xLeft","xRight","tokenCount","usedWidth","lineXLeft","lineXRight","drawRichText","renderRichText","prevStyle","needDrawBg","checkCache","cachedByMe","styleFont","computedFont","__computedFont","__styleFont","textX","textY","propItem","styleProp","ctxProp","textStrokeWidthPrev","strokeWidthChanged","strokeChanged","renderPlainText","needDrawText","r1","r2","r3","r4","total","PI","PI2","normalizeRadian","angle","smoothSpline","smoothBezier","points","smooth","controlPoints","smoothConstraint","cp1","cp2","Gradient","addColorStop","echarts","registerVisual","util","completeDimensions","extendSeriesModel","visualColorAccessPath","optionUpdated","gridSize","getInitialData","dimensions","List","initData","defaultOption","amplitude","waveLength","phase","period","direction","waveAnimation","animationEasing","animationEasingUpdate","animationDuration","animationDurationUpdate","outline","borderDistance","itemStyle","borderColor","borderWidth","shadowColor","backgroundStyle","label","insideColor","align","baseline","_sourceHelper","guessOrdinal","BE_ORDINAL","OTHER_DIMENSIONS","DataDimensionInfo","genName","fromZero","sysDims","isInstance","dimsDef","dataDimNameMap","coordDimNameMap","dimCount","optDimCount","sysDimItem","sysDimItemDimsDef","getDimCount","dimDefItem","userDimName","resultItem","displayName","encodeDef","encodeDefaulter","dataDims","coordDim","validDataDims","resultDimIdx","applyDim","availDimIdx","coordDimIndex","otherDims","sysDimIndex","sysDimItemOtherDims","ordinalMeta","sysDimItemDimsDefItem","defaultTooltip","generateCoord","generateCoordCount","extra","isExtraCoord","Must","itemName","seriesName","_model","Might","Not","inner","normalizeDimensionsDefine","nameMap","count","arrayRowsTravelFirst","maxLoop","getDatasetModel","seriesModel","getComponent","datasetIndex","doGuessOrdinal","dimIndex","dimName","dimType","sample","detectValue","row","beStr","isFinite","detectSourceFormat","datasetModel","getSource","resetSourceDefaulter","datasetMap","prepareSource","seriesOption","sourceHeader","datasetOption","completeResult","firstIndex","objectRowsCollectDimensions","colArr","completeBySourceData","encode","makeSeriesEncodeForAxisCoordSys","coordDimensions","baseCategoryDimIndex","categoryWayValueDimStart","encodeItemName","encodeSeriesName","uid","coordDimInfo","coordDimIdx","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","pushDim","dimIdxArr","idxFrom","idxCount","coordDimName","start","makeSeriesEncodeForNameBased","potentialNameDimIndex","dim","idxResult","idxRes0","idxRes1","guessRecords","guessResult","isPureNumber","fulfilled","nameDimIndex","e","IS_CONTAINER","parseClassType","componentType","ret","main","classBase","superCall","methodName","superApply","enableClassExtend","RootClass","mandatoryMethods","$constructor","proto","ExtendedClass","Clz","classAttr","enableClassManagement","entity","storage","registerClass","Clazz","checkClassType","container","makeContainer","getClass","componentMainType","subType","throwWhenNotFound","getClassesByMainType","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend","setReadOnly","properties","getOrCreateEncodeArr","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","userOutput","dimensionNames","dimItem","getDimensionInfo","otherDim","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","tooltip","getDimensionTypeByAxis","axisType","numberUtil","number","symbolUtil","LiquidLayout","extendChartView","render","api","group","removeAll","getData","itemModel","getItemModel","getHeight","size","outlineDistance","outlineBorderWidth","showOutline","outterRadius","innerRadius","paddingRadius","isFillContainer","symbol","getOutline","wavePath","strokePath","getPath","getModel","getItemStyle","fillPath","graphic","Group","getBackground","oldData","_data","waves","isForClipping","makePath","bouding","createSymbol","Circle","outlinePath","getWave","isInverse","oldWave","radiusX","radiusY","itemStyleModel","waterLevel","normalStyle","seriesColor","wave","inverse","_waterLevel","hoverStyle","setHoverStyle","clip","setWaveAnimation","maxSpeed","speed","cnt","defaultSpeed","phaseOffset","console","error","when","during","diff","initProps","setItemGraphicEl","newIdx","oldIdx","waveElement","getItemGraphicEl","newWave","shapeAttrs","styleAttrs","updateProps","execute","labelModel","textOption","formatted","getFormattedLabel","defaultVal","defaultLabel","getName","isNaN","outsideTextRect","Rect","setText","insideTextRect","insColor","boundingCircle","CompoundPath","paths","getText","dispose","Triangle","extendShape","Diamond","Pin","asin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","Line","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","symbolBuildProxies","SymbolClz","symbolType","proxySymbol","symbolPathSetColor","innerColor","symbolStyle","symbolShape","__isEmptyBrush","keepAspect","symbolPath","isEmpty","makeImage","setColor","pathTool","colorTool","ZImage","Text","Sector","Ring","Polygon","Polyline","BezierCurve","Arc","LinearGradient","RadialGradient","IncrementalDisplayable","subPixelOptimizeUtil","EMPTY_OBJ","_highlightNextDigit","_highlightKeyMap","_customShapeMap","registerShape","ShapeClass","layout","createFromString","centerGraphic","resizePath","boundingRect","aspect","mergePath","hasFillOrStroke","fillOrStroke","liftedColorMap","liftedColorCount","singleEnterEmphasis","el","hoverStl","__hoverStl","__highlighted","useHoverLayer","painter","elTarget","targetStyle","addHover","rollbackDefaultTextStyle","__hoverStlDirty","__cachedNormalStl","__cachedNormalZ2","elStyle","cacheElementStl","setDefaultHoverFillStroke","applyDefaultTextStyle","liftedColor","liftColor","singleEnterNormal","highlighted","removeHover","normalStl","normalZ2","traverseUpdate","updater","commonParam","trigger","fromState","toState","child","__highDownOnUpdate","setElementHoverStyle","onElementMouseOver","shouldSilent","__highByOuter","onElementMouseOut","onElementEmphasisEvent","highlightDigit","onElementNormalEvent","__highDownSilentOnTouch","zrByTouch","setAsHighDownDispatcher","asDispatcher","disable","highDownSilentOnTouch","highDownOnUpdate","__highDownDispatcher","method","setTextStyle","textStyle","textStyleModel","specifiedTextStyle","isEmphasis","setTextStyleCommon","isRectText","getTextPosition","getShallow","labelRotate","richResult","globalTextStyle","richItemNames","richItemNameMap","parentModel","getRichItemNames","richTextStyle","setTokenTextStyle","forceRich","isBlock","getAutoColor","insideRollbackOpt","autoColor","textTag","disableBox","insideRollback","useInsideStyle","useInsideStyleCache","useAutoColorCache","animateOrSetProps","isUpdate","props","animatableModel","isAnimationEnabled","postfix","duration","animationDelay","getAnimationDelayParams","animateTo","stopAnimation","lineLineIntersect","a1x","a1y","a2x","a2y","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","b1a1x","b1a1y","q","Z2_EMPHASIS_LIFT","CACHED_LABEL_STYLE_PROPERTIES","extendPath","extendFromString","getShapeClass","imageUrl","img","param","isHighDownDispatcher","getHighlightDigit","highlightKey","setLabelStyle","emphasisStyle","normalModel","emphasisModel","normalSpecified","emphasisSpecified","baseText","labelFetcher","labelDataIndex","labelDimIndex","labelProp","showNormal","showEmphasis","defaultText","normalStyleText","emphasisStyleText","modifyLabelStyle","normalStyleProps","emphasisStyleProps","defaultColor","getFont","gTextStyleModel","getTransform","ancestor","mat","transformDirection","hBase","vBase","vertex","groupTransition","g1","g2","elMap","elMap1","anid","oldEl","newProp","getAnimatableProps","clipPointsByRect","point","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","transformPath","vMag","vRatio","u","vAngle","processArc","fa","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathOptions","pathProxy","prevCmd","cpx","cpy","subpathX","subpathY","cmdList","cmdText","cmdStr","pLen","off","ctlPtx","ctlPty","createPathProxyFromString","pathEls","pathList","pathEl","pathBundle","STYLE_COMMON_PROPS","createLinearGradient","createRadialGradient","styleProto","textRect","transformText","blend","notCheckCache","globalCompositeOperation","otherStyle","newStyle","canvasGradient","idStart","arrySlice","eventProcessor","_$handlers","_$eventProcessor","on","eventful","event","query","handler","isOnce","_h","host","normalizeQuery","wrap","one","callAtLast","zrEventfulCallAtLast","lastWrap","splice","isSilent","newList","argLen","hItem","afterTrigger","triggerWithContext","Animator","logError","animatable","time","delay","easing","callback","forceAnimate","reverse","animateToShallow","objShallow","propertyCount","setAttrByPath","done","animatingShape","pathSplitted","animator","forwardToLast","stop","animateFrom","Clip","arraySlice","defaultGetter","defaultSetter","interpolateNumber","percent","interpolateString","interpolateArray","arrDim","len2","fillArr","arr0","arr1","arr0Len","arr1Len","isArraySame","catmullRomInterpolateArray","catmullRomInterpolate","v0","cloneValue","rgba2String","createTrackClip","oneTrackDone","keyframes","_getter","setter","_setter","useSpline","trackLen","trackMaxTime","firstVal","isValueArray","isValueColor","isValueString","lastValue","getArrayDim","sort","kfPercents","kfValues","prevValue","isAllValueEqual","colorArray","_target","lastFrame","lastFramePercent","life","_loop","_delay","onframe","frame","range","ondestroy","_tracks","_clipCount","_doneList","_onframeList","_clipList","tracks","pause","_paused","resume","isPaused","_doneCallback","doneList","lastClip","clipCount","addClip","oldOnFrame","clipList","removeClip","getClips","easingFuncs","_life","_initialized","gap","onrestart","_pausedTime","step","globalTime","deltaTime","_startTime","easingFunc","schedule","fire","restart","_needsRemove","remainder","eventType","arg","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","textHelper","tmpRect","save","restore","end","extremity","xDim","yDim","fromPoints","tx","ty","vec2Min","vec2Max","cubic","quadratic","windingLine","windingCubic","nRoots","y0_","y1_","nExtrema","unit","windingQuadratic","y_","windingArc","dir","x_","containPath","isStroke","_x","_l","_a","Pattern","repeat","createPattern","mathAtan2","nPoint","_image","sWidth","sHeight","_children","__storage","children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","addToStorage","addChildrenToStorage","delFromStorage","delChildrenFromStorage","eachChild","includeChildren","tmpMat","childRect","fixClipWithShadow","r0","clockwise","unitX","unitY","shadowTemp","orignalBrush","modified","clipPaths","polyHelper","v2Distance","interpolate","isLoop","segs","pos","w2","w3","v2Min","v2Max","v2Scale","v2Add","v2Clone","v2Sub","constraint","prevPoint","nextPoint","cps","d0","sum","cp0","shift","subPixelOptimizeOutputShape","pointAt","_curve","someVectorAt","isTangent","cpx2","cpy2","cpx1","cpy1","tangentAt","_updatePathDirty","globalCoord","Displayble","IncrementalDisplayble","_displayables","_temporaryDisplayables","_cursor","notClear","clearDisplaybles","addDisplayable","displayable","notPersistent","addDisplayables","displayables","eachPendingDisplayable","getWaterPositions","stage","curves","waveRight","seriesType","getTargetSeries","paletteScope","seiresModelMap","eachSeriesByType","__paletteScope","reset","dataAll","getRawData","idxMap","rawIdx","getRawIndex","filteredIdx","singleDataColor","getItemVisual","singleDataBorderColor","getColorFromPalette","setItemVisual"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,YACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,WAAYJ,GACM,iBAAZC,QACdA,QAAQ,sBAAwBD,EAAQG,QAAQ,YAEhDJ,EAAK,sBAAwBC,EAAQD,EAAc,SARrD,CASGO,QAAQ,SAASC,GACpB,OAAgB,SAAUC,GAEhB,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUV,QAGnC,IAAIC,EAASO,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHZ,QAAS,IAU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AAuC,MAAfH,GAAuBj4D,EAAKm4D,cAAcF,EAAa,eAAe,GAQlG,GALKC,GAAoBE,IAEvBnpB,EAAY2oB,EAAQ1oB,aAAa6oB,KAG9BG,EAAiB,CACpB,IAAIn/B,EAAQkW,EAAU90C,IAAI,oBAAsBgtC,EAAYkxB,oBAAoBT,EAAQjkB,QAAQokB,IAAWA,EAAS,GAAI5wB,EAAYuwB,eAAgBE,EAAQ7wB,SAEzI,MAAfkxB,GACFj4D,EAAKs4D,cAAcL,EAAa,QAASl/B,GAI7C,IAAKq/B,EAAuB,CAC1B,IAAI90B,EAAc2L,EAAU90C,IAAI,yBAEb,MAAf89D,GACFj4D,EAAKs4D,cAAcL,EAAa,cAAe30B","file":"echarts-liquidfill.min.js","sourceRoot":""} \ No newline at end of file diff --git a/dist/echarts.js b/dist/echarts.js index c22b458..dd55582 100644 --- a/dist/echarts.js +++ b/dist/echarts.js @@ -66,6 +66,8 @@ var guid = function () { * @desc thanks zepto. */ +/* global wx */ + var env = {}; if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') { @@ -206,12 +208,17 @@ function detect(ua) { // default, so we dont check navigator.maxTouchPoints for them here. touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge, // . - pointerEventsSupported: 'onpointerdown' in window - // Firefox supports pointer but not by default, only MS browsers are reliable on pointer + pointerEventsSupported: + // (1) Firefox supports pointer but not by default, only MS browsers are reliable on pointer // events currently. So we dont use that on other browsers unless tested sufficiently. - // Although IE 10 supports pointer event, it use old style and is different from the + // For example, in iOS 13 Mobile Chromium 78, if the touching behavior starts page + // scroll, the `pointermove` event can not be fired any more. That will break some + // features like "pan horizontally to move something and pan vertically to page scroll". + // The horizontal pan probably be interrupted by the casually triggered page scroll. + // (2) Although IE 10 supports pointer event, it use old style and is different from the // standard. So we exclude that. (IE 10 is hardly used on touch device) - && (browser.edge || (browser.ie && browser.version >= 11)), + 'onpointerdown' in window + && (browser.edge || (browser.ie && browser.version >= 11)), // passiveSupported: detectPassiveSupport() domSupported: typeof document !== 'undefined' }; @@ -300,7 +307,7 @@ function $override(name, fn) { * @return {*} new */ function clone(source) { - if (source == null || typeof source != 'object') { + if (source == null || typeof source !== 'object') { return source; } @@ -480,7 +487,9 @@ function inherits(clazz, baseClazz) { clazz.prototype = new F(); for (var prop in clazzPrototype) { - clazz.prototype[prop] = clazzPrototype[prop]; + if (clazzPrototype.hasOwnProperty(prop)) { + clazz.prototype[prop] = clazzPrototype[prop]; + } } clazz.prototype.constructor = clazz; clazz.superClass = baseClazz; @@ -504,13 +513,13 @@ function mixin(target, source, overlay) { * @param {Array|TypedArray} data */ function isArrayLike(data) { - if (! data) { + if (!data) { return; } - if (typeof data == 'string') { + if (typeof data === 'string') { return false; } - return typeof data.length == 'number'; + return typeof data.length === 'number'; } /** @@ -694,7 +703,7 @@ function isObject$1(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; - return type === 'function' || (!!value && type == 'object'); + return type === 'function' || (!!value && type === 'object'); } /** @@ -732,6 +741,7 @@ function isDom(value) { * @return {boolean} */ function eqNaN(value) { + /* eslint-disable-next-line no-self-compare */ return value !== value; } @@ -876,9 +886,11 @@ HashMap.prototype = { // should not use the exposed keys, who are prefixed. each: function (cb, context) { context !== void 0 && (cb = bind(cb, context)); + /* eslint-disable guard-for-in */ for (var key in this.data) { this.data.hasOwnProperty(key) && cb(this.data[key], key); } + /* eslint-enable guard-for-in */ }, // Do not use this method if performance sensitive. removeKey: function (key) { @@ -948,6 +960,8 @@ var zrUtil = (Object.freeze || Object)({ noop: noop }); +/* global Float32Array */ + var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; @@ -1253,7 +1267,11 @@ function Draggable() { this.on('mousedown', this._dragStart, this); this.on('mousemove', this._drag, this); this.on('mouseup', this._dragEnd, this); - this.on('globalout', this._dragEnd, this); + // `mosuemove` and `mouseup` can be continue to fire when dragging. + // See [Drag outside] in `Handler.js`. So we do not need to trigger + // `_dragEnd` when globalout. That would brings better user experience. + // this.on('globalout', this._dragEnd, this); + // this._dropTarget = null; // this._draggingTarget = null; @@ -1267,7 +1285,11 @@ Draggable.prototype = { _dragStart: function (e) { var draggingTarget = e.target; - if (draggingTarget && draggingTarget.draggable) { + // Find if there is draggable in the ancestor + while (draggingTarget && !draggingTarget.draggable) { + draggingTarget = draggingTarget.parent; + } + if (draggingTarget) { this._draggingTarget = draggingTarget; draggingTarget.dragging = true; this._x = e.offsetX; @@ -1354,6 +1376,8 @@ var arrySlice = Array.prototype.slice; * param: {string} eventType * param: {string|Object} query * return: {boolean} + * @param {Function} [eventProcessor.afterTrigger] Called after all handlers called. + * param: {string} eventType */ var Eventful = function (eventProcessor) { this._$handlers = {}; @@ -1373,38 +1397,7 @@ Eventful.prototype = { * @param {Object} context */ one: function (event, query, handler, context) { - var _h = this._$handlers; - - if (typeof query === 'function') { - context = handler; - handler = query; - query = null; - } - - if (!handler || !event) { - return this; - } - - query = normalizeQuery(this, query); - - if (!_h[event]) { - _h[event] = []; - } - - for (var i = 0; i < _h[event].length; i++) { - if (_h[event][i].h === handler) { - return this; - } - } - - _h[event].push({ - h: handler, - one: true, - query: query, - ctx: context || this - }); - - return this; + return on(this, event, query, handler, context, true); }, /** @@ -1416,38 +1409,7 @@ Eventful.prototype = { * @param {Object} [context] */ on: function (event, query, handler, context) { - var _h = this._$handlers; - - if (typeof query === 'function') { - context = handler; - handler = query; - query = null; - } - - if (!handler || !event) { - return this; - } - - query = normalizeQuery(this, query); - - if (!_h[event]) { - _h[event] = []; - } - - for (var i = 0; i < _h[event].length; i++) { - if (_h[event][i].h === handler) { - return this; - } - } - - _h[event].push({ - h: handler, - one: false, - query: query, - ctx: context || this - }); - - return this; + return on(this, event, query, handler, context, false); }, /** @@ -1458,14 +1420,16 @@ Eventful.prototype = { */ isSilent: function (event) { var _h = this._$handlers; - return _h[event] && _h[event].length; + return !_h[event] || !_h[event].length; }, /** * Unbind a event. * - * @param {string} event The event name. + * @param {string} [event] The event name. + * If no `event` input, "off" all listeners. * @param {Function} [handler] The event handler. + * If no `handler` input, "off" all listeners of the `event`. */ off: function (event, handler) { var _h = this._$handlers; @@ -1479,7 +1443,7 @@ Eventful.prototype = { if (_h[event]) { var newList = []; for (var i = 0, l = _h[event].length; i < l; i++) { - if (_h[event][i].h != handler) { + if (_h[event][i].h !== handler) { newList.push(_h[event][i]); } } @@ -1503,16 +1467,17 @@ Eventful.prototype = { * @param {string} type The event name. */ trigger: function (type) { - if (this._$handlers[type]) { + var _h = this._$handlers[type]; + var eventProcessor = this._$eventProcessor; + + if (_h) { var args = arguments; var argLen = args.length; - var eventProcessor = this._$eventProcessor; if (argLen > 3) { args = arrySlice.call(args, 1); } - var _h = this._$handlers[type]; var len = _h.length; for (var i = 0; i < len;) { var hItem = _h[i]; @@ -1552,6 +1517,9 @@ Eventful.prototype = { } } + eventProcessor && eventProcessor.afterTrigger + && eventProcessor.afterTrigger(type); + return this; }, @@ -1561,17 +1529,18 @@ Eventful.prototype = { * @param {string} type The event name. */ triggerWithContext: function (type) { - if (this._$handlers[type]) { + var _h = this._$handlers[type]; + var eventProcessor = this._$eventProcessor; + + if (_h) { var args = arguments; var argLen = args.length; - var eventProcessor = this._$eventProcessor; if (argLen > 4) { args = arrySlice.call(args, 1, args.length - 1); } var ctx = args[args.length - 1]; - var _h = this._$handlers[type]; var len = _h.length; for (var i = 0; i < len;) { var hItem = _h[i]; @@ -1611,10 +1580,14 @@ Eventful.prototype = { } } + eventProcessor && eventProcessor.afterTrigger + && eventProcessor.afterTrigger(type); + return this; } }; + function normalizeQuery(host, query) { var eventProcessor = host._$eventProcessor; if (query != null && eventProcessor && eventProcessor.normalizeQuery) { @@ -1623,22 +1596,331 @@ function normalizeQuery(host, query) { return query; } +function on(eventful, event, query, handler, context, isOnce) { + var _h = eventful._$handlers; + + if (typeof query === 'function') { + context = handler; + handler = query; + query = null; + } + + if (!handler || !event) { + return eventful; + } + + query = normalizeQuery(eventful, query); + + if (!_h[event]) { + _h[event] = []; + } + + for (var i = 0; i < _h[event].length; i++) { + if (_h[event][i].h === handler) { + return eventful; + } + } + + var wrap = { + h: handler, + one: isOnce, + query: query, + ctx: context || eventful, + // FIXME + // Do not publish this feature util it is proved that it makes sense. + callAtLast: handler.zrEventfulCallAtLast + }; + + var lastIndex = _h[event].length - 1; + var lastWrap = _h[event][lastIndex]; + (lastWrap && lastWrap.callAtLast) + ? _h[event].splice(lastIndex, 0, wrap) + : _h[event].push(wrap); + + return eventful; +} + /** - * 事件辅助类 - * @module zrender/core/event - * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * The algoritm is learnt from + * https://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/ + * And we made some optimization for matrix inversion. + * Other similar approaches: + * "cv::getPerspectiveTransform", "Direct Linear Transformation". */ -var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener; +var LN2 = Math.log(2); -var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; +function determinant(rows, rank, rowStart, rowMask, colMask, detCache) { + var cacheKey = rowMask + '-' + colMask; + var fullRank = rows.length; -function getBoundingClientRect(el) { - // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect - return el.getBoundingClientRect ? el.getBoundingClientRect() : {left: 0, top: 0}; + if (detCache.hasOwnProperty(cacheKey)) { + return detCache[cacheKey]; + } + + if (rank === 1) { + // In this case the colMask must be like: `11101111`. We can find the place of `0`. + var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2); + return rows[rowStart][colStart]; + } + + var subRowMask = rowMask | (1 << rowStart); + var subRowStart = rowStart + 1; + while (rowMask & (1 << subRowStart)) { + subRowStart++; + } + + var sum = 0; + for (var j = 0, colLocalIdx = 0; j < fullRank; j++) { + var colTag = 1 << j; + if (!(colTag & colMask)) { + sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] + // det(subMatrix(0, j)) + * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache); + colLocalIdx++; + } + } + + detCache[cacheKey] = sum; + + return sum; +} + +/** + * Usage: + * ```js + * var transformer = buildTransformer( + * [10, 44, 100, 44, 100, 300, 10, 300], + * [50, 54, 130, 14, 140, 330, 14, 220] + * ); + * var out = []; + * transformer && transformer([11, 33], out); + * ``` + * + * Notice: `buildTransformer` may take more than 10ms in some Android device. + * + * @param {Array.} src source four points, [x0, y0, x1, y1, x2, y2, x3, y3] + * @param {Array.} dest destination four points, [x0, y0, x1, y1, x2, y2, x3, y3] + * @return {Function} transformer If fail, return null/undefined. + */ +function buildTransformer(src, dest) { + 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]] + ]; + + var detCache = {}; + var det = determinant(mA, 8, 0, 0, 0, detCache); + if (det === 0) { + // can not make transformer when and only when + // any three of the markers are collinear. + return; + } + + // `invert(mA) * dest`, that is, `adj(mA) / det * dest`. + var vh = []; + for (var i = 0; i < 8; i++) { + for (var j = 0; j < 8; j++) { + vh[j] == null && (vh[j] = 0); + vh[j] += ((i + j) % 2 ? -1 : 1) + // det(subMatrix(i, j)) + * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) + / det * dest[i]; + } + } + + return function (out, srcPointX, srcPointY) { + var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1; + out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk; + out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk; + }; +} + +var EVENT_SAVED_PROP = '___zrEVENTSAVED'; +var _calcOut$1 = []; + +/** + * Transform "local coord" from `elFrom` to `elTarget`. + * "local coord": the coord based on the input `el`. The origin point is at + * the position of "left: 0; top: 0;" in the `el`. + * + * Support when CSS transform is used. + * + * Having the `out` (that is, `[outX, outY]`), we can create an DOM element + * and set the CSS style as "left: outX; top: outY;" and append it to `elTarge` + * to locate the element. + * + * For example, this code below positions a child of `document.body` on the event + * point, no matter whether `body` has `margin`/`paddin`/`transfrom`/... : + * ```js + * transformLocalCoord(out, container, document.body, event.offsetX, event.offsetY); + * if (!eqNaN(out[0])) { + * // Then locate the tip element on the event point. + * var tipEl = document.createElement('div'); + * tipEl.style.cssText = 'position: absolute; left:' + out[0] + ';top:' + out[1] + ';'; + * document.body.appendChild(tipEl); + * } + * ``` + * + * Notice: In some env this method is not supported. If called, `out` will be `[NaN, NaN]`. + * + * @param {Array.} out [inX: number, inY: number] The output.. + * If can not transform, `out` will not be modified but return `false`. + * @param {HTMLElement} elFrom The `[inX, inY]` is based on elFrom. + * @param {HTMLElement} elTarget The `out` is based on elTarget. + * @param {number} inX + * @param {number} inY + * @return {boolean} Whether transform successfully. + */ +function transformLocalCoord(out, elFrom, elTarget, inX, inY) { + return transformCoordWithViewport(_calcOut$1, elFrom, inX, inY, true) + && transformCoordWithViewport(out, elTarget, _calcOut$1[0], _calcOut$1[1]); +} + +/** + * Transform between a "viewport coord" and a "local coord". + * "viewport coord": the coord based on the left-top corner of the viewport + * of the browser. + * "local coord": the coord based on the input `el`. The origin point is at + * the position of "left: 0; top: 0;" in the `el`. + * + * Support the case when CSS transform is used on el. + * + * @param {Array.} out [inX: number, inY: number] The output. If `inverse: false`, + * it represents "local coord", otherwise "vireport coord". + * If can not transform, `out` will not be modified but return `false`. + * @param {HTMLElement} el The "local coord" is based on the `el`, see comment above. + * @param {number} inX If `inverse: false`, + * it represents "vireport coord", otherwise "local coord". + * @param {number} inY If `inverse: false`, + * it represents "vireport coord", otherwise "local coord". + * @param {boolean} [inverse=false] + * `true`: from "viewport coord" to "local coord". + * `false`: from "local coord" to "viewport coord". + * @return {boolean} Whether transform successfully. + */ +function transformCoordWithViewport(out, el, inX, inY, inverse) { + if (el.getBoundingClientRect && env$1.domSupported && !isCanvasEl(el)) { + var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {}); + var markers = prepareCoordMarkers(el, saved); + var transformer = preparePointerTransformer(markers, saved, inverse); + if (transformer) { + transformer(out, inX, inY); + return true; + } + } + return false; +} + +function prepareCoordMarkers(el, saved) { + var markers = saved.markers; + if (markers) { + return markers; + } + + markers = saved.markers = []; + var propLR = ['left', 'right']; + var propTB = ['top', 'bottom']; + + for (var i = 0; i < 4; i++) { + var marker = document.createElement('div'); + var stl = marker.style; + var idxLR = i % 2; + var idxTB = (i >> 1) % 2; + stl.cssText = [ + 'position: absolute', + 'visibility: hidden', + 'padding: 0', + 'margin: 0', + 'border-width: 0', + 'user-select: none', + 'width:0', + 'height:0', + // 'width: 5px', + // 'height: 5px', + propLR[idxLR] + ':0', + propTB[idxTB] + ':0', + propLR[1 - idxLR] + ':auto', + propTB[1 - idxTB] + ':auto', + '' + ].join('!important;'); + el.appendChild(marker); + markers.push(marker); + } + + return markers; +} + +function preparePointerTransformer(markers, saved, inverse) { + var transformerName = inverse ? 'invTrans' : 'trans'; + var transformer = saved[transformerName]; + var oldSrcCoords = saved.srcCoords; + var oldCoordTheSame = true; + var srcCoords = []; + var destCoords = []; + + for (var i = 0; i < 4; i++) { + var rect = markers[i].getBoundingClientRect(); + var ii = 2 * i; + var x = rect.left; + var y = rect.top; + srcCoords.push(x, y); + oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1]; + destCoords.push(markers[i].offsetLeft, markers[i].offsetTop); + } + // Cache to avoid time consuming of `buildTransformer`. + return (oldCoordTheSame && transformer) + ? transformer + : ( + saved.srcCoords = srcCoords, + saved[transformerName] = inverse + ? buildTransformer(destCoords, srcCoords) + : buildTransformer(srcCoords, destCoords) + ); } -// `calculate` is optional, default false +function isCanvasEl(el) { + return el.nodeName.toUpperCase() === 'CANVAS'; +} + +/** + * Utilities for mouse or touch events. + */ + +var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener; + +var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; +var _calcOut = []; + +/** + * Get the `zrX` and `zrY`, which are relative to the top-left of + * the input `el`. + * CSS transform (2D & 3D) is supported. + * + * The strategy to fetch the coords: + * + If `calculate` is not set as `true`, users of this method should + * ensure that `el` is the same or the same size & location as `e.target`. + * Otherwise the result coords are probably not expected. Because we + * firstly try to get coords from e.offsetX/e.offsetY. + * + If `calculate` is set as `true`, the input `el` can be any element + * and we force to calculate the coords based on `el`. + * + The input `el` should be positionable (not position:static). + * + * The force `calculate` can be used in case like: + * When mousemove event triggered on ec tooltip, `e.target` is not `el`(zr painter.dom). + * + * @param {HTMLElement} el DOM element. + * @param {Event} e Mouse event or touch event. + * @param {Object} out Get `out.zrX` and `out.zrY` as the result. + * @param {boolean} [calculate=false] Whether to force calculate + * the coordinates but not use ones provided by browser. + */ function clientToLocal(el, e, out, calculate) { out = out || {}; @@ -1649,12 +1931,8 @@ function clientToLocal(el, e, out, calculate) { // (see http://www.jacklmoore.com/notes/mouse-position/) // In zr painter.dom, padding edge equals to border edge. - // FIXME - // When mousemove event triggered on ec tooltip, target is not zr painter.dom, and - // offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y - // is too complex. So css-transfrom dont support in this case temporarily. if (calculate || !env$1.canvasSupported) { - defaultGetZrXY(el, e, out); + calculateZrXY(el, e, out); } // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned // ancestor element, so we should make sure el is positioned (e.g., not position:static). @@ -1674,26 +1952,74 @@ function clientToLocal(el, e, out, calculate) { } // For some other device, e.g., IOS safari. else { - defaultGetZrXY(el, e, out); + calculateZrXY(el, e, out); } return out; } -function defaultGetZrXY(el, e, out) { - // This well-known method below does not support css transform. - var box = getBoundingClientRect(el); - out.zrX = e.clientX - box.left; - out.zrY = e.clientY - box.top; +function calculateZrXY(el, e, out) { + // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect. + if (env$1.domSupported && el.getBoundingClientRect) { + var ex = e.clientX; + var ey = e.clientY; + + if (isCanvasEl(el)) { + // Original approach, which do not support CSS transform. + // marker can not be locationed in a canvas container + // (getBoundingClientRect is always 0). We do not support + // that input a pre-created canvas to zr while using css + // transform in iOS. + var box = el.getBoundingClientRect(); + out.zrX = ex - box.left; + out.zrY = ey - box.top; + return; + } + else { + if (transformCoordWithViewport(_calcOut, el, ex, ey)) { + out.zrX = _calcOut[0]; + out.zrY = _calcOut[1]; + return; + } + } + } + out.zrX = out.zrY = 0; } /** - * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标. - * `calculate` is optional, default false. + * Find native event compat for legency IE. + * Should be called at the begining of a native event listener. + * + * @param {Event} [e] Mouse event or touch event or pointer event. + * For lagency IE, we use `window.event` is used. + * @return {Event} The native event. + */ +function getNativeEvent(e) { + return e || window.event; +} + +/** + * Normalize the coordinates of the input event. + * + * Get the `e.zrX` and `e.zrY`, which are relative to the top-left of + * the input `el`. + * Get `e.zrDelta` if using mouse wheel. + * Get `e.which`, see the comment inside this function. + * + * Do not calculate repeatly if `zrX` and `zrY` already exist. + * + * Notice: see comments in `clientToLocal`. check the relationship + * between the result coords and the parameters `el` and `calculate`. + * + * @param {HTMLElement} el DOM element. + * @param {Event} [e] See `getNativeEvent`. + * @param {boolean} [calculate=false] Whether to force calculate + * the coordinates but not use ones provided by browser. + * @return {UIEvent} The normalized native UIEvent. */ function normalizeEvent(el, e, calculate) { - e = e || window.event; + e = getNativeEvent(e); if (e.zrX != null) { return e; @@ -1707,7 +2033,7 @@ function normalizeEvent(el, e, calculate) { e.zrDelta = (e.wheelDelta) ? e.wheelDelta / 120 : -(e.detail || 0) / 3; } else { - var touch = eventType != 'touchend' + var touch = eventType !== 'touchend' ? e.targetTouches[0] : e.changedTouches[0]; touch && clientToLocal(el, touch, e, calculate); @@ -1715,12 +2041,16 @@ function normalizeEvent(el, e, calculate) { // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0; // See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js - // If e.which has been defined, if may be readonly, + // If e.which has been defined, it may be readonly, // see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which var button = e.button; if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) { e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0))); } + // [Caution]: `e.which` from browser is not always reliable. For example, + // when press left button and `mousemove (pointermove)` in Edge, the `e.which` + // is 65536 and the `e.button` is -1. But the `mouseup (pointerup)` and + // `mousedown (pointerdown)` is the same as Chrome does. return e; } @@ -1729,8 +2059,11 @@ function normalizeEvent(el, e, calculate) { * @param {HTMLElement} el * @param {string} name * @param {Function} handler + * @param {Object|boolean} opt If boolean, means `opt.capture` + * @param {boolean} [opt.capture=false] + * @param {boolean} [opt.passive=false] */ -function addEventListener(el, name, handler) { +function addEventListener(el, name, handler, opt) { if (isDomLevel2) { // Reproduct the console warning: // [Violation] Added non-passive event listener to a scroll-blocking event. @@ -1753,16 +2086,24 @@ function addEventListener(el, name, handler) { // // By default, the third param of el.addEventListener is `capture: false`. // : void 0; // el.addEventListener(name, handler /* , opts */); - el.addEventListener(name, handler); + el.addEventListener(name, handler, opt); } else { + // For simplicity, do not implement `setCapture` for IE9-. el.attachEvent('on' + name, handler); } } -function removeEventListener(el, name, handler) { +/** + * Parameter are the same as `addEventListener`. + * + * Notice that if a listener is registered twice, one with capture and one without, + * remove each one separately. Removal of a capturing listener does not affect a + * non-capturing version of the same listener, and vice versa. + */ +function removeEventListener(el, name, handler, opt) { if (isDomLevel2) { - el.removeEventListener(name, handler); + el.removeEventListener(name, handler, opt); } else { el.detachEvent('on' + name, handler); @@ -1771,12 +2112,10 @@ function removeEventListener(el, name, handler) { /** * preventDefault and stopPropagation. - * Notice: do not do that in zrender. Upper application - * do that if necessary. + * Notice: do not use this method in zrender. It can only be + * used by upper applications if necessary. * - * @memberOf module:zrender/core/event - * @method - * @param {Event} e : event对象 + * @param {Event} e A mouse or touch event. */ var stop = isDomLevel2 ? function (e) { @@ -1789,11 +2128,195 @@ var stop = isDomLevel2 e.cancelBubble = true; }; -function notLeftMouse(e) { - // If e.which is undefined, considered as left mouse event. - return e.which > 1; +/** + * This method only works for mouseup and mousedown. The functionality is restricted + * for fault tolerance, See the `e.which` compatibility above. + * + * @param {MouseEvent} e + * @return {boolean} + */ +function isMiddleOrRightButtonOnMouseUpDown(e) { + return e.which === 2 || e.which === 3; +} + +/** + * To be removed. + * @deprecated + */ + +/** + * Only implements needed gestures for mobile. + */ + +var GestureMgr = function () { + + /** + * @private + * @type {Array.} + */ + this._track = []; +}; + +GestureMgr.prototype = { + + constructor: GestureMgr, + + recognize: function (event, target, root) { + this._doTrack(event, target, root); + return this._recognize(event); + }, + + clear: function () { + this._track.length = 0; + return this; + }, + + _doTrack: function (event, target, root) { + var touches = event.touches; + + if (!touches) { + return; + } + + var trackItem = { + points: [], + touches: [], + target: target, + event: event + }; + + for (var i = 0, len = touches.length; i < len; i++) { + var touch = touches[i]; + var pos = clientToLocal(root, touch, {}); + trackItem.points.push([pos.zrX, pos.zrY]); + trackItem.touches.push(touch); + } + + this._track.push(trackItem); + }, + + _recognize: function (event) { + for (var eventName in recognizers) { + if (recognizers.hasOwnProperty(eventName)) { + var gestureInfo = recognizers[eventName](this._track, event); + if (gestureInfo) { + return gestureInfo; + } + } + } + } +}; + +function dist$1(pointPair) { + var dx = pointPair[1][0] - pointPair[0][0]; + var dy = pointPair[1][1] - pointPair[0][1]; + + return Math.sqrt(dx * dx + dy * dy); +} + +function center(pointPair) { + return [ + (pointPair[0][0] + pointPair[1][0]) / 2, + (pointPair[0][1] + pointPair[1][1]) / 2 + ]; } +var recognizers = { + + pinch: function (track, event) { + var trackLen = track.length; + + if (!trackLen) { + return; + } + + var pinchEnd = (track[trackLen - 1] || {}).points; + var pinchPre = (track[trackLen - 2] || {}).points || pinchEnd; + + if (pinchPre + && pinchPre.length > 1 + && pinchEnd + && pinchEnd.length > 1 + ) { + var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre); + !isFinite(pinchScale) && (pinchScale = 1); + + event.pinchScale = pinchScale; + + var pinchCenter = center(pinchEnd); + event.pinchX = pinchCenter[0]; + event.pinchY = pinchCenter[1]; + + return { + type: 'pinch', + target: track[0].target, + event: event + }; + } + } + + // Only pinch currently. +}; + +/** + * [The interface between `Handler` and `HandlerProxy`]: + * + * The default `HandlerProxy` only support the common standard web environment + * (e.g., standalone browser, headless browser, embed browser in mobild APP, ...). + * But `HandlerProxy` can be replaced to support more non-standard environment + * (e.g., mini app), or to support more feature that the default `HandlerProxy` + * not provided (like echarts-gl did). + * So the interface between `Handler` and `HandlerProxy` should be stable. Do not + * make break changes util inevitable. The interface include the public methods + * of `Handler` and the events listed in `handlerNames` below, by which `HandlerProxy` + * drives `Handler`. + */ + +/** + * [Drag outside]: + * + * That is, triggering `mousemove` and `mouseup` event when the pointer is out of the + * zrender area when dragging. That is important for the improvement of the user experience + * when dragging something near the boundary without being terminated unexpectedly. + * + * We originally consider to introduce new events like `pagemovemove` and `pagemouseup` + * to resolve this issue. But some drawbacks of it is described in + * https://github.com/ecomfe/zrender/pull/536#issuecomment-560286899 + * + * Instead, we referenced the specifications: + * https://www.w3.org/TR/touch-events/#the-touchmove-event + * https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-mousemove + * where the the mousemove/touchmove can be continue to fire if the user began a drag + * operation and the pointer has left the boundary. (for the mouse event, browsers + * only do it on `document` and when the pointer has left the boundary of the browser.) + * + * So the default `HandlerProxy` supports this feature similarly: if it is in the dragging + * state (see `pointerCapture` in `HandlerProxy`), the `mousemove` and `mouseup` continue + * to fire until release the pointer. That is implemented by listen to those event on + * `document`. + * If we implement some other `HandlerProxy` only for touch device, that would be easier. + * The touch event support this feature by default. + * + * Note: + * There might be some cases that the mouse event can not be + * received on `document`. For example, + * (A) `useCapture` is not supported and some user defined event listeners on the ancestor + * of zr dom throw Error . + * (B) `useCapture` is not supported Some user defined event listeners on the ancestor of + * zr dom call `stopPropagation`. + * In these cases, the `mousemove` event might be keep triggered event + * if the mouse is released. We try to reduce the side-effect in those cases. + * That is, do nothing (especially, `findHover`) in those cases. See `isOutsideBoundary`. + * + * Note: + * If `HandlerProxy` listens to `document` with `useCapture`, `HandlerProxy` needs to + * make sure `stopPropagation` and `preventDefault` doing nothing if and only if the event + * target is not zrender dom. Becuase it is dangerous to enable users to call them in + * `document` capture phase to prevent the propagation to any listener of the webpage. + * But they are needed to work when the pointer inside the zrender dom. + */ + + var SILENT = 'silent'; function makeEventPacket(eveType, targetInfo, event) { @@ -1818,17 +2341,19 @@ function makeEventPacket(eveType, targetInfo, event) { }; } -function stopEvent(event) { +function stopEvent() { stop(this.event); } -function EmptyProxy () {} +function EmptyProxy() {} EmptyProxy.prototype.dispose = function () {}; + var handlerNames = [ 'click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu' ]; + /** * @alias module:zrender/Handler * @constructor @@ -1838,7 +2363,7 @@ var handlerNames = [ * @param {module:zrender/dom/HandlerProxy} proxy HandlerProxy instance. * @param {HTMLElement} painterRoot painter.root (not painter.getViewportRoot()). */ -var Handler = function(storage, painter, proxy, painterRoot) { +var Handler = function (storage, painter, proxy, painterRoot) { Eventful.call(this); this.storage = storage; @@ -1879,6 +2404,11 @@ var Handler = function(storage, painter, proxy, painterRoot) { */ this._lastY; + /** + * @private + * @type {module:zrender/core/GestureMgr} + */ + this._gestureMgr; Draggable.call(this); @@ -1908,6 +2438,8 @@ Handler.prototype = { var x = event.zrX; var y = event.zrY; + var isOutside = isOutsideBoundary(this, x, y); + var lastHovered = this._hovered; var lastHoveredTarget = lastHovered.target; @@ -1920,7 +2452,7 @@ Handler.prototype = { lastHoveredTarget = lastHovered.target; } - var hovered = this._hovered = this.findHover(x, y); + var hovered = this._hovered = isOutside ? {x: x, y: y} : this.findHover(x, y); var hoveredTarget = hovered.target; var proxy = this.proxy; @@ -1941,23 +2473,18 @@ Handler.prototype = { }, mouseout: function (event) { - this.dispatchToElement(this._hovered, 'mouseout', event); + var eventControl = event.zrEventControl; + var zrIsToLocalDOM = event.zrIsToLocalDOM; - // There might be some doms created by upper layer application - // at the same level of painter.getViewportRoot() (e.g., tooltip - // dom created by echarts), where 'globalout' event should not - // be triggered when mouse enters these doms. (But 'mouseout' - // should be triggered at the original hovered element as usual). - var element = event.toElement || event.relatedTarget; - var innerDom; - do { - element = element && element.parentNode; + if (eventControl !== 'only_globalout') { + this.dispatchToElement(this._hovered, 'mouseout', event); } - while (element && element.nodeType != 9 && !( - innerDom = element === this.painterRoot - )); - !innerDom && this.trigger('globalout', {event: event}); + if (eventControl !== 'no_globalout') { + // FIXME: if the pointer moving from the extra doms to realy "outside", + // the `globalout` should have been triggered. But currently not. + !zrIsToLocalDOM && this.trigger('globalout', {type: 'globalout', event: event}); + } }, /** @@ -2034,7 +2561,7 @@ Handler.prototype = { // 分发事件到用户自定义层 // 用户有可能在全局 click 事件中 dispose,所以需要判断下 painter 是否存在 this.painter && this.painter.eachOtherLayer(function (layer) { - if (typeof(layer[eventHandler]) == 'function') { + if (typeof (layer[eventHandler]) === 'function') { layer[eventHandler].call(layer, eventPacket); } if (layer.trigger) { @@ -2052,11 +2579,11 @@ Handler.prototype = { * @return {model:zrender/Element} * @method */ - findHover: function(x, y, exclude) { + findHover: function (x, y, exclude) { var list = this.storage.getDisplayList(); var out = {x: x, y: y}; - for (var i = list.length - 1; i >= 0 ; i--) { + for (var i = list.length - 1; i >= 0; i--) { var hoverCheckResult; if (list[i] !== exclude // getDisplayList may include ignored item in VML mode @@ -2072,15 +2599,49 @@ Handler.prototype = { } return out; + }, + + processGesture: function (event, stage) { + if (!this._gestureMgr) { + this._gestureMgr = new GestureMgr(); + } + var gestureMgr = this._gestureMgr; + + stage === 'start' && gestureMgr.clear(); + + var gestureInfo = gestureMgr.recognize( + event, + this.findHover(event.zrX, event.zrY, null).target, + this.proxy.dom + ); + + stage === 'end' && gestureMgr.clear(); + + // Do not do any preventDefault here. Upper application do that if necessary. + if (gestureInfo) { + var type = gestureInfo.type; + event.gestureEvent = type; + + this.dispatchToElement({target: gestureInfo.target}, type, gestureInfo.event); + } } }; // Common handlers each$1(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { Handler.prototype[name] = function (event) { - // Find hover again to avoid click event is dispatched manually. Or click is triggered without mouseover - var hovered = this.findHover(event.zrX, event.zrY); - var hoveredTarget = hovered.target; + var x = event.zrX; + var y = event.zrY; + var isOutside = isOutsideBoundary(this, x, y); + + var hovered; + var hoveredTarget; + + if (name !== 'mouseup' || !isOutside) { + // Find hover again to avoid click event is dispatched manually. Or click is triggered without mouseover + hovered = this.findHover(x, y); + hoveredTarget = hovered.target; + } if (name === 'mousedown') { this._downEl = hoveredTarget; @@ -2118,7 +2679,7 @@ function isHover(displayable, x, y) { // If clipped by ancestor. // FIXME: If clipPath has neither stroke nor fill, // el.clipPath.contain(x, y) will always return false. - if (el.clipPath && !el.clipPath.contain(x, y)) { + if (el.clipPath && !el.clipPath.contain(x, y)) { return false; } if (el.silent) { @@ -2132,6 +2693,14 @@ function isHover(displayable, x, y) { return false; } +/** + * See [Drag outside]. + */ +function isOutsideBoundary(handlerInstance, x, y) { + var painter = handlerInstance.painter; + return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight(); +} + mixin(Handler, Eventful); mixin(Handler, Draggable); @@ -2140,9 +2709,11 @@ mixin(Handler, Draggable); * @exports zrender/tool/matrix */ +/* global Float32Array */ + var ArrayCtor$1 = typeof Float32Array === 'undefined' ? Array - : Float32Array; + : Float32Array; /** * Create a identity matrix. @@ -2826,13 +3397,14 @@ var easing = { return 1; } if (!a || a < 1) { - a = 1; s = p / 4; + a = 1; + s = p / 4; } else { s = p * Math.asin(1 / a) / (2 * Math.PI); } - return -(a * Math.pow(2, 10 * (k -= 1)) * - Math.sin((k - s) * (2 * Math.PI) / p)); + return -(a * Math.pow(2, 10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p)); }, /** * @param {number} k @@ -2849,13 +3421,14 @@ var easing = { return 1; } if (!a || a < 1) { - a = 1; s = p / 4; + a = 1; + s = p / 4; } else { s = p * Math.asin(1 / a) / (2 * Math.PI); } - return (a * Math.pow(2, -10 * k) * - Math.sin((k - s) * (2 * Math.PI) / p) + 1); + return (a * Math.pow(2, -10 * k) + * Math.sin((k - s) * (2 * Math.PI) / p) + 1); }, /** * @param {number} k @@ -2872,7 +3445,8 @@ var easing = { return 1; } if (!a || a < 1) { - a = 1; s = p / 4; + a = 1; + s = p / 4; } else { s = p * Math.asin(1 / a) / (2 * Math.PI); @@ -3022,7 +3596,7 @@ Clip.prototype = { percent = Math.min(percent, 1); var easing$$1 = this.easing; - var easingFunc = typeof easing$$1 == 'string' ? easing[easing$$1] : easing$$1; + var easingFunc = typeof easing$$1 === 'string' ? easing[easing$$1] : easing$$1; var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent; @@ -3030,9 +3604,9 @@ Clip.prototype = { this.fire('frame', schedule); // 结束 - if (percent == 1) { + if (percent === 1) { if (this.loop) { - this.restart (globalTime); + this.restart(globalTime); // 重新开始周期 // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 return 'restart'; @@ -3266,80 +3840,80 @@ LRUProto.clear = function () { }; var kCSSColorTable = { - 'transparent': [0,0,0,0], 'aliceblue': [240,248,255,1], - 'antiquewhite': [250,235,215,1], 'aqua': [0,255,255,1], - 'aquamarine': [127,255,212,1], 'azure': [240,255,255,1], - 'beige': [245,245,220,1], 'bisque': [255,228,196,1], - 'black': [0,0,0,1], 'blanchedalmond': [255,235,205,1], - 'blue': [0,0,255,1], 'blueviolet': [138,43,226,1], - 'brown': [165,42,42,1], 'burlywood': [222,184,135,1], - 'cadetblue': [95,158,160,1], 'chartreuse': [127,255,0,1], - 'chocolate': [210,105,30,1], 'coral': [255,127,80,1], - 'cornflowerblue': [100,149,237,1], 'cornsilk': [255,248,220,1], - 'crimson': [220,20,60,1], 'cyan': [0,255,255,1], - 'darkblue': [0,0,139,1], 'darkcyan': [0,139,139,1], - 'darkgoldenrod': [184,134,11,1], 'darkgray': [169,169,169,1], - 'darkgreen': [0,100,0,1], 'darkgrey': [169,169,169,1], - 'darkkhaki': [189,183,107,1], 'darkmagenta': [139,0,139,1], - 'darkolivegreen': [85,107,47,1], 'darkorange': [255,140,0,1], - 'darkorchid': [153,50,204,1], 'darkred': [139,0,0,1], - 'darksalmon': [233,150,122,1], 'darkseagreen': [143,188,143,1], - 'darkslateblue': [72,61,139,1], 'darkslategray': [47,79,79,1], - 'darkslategrey': [47,79,79,1], 'darkturquoise': [0,206,209,1], - 'darkviolet': [148,0,211,1], 'deeppink': [255,20,147,1], - 'deepskyblue': [0,191,255,1], 'dimgray': [105,105,105,1], - 'dimgrey': [105,105,105,1], 'dodgerblue': [30,144,255,1], - 'firebrick': [178,34,34,1], 'floralwhite': [255,250,240,1], - 'forestgreen': [34,139,34,1], 'fuchsia': [255,0,255,1], - 'gainsboro': [220,220,220,1], 'ghostwhite': [248,248,255,1], - 'gold': [255,215,0,1], 'goldenrod': [218,165,32,1], - 'gray': [128,128,128,1], 'green': [0,128,0,1], - 'greenyellow': [173,255,47,1], 'grey': [128,128,128,1], - 'honeydew': [240,255,240,1], 'hotpink': [255,105,180,1], - 'indianred': [205,92,92,1], 'indigo': [75,0,130,1], - 'ivory': [255,255,240,1], 'khaki': [240,230,140,1], - 'lavender': [230,230,250,1], 'lavenderblush': [255,240,245,1], - 'lawngreen': [124,252,0,1], 'lemonchiffon': [255,250,205,1], - 'lightblue': [173,216,230,1], 'lightcoral': [240,128,128,1], - 'lightcyan': [224,255,255,1], 'lightgoldenrodyellow': [250,250,210,1], - 'lightgray': [211,211,211,1], 'lightgreen': [144,238,144,1], - 'lightgrey': [211,211,211,1], 'lightpink': [255,182,193,1], - 'lightsalmon': [255,160,122,1], 'lightseagreen': [32,178,170,1], - 'lightskyblue': [135,206,250,1], 'lightslategray': [119,136,153,1], - 'lightslategrey': [119,136,153,1], 'lightsteelblue': [176,196,222,1], - 'lightyellow': [255,255,224,1], 'lime': [0,255,0,1], - 'limegreen': [50,205,50,1], 'linen': [250,240,230,1], - 'magenta': [255,0,255,1], 'maroon': [128,0,0,1], - 'mediumaquamarine': [102,205,170,1], 'mediumblue': [0,0,205,1], - 'mediumorchid': [186,85,211,1], 'mediumpurple': [147,112,219,1], - 'mediumseagreen': [60,179,113,1], 'mediumslateblue': [123,104,238,1], - 'mediumspringgreen': [0,250,154,1], 'mediumturquoise': [72,209,204,1], - 'mediumvioletred': [199,21,133,1], 'midnightblue': [25,25,112,1], - 'mintcream': [245,255,250,1], 'mistyrose': [255,228,225,1], - 'moccasin': [255,228,181,1], 'navajowhite': [255,222,173,1], - 'navy': [0,0,128,1], 'oldlace': [253,245,230,1], - 'olive': [128,128,0,1], 'olivedrab': [107,142,35,1], - 'orange': [255,165,0,1], 'orangered': [255,69,0,1], - 'orchid': [218,112,214,1], 'palegoldenrod': [238,232,170,1], - 'palegreen': [152,251,152,1], 'paleturquoise': [175,238,238,1], - 'palevioletred': [219,112,147,1], 'papayawhip': [255,239,213,1], - 'peachpuff': [255,218,185,1], 'peru': [205,133,63,1], - 'pink': [255,192,203,1], 'plum': [221,160,221,1], - 'powderblue': [176,224,230,1], 'purple': [128,0,128,1], - 'red': [255,0,0,1], 'rosybrown': [188,143,143,1], - 'royalblue': [65,105,225,1], 'saddlebrown': [139,69,19,1], - 'salmon': [250,128,114,1], 'sandybrown': [244,164,96,1], - 'seagreen': [46,139,87,1], 'seashell': [255,245,238,1], - 'sienna': [160,82,45,1], 'silver': [192,192,192,1], - 'skyblue': [135,206,235,1], 'slateblue': [106,90,205,1], - 'slategray': [112,128,144,1], 'slategrey': [112,128,144,1], - 'snow': [255,250,250,1], 'springgreen': [0,255,127,1], - 'steelblue': [70,130,180,1], 'tan': [210,180,140,1], - 'teal': [0,128,128,1], 'thistle': [216,191,216,1], - 'tomato': [255,99,71,1], 'turquoise': [64,224,208,1], - 'violet': [238,130,238,1], 'wheat': [245,222,179,1], - 'white': [255,255,255,1], 'whitesmoke': [245,245,245,1], - 'yellow': [255,255,0,1], 'yellowgreen': [154,205,50,1] + 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1], + 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1], + 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1], + 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1], + 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1], + 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1], + 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1], + 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1], + 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1], + 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1], + 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1], + 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1], + 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1], + 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1], + 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1], + 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1], + 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1], + 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1], + 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1], + 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1], + 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1], + 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1], + 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1], + 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1], + 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1], + 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1], + 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1], + 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1], + 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1], + 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1], + 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1], + 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1], + 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1], + 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1], + 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1], + 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1], + 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1], + 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1], + 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1], + 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1], + 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1], + 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1], + 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1], + 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1], + 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1], + 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1], + 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1], + 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1], + 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1], + 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1], + 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1], + 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1], + 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1], + 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1], + 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1], + 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1], + 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1], + 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1], + 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1], + 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1], + 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1], + 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1], + 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1], + 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1], + 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1], + 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1], + 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1], + 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1], + 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1], + 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1], + 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1], + 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1], + 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1], + 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1] }; function clampCssByte(i) { // Clamp to integer 0 .. 255. @@ -3385,7 +3959,7 @@ function cssHueToRgb(m1, m2, h) { return m2; } if (h * 3 < 2) { - return m1 + (m2 - m1) * (2/3 - h) * 6; + return m1 + (m2 - m1) * (2 / 3 - h) * 6; } return m1; } @@ -3395,11 +3969,17 @@ function lerpNumber(a, b, p) { } function setRgba(out, r, g, b, a) { - out[0] = r; out[1] = g; out[2] = b; out[3] = a; + out[0] = r; + out[1] = g; + out[2] = b; + out[3] = a; return out; } function copyRgba(out, a) { - out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; return out; } @@ -3478,7 +4058,8 @@ function parse(colorStr, rgbaArr) { return; } - var op = str.indexOf('('), ep = str.indexOf(')'); + var op = str.indexOf('('); + var ep = str.indexOf(')'); if (op !== -1 && ep + 1 === str.length) { var fname = str.substr(0, op); var params = str.substr(op + 1, ep - (op + 1)).split(','); @@ -3855,7 +4436,7 @@ function interpolateString(p0, p1, percent) { */ function interpolateArray(p0, p1, percent, out, arrDim) { var len = p0.length; - if (arrDim == 1) { + if (arrDim === 1) { for (var i = 0; i < len; i++) { out[i] = interpolateNumber(p0[i], p1[i], percent); } @@ -3961,7 +4542,7 @@ function catmullRomInterpolateArray( p0, p1, p2, p3, t, t2, t3, out, arrDim ) { var len = p0.length; - if (arrDim == 1) { + if (arrDim === 1) { for (var i = 0; i < len; i++) { out[i] = catmullRomInterpolate( p0[i], p1[i], p2[i], p3[i], t, t2, t3 @@ -4050,7 +4631,7 @@ function createTrackClip(animator, easing, oneTrackDone, keyframes, propName, fo var trackMaxTime; // Sort keyframe as ascending - keyframes.sort(function(a, b) { + keyframes.sort(function (a, b) { return a.time - b.time; }); @@ -4074,7 +4655,7 @@ function createTrackClip(animator, easing, oneTrackDone, keyframes, propName, fo prevValue = value; // Try converting a string to a color array - if (typeof value == 'string') { + if (typeof value === 'string') { var colorArray = parse(value); if (colorArray) { value = colorArray; @@ -4252,7 +4833,7 @@ function createTrackClip(animator, easing, oneTrackDone, keyframes, propName, fo * @param {Function} getter * @param {Function} setter */ -var Animator = function(target, loop, getter, setter) { +var Animator = function (target, loop, getter, setter) { this._tracks = {}; this._target = target; @@ -4274,12 +4855,12 @@ var Animator = function(target, loop, getter, setter) { Animator.prototype = { /** - * 设置动画关键帧 + * Set Animation keyframe * @param {number} time 关键帧时间,单位是ms * @param {Object} props 关键帧的属性值,key-value表示 * @return {module:zrender/animation/Animator} */ - when: function(time /* ms */, props) { + when: function (time /* ms */, props) { var tracks = this._tracks; for (var propName in props) { if (!props.hasOwnProperty(propName)) { @@ -4353,7 +4934,7 @@ Animator.prototype = { } }, /** - * 开始执行动画 + * Start the animation * @param {string|Function} [easing] * 动画缓动函数,详见{@link module:zrender/animation/easing} * @param {boolean} forceAnimate @@ -4364,7 +4945,7 @@ Animator.prototype = { var self = this; var clipCount = 0; - var oneTrackDone = function() { + var oneTrackDone = function () { clipCount--; if (!clipCount) { self._doneCallback(); @@ -4414,7 +4995,7 @@ Animator.prototype = { return this; }, /** - * 停止动画 + * Stop animation * @param {boolean} forwardToLast If move to last frame before stop */ stop: function (forwardToLast) { @@ -4431,7 +5012,7 @@ Animator.prototype = { clipList.length = 0; }, /** - * 设置动画延迟开始的时间 + * Set when animation delay starts * @param {number} time 单位ms * @return {module:zrender/animation/Animator} */ @@ -4440,11 +5021,11 @@ Animator.prototype = { return this; }, /** - * 添加动画结束的回调 + * Add callback for animation end * @param {Function} cb * @return {module:zrender/animation/Animator} */ - done: function(cb) { + done: function (cb) { if (cb) { this._doneList.push(cb); } @@ -4473,38 +5054,26 @@ if (typeof window !== 'undefined') { */ /** - * debug日志选项:catchBrushException为true下有效 - * 0 : 不生成debug数据,发布用 - * 1 : 异常抛出,调试用 - * 2 : 控制台输出,调试用 + * Debug log mode: + * 0: Do nothing, for release. + * 1: console.error, for debug. */ var debugMode = 0; // retina 屏幕优化 var devicePixelRatio = dpr; -var log = function () { +var logError = function () { }; if (debugMode === 1) { - log = function () { - for (var k in arguments) { - throw new Error(arguments[k]); - } - }; -} -else if (debugMode > 1) { - log = function () { - for (var k in arguments) { - console.log(arguments[k]); - } - }; + logError = console.error; } -var zrLog = log; +var logError$1 = logError; /** - * @alias modue:zrender/mixin/Animatable + * @alias module:zrender/mixin/Animatable * @constructor */ var Animatable = function () { @@ -4557,7 +5126,7 @@ Animatable.prototype = { } if (!target) { - zrLog( + logError$1( 'Property "' + path + '" is not existed in element ' @@ -5184,7 +5753,7 @@ BoundingRect.prototype = { var by0 = b.y; var by1 = b.y + b.height; - return ! (ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); + return !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); }, contain: function (x, y) { @@ -5778,7 +6347,10 @@ function TimSort(array, compare) { while (stackSize > 1) { var n = stackSize - 2; - if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) { + if ( + (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1]) + || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) + ) { if (runLength[n - 1] < runLength[n + 1]) { n--; } @@ -5868,7 +6440,9 @@ function TimSort(array, compare) { } var _minGallop = minGallop; - var count1, count2, exit; + var count1; + var count2; + var exit; while (1) { count1 = 0; @@ -5983,7 +6557,7 @@ function TimSort(array, compare) { } } - function mergeHigh (start1, length1, start2, length2) { + function mergeHigh(start1, length1, start2, length2) { var i = 0; for (i = 0; i < length2; i++) { @@ -6454,6 +7028,15 @@ var fixShadow = function (ctx, propName, value) { return value; }; +var ContextCachedBy = { + NONE: 0, + STYLE_BIND: 1, + PLAIN_TEXT: 2 +}; + +// Avoid confused with 0/false. +var WILL_BE_RESTORED = 9; + var STYLE_COMMON_PROPS = [ ['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'], ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10] @@ -6540,7 +7123,12 @@ Style.prototype = { strokeOpacity: null, /** - * @type {Array.} + * `true` is not supported. + * `false`/`null`/`undefined` are the same. + * `false` is used to remove lineDash in some + * case that `null`/`undefined` can not be set. + * (e.g., emphasis.lineStyle in echarts) + * @type {Array.|boolean} */ lineDash: null, @@ -6742,23 +7330,31 @@ Style.prototype = { /** * Whether transform text. - * Only useful in Path and Image element + * Only available in Path and Image element, + * where the text is called as `RectText`. * @type {boolean} */ transformText: false, /** - * Text rotate around position of Path or Image - * Only useful in Path and Image element and transformText is false. + * Text rotate around position of Path or Image. + * The origin of the rotation can be specified by `textOrigin`. + * Only available in Path and Image element, + * where the text is called as `RectText`. */ textRotation: 0, /** - * Text origin of text rotation, like [10, 40]. - * Based on x, y of rect. - * Useful in label rotation of circular symbol. - * By default, this origin is textPosition. - * Can be 'center'. + * Text origin of text rotation. + * Useful in the case like label rotation of circular symbol. + * Only available in Path and Image element, where the text is called + * as `RectText` and the element is called as "host element". + * The value can be: + * + If specified as a coordinate like `[10, 40]`, it is the `[x, y]` + * base on the left-top corner of the rect of its host element. + * + If specified as a string `center`, it is the center of the rect of + * its host element. + * + By default, this origin is the `textPosition`. * @type {string|Array.} */ textOrigin: null, @@ -6813,30 +7409,34 @@ Style.prototype = { bind: function (ctx, el, prevEl) { var style = this; var prevStyle = prevEl && prevEl.style; - var firstDraw = !prevStyle; + // If no prevStyle, it means first draw. + // Only apply cache if the last time cachced by this function. + var notCheckCache = !prevStyle || ctx.__attrCachedBy !== ContextCachedBy.STYLE_BIND; + + ctx.__attrCachedBy = ContextCachedBy.STYLE_BIND; for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { var prop = STYLE_COMMON_PROPS[i]; var styleName = prop[0]; - if (firstDraw || style[styleName] !== prevStyle[styleName]) { + if (notCheckCache || style[styleName] !== prevStyle[styleName]) { // FIXME Invalid property value will cause style leak from previous element. ctx[styleName] = fixShadow(ctx, styleName, style[styleName] || prop[1]); } } - if ((firstDraw || style.fill !== prevStyle.fill)) { + if ((notCheckCache || style.fill !== prevStyle.fill)) { ctx.fillStyle = style.fill; } - if ((firstDraw || style.stroke !== prevStyle.stroke)) { + if ((notCheckCache || style.stroke !== prevStyle.stroke)) { ctx.strokeStyle = style.stroke; } - if ((firstDraw || style.opacity !== prevStyle.opacity)) { + if ((notCheckCache || style.opacity !== prevStyle.opacity)) { ctx.globalAlpha = style.opacity == null ? 1 : style.opacity; } - if ((firstDraw || style.blend !== prevStyle.blend)) { + if ((notCheckCache || style.blend !== prevStyle.blend)) { ctx.globalCompositeOperation = style.blend || 'source-over'; } if (this.hasStroke()) { @@ -6993,7 +7593,7 @@ function createDom(id, painter, dpr) { * @param {module:zrender/Painter} painter * @param {number} [dpr] */ -var Layer = function(id, painter, dpr) { +var Layer = function (id, painter, dpr) { var dom; dpr = dpr || devicePixelRatio; if (typeof id === 'string') { @@ -7014,8 +7614,8 @@ var Layer = function(id, painter, dpr) { domStyle['user-select'] = 'none'; domStyle['-webkit-touch-callout'] = 'none'; domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)'; - domStyle['padding'] = 0; - domStyle['margin'] = 0; + domStyle['padding'] = 0; // eslint-disable-line dot-notation + domStyle['margin'] = 0; // eslint-disable-line dot-notation domStyle['border-width'] = 0; } @@ -7082,7 +7682,7 @@ Layer.prototype = { this.domBack = createDom('back-' + this.id, this.painter, dpr); this.ctxBack = this.domBack.getContext('2d'); - if (dpr != 1) { + if (dpr !== 1) { this.ctxBack.scale(dpr, dpr); } }, @@ -7110,7 +7710,7 @@ Layer.prototype = { domBack.width = width * dpr; domBack.height = height * dpr; - if (dpr != 1) { + if (dpr !== 1) { this.ctxBack.scale(dpr, dpr); } } @@ -7243,7 +7843,7 @@ function createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) { !isImageReady(image) && cachedImgObj.pending.push(pendingWrap); } else { - !image && (image = new Image()); + image = new Image(); image.onload = image.onerror = imageOnLoad; globalImageCache.put( @@ -7288,7 +7888,7 @@ var textWidthCacheCounter = 0; var TEXT_CACHE_MAX = 5000; var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g; -var DEFAULT_FONT = '12px sans-serif'; +var DEFAULT_FONT$1 = '12px sans-serif'; // Avoid assign to an exported variable, for transforming to cjs. var methods$1 = {}; @@ -7304,7 +7904,7 @@ function $override$1(name, fn) { * @return {number} width */ function getWidth(text, font) { - font = font || DEFAULT_FONT; + font = font || DEFAULT_FONT$1; var key = text + ':' + font; if (textWidthCache[key]) { return textWidthCache[key]; @@ -7339,14 +7939,14 @@ function getWidth(text, font) { * @param {Object} [truncate] * @return {Object} {x, y, width, height, lineHeight} */ -function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) { +function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) { return rich - ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) - : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, truncate); + ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) + : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate); } -function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, truncate) { - var contentBlock = parsePlainText(text, font, textPadding, truncate); +function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate) { + var contentBlock = parsePlainText(text, font, textPadding, textLineHeight, truncate); var outerWidth = getWidth(text, font); if (textPadding) { outerWidth += textPadding[1] + textPadding[3]; @@ -7362,13 +7962,14 @@ function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, return rect; } -function getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) { +function getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) { var contentBlock = parseRichText(text, { rich: rich, truncate: truncate, font: font, textAlign: textAlign, - textPadding: textPadding + textPadding: textPadding, + textLineHeight: textLineHeight }); var outerWidth = contentBlock.outerWidth; var outerHeight = contentBlock.outerHeight; @@ -7415,16 +8016,20 @@ function adjustTextY(y, height, textVerticalAlign) { } /** + * Follow same interface to `Displayable.prototype.calculateTextPosition`. * @public - * @param {stirng} textPosition - * @param {Object} rect {x, y, width, height} - * @param {number} distance - * @return {Object} {x, y, textAlign, textVerticalAlign} + * @param {Obejct} [out] Prepared out object. If not input, auto created in the method. + * @param {module:zrender/graphic/Style} style where `textPosition` and `textDistance` are visited. + * @param {Object} rect {x, y, width, height} Rect of the host elment, according to which the text positioned. + * @return {Object} The input `out`. Set: {x, y, textAlign, textVerticalAlign} */ -function adjustTextPositionOnRect(textPosition, rect, distance) { +function calculateTextPosition(out, style, rect) { + var textPosition = style.textPosition; + var distance = style.textDistance; var x = rect.x; var y = rect.y; + distance = distance || 0; var height = rect.height; var width = rect.width; @@ -7506,14 +8111,26 @@ function adjustTextPositionOnRect(textPosition, rect, distance) { break; } - return { - x: x, - y: y, - textAlign: textAlign, - textVerticalAlign: textVerticalAlign - }; + out = out || {}; + out.x = x; + out.y = y; + out.textAlign = textAlign; + out.textVerticalAlign = textVerticalAlign; + + return out; } +/** + * To be removed. But still do not remove in case that some one has imported it. + * @deprecated + * @public + * @param {stirng} textPosition + * @param {Object} rect {x, y, width, height} + * @param {number} distance + * @return {Object} {x, y, textAlign, textVerticalAlign} + */ + + /** * Show ellipsis if overflow. * @@ -7569,7 +8186,7 @@ function prepareTruncateOptions(containerWidth, font, ellipsis, options) { contentWidth -= ascCharWidth; } - var ellipsisWidth = getWidth(ellipsis); + var ellipsisWidth = getWidth(ellipsis, font); if (ellipsisWidth > contentWidth) { ellipsis = ''; ellipsisWidth = 0; @@ -7600,7 +8217,7 @@ function truncateSingleLine(textLine, options) { return textLine; } - for (var j = 0;; j++) { + for (var j = 0; ; j++) { if (lineWidth <= contentWidth || j >= options.maxIterations) { textLine += options.ellipsis; break; @@ -7656,7 +8273,7 @@ function measureText(text, font) { // Avoid assign to an exported variable, for transforming to cjs. methods$1.measureText = function (text, font) { var ctx = getContext(); - ctx.font = font || DEFAULT_FONT; + ctx.font = font || DEFAULT_FONT$1; return ctx.measureText(text); }; @@ -7665,22 +8282,27 @@ methods$1.measureText = function (text, font) { * @param {string} text * @param {string} font * @param {Object} [truncate] - * @return {Object} block: {lineHeight, lines, height, outerHeight} + * @return {Object} block: {lineHeight, lines, height, outerHeight, canCacheByTextString} * Notice: for performance, do not calculate outerWidth util needed. + * `canCacheByTextString` means the result `lines` is only determined by the input `text`. + * Thus we can simply comparing the `input` text to determin whether the result changed, + * without travel the result `lines`. */ -function parsePlainText(text, font, padding, truncate) { +function parsePlainText(text, font, padding, textLineHeight, truncate) { text != null && (text += ''); - var lineHeight = getLineHeight(font); + var lineHeight = retrieve2(textLineHeight, getLineHeight(font)); var lines = text ? text.split('\n') : []; var height = lines.length * lineHeight; var outerHeight = height; + var canCacheByTextString = true; if (padding) { outerHeight += padding[0] + padding[2]; } if (text && truncate) { + canCacheByTextString = false; var truncOuterHeight = truncate.outerHeight; var truncOuterWidth = truncate.outerWidth; if (truncOuterHeight != null && outerHeight > truncOuterHeight) { @@ -7707,7 +8329,8 @@ function parsePlainText(text, font, padding, truncate) { lines: lines, height: height, outerHeight: outerHeight, - lineHeight: lineHeight + lineHeight: lineHeight, + canCacheByTextString: canCacheByTextString }; } @@ -7955,6 +8578,15 @@ function makeFont(style) { return font && trim(font) || style.textFont || style.font; } +/** + * @param {Object} ctx + * @param {Object} shape + * @param {number} shape.x + * @param {number} shape.y + * @param {number} shape.width + * @param {number} shape.height + * @param {number} shape.r + */ function buildPath(ctx, shape) { var x = shape.x; var y = shape.y; @@ -8035,6 +8667,8 @@ function buildPath(ctx, shape) { r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5); } +var DEFAULT_FONT = DEFAULT_FONT$1; + // TODO: Have not support 'start', 'end' yet. var VALID_TEXT_ALIGN = {left: 1, right: 1, center: 1}; var VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1}; @@ -8046,6 +8680,8 @@ var SHADOW_STYLE_COMMON_PROPS = [ ['textShadowOffsetY', 'shadowOffsetY', 0], ['textShadowColor', 'shadowColor', 'transparent'] ]; +var _tmpTextPositionResult = {}; +var _tmpBoxPositionResult = {}; /** * @param {module:zrender/graphic/Style} style @@ -8088,11 +8724,11 @@ function normalizeStyle(style) { * @param {module:zrender/graphic/Style} style * @param {Object|boolean} [rect] {x, y, width, height} * If set false, rect text is not used. - * @param {Element} [prevEl] For ctx prop cache. + * @param {Element|module:zrender/graphic/helper/constant.WILL_BE_RESTORED} [prevEl] For ctx prop cache. */ function renderText(hostEl, ctx, text, style, rect, prevEl) { style.rich - ? renderRichText(hostEl, ctx, text, style, rect) + ? renderRichText(hostEl, ctx, text, style, rect, prevEl) : renderPlainText(hostEl, ctx, text, style, rect, prevEl); } @@ -8101,14 +8737,45 @@ function renderText(hostEl, ctx, text, style, rect, prevEl) { function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { 'use strict'; - var prevStyle = prevEl && prevEl.style; - // Some cache only available on textEl. - var isPrevTextEl = prevStyle && prevEl.type === 'text'; + var needDrawBg = needDrawBackground(style); + + var prevStyle; + var checkCache = false; + var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; + + // Only take and check cache for `Text` el, but not RectText. + if (prevEl !== WILL_BE_RESTORED) { + if (prevEl) { + prevStyle = prevEl.style; + checkCache = !needDrawBg && cachedByMe && prevStyle; + } + + // Prevent from using cache in `Style::bind`, because of the case: + // ctx property is modified by other properties than `Style::bind` + // used, and Style::bind is called next. + ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT; + } + // Since this will be restored, prevent from using these props to check cache in the next + // entering of this method. But do not need to clear other cache like `Style::bind`. + else if (cachedByMe) { + ctx.__attrCachedBy = ContextCachedBy.NONE; + } var styleFont = style.font || DEFAULT_FONT; - if (!isPrevTextEl || styleFont !== (prevStyle.font || DEFAULT_FONT)) { + // PENDING + // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically + // we can make font cache on ctx, which can cache for text el that are discontinuous. + // But layer save/restore needed to be considered. + // if (styleFont !== ctx.__fontCache) { + // ctx.font = styleFont; + // if (prevEl !== WILL_BE_RESTORED) { + // ctx.__fontCache = styleFont; + // } + // } + if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) { ctx.font = styleFont; } + // Use the final font from context-2d, because the final // font might not be the style.font when it is illegal. // But get `ctx.font` might be time consuming. @@ -8119,11 +8786,12 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { } var textPadding = style.textPadding; + var textLineHeight = style.textLineHeight; var contentBlock = hostEl.__textCotentBlock; if (!contentBlock || hostEl.__dirtyText) { contentBlock = hostEl.__textCotentBlock = parsePlainText( - text, computedFont, textPadding, style.truncate + text, computedFont, textPadding, textLineHeight, style.truncate ); } @@ -8132,7 +8800,7 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { var textLines = contentBlock.lines; var lineHeight = contentBlock.lineHeight; - var boxPos = getBoxPosition(outerHeight, style, rect); + var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect); var baseX = boxPos.baseX; var baseY = boxPos.baseY; var textAlign = boxPos.textAlign || 'left'; @@ -8145,7 +8813,6 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { var textX = baseX; var textY = boxY; - var needDrawBg = needDrawBackground(style); if (needDrawBg || textPadding) { // Consider performance, do not call getTextWidth util necessary. var textWidth = getWidth(text, computedFont); @@ -8168,6 +8835,8 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { // Force baseline to be "middle". Otherwise, if using "top", the // text will offset downward a little bit in font "Microsoft YaHei". ctx.textBaseline = 'middle'; + // Set text opacity + ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable. for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) { @@ -8175,7 +8844,7 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { var styleProp = propItem[0]; var ctxProp = propItem[1]; var val = style[styleProp]; - if (!isPrevTextEl || val !== prevStyle[styleProp]) { + if (!checkCache || val !== prevStyle[styleProp]) { ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]); } } @@ -8184,9 +8853,9 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { textY += lineHeight / 2; var textStrokeWidth = style.textStrokeWidth; - var textStrokeWidthPrev = isPrevTextEl ? prevStyle.textStrokeWidth : null; - var strokeWidthChanged = !isPrevTextEl || textStrokeWidth !== textStrokeWidthPrev; - var strokeChanged = !isPrevTextEl || strokeWidthChanged || style.textStroke !== prevStyle.textStroke; + var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null; + var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev; + var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke; var textStroke = getStroke(style.textStroke, textStrokeWidth); var textFill = getFill(style.textFill); @@ -8199,7 +8868,7 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { } } if (textFill) { - if (!isPrevTextEl || style.textFill !== prevStyle.textFill) { + if (!checkCache || style.textFill !== prevStyle.textFill) { ctx.fillStyle = textFill; } } @@ -8220,7 +8889,13 @@ function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { } } -function renderRichText(hostEl, ctx, text, style, rect) { +function renderRichText(hostEl, ctx, text, style, rect, prevEl) { + // Do not do cache for rich text because of the complexity. + // But `RectText` this will be restored, do not need to clear other cache like `Style::bind`. + if (prevEl !== WILL_BE_RESTORED) { + ctx.__attrCachedBy = ContextCachedBy.NONE; + } + var contentBlock = hostEl.__textCotentBlock; if (!contentBlock || hostEl.__dirtyText) { @@ -8236,7 +8911,7 @@ function drawRichText(hostEl, ctx, contentBlock, style, rect) { var outerHeight = contentBlock.outerHeight; var textPadding = style.textPadding; - var boxPos = getBoxPosition(outerHeight, style, rect); + var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect); var baseX = boxPos.baseX; var baseY = boxPos.baseY; var textAlign = boxPos.textAlign; @@ -8390,8 +9065,10 @@ function placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign } function needDrawBackground(style) { - return style.textBackgroundColor - || (style.textBorderWidth && style.textBorderColor); + return !!( + style.textBackgroundColor + || (style.textBorderWidth && style.textBorderColor) + ); } // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius, text} @@ -8434,10 +9111,6 @@ function drawBackground(hostEl, ctx, style, x, y, width, height) { ctx.fill(); } } - else if (isFunction$1(textBackgroundColor)) { - setCtx(ctx, 'fillStyle', textBackgroundColor(style)); - ctx.fill(); - } else if (isObject$1(textBackgroundColor)) { var image = textBackgroundColor.image; @@ -8471,7 +9144,7 @@ function onBgImageLoaded(image, textBackgroundColor) { textBackgroundColor.image = image; } -function getBoxPosition(blockHeiht, style, rect) { +function getBoxPosition(out, hostEl, style, rect) { var baseX = style.x || 0; var baseY = style.y || 0; var textAlign = style.textAlign; @@ -8486,9 +9159,9 @@ function getBoxPosition(blockHeiht, style, rect) { baseY = rect.y + parsePercent(textPosition[1], rect.height); } else { - var res = adjustTextPositionOnRect( - textPosition, rect, style.textDistance - ); + var res = (hostEl && hostEl.calculateTextPosition) + ? hostEl.calculateTextPosition(_tmpTextPositionResult, style, rect) + : calculateTextPosition(_tmpTextPositionResult, style, rect); baseX = res.x; baseY = res.y; // Default align and baseline when has textPosition @@ -8505,14 +9178,16 @@ function getBoxPosition(blockHeiht, style, rect) { } } - return { - baseX: baseX, - baseY: baseY, - textAlign: textAlign, - textVerticalAlign: textVerticalAlign - }; + out = out || {}; + out.baseX = baseX; + out.baseY = baseY; + out.textAlign = textAlign; + out.textVerticalAlign = textVerticalAlign; + + return out; } + function setCtx(ctx, prop, value) { ctx[prop] = fixShadow(ctx, prop, value); return ctx[prop]; @@ -8628,14 +9303,13 @@ RectText.prototype = { } // transformText and textRotation can not be used at the same time. - renderText(this, ctx, text, style, rect); + renderText(this, ctx, text, style, rect, WILL_BE_RESTORED); ctx.restore(); } }; /** - * 可绘制的图形基类 * Base class of all displayable graphic objects * @module zrender/graphic/Displayable */ @@ -8655,8 +9329,8 @@ function Displayable(opts) { // Extend properties for (var name in opts) { if ( - opts.hasOwnProperty(name) && - name !== 'style' + opts.hasOwnProperty(name) + && name !== 'style' ) { this[name] = opts[name]; } @@ -8669,7 +9343,9 @@ function Displayable(opts) { this._rect = null; // Shapes for cascade clipping. - this.__clipPaths = []; + // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array. + // because it is easy to only using null to check whether clipPaths changed. + this.__clipPaths = null; // FIXME Stateful must be mixined after style is setted // Stateful.call(this, opts); @@ -8682,16 +9358,15 @@ Displayable.prototype = { type: 'displayable', /** - * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制 - * Dirty flag. From which painter will determine if this displayable object needs brush + * Dirty flag. From which painter will determine if this displayable object needs brush. * @name module:zrender/graphic/Displayable#__dirty * @type {boolean} */ __dirty: true, /** - * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 - * If ignore drawing of the displayable object. Mouse event will still be triggered + * Whether the displayable object is visible. when it is true, the displayable object + * is not drawn, but the mouse event can still trigger the object. * @name module:/zrender/graphic/Displayable#invisible * @type {boolean} * @default false @@ -8713,7 +9388,7 @@ Displayable.prototype = { z2: 0, /** - * z层level,决定绘画在哪层canvas中 + * The z level determines the displayable object can be drawn in which layer canvas. * @name module:/zrender/graphic/Displayable#zlevel * @type {number} * @default 0 @@ -8721,7 +9396,7 @@ Displayable.prototype = { zlevel: 0, /** - * 是否可拖拽 + * Whether it can be dragged. * @name module:/zrender/graphic/Displayable#draggable * @type {boolean} * @default false @@ -8729,7 +9404,7 @@ Displayable.prototype = { draggable: false, /** - * 是否正在拖拽 + * Whether is it dragging. * @name module:/zrender/graphic/Displayable#draggable * @type {boolean} * @default false @@ -8737,7 +9412,7 @@ Displayable.prototype = { dragging: false, /** - * 是否相应鼠标事件 + * Whether to respond to mouse events. * @name module:/zrender/graphic/Displayable#silent * @type {boolean} * @default false @@ -8787,21 +9462,20 @@ Displayable.prototype = { afterBrush: function (ctx) {}, /** - * 图形绘制方法 + * Graphic drawing method. * @param {CanvasRenderingContext2D} ctx */ // Interface brush: function (ctx, prevEl) {}, /** - * 获取最小包围盒 + * Get the minimum bounding box. * @return {module:zrender/core/BoundingRect} */ // Interface getBoundingRect: function () {}, /** - * 判断坐标 x, y 是否在图形上 * If displayable element contain coord x, y * @param {number} x * @param {number} y @@ -8820,7 +9494,6 @@ Displayable.prototype = { }, /** - * 判断坐标 x, y 是否在图形的包围盒上 * If bounding rect of element contain coord x, y * @param {number} x * @param {number} y @@ -8833,7 +9506,6 @@ Displayable.prototype = { }, /** - * 标记图形元素为脏,并且在下一帧重绘 * Mark displayable element dirty and refresh next frame */ dirty: function () { @@ -8845,11 +9517,10 @@ Displayable.prototype = { }, /** - * 图形是否会触发事件 * If displayable object binded any event * @return {boolean} */ - // TODO, 通过 bind 绑定的事件 + // TODO, events bound by bind // isSilent: function () { // return !( // this.hoverable || this.draggable @@ -8894,7 +9565,28 @@ Displayable.prototype = { this.style = new Style(obj, this); this.dirty(false); return this; - } + }, + + /** + * The string value of `textPosition` needs to be calculated to a real postion. + * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]` + * by default. See `contain/text.js#calculateTextPosition` for more details. + * But some coutom shapes like "pin", "flag" have center that is not exactly + * `[width/2, height/2]`. So we provide this hook to customize the calculation + * for those shapes. It will be called if the `style.textPosition` is a string. + * @param {Obejct} [out] Prepared out object. If not provided, this method should + * be responsible for creating one. + * @param {module:zrender/graphic/Style} style + * @param {Object} rect {x, y, width, height} + * @return {Obejct} out The same as the input out. + * { + * x: number. mandatory. + * y: number. mandatory. + * textAlign: string. optional. use style.textAlign by default. + * textVerticalAlign: string. optional. use style.textVerticalAlign by default. + * } + */ + calculateTextPosition: null }; inherits(Displayable, Element); @@ -8990,14 +9682,14 @@ ZImage.prototype = { // Draw rect text if (style.text != null) { // Only restore transform when needs draw text. - this.restoreTransform(ctx); + this.restoreTransform(ctx); this.drawRectText(ctx, this.getBoundingRect()); } }, getBoundingRect: function () { var style = this.style; - if (! this._rect) { + if (!this._rect) { this._rect = new BoundingRect( style.x || 0, style.y || 0, style.width || 0, style.height || 0 ); @@ -9027,8 +9719,8 @@ function isLayerValid(layer) { return true; } - if (typeof(layer.resize) !== 'function' - || typeof(layer.refresh) !== 'function' + if (typeof (layer.resize) !== 'function' + || typeof (layer.refresh) !== 'function' ) { return false; } @@ -9049,10 +9741,10 @@ function isDisplayableCulled(el, width, height) { } function isClipPathChanged(clipPaths, prevClipPaths) { - if (clipPaths == prevClipPaths) { // Can both be null or undefined + // displayable.__clipPaths can only be `null`/`undefined` or an non-empty array. + if (clipPaths === prevClipPaths) { return false; } - if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) { return true; } @@ -9061,6 +9753,7 @@ function isClipPathChanged(clipPaths, prevClipPaths) { return true; } } + return false; } function doClip(clipPaths, ctx) { @@ -9079,10 +9772,16 @@ function doClip(clipPaths, ctx) { function createRoot(width, height) { var domRoot = document.createElement('div'); - // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + // domRoot.onselectstart = returnFalse; // Avoid page selected domRoot.style.cssText = [ 'position:relative', - 'overflow:hidden', + // IOS13 safari probably has a compositing bug (z order of the canvas and the consequent + // dom does not act as expected) when some of the parent dom has + // `-webkit-overflow-scrolling: touch;` and the webpage is longer than one screen and + // the canvas is not at the top part of the page. + // Check `https://bugs.webkit.org/show_bug.cgi?id=203681` for more details. We remove + // this `overflow:hidden` to avoid the bug. + // 'overflow:hidden', 'width:' + width + 'px', 'height:' + height + 'px', 'padding:0', @@ -9506,16 +10205,14 @@ Painter.prototype = { ) { var clipPaths = el.__clipPaths; + var prevElClipPaths = scope.prevElClipPaths; // Optimize when clipping on group with several elements - if (!scope.prevElClipPaths - || isClipPathChanged(clipPaths, scope.prevElClipPaths) - ) { + if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) { // If has previous clipping state, restore from it - if (scope.prevElClipPaths) { - currentLayer.ctx.restore(); + if (prevElClipPaths) { + ctx.restore(); scope.prevElClipPaths = null; - // Reset prevEl since context has been restored scope.prevEl = null; } @@ -9555,6 +10252,10 @@ Painter.prototype = { if (this._layerConfig[zlevel]) { merge(layer, this._layerConfig[zlevel], true); } + // TODO Remove EL_AFTER_INCREMENTAL_INC magic number + else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) { + merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true); + } if (virtual) { layer.virtual = virtual; @@ -9580,12 +10281,12 @@ Painter.prototype = { var domRoot = this._domRoot; if (layersMap[zlevel]) { - zrLog('ZLevel ' + zlevel + ' has been used already'); + logError$1('ZLevel ' + zlevel + ' has been used already'); return; } // Check if is a valid layer if (!isLayerValid(layer)) { - zrLog('Layer of zlevel ' + zlevel + ' is not valid'); + logError$1('Layer of zlevel ' + zlevel + ' is not valid'); return; } @@ -9707,23 +10408,40 @@ Painter.prototype = { var prevLayer = null; var incrementalLayerCount = 0; + var prevZlevel; for (var i = 0; i < list.length; i++) { var el = list[i]; var zlevel = el.zlevel; var layer; - // PENDING If change one incremental element style ? - // TODO Where there are non-incremental elements between incremental elements. + + if (prevZlevel !== zlevel) { + prevZlevel = zlevel; + incrementalLayerCount = 0; + } + + // TODO Not use magic number on zlevel. + + // Each layer with increment element can be separated to 3 layers. + // (Other Element drawn after incremental element) + // -----------------zlevel + EL_AFTER_INCREMENTAL_INC-------------------- + // (Incremental element) + // ----------------------zlevel + INCREMENTAL_INC------------------------ + // (Element drawn before incremental element) + // --------------------------------zlevel-------------------------------- if (el.incremental) { layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing); layer.incremental = true; incrementalLayerCount = 1; } else { - layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing); + layer = this.getLayer( + zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), + this._needsManuallyCompositing + ); } if (!layer.__builtin__) { - zrLog('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id); + logError$1('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id); } if (layer !== prevLayer) { @@ -9804,6 +10522,7 @@ Painter.prototype = { for (var i = 0; i < this._zlevelList.length; i++) { var _zlevel = this._zlevelList[i]; + // TODO Remove EL_AFTER_INCREMENTAL_INC magic number if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) { var layer = this._layers[_zlevel]; merge(layer, layerConfig[zlevel], true); @@ -9858,7 +10577,7 @@ Painter.prototype = { domRoot.style.display = ''; // 优化没有实际改变的resize - if (this._width != width || height != this._height) { + if (this._width !== width || height !== this._height) { domRoot.style.width = width + 'px'; domRoot.style.height = height + 'px'; @@ -10051,7 +10770,7 @@ Painter.prototype = { }; /** - * 动画主类, 调度和管理所有动画控制器 + * Animation main class, dispatch and manage all animation controllers * * @module zrender/animation/Animation * @author pissang(https://github.com/pissang) @@ -10094,7 +10813,7 @@ var Animation = function (options) { this.stage = options.stage || {}; - this.onframe = options.onframe || function() {}; + this.onframe = options.onframe || function () {}; // private properties this._clips = []; @@ -10116,14 +10835,14 @@ Animation.prototype = { constructor: Animation, /** - * 添加 clip + * Add clip * @param {module:zrender/animation/Clip} clip */ addClip: function (clip) { this._clips.push(clip); }, /** - * 添加 animator + * Add animator * @param {module:zrender/animation/Animator} animator */ addAnimator: function (animator) { @@ -10134,10 +10853,10 @@ Animation.prototype = { } }, /** - * 删除动画片段 + * Delete animation clip * @param {module:zrender/animation/Clip} clip */ - removeClip: function(clip) { + removeClip: function (clip) { var idx = indexOf(this._clips, clip); if (idx >= 0) { this._clips.splice(idx, 1); @@ -10145,7 +10864,7 @@ Animation.prototype = { }, /** - * 删除动画片段 + * Delete animation clip * @param {module:zrender/animation/Animator} animator */ removeAnimator: function (animator) { @@ -10156,7 +10875,7 @@ Animation.prototype = { animator.animation = null; }, - _update: function() { + _update: function () { var time = new Date().getTime() - this._pausedTime; var delta = time - this._time; var clips = this._clips; @@ -10304,166 +11023,55 @@ Animation.prototype = { mixin(Animation, Eventful); -/** - * Only implements needed gestures for mobile. - */ +/* global document */ -var GestureMgr = function () { - - /** - * @private - * @type {Array.} - */ - this._track = []; -}; - -GestureMgr.prototype = { - - constructor: GestureMgr, - - recognize: function (event, target, root) { - this._doTrack(event, target, root); - return this._recognize(event); - }, - - clear: function () { - this._track.length = 0; - return this; - }, - - _doTrack: function (event, target, root) { - var touches = event.touches; - - if (!touches) { - return; - } - - var trackItem = { - points: [], - touches: [], - target: target, - event: event - }; - - for (var i = 0, len = touches.length; i < len; i++) { - var touch = touches[i]; - var pos = clientToLocal(root, touch, {}); - trackItem.points.push([pos.zrX, pos.zrY]); - trackItem.touches.push(touch); - } - - this._track.push(trackItem); - }, - - _recognize: function (event) { - for (var eventName in recognizers) { - if (recognizers.hasOwnProperty(eventName)) { - var gestureInfo = recognizers[eventName](this._track, event); - if (gestureInfo) { - return gestureInfo; - } - } - } - } -}; +var TOUCH_CLICK_DELAY = 300; -function dist$1(pointPair) { - var dx = pointPair[1][0] - pointPair[0][0]; - var dy = pointPair[1][1] - pointPair[0][1]; +var globalEventSupported = env$1.domSupported; - return Math.sqrt(dx * dx + dy * dy); -} -function center(pointPair) { - return [ - (pointPair[0][0] + pointPair[1][0]) / 2, - (pointPair[0][1] + pointPair[1][1]) / 2 +var localNativeListenerNames = (function () { + var mouseHandlerNames = [ + 'click', 'dblclick', 'mousewheel', 'mouseout', + 'mouseup', 'mousedown', 'mousemove', 'contextmenu' ]; -} - -var recognizers = { - - pinch: function (track, event) { - var trackLen = track.length; - - if (!trackLen) { - return; - } - - var pinchEnd = (track[trackLen - 1] || {}).points; - var pinchPre = (track[trackLen - 2] || {}).points || pinchEnd; - - if (pinchPre - && pinchPre.length > 1 - && pinchEnd - && pinchEnd.length > 1 - ) { - var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre); - !isFinite(pinchScale) && (pinchScale = 1); - - event.pinchScale = pinchScale; - - var pinchCenter = center(pinchEnd); - event.pinchX = pinchCenter[0]; - event.pinchY = pinchCenter[1]; - - return { - type: 'pinch', - target: track[0].target, - event: event - }; - } - } - - // Only pinch currently. -}; - -var TOUCH_CLICK_DELAY = 300; - -var mouseHandlerNames = [ - 'click', 'dblclick', 'mousewheel', 'mouseout', - 'mouseup', 'mousedown', 'mousemove', 'contextmenu' -]; + var touchHandlerNames = [ + 'touchstart', 'touchend', 'touchmove' + ]; + var pointerEventNameMap = { + pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1 + }; + var pointerHandlerNames = map(mouseHandlerNames, function (name) { + var nm = name.replace('mouse', 'pointer'); + return pointerEventNameMap.hasOwnProperty(nm) ? nm : name; + }); -var touchHandlerNames = [ - 'touchstart', 'touchend', 'touchmove' -]; + return { + mouse: mouseHandlerNames, + touch: touchHandlerNames, + pointer: pointerHandlerNames + }; +})(); -var pointerEventNames = { - pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1 +var globalNativeListenerNames = { + mouse: ['mousemove', 'mouseup'], + pointer: ['pointermove', 'pointerup'] }; -var pointerHandlerNames = map(mouseHandlerNames, function (name) { - var nm = name.replace('mouse', 'pointer'); - return pointerEventNames[nm] ? nm : name; -}); function eventNameFix(name) { return (name === 'mousewheel' && env$1.browser.firefox) ? 'DOMMouseScroll' : name; } -function processGesture(proxy, event, stage) { - var gestureMgr = proxy._gestureMgr; - - stage === 'start' && gestureMgr.clear(); - - var gestureInfo = gestureMgr.recognize( - event, - proxy.handler.findHover(event.zrX, event.zrY, null).target, - proxy.dom - ); - - stage === 'end' && gestureMgr.clear(); - - // Do not do any preventDefault here. Upper application do that if necessary. - if (gestureInfo) { - var type = gestureInfo.type; - event.gestureEvent = type; - - proxy.handler.dispatchToElement({target: gestureInfo.target}, type, gestureInfo.event); - } +function isPointerFromTouch(event) { + var pointerType = event.pointerType; + return pointerType === 'pen' || pointerType === 'touch'; } +// function useMSGuesture(handlerProxy, event) { +// return isPointerFromTouch(event) && !!handlerProxy._msGesture; +// } + // function onMSGestureChange(proxy, event) { // if (event.translationX || event.translationY) { // // mousemove is carried by MSGesture to reduce the sensitivity. @@ -10483,117 +11091,177 @@ function processGesture(proxy, event, stage) { * 1. Mobile browsers dispatch mouse events 300ms after touchend. * 2. Chrome for Android dispatch mousedown for long-touch about 650ms * Result: Blocking Mouse Events for 700ms. + * + * @param {DOMHandlerScope} scope */ -function setTouchTimer(instance) { - instance._touching = true; - clearTimeout(instance._touchTimer); - instance._touchTimer = setTimeout(function () { - instance._touching = false; +function setTouchTimer(scope) { + scope.touching = true; + if (scope.touchTimer != null) { + clearTimeout(scope.touchTimer); + scope.touchTimer = null; + } + scope.touchTimer = setTimeout(function () { + scope.touching = false; + scope.touchTimer = null; }, 700); } +// Mark touch, which is useful in distinguish touch and +// mouse event in upper applicatoin. +function markTouch(event) { + event && (event.zrByTouch = true); +} + + +// function markTriggeredFromLocal(event) { +// event && (event.__zrIsFromLocal = true); +// } + +// function isTriggeredFromLocal(instance, event) { +// return !!(event && event.__zrIsFromLocal); +// } + +function normalizeGlobalEvent(instance, event) { + // offsetX, offsetY still need to be calculated. They are necessary in the event + // handlers of the upper applications. Set `true` to force calculate them. + return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true); +} + +/** + * Detect whether the given el is in `painterRoot`. + */ +function isLocalEl(instance, el) { + var elTmp = el; + var isLocal = false; + while (elTmp && elTmp.nodeType !== 9 + && !( + isLocal = elTmp.domBelongToZr + || (elTmp !== el && elTmp === instance.painterRoot) + ) + ) { + elTmp = elTmp.parentNode; + } + return isLocal; +} + +/** + * Make a fake event but not change the original event, + * becuase the global event probably be used by other + * listeners not belonging to zrender. + * @class + */ +function FakeGlobalEvent(instance, event) { + this.type = event.type; + this.target = this.currentTarget = instance.dom; + this.pointerType = event.pointerType; + // Necessray for the force calculation of zrX, zrY + this.clientX = event.clientX; + this.clientY = event.clientY; + // Because we do not mount global listeners to touch events, + // we do not copy `targetTouches` and `changedTouches` here. +} +var fakeGlobalEventProto = FakeGlobalEvent.prototype; +// we make the default methods on the event do nothing, +// otherwise it is dangerous. See more details in +// [Drag outside] in `Handler.js`. +fakeGlobalEventProto.stopPropagation = + fakeGlobalEventProto.stopImmediatePropagation = + fakeGlobalEventProto.preventDefault = noop; + + +/** + * Local DOM Handlers + * @this {HandlerProxy} + */ +var localDOMHandlers = { + + mousedown: function (event) { + event = normalizeEvent(this.dom, event); + + this._mayPointerCapture = [event.zrX, event.zrY]; + + this.trigger('mousedown', event); + }, -var domHandlers = { - /** - * Mouse move handler - * @inner - * @param {Event} event - */ mousemove: function (event) { event = normalizeEvent(this.dom, event); + var downPoint = this._mayPointerCapture; + if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) { + togglePointerCapture(this, true); + } + this.trigger('mousemove', event); }, - /** - * Mouse out handler - * @inner - * @param {Event} event - */ - mouseout: function (event) { + mouseup: function (event) { event = normalizeEvent(this.dom, event); - var element = event.toElement || event.relatedTarget; - if (element != this.dom) { - while (element && element.nodeType != 9) { - // 忽略包含在root中的dom引起的mouseOut - if (element === this.dom) { - return; - } + togglePointerCapture(this, false); - element = element.parentNode; - } + this.trigger('mouseup', event); + }, + + mouseout: function (event) { + event = normalizeEvent(this.dom, event); + + // Similarly to the browser did on `document` and touch event, + // `globalout` will be delayed to final pointer cature release. + if (this._pointerCapturing) { + event.zrEventControl = 'no_globalout'; } + // There might be some doms created by upper layer application + // at the same level of painter.getViewportRoot() (e.g., tooltip + // dom created by echarts), where 'globalout' event should not + // be triggered when mouse enters these doms. (But 'mouseout' + // should be triggered at the original hovered element as usual). + var element = event.toElement || event.relatedTarget; + event.zrIsToLocalDOM = isLocalEl(this, element); + this.trigger('mouseout', event); }, - /** - * Touch开始响应函数 - * @inner - * @param {Event} event - */ touchstart: function (event) { // Default mouse behaviour should not be disabled here. // For example, page may needs to be slided. event = normalizeEvent(this.dom, event); - // Mark touch, which is useful in distinguish touch and - // mouse event in upper applicatoin. - event.zrByTouch = true; + markTouch(event); this._lastTouchMoment = new Date(); - processGesture(this, event, 'start'); + this.handler.processGesture(event, 'start'); - // In touch device, trigger `mousemove`(`mouseover`) should - // be triggered, and must before `mousedown` triggered. - domHandlers.mousemove.call(this, event); - - domHandlers.mousedown.call(this, event); - - setTouchTimer(this); + // For consistent event listener for both touch device and mouse device, + // we simulate "mouseover-->mousedown" in touch device. So we trigger + // `mousemove` here (to trigger `mouseover` inside), and then trigger + // `mousedown`. + localDOMHandlers.mousemove.call(this, event); + localDOMHandlers.mousedown.call(this, event); }, - /** - * Touch移动响应函数 - * @inner - * @param {Event} event - */ touchmove: function (event) { - event = normalizeEvent(this.dom, event); - // Mark touch, which is useful in distinguish touch and - // mouse event in upper applicatoin. - event.zrByTouch = true; + markTouch(event); - processGesture(this, event, 'change'); + this.handler.processGesture(event, 'change'); // Mouse move should always be triggered no matter whether // there is gestrue event, because mouse move and pinch may // be used at the same time. - domHandlers.mousemove.call(this, event); - - setTouchTimer(this); + localDOMHandlers.mousemove.call(this, event); }, - /** - * Touch结束响应函数 - * @inner - * @param {Event} event - */ touchend: function (event) { - event = normalizeEvent(this.dom, event); - // Mark touch, which is useful in distinguish touch and - // mouse event in upper applicatoin. - event.zrByTouch = true; + markTouch(event); - processGesture(this, event, 'end'); + this.handler.processGesture(event, 'end'); - domHandlers.mouseup.call(this, event); + localDOMHandlers.mouseup.call(this, event); // Do not trigger `mouseout` here, in spite of `mousemove`(`mouseover`) is // triggered in `touchstart`. This seems to be illogical, but by this mechanism, @@ -10606,14 +11274,12 @@ var domHandlers = { // click event should always be triggered no matter whether // there is gestrue event. System click can not be prevented. if (+new Date() - this._lastTouchMoment < TOUCH_CLICK_DELAY) { - domHandlers.click.call(this, event); + localDOMHandlers.click.call(this, event); } - - setTouchTimer(this); }, pointerdown: function (event) { - domHandlers.mousedown.call(this, event); + localDOMHandlers.mousedown.call(this, event); // if (useMSGuesture(this, event)) { // this._msGesture.addPointer(event.pointerId); @@ -10627,12 +11293,12 @@ var domHandlers = { // upper application. So, we dont support mousemove on MS touch // device yet. if (!isPointerFromTouch(event)) { - domHandlers.mousemove.call(this, event); + localDOMHandlers.mousemove.call(this, event); } }, pointerup: function (event) { - domHandlers.mouseup.call(this, event); + localDOMHandlers.mouseup.call(this, event); }, pointerout: function (event) { @@ -10640,86 +11306,77 @@ var domHandlers = { // (IE11+/Edge on MS Surface) after click event triggered, // which is inconsistent with the mousout behavior we defined // in touchend. So we unify them. - // (check domHandlers.touchend for detailed explanation) + // (check localDOMHandlers.touchend for detailed explanation) if (!isPointerFromTouch(event)) { - domHandlers.mouseout.call(this, event); + localDOMHandlers.mouseout.call(this, event); } } -}; -function isPointerFromTouch(event) { - var pointerType = event.pointerType; - return pointerType === 'pen' || pointerType === 'touch'; -} - -// function useMSGuesture(handlerProxy, event) { -// return isPointerFromTouch(event) && !!handlerProxy._msGesture; -// } +}; -// Common handlers -each$1(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { - domHandlers[name] = function (event) { +/** + * Othere DOM UI Event handlers for zr dom. + * @this {HandlerProxy} + */ +each$1(['click', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { + localDOMHandlers[name] = function (event) { event = normalizeEvent(this.dom, event); this.trigger(name, event); }; }); + /** - * 为控制类实例初始化dom 事件处理函数 + * DOM UI Event handlers for global page. * - * @inner - * @param {module:zrender/Handler} instance 控制类实例 + * [Caution]: + * those handlers should both support in capture phase and bubble phase! + * + * @this {HandlerProxy} */ -function initDomHandler(instance) { - each$1(touchHandlerNames, function (name) { - instance._handlers[name] = bind(domHandlers[name], instance); - }); - - each$1(pointerHandlerNames, function (name) { - instance._handlers[name] = bind(domHandlers[name], instance); - }); +var globalDOMHandlers = { - each$1(mouseHandlerNames, function (name) { - instance._handlers[name] = makeMouseHandler(domHandlers[name], instance); - }); + pointermove: function (event) { + // FIXME + // pointermove is so sensitive that it always triggered when + // tap(click) on touch screen, which affect some judgement in + // upper application. So, we dont support mousemove on MS touch + // device yet. + if (!isPointerFromTouch(event)) { + globalDOMHandlers.mousemove.call(this, event); + } + }, - function makeMouseHandler(fn, instance) { - return function () { - if (instance._touching) { - return; - } - return fn.apply(instance, arguments); - }; - } -} + pointerup: function (event) { + globalDOMHandlers.mouseup.call(this, event); + }, + mousemove: function (event) { + this.trigger('mousemove', event); + }, -function HandlerDomProxy(dom) { - Eventful.call(this); + mouseup: function (event) { + var pointerCaptureReleasing = this._pointerCapturing; - this.dom = dom; + togglePointerCapture(this, false); - /** - * @private - * @type {boolean} - */ - this._touching = false; + this.trigger('mouseup', event); - /** - * @private - * @type {number} - */ - this._touchTimer; + if (pointerCaptureReleasing) { + event.zrEventControl = 'only_globalout'; + this.trigger('mouseout', event); + } + } - /** - * @private - * @type {module:zrender/core/GestureMgr} - */ - this._gestureMgr = new GestureMgr(); +}; - this._handlers = {}; - initDomHandler(this); +/** + * @param {HandlerProxy} instance + * @param {DOMHandlerScope} scope + */ +function mountLocalDOMEventListeners(instance, scope) { + var domHandlers = scope.domHandlers; if (env$1.pointerEventsSupported) { // Only IE11+/Edge // 1. On devices that both enable touch and mouse (e.g., MS Surface and lenovo X240), @@ -10728,7 +11385,12 @@ function HandlerDomProxy(dom) { // 2. On MS Surface, it probablely only trigger mousedown but no mouseup when tap on // screen, which do not occurs in pointer event. // So we use pointer event to both detect touch gesture and mouse behavior. - mountHandlers(pointerHandlerNames, this); + each$1(localNativeListenerNames.pointer, function (nativeEventName) { + mountSingleDOMEventListener(scope, nativeEventName, function (event) { + // markTriggeredFromLocal(event); + domHandlers[nativeEventName].call(instance, event); + }); + }); // FIXME // Note: MS Gesture require CSS touch-action set. But touch-action is not reliable, @@ -10747,7 +11409,13 @@ function HandlerDomProxy(dom) { } else { if (env$1.touchEventsSupported) { - mountHandlers(touchHandlerNames, this); + each$1(localNativeListenerNames.touch, function (nativeEventName) { + mountSingleDOMEventListener(scope, nativeEventName, function (event) { + // markTriggeredFromLocal(event); + domHandlers[nativeEventName].call(instance, event); + setTouchTimer(scope); + }); + }); // Handler of 'mouseout' event is needed in touch mode, which will be mounted below. // addEventListener(root, 'mouseout', this._mouseoutHandler); } @@ -10757,23 +11425,145 @@ function HandlerDomProxy(dom) { // mouse event can not be handle in those devices. // 2. On MS Surface, Chrome will trigger both touch event and mouse event. How to prevent // mouseevent after touch event triggered, see `setTouchTimer`. - mountHandlers(mouseHandlerNames, this); + each$1(localNativeListenerNames.mouse, function (nativeEventName) { + mountSingleDOMEventListener(scope, nativeEventName, function (event) { + event = getNativeEvent(event); + if (!scope.touching) { + // markTriggeredFromLocal(event); + domHandlers[nativeEventName].call(instance, event); + } + }); + }); } +} - function mountHandlers(handlerNames, instance) { - each$1(handlerNames, function (name) { - addEventListener(dom, eventNameFix(name), instance._handlers[name]); - }, instance); +/** + * @param {HandlerProxy} instance + * @param {DOMHandlerScope} scope + */ +function mountGlobalDOMEventListeners(instance, scope) { + // Only IE11+/Edge. See the comment in `mountLocalDOMEventListeners`. + if (env$1.pointerEventsSupported) { + each$1(globalNativeListenerNames.pointer, mount); } + // Touch event has implemented "drag outside" so we do not mount global listener for touch event. + // (see https://www.w3.org/TR/touch-events/#the-touchmove-event) + // We do not consider "both-support-touch-and-mouse device" for this feature (see the comment of + // `mountLocalDOMEventListeners`) to avoid bugs util some requirements come. + else if (!env$1.touchEventsSupported) { + each$1(globalNativeListenerNames.mouse, mount); + } + + function mount(nativeEventName) { + function nativeEventListener(event) { + event = getNativeEvent(event); + // See the reason in [Drag outside] in `Handler.js` + // This checking supports both `useCapture` or not. + // PENDING: if there is performance issue in some devices, + // we probably can not use `useCapture` and change a easier + // to judes whether local (mark). + if (!isLocalEl(instance, event.target)) { + event = normalizeGlobalEvent(instance, event); + scope.domHandlers[nativeEventName].call(instance, event); + } + } + mountSingleDOMEventListener( + scope, nativeEventName, nativeEventListener, + {capture: true} // See [Drag Outside] in `Handler.js` + ); + } +} + +function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) { + scope.mounted[nativeEventName] = listener; + scope.listenerOpts[nativeEventName] = opt; + addEventListener(scope.domTarget, eventNameFix(nativeEventName), listener, opt); +} + +function unmountDOMEventListeners(scope) { + var mounted = scope.mounted; + for (var nativeEventName in mounted) { + if (mounted.hasOwnProperty(nativeEventName)) { + removeEventListener( + scope.domTarget, eventNameFix(nativeEventName), mounted[nativeEventName], + scope.listenerOpts[nativeEventName] + ); + } + } + scope.mounted = {}; +} + +/** + * See [Drag Outside] in `Handler.js`. + * @implement + * @param {boolean} isPointerCapturing Should never be `null`/`undefined`. + * `true`: start to capture pointer if it is not capturing. + * `false`: end the capture if it is capturing. + */ +function togglePointerCapture(instance, isPointerCapturing) { + instance._mayPointerCapture = null; + + if (globalEventSupported && (instance._pointerCapturing ^ isPointerCapturing)) { + instance._pointerCapturing = isPointerCapturing; + + var globalHandlerScope = instance._globalHandlerScope; + isPointerCapturing + ? mountGlobalDOMEventListeners(instance, globalHandlerScope) + : unmountDOMEventListeners(globalHandlerScope); + } +} + +/** + * @inner + * @class + */ +function DOMHandlerScope(domTarget, domHandlers) { + this.domTarget = domTarget; + this.domHandlers = domHandlers; + + // Key: eventName, value: mounted handler funcitons. + // Used for unmount. + this.mounted = {}; + this.listenerOpts = {}; + + this.touchTimer = null; + this.touching = false; +} + +/** + * @public + * @class + */ +function HandlerDomProxy(dom, painterRoot) { + Eventful.call(this); + + this.dom = dom; + this.painterRoot = painterRoot; + + this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers); + + if (globalEventSupported) { + this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers); + } + + /** + * @type {boolean} + */ + this._pointerCapturing = false; + /** + * @type {Array.} [x, y] or null. + */ + this._mayPointerCapture = null; + + mountLocalDOMEventListeners(this, this._localHandlerScope); } var handlerDomProxyProto = HandlerDomProxy.prototype; -handlerDomProxyProto.dispose = function () { - var handlerNames = mouseHandlerNames.concat(touchHandlerNames); - for (var i = 0; i < handlerNames.length; i++) { - var name = handlerNames[i]; - removeEventListener(this.dom, eventNameFix(name), this._handlers[name]); +handlerDomProxyProto.dispose = function () { + unmountDOMEventListeners(this._localHandlerScope); + if (globalEventSupported) { + unmountDOMEventListeners(this._globalHandlerScope); } }; @@ -10781,6 +11571,7 @@ handlerDomProxyProto.setCursor = function (cursorStyle) { this.dom.style && (this.dom.style.cursor = cursorStyle || 'default'); }; + mixin(HandlerDomProxy, Eventful); /*! @@ -10804,12 +11595,12 @@ var instances$1 = {}; // ZRender实例map索引 /** * @type {string} */ -var version$1 = '4.0.4'; +var version$1 = '4.3.1'; /** * Initializing a zrender instance * @param {HTMLElement} dom - * @param {Object} opts + * @param {Object} [opts] * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg' * @param {number} [opts.devicePixelRatio] * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined) @@ -10906,7 +11697,7 @@ var ZRender = function (id, dom, opts) { this.storage = storage; this.painter = painter; - var handerProxy = (!env$1.node && !env$1.worker) ? new HandlerDomProxy(painter.getViewportRoot()) : null; + var handerProxy = (!env$1.node && !env$1.worker) ? new HandlerDomProxy(painter.getViewportRoot(), painter.root) : null; this.handler = new Handler(storage, painter, handerProxy, painter.root); /** @@ -11003,14 +11794,14 @@ ZRender.prototype = { */ refreshImmediately: function () { // var start = new Date(); + // Clear needsRefresh ahead to avoid something wrong happens in refresh // Or it will cause zrender refreshes again and again. - this._needsRefresh = false; + this._needsRefresh = this._needsRefreshHover = false; this.painter.refresh(); - /** - * Avoid trigger zr.refresh in Element#beforeUpdate hook - */ - this._needsRefresh = false; + // Avoid trigger zr.refresh in Element#beforeUpdate hook + this._needsRefresh = this._needsRefreshHover = false; + // var end = new Date(); // var log = document.getElementById('log'); // if (log) { @@ -11021,7 +11812,7 @@ ZRender.prototype = { /** * Mark and repaint the canvas in the next frame of browser */ - refresh: function() { + refresh: function () { this._needsRefresh = true; }, @@ -11100,7 +11891,7 @@ ZRender.prototype = { * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined) * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined) */ - resize: function(opts) { + resize: function (opts) { opts = opts || {}; this.painter.resize(opts.width, opts.height); this.handler.resize(); @@ -11116,14 +11907,14 @@ ZRender.prototype = { /** * Get container width */ - getWidth: function() { + getWidth: function () { return this.painter.getWidth(); }, /** * Get container height */ - getHeight: function() { + getHeight: function () { return this.painter.getHeight(); }, @@ -11146,7 +11937,7 @@ ZRender.prototype = { * @param {number} width * @param {number} height */ - pathToImage: function(e, dpr) { + pathToImage: function (e, dpr) { return this.painter.pathToImage(e, dpr); }, @@ -11175,7 +11966,7 @@ ZRender.prototype = { * @param {Function} eventHandler Handler function * @param {Object} [context] Context object */ - on: function(eventName, eventHandler, context) { + on: function (eventName, eventHandler, context) { this.handler.on(eventName, eventHandler, context); }, @@ -11184,7 +11975,7 @@ ZRender.prototype = { * @param {string} eventName Event name * @param {Function} [eventHandler] Handler function */ - off: function(eventName, eventHandler) { + off: function (eventName, eventHandler) { this.handler.off(eventName, eventHandler); }, @@ -11761,6 +12552,41 @@ function getAttribute(dom, key) { : dom[key]; } +function getTooltipRenderMode(renderModeOption) { + if (renderModeOption === 'auto') { + // Using html when `document` exists, use richText otherwise + return env$1.domSupported ? 'html' : 'richText'; + } + else { + return renderModeOption || 'html'; + } +} + +/** + * Group a list by key. + * + * @param {Array} array + * @param {Function} getKey + * param {*} Array item + * return {string} key + * @return {Object} Result + * {Array}: keys, + * {module:zrender/core/util/HashMap} buckets: {key -> Array} + */ +function groupData(array, getKey) { + var buckets = createHashMap(); + var keys = []; + + each$1(array, function (item) { + var key = getKey(item); + (buckets.get(key) + || (keys.push(key), buckets.set(key, [])) + ).push(item); + }); + + return {keys: keys, buckets: buckets}; +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -12095,8 +12921,9 @@ var getLineStyle = makeStyleMapper( var lineStyleMixin = { getLineStyle: function (excludes) { var style = getLineStyle(this, excludes); - var lineDash = this.getLineDash(style.lineWidth); - lineDash && (style.lineDash = lineDash); + // Always set lineDash whether dashed, otherwise we can not + // erase the previous style when assigning to el.style. + style.lineDash = this.getLineDash(style.lineWidth); return style; }, @@ -12107,8 +12934,16 @@ var lineStyleMixin = { var lineType = this.get('type'); var dotSize = Math.max(lineWidth, 2); var dashSize = lineWidth * 4; - return (lineType === 'solid' || lineType == null) ? null - : (lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize]); + return (lineType === 'solid' || lineType == null) + // Use `false` but not `null` for the solid line here, because `null` might be + // ignored when assigning to `el.style`. e.g., when setting `lineStyle.type` as + // `'dashed'` and `emphasis.lineStyle.type` as `'solid'` in graph series, the + // `lineDash` gotten form the latter one is not able to erase that from the former + // one if using `null` here according to the emhpsis strategy in `util/graphic.js`. + ? false + : lineType === 'dashed' + ? [dashSize, dashSize] + : [dotSize, dotSize]; } }; @@ -12223,7 +13058,7 @@ function cubicRootAt(p0, p1, p2, p3, val, roots) { // Evaluate roots of cubic functions var a = p3 + 3 * (p1 - p2) - p0; var b = 3 * (p2 - p1 * 2 + p0); - var c = 3 * (p1 - p0); + var c = 3 * (p1 - p0); var d = p0 - val; var A = b * b - 3 * a * c; @@ -12320,7 +13155,7 @@ function cubicExtrema(p0, p1, p2, p3, extrema) { if (isAroundZero(a)) { if (isNotAroundZero$1(b)) { var t1 = -c / b; - if (t1 >= 0 && t1 <=1) { + if (t1 >= 0 && t1 <= 1) { extrema[n++] = t1; } } @@ -12889,6 +13724,8 @@ function fromArc( // TODO getTotalLength, getPointAtLength +/* global Float32Array */ + var CMD = { M: 1, L: 2, @@ -12921,7 +13758,7 @@ var mathSin$1 = Math.sin; var mathSqrt$1 = Math.sqrt; var mathAbs = Math.abs; -var hasTypedArray = typeof Float32Array != 'undefined'; +var hasTypedArray = typeof Float32Array !== 'undefined'; /** * @alias module:zrender/core/PathProxy @@ -12972,9 +13809,11 @@ PathProxy.prototype = { /** * @readOnly */ - setScale: function (sx, sy) { - this._ux = mathAbs(1 / devicePixelRatio / sx) || 0; - this._uy = mathAbs(1 / devicePixelRatio / sy) || 0; + setScale: function (sx, sy, segmentIgnoreThreshold) { + // Compat. Previously there is no segmentIgnoreThreshold. + segmentIgnoreThreshold = segmentIgnoreThreshold || 0; + this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0; + this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0; }, getContext: function () { @@ -13211,7 +14050,7 @@ PathProxy.prototype = { var len$$1 = data.length; - if (! (this.data && this.data.length == len$$1) && hasTypedArray) { + if (!(this.data && this.data.length === len$$1) && hasTypedArray) { this.data = new Float32Array(len$$1); } @@ -13319,7 +14158,7 @@ PathProxy.prototype = { y -= offset * dy; while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1) - || (dx == 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) { + || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) { idx = this._dashIdx; dash = lineDash[idx]; x += dx * dash; @@ -13449,7 +14288,7 @@ PathProxy.prototype = { for (var i = 0; i < data.length;) { var cmd = data[i++]; - if (i == 1) { + if (i === 1) { // 如果第一个命令是 L, C, Q // 则 previous point 同绘制命令的第一个 point // @@ -13504,10 +14343,10 @@ PathProxy.prototype = { var startAngle = data[i++]; var endAngle = data[i++] + startAngle; // TODO Arc 旋转 - var psi = data[i++]; + i += 1; var anticlockwise = 1 - data[i++]; - if (i == 1) { + if (i === 1) { // 直接使用 arc 命令 // 第一个命令起点还未定义 x0 = mathCos$1(startAngle) * rx + cx; @@ -13558,16 +14397,19 @@ PathProxy.prototype = { */ rebuildPath: function (ctx) { var d = this.data; - var x0, y0; - var xi, yi; - var x, y; + var x0; + var y0; + var xi; + var yi; + var x; + var y; var ux = this._ux; var uy = this._uy; var len$$1 = this._len; for (var i = 0; i < len$$1;) { var cmd = d[i++]; - if (i == 1) { + if (i === 1) { // 如果第一个命令是 L, C, Q // 则 previous point 同绘制命令的第一个 point // @@ -13633,7 +14475,7 @@ PathProxy.prototype = { ctx.arc(cx, cy, r, theta, endAngle, 1 - fs); } - if (i == 1) { + if (i === 1) { // 直接使用 arc 命令 // 第一个命令起点还未定义 x0 = mathCos$1(theta) * rx + cx; @@ -13688,7 +14530,7 @@ function containStroke$1(x0, y0, x1, y1, lineWidth, x, y) { if (x0 !== x1) { _a = (y0 - y1) / (x0 - x1); - _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; + _b = (x0 * y1 - x1 * y0) / (x0 - x1); } else { return Math.abs(x - x0) <= _l / 2; @@ -13818,7 +14660,8 @@ function containStroke$4( var tmp = startAngle; startAngle = normalizeRadian(endAngle); endAngle = normalizeRadian(tmp); - } else { + } + else { startAngle = normalizeRadian(startAngle); endAngle = normalizeRadian(endAngle); } @@ -13890,7 +14733,8 @@ function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { else { var w = 0; var nExtrema = -1; - var y0_, y1_; + var y0_; + var y1_; for (var i = 0; i < nRoots; i++) { var t = roots[i]; @@ -13911,7 +14755,7 @@ function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { y1_ = cubicAt(y0, y1, y2, y3, extrema[1]); } } - if (nExtrema == 2) { + if (nExtrema === 2) { // 分成三段单调函数 if (t < extrema[0]) { w += y0_ < y0 ? unit : -unit; @@ -14008,7 +14852,8 @@ function windingArc( var dir = anticlockwise ? 1 : -1; if (x >= roots[0] + cx && x <= roots[1] + cx) { return dir; - } else { + } + else { return 0; } } @@ -14070,7 +14915,7 @@ function containPath(data, lineWidth, isStroke, x, y) { // } } - if (i == 1) { + if (i === 1) { // 如果第一个命令是 L, C, Q // 则 previous point 同绘制命令的第一个 point // @@ -14151,7 +14996,7 @@ function containPath(data, lineWidth, isStroke, x, y) { var theta = data[i++]; var dTheta = data[i++]; // TODO Arc 旋转 - var psi = data[i++]; + i += 1; var anticlockwise = 1 - data[i++]; var x1 = Math.cos(theta) * rx + cx; var y1 = Math.sin(theta) * ry + cy; @@ -14272,6 +15117,17 @@ Path.prototype = { strokeContainThreshold: 5, + // This item default to be false. But in map series in echarts, + // in order to improve performance, it should be set to true, + // so the shorty segment won't draw. + segmentIgnoreThreshold: 0, + + /** + * See `module:zrender/src/graphic/helper/subPixelOptimize`. + * @type {boolean} + */ + subPixelOptimize: false, + brush: function (ctx, prevEl) { var style = this.style; var path = this.path || pathProxyForDraw; @@ -14321,7 +15177,7 @@ Path.prototype = { // Update path sx, sy var scale = this.getGlobalScale(); - path.setScale(scale[0], scale[1]); + path.setScale(scale[0], scale[1], this.segmentIgnoreThreshold); // Proxy context // Rebuild path in following 2 cases @@ -14591,7 +15447,7 @@ Path.extend = function (defaults$$1) { var thisShape = this.shape; for (var name in defaultShape) { if ( - ! thisShape.hasOwnProperty(name) + !thisShape.hasOwnProperty(name) && defaultShape.hasOwnProperty(name) ) { thisShape[name] = defaultShape[name]; @@ -14721,13 +15577,13 @@ var mathSin = Math.sin; var mathCos = Math.cos; var PI = Math.PI; -var vMag = function(v) { +var vMag = function (v) { return Math.sqrt(v[0] * v[0] + v[1] * v[1]); }; -var vRatio = function(u, v) { +var vRatio = function (u, v) { return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); }; -var vAngle = function(u, v) { +var vAngle = function (u, v) { return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); }; @@ -15179,6 +16035,9 @@ Text.prototype = { // style.bind(ctx, this, prevEl); if (!needDrawText(text, style)) { + // The current el.style is not applied + // and should not be used as cache. + ctx.__attrCachedBy = ContextCachedBy.NONE; return; } @@ -15205,6 +16064,7 @@ Text.prototype = { style.textAlign, style.textVerticalAlign, style.textPadding, + style.textLineHeight, style.rich ); @@ -15510,7 +16370,8 @@ var smoothBezier = function (points, smooth, isLoop, constraint) { var prevPoint; var nextPoint; - var min$$1, max$$1; + var min$$1; + var max$$1; if (constraint) { min$$1 = [Infinity, Infinity]; max$$1 = [-Infinity, -Infinity]; @@ -15659,11 +16520,131 @@ var Polyline = Path.extend({ } }); +/** + * Sub-pixel optimize for canvas rendering, prevent from blur + * when rendering a thin vertical/horizontal line. + */ + +var round = Math.round; + +/** + * Sub pixel optimize line for canvas + * + * @param {Object} outputShape The modification will be performed on `outputShape`. + * `outputShape` and `inputShape` can be the same object. + * `outputShape` object can be used repeatly, because all of + * the `x1`, `x2`, `y1`, `y2` will be assigned in this method. + * @param {Object} [inputShape] + * @param {number} [inputShape.x1] + * @param {number} [inputShape.y1] + * @param {number} [inputShape.x2] + * @param {number} [inputShape.y2] + * @param {Object} [style] + * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize. + */ +function subPixelOptimizeLine$1(outputShape, inputShape, style) { + if (!inputShape) { + return; + } + + var x1 = inputShape.x1; + var x2 = inputShape.x2; + var y1 = inputShape.y1; + var y2 = inputShape.y2; + + outputShape.x1 = x1; + outputShape.x2 = x2; + outputShape.y1 = y1; + outputShape.y2 = y2; + + var lineWidth = style && style.lineWidth; + if (!lineWidth) { + return; + } + + if (round(x1 * 2) === round(x2 * 2)) { + outputShape.x1 = outputShape.x2 = subPixelOptimize$1(x1, lineWidth, true); + } + if (round(y1 * 2) === round(y2 * 2)) { + outputShape.y1 = outputShape.y2 = subPixelOptimize$1(y1, lineWidth, true); + } +} + +/** + * Sub pixel optimize rect for canvas + * + * @param {Object} outputShape The modification will be performed on `outputShape`. + * `outputShape` and `inputShape` can be the same object. + * `outputShape` object can be used repeatly, because all of + * the `x`, `y`, `width`, `height` will be assigned in this method. + * @param {Object} [inputShape] + * @param {number} [inputShape.x] + * @param {number} [inputShape.y] + * @param {number} [inputShape.width] + * @param {number} [inputShape.height] + * @param {Object} [style] + * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize. + */ +function subPixelOptimizeRect$1(outputShape, inputShape, style) { + if (!inputShape) { + return; + } + + var originX = inputShape.x; + var originY = inputShape.y; + var originWidth = inputShape.width; + var originHeight = inputShape.height; + + outputShape.x = originX; + outputShape.y = originY; + outputShape.width = originWidth; + outputShape.height = originHeight; + + var lineWidth = style && style.lineWidth; + if (!lineWidth) { + return; + } + + outputShape.x = subPixelOptimize$1(originX, lineWidth, true); + outputShape.y = subPixelOptimize$1(originY, lineWidth, true); + outputShape.width = Math.max( + subPixelOptimize$1(originX + originWidth, lineWidth, false) - outputShape.x, + originWidth === 0 ? 0 : 1 + ); + outputShape.height = Math.max( + subPixelOptimize$1(originY + originHeight, lineWidth, false) - outputShape.y, + originHeight === 0 ? 0 : 1 + ); +} + +/** + * Sub pixel optimize for canvas + * + * @param {number} position Coordinate, such as x, y + * @param {number} lineWidth If `null`/`undefined`/`0`, do not optimize. + * @param {boolean=} positiveOrNegative Default false (negative). + * @return {number} Optimized position. + */ +function subPixelOptimize$1(position, lineWidth, positiveOrNegative) { + if (!lineWidth) { + return position; + } + // Assure that (position + lineWidth / 2) is near integer edge, + // otherwise line will be fuzzy in canvas. + var doubledPosition = round(position * 2); + return (doubledPosition + round(lineWidth)) % 2 === 0 + ? doubledPosition / 2 + : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2; +} + /** * 矩形 * @module zrender/graphic/shape/Rect */ +// Avoid create repeatly. +var subPixelOptimizeOutputShape = {}; + var Rect = Path.extend({ type: 'rect', @@ -15683,10 +16664,27 @@ var Rect = Path.extend({ }, buildPath: function (ctx, shape) { - var x = shape.x; - var y = shape.y; - var width = shape.width; - var height = shape.height; + var x; + var y; + var width; + var height; + + if (this.subPixelOptimize) { + subPixelOptimizeRect$1(subPixelOptimizeOutputShape, shape, this.style); + x = subPixelOptimizeOutputShape.x; + y = subPixelOptimizeOutputShape.y; + width = subPixelOptimizeOutputShape.width; + height = subPixelOptimizeOutputShape.height; + subPixelOptimizeOutputShape.r = shape.r; + shape = subPixelOptimizeOutputShape; + } + else { + x = shape.x; + y = shape.y; + width = shape.width; + height = shape.height; + } + if (!shape.r) { ctx.rect(x, y, width, height); } @@ -15703,6 +16701,9 @@ var Rect = Path.extend({ * @module zrender/graphic/shape/Line */ +// Avoid create repeatly. +var subPixelOptimizeOutputShape$1 = {}; + var Line = Path.extend({ type: 'line', @@ -15724,10 +16725,25 @@ var Line = Path.extend({ }, buildPath: function (ctx, shape) { - var x1 = shape.x1; - var y1 = shape.y1; - var x2 = shape.x2; - var y2 = shape.y2; + var x1; + var y1; + var x2; + var y2; + + if (this.subPixelOptimize) { + subPixelOptimizeLine$1(subPixelOptimizeOutputShape$1, shape, this.style); + x1 = subPixelOptimizeOutputShape$1.x1; + y1 = subPixelOptimizeOutputShape$1.y1; + x2 = subPixelOptimizeOutputShape$1.x2; + y2 = subPixelOptimizeOutputShape$1.y2; + } + else { + x1 = shape.x1; + y1 = shape.y1; + x2 = shape.x2; + y2 = shape.y2; + } + var percent = shape.percent; if (percent === 0) { @@ -15961,7 +16977,7 @@ var CompoundPath = Path.extend({ if (!paths[i].path) { paths[i].createPathProxy(); } - paths[i].path.setScale(scale[0], scale[1]); + paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold); } }, @@ -16084,7 +17100,7 @@ inherits(RadialGradient, Gradient); /** * Displayable for incremental rendering. It will be rendered in a separate layer - * IncrementalDisplay have too main methods. `clearDisplayables` and `addDisplayables` + * IncrementalDisplay have two main methods. `clearDisplayables` and `addDisplayables` * addDisplayables will render the added displayables incremetally. * * It use a not clearFlag to tell the painter don't clear the layer if it's the first element. @@ -16131,7 +17147,7 @@ IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPer } }; -IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) { +IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) { for (var i = this._cursor; i < this._displayables.length; i++) { cb && cb(this._displayables[i]); } @@ -16233,12 +17249,30 @@ inherits(IncrementalDisplayble, Displayable); * under the License. */ -var round = Math.round; var mathMax$1 = Math.max; var mathMin$1 = Math.min; var EMPTY_OBJ = {}; +var Z2_EMPHASIS_LIFT = 1; + +// key: label model property nane, value: style property name. +var CACHED_LABEL_STYLE_PROPERTIES = { + color: 'textFill', + textBorderColor: 'textStroke', + textBorderWidth: 'textStrokeWidth' +}; + +var EMPHASIS = 'emphasis'; +var NORMAL = 'normal'; + +// Reserve 0 as default. +var _highlightNextDigit = 1; +var _highlightKeyMap = {}; + +var _customShapeMap = {}; + + /** * Extend shape with parameters */ @@ -16253,6 +17287,54 @@ function extendPath(pathData, opts) { return extendFromString(pathData, opts); } +/** + * Register a user defined shape. + * The shape class can be fetched by `getShapeClass` + * This method will overwrite the registered shapes, including + * the registered built-in shapes, if using the same `name`. + * The shape can be used in `custom series` and + * `graphic component` by declaring `{type: name}`. + * + * @param {string} name + * @param {Object} ShapeClass Can be generated by `extendShape`. + */ +function registerShape(name, ShapeClass) { + _customShapeMap[name] = ShapeClass; +} + +/** + * Find shape class registered by `registerShape`. Usually used in + * fetching user defined shape. + * + * [Caution]: + * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared + * to use user registered shapes. + * Because the built-in shape (see `getBuiltInShape`) will be registered by + * `registerShape` by default. That enables users to get both built-in + * shapes as well as the shapes belonging to themsleves. But users can overwrite + * the built-in shapes by using names like 'circle', 'rect' via calling + * `registerShape`. So the echarts inner featrues should not fetch shapes from here + * in case that it is overwritten by users, except that some features, like + * `custom series`, `graphic component`, do it deliberately. + * + * (2) In the features like `custom series`, `graphic component`, the user input + * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic + * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names + * are reserved names, that is, if some user register a shape named `'image'`, + * the shape will not be used. If we intending to add some more reserved names + * in feature, that might bring break changes (disable some existing user shape + * names). But that case probably rearly happen. So we dont make more mechanism + * to resolve this issue here. + * + * @param {string} name + * @return {Object} The shape class. If not found, return nothing. + */ +function getShapeClass(name) { + if (_customShapeMap.hasOwnProperty(name)) { + return _customShapeMap[name]; + } +} + /** * Create a path element from path data string * @param {string} pathData @@ -16262,12 +17344,10 @@ function extendPath(pathData, opts) { */ function makePath(pathData, opts, rect, layout) { var path = createFromString(pathData, opts); - var boundingRect = path.getBoundingRect(); if (rect) { if (layout === 'center') { - rect = centerGraphic(rect, boundingRect); + rect = centerGraphic(rect, path.getBoundingRect()); } - resizePath(path, rect); } return path; @@ -16365,15 +17445,7 @@ function resizePath(path, rect) { * @return {Object} Modified param */ function subPixelOptimizeLine(param) { - var shape = param.shape; - var lineWidth = param.style.lineWidth; - - if (round(shape.x1 * 2) === round(shape.x2 * 2)) { - shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true); - } - if (round(shape.y1 * 2) === round(shape.y2 * 2)) { - shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true); - } + subPixelOptimizeLine$1(param.shape, param.shape, param.style); return param; } @@ -16391,22 +17463,7 @@ function subPixelOptimizeLine(param) { * @return {Object} Modified param */ function subPixelOptimizeRect(param) { - var shape = param.shape; - var lineWidth = param.style.lineWidth; - var originX = shape.x; - var originY = shape.y; - var originWidth = shape.width; - var originHeight = shape.height; - shape.x = subPixelOptimize(shape.x, lineWidth, true); - shape.y = subPixelOptimize(shape.y, lineWidth, true); - shape.width = Math.max( - subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, - originWidth === 0 ? 0 : 1 - ); - shape.height = Math.max( - subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, - originHeight === 0 ? 0 : 1 - ); + subPixelOptimizeRect$1(param.shape, param.shape, param.style); return param; } @@ -16418,17 +17475,11 @@ function subPixelOptimizeRect(param) { * @param {boolean=} positiveOrNegative Default false (negative). * @return {number} Optimized position. */ -function subPixelOptimize(position, lineWidth, positiveOrNegative) { - // Assure that (position + lineWidth / 2) is near integer edge, - // otherwise line will be fuzzy in canvas. - var doubledPosition = round(position * 2); - return (doubledPosition + round(lineWidth)) % 2 === 0 - ? doubledPosition / 2 - : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2; -} +var subPixelOptimize = subPixelOptimize$1; + function hasFillOrStroke(fillOrStroke) { - return fillOrStroke != null && fillOrStroke != 'none'; + return fillOrStroke != null && fillOrStroke !== 'none'; } // Most lifted color are duplicated. @@ -16458,15 +17509,16 @@ function cacheElementStl(el) { var hoverStyle = el.__hoverStl; if (!hoverStyle) { - el.__normalStl = null; + el.__cachedNormalStl = el.__cachedNormalZ2 = null; return; } - var normalStyle = el.__normalStl = {}; + var normalStyle = el.__cachedNormalStl = {}; + el.__cachedNormalZ2 = el.z2; var elStyle = el.style; for (var name in hoverStyle) { - // See comment in `doSingleEnterHover`. + // See comment in `singleEnterEmphasis`. if (hoverStyle[name] != null) { normalStyle[name] = elStyle[name]; } @@ -16477,18 +17529,19 @@ function cacheElementStl(el) { normalStyle.stroke = elStyle.stroke; } -function doSingleEnterHover(el) { +function singleEnterEmphasis(el) { var hoverStl = el.__hoverStl; if (!hoverStl || el.__highlighted) { return; } - var useHoverLayer = el.useHoverLayer; + var zr = el.__zr; + + var useHoverLayer = el.useHoverLayer && zr && zr.painter.type === 'canvas'; el.__highlighted = useHoverLayer ? 'layer' : 'plain'; - var zr = el.__zr; - if (!zr && useHoverLayer) { + if (el.isGroup || (!zr && el.useHoverLayer)) { return; } @@ -16500,9 +17553,6 @@ function doSingleEnterHover(el) { targetStyle = elTarget.style; } - // Consider case: only `position: 'top'` is set on emphasis, then text - // color should be returned to `autoColor`, rather than remain '#fff'. - // So we should rollback then apply again after style merging. rollbackDefaultTextStyle(targetStyle); if (!useHoverLayer) { @@ -16525,9 +17575,13 @@ function doSingleEnterHover(el) { // where properties of `emphasis` may not appear in `normal`. We previously use // module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`. // But consider rich text and setOption in merge mode, it is impossible to cover - // all properties in merge. So we use merge mode when setting style here, where - // only properties that is not `null/undefined` can be set. The disadventage: - // null/undefined can not be used to remove style any more in `emphasis`. + // all properties in merge. So we use merge mode when setting style here. + // But we choose the merge strategy that only properties that is not `null/undefined`. + // Because when making a textStyle (espacially rich text), it is not easy to distinguish + // `hasOwnProperty` and `null/undefined` in code, so we trade them as the same for simplicity. + // But this strategy brings a trouble that `null/undefined` can not be used to remove + // style any more in `emphasis`. Users can both set properties directly on normal and + // emphasis to avoid this issue, or we might support `'none'` for this case if required. targetStyle.extendFrom(hoverStl); setDefaultHoverFillStroke(targetStyle, hoverStl, 'fill'); @@ -16537,7 +17591,7 @@ function doSingleEnterHover(el) { if (!useHoverLayer) { el.dirty(false); - el.z2 += 1; + el.z2 += Z2_EMPHASIS_LIFT; } } @@ -16547,135 +17601,195 @@ function setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) { } } -function doSingleLeaveHover(el) { - if (el.__highlighted) { - doSingleRestoreHoverStyle(el); - el.__highlighted = false; +function singleEnterNormal(el) { + var highlighted = el.__highlighted; + + if (!highlighted) { + return; } -} -function doSingleRestoreHoverStyle(el) { - var highlighted = el.__highlighted; + el.__highlighted = false; + + if (el.isGroup) { + return; + } if (highlighted === 'layer') { el.__zr && el.__zr.removeHover(el); } - else if (highlighted) { + else { var style = el.style; - var normalStl = el.__normalStl; + var normalStl = el.__cachedNormalStl; if (normalStl) { rollbackDefaultTextStyle(style); - - // Consider null/undefined value, should use - // `setStyle` but not `extendFrom(stl, true)`. el.setStyle(normalStl); - applyDefaultTextStyle(style); - - el.z2 -= 1; + } + // `__cachedNormalZ2` will not be reset if calling `setElementHoverStyle` + // when `el` is on emphasis state. So here by comparing with 1, we try + // hard to make the bug case rare. + var normalZ2 = el.__cachedNormalZ2; + if (normalZ2 != null && el.z2 - normalZ2 === Z2_EMPHASIS_LIFT) { + el.z2 = normalZ2; } } } -function traverseCall(el, method) { - el.isGroup - ? el.traverse(function (child) { - !child.isGroup && method(child); - }) - : method(el); +function traverseUpdate(el, updater, commonParam) { + // If root is group, also enter updater for `highDownOnUpdate`. + var fromState = NORMAL; + var toState = NORMAL; + var trigger; + // See the rule of `highDownOnUpdate` on `graphic.setAsHighDownDispatcher`. + el.__highlighted && (fromState = EMPHASIS, trigger = true); + updater(el, commonParam); + el.__highlighted && (toState = EMPHASIS, trigger = true); + + el.isGroup && el.traverse(function (child) { + !child.isGroup && updater(child, commonParam); + }); + + trigger && el.__highDownOnUpdate && el.__highDownOnUpdate(fromState, toState); } /** - * Set hover style of element. + * Set hover style (namely "emphasis style") of element, based on the current + * style of the given `el`. + * This method should be called after all of the normal styles have been adopted + * to the `el`. See the reason on `setHoverStyle`. * * @param {module:zrender/Element} el Should not be `zrender/container/Group`. + * @param {Object} [el.hoverStyle] Can be set on el or its descendants, + * e.g., `el.hoverStyle = ...; graphic.setHoverStyle(el); `. + * Often used when item group has a label element and it's hoverStyle is different. * @param {Object|boolean} [hoverStl] The specified hover style. * If set as `false`, disable the hover style. * Similarly, The `el.hoverStyle` can alse be set * as `false` to disable the hover style. * Otherwise, use the default hover style if not provided. - * @param {Object} [opt] - * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger` */ function setElementHoverStyle(el, hoverStl) { - hoverStl = el.__hoverStl = hoverStl !== false && (hoverStl || {}); + // For performance consideration, it might be better to make the "hover style" only the + // difference properties from the "normal style", but not a entire copy of all styles. + hoverStl = el.__hoverStl = hoverStl !== false && (el.hoverStyle || hoverStl || {}); el.__hoverStlDirty = true; + // FIXME + // It is not completely right to save "normal"/"emphasis" flag on elements. + // It probably should be saved on `data` of series. Consider the cases: + // (1) A highlighted elements are moved out of the view port and re-enter + // again by dataZoom. + // (2) call `setOption` and replace elements totally when they are highlighted. if (el.__highlighted) { - doSingleLeaveHover(el); - doSingleEnterHover(el); - } -} + // Consider the case: + // The styles of a highlighted `el` is being updated. The new "emphasis style" + // should be adapted to the `el`. Notice here new "normal styles" should have + // been set outside and the cached "normal style" is out of date. + el.__cachedNormalStl = null; + // Do not clear `__cachedNormalZ2` here, because setting `z2` is not a constraint + // of this method. In most cases, `z2` is not set and hover style should be able + // to rollback. Of course, that would bring bug, but only in a rare case, see + // `doSingleLeaveHover` for details. + singleEnterNormal(el); -/** - * @param {module:zrender/Element} el - * @return {boolean} - */ -function isInEmphasis(el) { - return el && el.__isEmphasis; + singleEnterEmphasis(el); + } } function onElementMouseOver(e) { - if (this.__hoverSilentOnTouch && e.zrByTouch) { - return; - } - - // Only if element is not in emphasis status - !this.__isEmphasis && traverseCall(this, doSingleEnterHover); + !shouldSilent(this, e) + // "emphasis" event highlight has higher priority than mouse highlight. + && !this.__highByOuter + && traverseUpdate(this, singleEnterEmphasis); } function onElementMouseOut(e) { - if (this.__hoverSilentOnTouch && e.zrByTouch) { - return; - } + !shouldSilent(this, e) + // "emphasis" event highlight has higher priority than mouse highlight. + && !this.__highByOuter + && traverseUpdate(this, singleEnterNormal); +} - // Only if element is not in emphasis status - !this.__isEmphasis && traverseCall(this, doSingleLeaveHover); +function onElementEmphasisEvent(highlightDigit) { + this.__highByOuter |= 1 << (highlightDigit || 0); + traverseUpdate(this, singleEnterEmphasis); } -function enterEmphasis() { - this.__isEmphasis = true; - traverseCall(this, doSingleEnterHover); +function onElementNormalEvent(highlightDigit) { + !(this.__highByOuter &= ~(1 << (highlightDigit || 0))) + && traverseUpdate(this, singleEnterNormal); } -function leaveEmphasis() { - this.__isEmphasis = false; - traverseCall(this, doSingleLeaveHover); +function shouldSilent(el, e) { + return el.__highDownSilentOnTouch && e.zrByTouch; } /** - * Set hover style of element. + * Set hover style (namely "emphasis style") of element, + * based on the current style of the given `el`. * - * [Caveat]: - * This method can be called repeatly and achieve the same result. + * (1) + * **CONSTRAINTS** for this method: + * This method MUST be called after all of the normal styles having been adopted + * to the `el`. + * The input `hoverStyle` (that is, "emphasis style") MUST be the subset of the + * "normal style" having been set to the el. + * `color` MUST be one of the "normal styles" (because color might be lifted as + * a default hover style). * - * [Usage]: + * The reason: this method treat the current style of the `el` as the "normal style" + * and cache them when enter/update the "emphasis style". Consider the case: the `el` + * is in "emphasis" state and `setOption`/`dispatchAction` trigger the style updating + * logic, where the el should shift from the original emphasis style to the new + * "emphasis style" and should be able to "downplay" back to the new "normal style". + * + * Indeed, it is error-prone to make a interface has so many constraints, but I have + * not found a better solution yet to fit the backward compatibility, performance and + * the current programming style. + * + * (2) * Call the method for a "root" element once. Do not call it for each descendants. * If the descendants elemenets of a group has itself hover style different from the * root group, we can simply mount the style on `el.hoverStyle` for them, but should * not call this method for them. * + * (3) These input parameters can be set directly on `el`: + * * @param {module:zrender/Element} el + * @param {Object} [el.hoverStyle] See `graphic.setElementHoverStyle`. + * @param {boolean} [el.highDownSilentOnTouch=false] See `graphic.setAsHighDownDispatcher`. + * @param {Function} [el.highDownOnUpdate] See `graphic.setAsHighDownDispatcher`. * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`. - * @param {Object} [opt] - * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`. - */ -function setHoverStyle(el, hoverStyle, opt) { - el.isGroup - ? el.traverse(function (child) { - // If element has sepcified hoverStyle, then use it instead of given hoverStyle - // Often used when item group has a label element and it's hoverStyle is different - !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle); - }) - : setElementHoverStyle(el, el.hoverStyle || hoverStyle); - - setAsHoverStyleTrigger(el, opt); + */ +function setHoverStyle(el, hoverStyle) { + setAsHighDownDispatcher(el, true); + traverseUpdate(el, setElementHoverStyle, hoverStyle); } /** - * @param {Object|boolean} [opt] If `false`, means disable trigger. - * @param {boolean} [opt.hoverSilentOnTouch=false] + * @param {module:zrender/Element} el + * @param {Function} [el.highDownOnUpdate] Called when state updated. + * Since `setHoverStyle` has the constraint that it must be called after + * all of the normal style updated, `highDownOnUpdate` is not needed to + * trigger if both `fromState` and `toState` is 'normal', and needed to + * trigger if both `fromState` and `toState` is 'emphasis', which enables + * to sync outside style settings to "emphasis" state. + * @this {string} This dispatcher `el`. + * @param {string} fromState Can be "normal" or "emphasis". + * `fromState` might equal to `toState`, + * for example, when this method is called when `el` is + * on "emphasis" state. + * @param {string} toState Can be "normal" or "emphasis". + * + * FIXME + * CAUTION: Do not expose `highDownOnUpdate` outside echarts. + * Because it is not a complete solution. The update + * listener should not have been mount in element, + * and the normal/emphasis state should not have + * mantained on elements. + * + * @param {boolean} [el.highDownSilentOnTouch=false] * In touch device, mouseover event will be trigger on touchstart event * (see module:zrender/dom/HandlerProxy). By this mechanism, we can * conveniently use hoverStyle when tap on touch screen without additional @@ -16683,28 +17797,59 @@ function setHoverStyle(el, hoverStyle, opt) { * But if the chart/component has select feature, which usually also use * hoverStyle, there might be conflict between 'select-highlight' and * 'hover-highlight' especially when roam is enabled (see geo for example). - * In this case, hoverSilentOnTouch should be used to disable hover-highlight - * on touch device. + * In this case, `highDownSilentOnTouch` should be used to disable + * hover-highlight on touch device. + * @param {boolean} [asDispatcher=true] If `false`, do not set as "highDownDispatcher". */ -function setAsHoverStyleTrigger(el, opt) { - var disable = opt === false; - el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; +function setAsHighDownDispatcher(el, asDispatcher) { + var disable = asDispatcher === false; + // Make `highDownSilentOnTouch` and `highDownOnUpdate` only work after + // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly. + el.__highDownSilentOnTouch = el.highDownSilentOnTouch; + el.__highDownOnUpdate = el.highDownOnUpdate; // Simple optimize, since this method might be // called for each elements of a group in some cases. - if (!disable || el.__hoverStyleTrigger) { + if (!disable || el.__highDownDispatcher) { var method = disable ? 'off' : 'on'; // Duplicated function will be auto-ignored, see Eventful.js. el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); - // Emphasis, normal can be triggered manually - el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis); + // Emphasis, normal can be triggered manually by API or other components like hover link. + el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); + // Also keep previous record. + el.__highByOuter = el.__highByOuter || 0; - el.__hoverStyleTrigger = !disable; + el.__highDownDispatcher = !disable; } } /** + * @param {module:zrender/src/Element} el + * @return {boolean} + */ +function isHighDownDispatcher(el) { + return !!(el && el.__highDownDispatcher); +} + +/** + * Support hightlight/downplay record on each elements. + * For the case: hover highlight/downplay (legend, visualMap, ...) and + * user triggerred hightlight/downplay should not conflict. + * Only all of the highlightDigit cleared, return to normal. + * @param {string} highlightKey + * @return {number} highlightDigit + */ +function getHighlightDigit(highlightKey) { + var highlightDigit = _highlightKeyMap[highlightKey]; + if (highlightDigit == null && _highlightNextDigit <= 32) { + highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++; + } + return highlightDigit; +} + +/** + * See more info in `setTextStyleCommon`. * @param {Object|module:zrender/graphic/Style} normalStyle * @param {Object} emphasisStyle * @param {module:echarts/model/Model} normalModel @@ -16712,11 +17857,13 @@ function setAsHoverStyleTrigger(el, opt) { * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props. * @param {string|Function} [opt.defaultText] * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by - * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` - * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by - * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` - * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by - * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` + * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {number} [opt.labelDataIndex] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {number} [opt.labelDimIndex] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` + * @param {string} [opt.labelProp] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)` * @param {Object} [normalSpecified] * @param {Object} [emphasisSpecified] */ @@ -16730,6 +17877,7 @@ function setLabelStyle( var labelFetcher = opt.labelFetcher; var labelDataIndex = opt.labelDataIndex; var labelDimIndex = opt.labelDimIndex; + var labelProp = opt.labelProp; // This scenario, `label.normal.show = true; label.emphasis.show = false`, // is not supported util someone requests. @@ -16743,7 +17891,7 @@ function setLabelStyle( var baseText; if (showNormal || showEmphasis) { if (labelFetcher) { - baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex); + baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, labelProp); } if (baseText == null) { baseText = isFunction$1(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText; @@ -16753,7 +17901,7 @@ function setLabelStyle( var emphasisStyleText = showEmphasis ? retrieve2( labelFetcher - ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex) + ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex, labelProp) : null, baseText ) @@ -16775,8 +17923,32 @@ function setLabelStyle( emphasisStyle.text = emphasisStyleText; } +/** + * Modify label style manually. + * Only works after `setLabelStyle` and `setElementHoverStyle` called. + * + * @param {module:zrender/src/Element} el + * @param {Object} [normalStyleProps] optional + * @param {Object} [emphasisStyleProps] optional + */ +function modifyLabelStyle(el, normalStyleProps, emphasisStyleProps) { + var elStyle = el.style; + if (normalStyleProps) { + rollbackDefaultTextStyle(elStyle); + el.setStyle(normalStyleProps); + applyDefaultTextStyle(elStyle); + } + elStyle = el.__hoverStl; + if (emphasisStyleProps && elStyle) { + rollbackDefaultTextStyle(elStyle); + extend(elStyle, emphasisStyleProps); + applyDefaultTextStyle(elStyle); + } +} + /** * Set basic textStyle properties. + * See more info in `setTextStyleCommon`. * @param {Object|module:zrender/graphic/Style} textStyle * @param {module:echarts/model/Model} model * @param {Object} [specifiedTextStyle] Can be overrided by settings in model. @@ -16795,6 +17967,7 @@ function setTextStyle( /** * Set text option in the style. + * See more info in `setTextStyleCommon`. * @deprecated * @param {Object} textStyle * @param {module:echarts/model/Model} labelModel @@ -16817,7 +17990,23 @@ function setText(textStyle, labelModel, defaultColor) { } /** - * { + * The uniform entry of set text style, that is, retrieve style definitions + * from `model` and set to `textStyle` object. + * + * Never in merge mode, but in overwrite mode, that is, all of the text style + * properties will be set. (Consider the states of normal and emphasis and + * default value can be adopted, merge would make the logic too complicated + * to manage.) + * + * The `textStyle` object can either be a plain object or an instance of + * `zrender/src/graphic/Style`, and either be the style of normal or emphasis. + * After this mothod called, the `textStyle` object can then be used in + * `el.setStyle(textStyle)` or `el.hoverStyle = textStyle`. + * + * Default value will be adopted and `insideRollbackOpt` will be created. + * See `applyDefaultTextStyle` `rollbackDefaultTextStyle` for more details. + * + * opt: { * disableBox: boolean, Whether diable drawing box of block (outer most). * isRectText: boolean, * autoColor: string, specify a color when color is 'auto', @@ -16837,11 +18026,18 @@ function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) { opt = opt || EMPTY_OBJ; if (opt.isRectText) { - var textPosition = textStyleModel.getShallow('position') - || (isEmphasis ? null : 'inside'); - // 'outside' is not a valid zr textPostion value, but used - // in bar series, and magric type should be considered. - textPosition === 'outside' && (textPosition = 'top'); + var textPosition; + if (opt.getTextPosition) { + textPosition = opt.getTextPosition(textStyleModel, isEmphasis); + } + else { + textPosition = textStyleModel.getShallow('position') + || (isEmphasis ? null : 'inside'); + // 'outside' is not a valid zr textPostion value, but used + // in bar series, and magric type should be considered. + textPosition === 'outside' && (textPosition = 'top'); + } + textStyle.textPosition = textPosition; textStyle.textOffset = textStyleModel.getShallow('offset'); var labelRotate = textStyleModel.getShallow('rotate'); @@ -16878,6 +18074,10 @@ function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) { // Cascade is supported in rich. var richTextStyle = textStyleModel.getModel(['rich', name]); // In rich, never `disableBox`. + // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`, + // the default color `'blue'` will not be adopted if no color declared in `rich`. + // That might confuses users. So probably we should put `textStyleModel` as the + // root ancestor of the `richTextStyle`. But that would be a break change. setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis); } } @@ -16938,10 +18138,6 @@ function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEm globalTextStyle.textBorderWidth ); - // Save original textPosition, because style.textPosition will be repalced by - // real location (like [10, 30]) in zrender. - textStyle.insideRawTextPosition = textStyle.textPosition; - if (!isEmphasis) { if (isBlock) { textStyle.insideRollbackOpt = opt; @@ -16998,57 +18194,83 @@ function getAutoColor(color, opt) { return color !== 'auto' ? color : (opt && opt.autoColor) ? opt.autoColor : null; } -// When text position is `inside` and `textFill` not specified, we -// provide a mechanism to auto make text border for better view. But -// text position changing when hovering or being emphasis should be -// considered, where the `insideRollback` enables to restore the style. +/** + * Give some default value to the input `textStyle` object, based on the current settings + * in this `textStyle` object. + * + * The Scenario: + * when text position is `inside` and `textFill` is not specified, we show + * text border by default for better view. But it should be considered that text position + * might be changed when hovering or being emphasis, where the `insideRollback` is used to + * restore the style. + * + * Usage (& NOTICE): + * When a style object (eithor plain object or instance of `zrender/src/graphic/Style`) is + * about to be modified on its text related properties, `rollbackDefaultTextStyle` should + * be called before the modification and `applyDefaultTextStyle` should be called after that. + * (For the case that all of the text related properties is reset, like `setTextStyleCommon` + * does, `rollbackDefaultTextStyle` is not needed to be called). + */ function applyDefaultTextStyle(textStyle) { - if (textStyle.textFill != null) { - return; - } - + var textPosition = textStyle.textPosition; var opt = textStyle.insideRollbackOpt; - var useInsideStyle = opt.useInsideStyle; - var textPosition = textStyle.insideRawTextPosition; var insideRollback; - var autoColor = opt.autoColor; - - if (useInsideStyle !== false - && (useInsideStyle === true - || (opt.isRectText - && textPosition - // textPosition can be [10, 30] - && typeof textPosition === 'string' - && textPosition.indexOf('inside') >= 0 - ) - ) - ) { - insideRollback = { - textFill: null, - textStroke: textStyle.textStroke, - textStrokeWidth: textStyle.textStrokeWidth - }; - textStyle.textFill = '#fff'; - // Consider text with #fff overflow its container. - if (textStyle.textStroke == null) { - textStyle.textStroke = autoColor; - textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2); + + if (opt && textStyle.textFill == null) { + var autoColor = opt.autoColor; + var isRectText = opt.isRectText; + var useInsideStyle = opt.useInsideStyle; + + var useInsideStyleCache = useInsideStyle !== false + && (useInsideStyle === true + || (isRectText + && textPosition + // textPosition can be [10, 30] + && typeof textPosition === 'string' + && textPosition.indexOf('inside') >= 0 + ) + ); + var useAutoColorCache = !useInsideStyleCache && autoColor != null; + + // All of the props declared in `CACHED_LABEL_STYLE_PROPERTIES` are to be cached. + if (useInsideStyleCache || useAutoColorCache) { + insideRollback = { + textFill: textStyle.textFill, + textStroke: textStyle.textStroke, + textStrokeWidth: textStyle.textStrokeWidth + }; + } + if (useInsideStyleCache) { + textStyle.textFill = '#fff'; + // Consider text with #fff overflow its container. + if (textStyle.textStroke == null) { + textStyle.textStroke = autoColor; + textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2); + } + } + if (useAutoColorCache) { + textStyle.textFill = autoColor; } - } - else if (autoColor != null) { - insideRollback = {textFill: null}; - textStyle.textFill = autoColor; } - // Always set `insideRollback`, for clearing previous. - if (insideRollback) { - textStyle.insideRollback = insideRollback; - } + // Always set `insideRollback`, so that the previous one can be cleared. + textStyle.insideRollback = insideRollback; } +/** + * Consider the case: in a scatter, + * label: { + * normal: {position: 'inside'}, + * emphasis: {position: 'top'} + * } + * In the normal state, the `textFill` will be set as '#fff' for pretty view (see + * `applyDefaultTextStyle`), but when switching to emphasis state, the `textFill` + * should be retured to 'autoColor', but not keep '#fff'. + */ function rollbackDefaultTextStyle(style) { var insideRollback = style.insideRollback; if (insideRollback) { + // Reset all of the props in `CACHED_LABEL_STYLE_PROPERTIES`. style.textFill = insideRollback.textFill; style.textStroke = insideRollback.textStroke; style.textStrokeWidth = insideRollback.textStrokeWidth; @@ -17057,8 +18279,7 @@ function rollbackDefaultTextStyle(style) { } function getFont(opt, ecModel) { - // ecModel or default text style model. - var gTextStyleModel = ecModel || ecModel.getModel('textStyle'); + var gTextStyleModel = ecModel && ecModel.getModel('textStyle'); return trim([ // FIXME in node-canvas fontWeight is before fontStyle opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', @@ -17111,7 +18332,7 @@ function animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb) * configuration in series. * * Caution: this method will stop previous animation. - * So if do not use this method to one element twice before + * So do not use this method to one element twice before * animation starts, unless you know what you are doing. * * @param {module:zrender/Element} el @@ -17137,7 +18358,7 @@ function updateProps(el, props, animatableModel, dataIndex, cb) { * configuration in series. * * Caution: this method will stop previous animation. - * So if do not use this method to one element twice before + * So do not use this method to one element twice before * animation starts, unless you know what you are doing. * * @param {module:zrender/Element} el @@ -17267,6 +18488,8 @@ function groupTransition(g1, g2, animatableModel, cb) { * @return {Array.>} A new clipped points. */ function clipPointsByRect(points, rect) { + // FIXME: this way migth be incorrect when grpahic clipped by a corner. + // and when element have border. return map(points, function (point) { var x = point[0]; x = mathMax$1(x, rect.x); @@ -17289,6 +18512,8 @@ function clipRectByRect(targetRect, rect) { var y = mathMax$1(targetRect.y, rect.y); var y2 = mathMin$1(targetRect.y + targetRect.height, rect.y + rect.height); + // If the total rect is cliped, nothing, including the border, + // should be painted. So return undefined. if (x2 >= x && y2 >= y) { return { x: x, @@ -17328,12 +18553,110 @@ function createIcon(iconStr, opt, rect) { } } +/** + * Return `true` if the given line (line `a`) and the given polygon + * are intersect. + * Note that we do not count colinear as intersect here because no + * requirement for that. We could do that if required in future. + * + * @param {number} a1x + * @param {number} a1y + * @param {number} a2x + * @param {number} a2y + * @param {Array.>} points Points of the polygon. + * @return {boolean} + */ +function linePolygonIntersect(a1x, a1y, a2x, a2y, points) { + for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { + var p = points[i]; + if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) { + return true; + } + p2 = p; + } +} + +/** + * Return `true` if the given two lines (line `a` and line `b`) + * are intersect. + * Note that we do not count colinear as intersect here because no + * requirement for that. We could do that if required in future. + * + * @param {number} a1x + * @param {number} a1y + * @param {number} a2x + * @param {number} a2y + * @param {number} b1x + * @param {number} b1y + * @param {number} b2x + * @param {number} b2y + * @return {boolean} + */ +function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { + // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`. + var mx = a2x - a1x; + var my = a2y - a1y; + var nx = b2x - b1x; + var ny = b2y - b1y; + + // `vec_m` and `vec_n` are parallel iff + // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`. + var nmCrossProduct = crossProduct2d(nx, ny, mx, my); + if (nearZero(nmCrossProduct)) { + return false; + } + + // `vec_m` and `vec_n` are intersect iff + // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`, + // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)` + // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`. + var b1a1x = a1x - b1x; + var b1a1y = a1y - b1y; + var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct; + if (q < 0 || q > 1) { + return false; + } + var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct; + if (p < 0 || p > 1) { + return false; + } + + return true; +} + +/** + * Cross product of 2-dimension vector. + */ +function crossProduct2d(x1, y1, x2, y2) { + return x1 * y2 - x2 * y1; +} + +function nearZero(val) { + return val <= (1e-6) && val >= -(1e-6); +} + +// Register built-in shapes. These shapes might be overwirtten +// by users, although we do not recommend that. +registerShape('circle', Circle); +registerShape('sector', Sector); +registerShape('ring', Ring); +registerShape('polygon', Polygon); +registerShape('polyline', Polyline); +registerShape('rect', Rect); +registerShape('line', Line); +registerShape('bezierCurve', BezierCurve); +registerShape('arc', Arc); + var graphic = (Object.freeze || Object)({ + Z2_EMPHASIS_LIFT: Z2_EMPHASIS_LIFT, + CACHED_LABEL_STYLE_PROPERTIES: CACHED_LABEL_STYLE_PROPERTIES, extendShape: extendShape, extendPath: extendPath, + registerShape: registerShape, + getShapeClass: getShapeClass, makePath: makePath, makeImage: makeImage, mergePath: mergePath, @@ -17342,10 +18665,12 @@ var graphic = (Object.freeze || Object)({ subPixelOptimizeRect: subPixelOptimizeRect, subPixelOptimize: subPixelOptimize, setElementHoverStyle: setElementHoverStyle, - isInEmphasis: isInEmphasis, setHoverStyle: setHoverStyle, - setAsHoverStyleTrigger: setAsHoverStyleTrigger, + setAsHighDownDispatcher: setAsHighDownDispatcher, + isHighDownDispatcher: isHighDownDispatcher, + getHighlightDigit: getHighlightDigit, setLabelStyle: setLabelStyle, + modifyLabelStyle: modifyLabelStyle, setTextStyle: setTextStyle, setText: setText, getFont: getFont, @@ -17358,6 +18683,8 @@ var graphic = (Object.freeze || Object)({ clipPointsByRect: clipPointsByRect, clipRectByRect: clipRectByRect, createIcon: createIcon, + linePolygonIntersect: linePolygonIntersect, + lineLineIntersect: lineLineIntersect, Group: Group, Image: ZImage, Text: Text, @@ -17432,6 +18759,7 @@ var textStyleMixin = { this.getShallow('align'), this.getShallow('verticalAlign') || this.getShallow('baseline'), this.getShallow('padding'), + this.getShallow('lineHeight'), this.getShallow('rich'), this.getShallow('truncateText') ); @@ -17516,7 +18844,7 @@ var inner = makeInner(); /** * @alias module:echarts/model/Model * @constructor - * @param {Object} option + * @param {Object} [option] * @param {module:echarts/model/Model} [parentModel] * @param {module:echarts/model/Global} [ecModel] */ @@ -17639,7 +18967,7 @@ Model.prototype = { }, // If path is null/undefined, return null/undefined. - parsePath: function(path) { + parsePath: function (path) { if (typeof path === 'string') { path = path.split('.'); } @@ -17902,10 +19230,19 @@ function enableTopologicalTravel(entity, dependencyGetter) { * under the License. */ +/* +* A third-party license is embeded for some of the code in this file: +* The method "quantile" was copied from "d3.js". +* (See more details in the comment of the method below.) +* The use of the source code of this file is also subject to the terms +* and consitions of the license of "d3.js" (BSD-3Clause, see +* ). +*/ + var RADIAN_EPSILON = 1e-4; function _trim(str) { - return str.replace(/^\s+/, '').replace(/\s+$/, ''); + return str.replace(/^\s+|\s+$/g, ''); } /** @@ -18015,6 +19352,13 @@ function round$1(x, precision, returnStr) { return returnStr ? x : +x; } +/** + * asc sort arr. + * The input arr will be modified. + * + * @param {Array} arr + * @return {Array} The input arr. + */ function asc(arr) { arr.sort(function (a, b) { return a - b; @@ -18163,7 +19507,9 @@ function isRadianAroundZero(val) { return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; } +/* eslint-disable */ var 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 +/* eslint-enable */ /** * @param {string|Date|number} value These values can be accepted: @@ -18251,8 +19597,28 @@ function quantity(val) { return Math.pow(10, quantityExponent(val)); } +/** + * Exponent of the quantity of a number + * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3 + * + * @param {number} val non-negative value + * @return {number} + */ function quantityExponent(val) { - return Math.floor(Math.log(val) / Math.LN10); + if (val === 0) { + return 0; + } + + var exp = Math.floor(Math.log(val) / Math.LN10); + /** + * exp is expected to be the rounded-down result of the base-10 log of val. + * But due to the precision loss with Math.log(val), we need to restore it + * using 10^exp to make sure we can get val back from exp. #11249 + */ + if (val / Math.pow(10, exp) >= 10) { + exp++; + } + return exp; } /** @@ -18272,18 +19638,38 @@ function nice(val, round) { var f = val / exp10; // 1 <= f < 10 var nf; if (round) { - if (f < 1.5) { nf = 1; } - else if (f < 2.5) { nf = 2; } - else if (f < 4) { nf = 3; } - else if (f < 7) { nf = 5; } - else { nf = 10; } + if (f < 1.5) { + nf = 1; + } + else if (f < 2.5) { + nf = 2; + } + else if (f < 4) { + nf = 3; + } + else if (f < 7) { + nf = 5; + } + else { + nf = 10; + } } else { - if (f < 1) { nf = 1; } - else if (f < 2) { nf = 2; } - else if (f < 3) { nf = 3; } - else if (f < 5) { nf = 5; } - else { nf = 10; } + if (f < 1) { + nf = 1; + } + else if (f < 2) { + nf = 2; + } + else if (f < 3) { + nf = 3; + } + else if (f < 5) { + nf = 5; + } + else { + nf = 10; + } } val = nf * exp10; @@ -18293,39 +19679,9 @@ function nice(val, round) { } /** - * BSD 3-Clause - * - * Copyright (c) 2010-2015, Michael Bostock - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * The name Michael Bostock may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @see - * @see + * This code was copied from "d3.js" + * . + * See the license statement at the head of this file. * @param {Array.} ascArr */ function quantile(ascArr, p) { @@ -18427,6 +19783,7 @@ var number = (Object.freeze || Object)({ isRadianAroundZero: isRadianAroundZero, parseDate: parseDate, quantity: quantity, + quantityExponent: quantityExponent, nice: nice, quantile: quantile, reformIntervals: reformIntervals, @@ -18452,8 +19809,10 @@ var number = (Object.freeze || Object)({ * under the License. */ +// import Text from 'zrender/src/graphic/Text'; + /** - * 每三位默认加,格式化 + * add commas after every three numbers * @param {string|number} x * @return {string} */ @@ -18462,7 +19821,7 @@ function addCommas(x) { return '-'; } x = (x + '').split('.'); - return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') + return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (x.length > 1 ? ('.' + x[1]) : ''); } @@ -18472,7 +19831,7 @@ function addCommas(x) { * @return {string} str */ function toCamelCase(str, upperCaseFirst) { - str = (str || '').toLowerCase().replace(/-(.)/g, function(match, group1) { + str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); }); @@ -18666,7 +20025,61 @@ function capitalFirst(str) { var truncateText$1 = truncateText; -var getTextRect = getBoundingRect; +/** + * @public + * @param {Object} opt + * @param {string} opt.text + * @param {string} opt.font + * @param {string} [opt.textAlign='left'] + * @param {string} [opt.textVerticalAlign='top'] + * @param {Array.} [opt.textPadding] + * @param {number} [opt.textLineHeight] + * @param {Object} [opt.rich] + * @param {Object} [opt.truncate] + * @return {Object} {x, y, width, height, lineHeight} + */ +function getTextBoundingRect(opt) { + return getBoundingRect( + opt.text, + opt.font, + opt.textAlign, + opt.textVerticalAlign, + opt.textPadding, + opt.textLineHeight, + opt.rich, + opt.truncate + ); +} + +/** + * @deprecated + * the `textLineHeight` was added later. + * For backward compatiblility, put it as the last parameter. + * But deprecated this interface. Please use `getTextBoundingRect` instead. + */ +function getTextRect( + text, font, textAlign, textVerticalAlign, textPadding, rich, truncate, textLineHeight +) { + return getBoundingRect( + text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate + ); +} + +/** + * open new tab + * @param {string} link url + * @param {string} target blank or self + */ +function windowOpen(link, target) { + if (target === '_blank' || target === 'blank') { + var blank = window.open(); + blank.opener = null; + blank.location = link; + } + else { + window.open(link, target); + } +} var format = (Object.freeze || Object)({ @@ -18680,7 +20093,9 @@ var format = (Object.freeze || Object)({ formatTime: formatTime, capitalFirst: capitalFirst, truncateText: truncateText$1, - getTextRect: getTextRect + getTextBoundingRect: getTextBoundingRect, + getTextRect: getTextRect, + windowOpen: windowOpen }); /* @@ -19471,7 +20886,10 @@ var globalDefault = { // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'], // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'], // Dark colors: - color: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'], + color: [ + '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83', + '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3' + ], gradientColor: ['#f6efa6', '#d88273', '#bf444c'], @@ -19611,178 +21029,6 @@ var colorPaletteMixin = { * under the License. */ -/** - * Helper for model references. - * There are many manners to refer axis/coordSys. - */ - -// TODO -// merge relevant logic to this file? -// check: "modelHelper" of tooltip and "BrushTargetManager". - -/** - * @return {Object} For example: - * { - * coordSysName: 'cartesian2d', - * coordSysDims: ['x', 'y', ...], - * axisMap: HashMap({ - * x: xAxisModel, - * y: yAxisModel - * }), - * categoryAxisMap: HashMap({ - * x: xAxisModel, - * y: undefined - * }), - * // It also indicate that whether there is category axis. - * firstCategoryDimIndex: 1, - * // To replace user specified encode. - * } - */ -function getCoordSysDefineBySeries(seriesModel) { - var coordSysName = seriesModel.get('coordinateSystem'); - var result = { - coordSysName: coordSysName, - coordSysDims: [], - axisMap: createHashMap(), - categoryAxisMap: createHashMap() - }; - var fetch = fetchers[coordSysName]; - if (fetch) { - fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); - return result; - } -} - -var fetchers = { - - cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { - var xAxisModel = seriesModel.getReferringComponents('xAxis')[0]; - var yAxisModel = seriesModel.getReferringComponents('yAxis')[0]; - - if (__DEV__) { - if (!xAxisModel) { - throw new Error('xAxis "' + retrieve( - seriesModel.get('xAxisIndex'), - seriesModel.get('xAxisId'), - 0 - ) + '" not found'); - } - if (!yAxisModel) { - throw new Error('yAxis "' + retrieve( - seriesModel.get('xAxisIndex'), - seriesModel.get('yAxisId'), - 0 - ) + '" not found'); - } - } - - result.coordSysDims = ['x', 'y']; - axisMap.set('x', xAxisModel); - axisMap.set('y', yAxisModel); - - if (isCategory(xAxisModel)) { - categoryAxisMap.set('x', xAxisModel); - result.firstCategoryDimIndex = 0; - } - if (isCategory(yAxisModel)) { - categoryAxisMap.set('y', yAxisModel); - result.firstCategoryDimIndex = 1; - } - }, - - singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { - var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0]; - - if (__DEV__) { - if (!singleAxisModel) { - throw new Error('singleAxis should be specified.'); - } - } - - result.coordSysDims = ['single']; - axisMap.set('single', singleAxisModel); - - if (isCategory(singleAxisModel)) { - categoryAxisMap.set('single', singleAxisModel); - result.firstCategoryDimIndex = 0; - } - }, - - polar: function (seriesModel, result, axisMap, categoryAxisMap) { - var polarModel = seriesModel.getReferringComponents('polar')[0]; - var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); - var angleAxisModel = polarModel.findAxisModel('angleAxis'); - - if (__DEV__) { - if (!angleAxisModel) { - throw new Error('angleAxis option not found'); - } - if (!radiusAxisModel) { - throw new Error('radiusAxis option not found'); - } - } - - result.coordSysDims = ['radius', 'angle']; - axisMap.set('radius', radiusAxisModel); - axisMap.set('angle', angleAxisModel); - - if (isCategory(radiusAxisModel)) { - categoryAxisMap.set('radius', radiusAxisModel); - result.firstCategoryDimIndex = 0; - } - if (isCategory(angleAxisModel)) { - categoryAxisMap.set('angle', angleAxisModel); - result.firstCategoryDimIndex = 1; - } - }, - - geo: function (seriesModel, result, axisMap, categoryAxisMap) { - result.coordSysDims = ['lng', 'lat']; - }, - - parallel: function (seriesModel, result, axisMap, categoryAxisMap) { - var ecModel = seriesModel.ecModel; - var parallelModel = ecModel.getComponent( - 'parallel', seriesModel.get('parallelIndex') - ); - var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); - - each$1(parallelModel.parallelAxisIndex, function (axisIndex, index) { - var axisModel = ecModel.getComponent('parallelAxis', axisIndex); - var axisDim = coordSysDims[index]; - axisMap.set(axisDim, axisModel); - - if (isCategory(axisModel) && result.firstCategoryDimIndex == null) { - categoryAxisMap.set(axisDim, axisModel); - result.firstCategoryDimIndex = index; - } - }); - } -}; - -function isCategory(axisModel) { - return axisModel.get('type') === 'category'; -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - // Avoid typo. var SOURCE_FORMAT_ORIGINAL = 'original'; var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows'; @@ -19952,6 +21198,13 @@ enableClassCheck(Source); * under the License. */ +// The result of `guessOrdinal`. +var BE_ORDINAL = { + Must: 1, // Encounter string but not '-' and not number-like. + Might: 2, // Encounter string but number-like. + Not: 3 // Other cases +}; + var inner$3 = makeInner(); /** @@ -19968,6 +21221,10 @@ function detectSourceFormat(datasetModel) { } else if (isArray(data)) { // FIXME Whether tolerate null in top level array? + if (data.length === 0) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + } + for (var i = 0, len = data.length; i < len; i++) { var item = data[i]; @@ -20081,14 +21338,6 @@ function prepareSource(seriesModel) { data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine ); - // Note: dataset option does not have `encode`. - var encodeDefine = seriesOption.encode; - if (!encodeDefine && datasetModel) { - encodeDefine = makeDefaultEncode( - seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult - ); - } - inner$3(seriesModel).source = new Source({ data: data, fromDataset: fromDataset, @@ -20097,7 +21346,8 @@ function prepareSource(seriesModel) { dimensionsDefine: completeResult.dimensionsDefine, startIndex: completeResult.startIndex, dimensionsDetectCount: completeResult.dimensionsDetectCount, - encodeDefine: encodeDefine + // Note: dataset option does not have `encode`. + encodeDefine: seriesOption.encode }); } @@ -20109,7 +21359,6 @@ function completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, var dimensionsDetectCount; var startIndex; - var findPotentialName; if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { // Rule: Most of the first line are string: it is header. @@ -20152,13 +21401,11 @@ function completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { if (!dimensionsDefine) { dimensionsDefine = objectRowsCollectDimensions(data); - findPotentialName = true; } } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { if (!dimensionsDefine) { dimensionsDefine = []; - findPotentialName = true; each$1(data, function (colArr, key) { dimensionsDefine.push(key); }); @@ -20174,21 +21421,10 @@ function completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, } } - var potentialNameDimIndex; - if (findPotentialName) { - each$1(dimensionsDefine, function (dim, idx) { - if ((isObject$1(dim) ? dim.name : dim) === 'name') { - potentialNameDimIndex = idx; - } - }); - } - return { startIndex: startIndex, dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine), - dimensionsDetectCount: dimensionsDetectCount, - potentialNameDimIndex: potentialNameDimIndex - // TODO: potentialIdDimIdx + dimensionsDetectCount: dimensionsDetectCount }; } @@ -20262,103 +21498,198 @@ function objectRowsCollectDimensions(data) { } } -// ??? TODO merge to completedimensions, where also has -// default encode making logic. And the default rule -// should depends on series? consider 'map'. -function makeDefaultEncode( - seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult -) { - var coordSysDefine = getCoordSysDefineBySeries(seriesModel); +/** + * [The strategy of the arrengment of data dimensions for dataset]: + * "value way": all axes are non-category axes. So series one by one take + * several (the number is coordSysDims.length) dimensions from dataset. + * The result of data arrengment of data dimensions like: + * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y | + * "category way": at least one axis is category axis. So the the first data + * dimension is always mapped to the first category axis and shared by + * all of the series. The other data dimensions are taken by series like + * "value way" does. + * The result of data arrengment of data dimensions like: + * | ser_shared_x | ser0_y | ser1_y | ser2_y | + * + * @param {Array.} coordDimensions [{name: , type: , dimsDef: }, ...] + * @param {module:model/Series} seriesModel + * @param {module:data/Source} source + * @return {Object} encode Never be `null/undefined`. + */ +function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) { var encode = {}; - // var encodeTooltip = []; - // var encodeLabel = []; + + var datasetModel = getDatasetModel(seriesModel); + // Currently only make default when using dataset, util more reqirements occur. + if (!datasetModel || !coordDimensions) { + return encode; + } + var encodeItemName = []; var encodeSeriesName = []; - var seriesType = seriesModel.subType; - - // ??? TODO refactor: provide by series itself. - // Consider the case: 'map' series is based on geo coordSys, - // 'graph', 'heatmap' can be based on cartesian. But can not - // give default rule simply here. - var nSeriesMap = createHashMap(['pie', 'map', 'funnel']); - var cSeriesMap = createHashMap([ - 'line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot' - ]); - - // Usually in this case series will use the first data - // dimension as the "value" dimension, or other default - // processes respectively. - if (coordSysDefine && cSeriesMap.get(seriesType) != null) { - var ecModel = seriesModel.ecModel; - var datasetMap = inner$3(ecModel).datasetMap; - var key = datasetModel.uid + '_' + seriesLayoutBy; - var datasetRecord = datasetMap.get(key) - || datasetMap.set(key, {categoryWayDim: 1, valueWayDim: 0}); - // TODO - // Auto detect first time axis and do arrangement. - each$1(coordSysDefine.coordSysDims, function (coordDim) { - // In value way. - if (coordSysDefine.firstCategoryDimIndex == null) { - var dataDim = datasetRecord.valueWayDim++; - encode[coordDim] = dataDim; - - // ??? TODO give a better default series name rule? - // especially when encode x y specified. - // consider: when mutiple series share one dimension - // category axis, series name should better use - // the other dimsion name. On the other hand, use - // both dimensions name. - - encodeSeriesName.push(dataDim); - // encodeTooltip.push(dataDim); - // encodeLabel.push(dataDim); - } - // In category way, category axis. - else if (coordSysDefine.categoryAxisMap.get(coordDim)) { - encode[coordDim] = 0; - encodeItemName.push(0); - } - // In category way, non-category axis. - else { - var dataDim = datasetRecord.categoryWayDim++; - encode[coordDim] = dataDim; - // encodeTooltip.push(dataDim); - // encodeLabel.push(dataDim); - encodeSeriesName.push(dataDim); + var ecModel = seriesModel.ecModel; + var datasetMap = inner$3(ecModel).datasetMap; + var key = datasetModel.uid + '_' + source.seriesLayoutBy; + + var baseCategoryDimIndex; + var categoryWayValueDimStart; + coordDimensions = coordDimensions.slice(); + each$1(coordDimensions, function (coordDimInfo, coordDimIdx) { + !isObject$1(coordDimInfo) && (coordDimensions[coordDimIdx] = {name: coordDimInfo}); + if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) { + baseCategoryDimIndex = coordDimIdx; + categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimensions[coordDimIdx]); + } + encode[coordDimInfo.name] = []; + }); + + var datasetRecord = datasetMap.get(key) + || datasetMap.set(key, {categoryWayDim: categoryWayValueDimStart, valueWayDim: 0}); + + // TODO + // Auto detect first time axis and do arrangement. + each$1(coordDimensions, function (coordDimInfo, coordDimIdx) { + var coordDimName = coordDimInfo.name; + var count = getDataDimCountOnCoordDim(coordDimInfo); + + // In value way. + if (baseCategoryDimIndex == null) { + var start = datasetRecord.valueWayDim; + pushDim(encode[coordDimName], start, count); + pushDim(encodeSeriesName, start, count); + datasetRecord.valueWayDim += count; + + // ??? TODO give a better default series name rule? + // especially when encode x y specified. + // consider: when mutiple series share one dimension + // category axis, series name should better use + // the other dimsion name. On the other hand, use + // both dimensions name. + } + // In category way, the first category axis. + else if (baseCategoryDimIndex === coordDimIdx) { + pushDim(encode[coordDimName], 0, count); + pushDim(encodeItemName, 0, count); + } + // In category way, the other axis. + else { + var start = datasetRecord.categoryWayDim; + pushDim(encode[coordDimName], start, count); + pushDim(encodeSeriesName, start, count); + datasetRecord.categoryWayDim += count; + } + }); + + function pushDim(dimIdxArr, idxFrom, idxCount) { + for (var i = 0; i < idxCount; i++) { + dimIdxArr.push(idxFrom + i); + } + } + + function getDataDimCountOnCoordDim(coordDimInfo) { + var dimsDef = coordDimInfo.dimsDef; + return dimsDef ? dimsDef.length : 1; + } + + encodeItemName.length && (encode.itemName = encodeItemName); + encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + + return encode; +} + +/** + * Work for data like [{name: ..., value: ...}, ...]. + * + * @param {module:model/Series} seriesModel + * @param {module:data/Source} source + * @return {Object} encode Never be `null/undefined`. + */ +function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) { + var encode = {}; + + var datasetModel = getDatasetModel(seriesModel); + // Currently only make default when using dataset, util more reqirements occur. + if (!datasetModel) { + return encode; + } + + var sourceFormat = source.sourceFormat; + var dimensionsDefine = source.dimensionsDefine; + + var potentialNameDimIndex; + if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + each$1(dimensionsDefine, function (dim, idx) { + if ((isObject$1(dim) ? dim.name : dim) === 'name') { + potentialNameDimIndex = idx; } }); } - // Do not make a complex rule! Hard to code maintain and not necessary. - // ??? TODO refactor: provide by series itself. - // [{name: ..., value: ...}, ...] like: - else if (nSeriesMap.get(seriesType) != null) { - // Find the first not ordinal. (5 is an experience value) - var firstNotOrdinal; - for (var i = 0; i < 5 && firstNotOrdinal == null; i++) { - if (!doGuessOrdinal( - data, sourceFormat, seriesLayoutBy, - completeResult.dimensionsDefine, completeResult.startIndex, i - )) { - firstNotOrdinal = i; + + // idxResult: {v, n}. + var idxResult = (function () { + + var idxRes0 = {}; + var idxRes1 = {}; + var guessRecords = []; + + // 5 is an experience value. + for (var i = 0, len = Math.min(5, dimCount); i < len; i++) { + var guessResult = doGuessOrdinal( + source.data, sourceFormat, source.seriesLayoutBy, + dimensionsDefine, source.startIndex, i + ); + guessRecords.push(guessResult); + var isPureNumber = guessResult === BE_ORDINAL.Not; + + // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim, + // and then find a name dim with the priority: + // "BE_ORDINAL.Might|BE_ORDINAL.Must" > "other dim" > "the value dim itself". + if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) { + idxRes0.v = i; + } + if (idxRes0.n == null + || (idxRes0.n === idxRes0.v) + || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) + ) { + idxRes0.n = i; + } + if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) { + return idxRes0; + } + + // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not), + // find the first BE_ORDINAL.Might as the value dim, + // and then find a name dim with the priority: + // "other dim" > "the value dim itself". + // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be + // treated as number. + if (!isPureNumber) { + if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) { + idxRes1.v = i; + } + if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) { + idxRes1.n = i; + } } } - if (firstNotOrdinal != null) { - encode.value = firstNotOrdinal; - var nameDimIndex = completeResult.potentialNameDimIndex - || Math.max(firstNotOrdinal - 1, 0); - // By default, label use itemName in charts. - // So we dont set encodeLabel here. - encodeSeriesName.push(nameDimIndex); - encodeItemName.push(nameDimIndex); - // encodeTooltip.push(firstNotOrdinal); + + function fulfilled(idxResult) { + return idxResult.v != null && idxResult.n != null; } - } - // encodeTooltip.length && (encode.tooltip = encodeTooltip); - // encodeLabel.length && (encode.label = encodeLabel); - encodeItemName.length && (encode.itemName = encodeItemName); - encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null; + })(); + + if (idxResult) { + encode.value = idxResult.v; + // `potentialNameDimIndex` has highest priority. + var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; + // By default, label use itemName in charts. + // So we dont set encodeLabel here. + encode.itemName = [nameDimIndex]; + encode.seriesName = [nameDimIndex]; + } return encode; } @@ -20386,7 +21717,7 @@ function getDatasetModel(seriesModel) { * * @param {module:echars/data/Source} source * @param {number} dimIndex - * @return {boolean} Whether ordinal. + * @return {BE_ORDINAL} guess result. */ function guessOrdinal(source, dimIndex) { return doGuessOrdinal( @@ -20400,6 +21731,7 @@ function guessOrdinal(source, dimIndex) { } // dimIndex may be overflow source data. +// return {BE_ORDINAL} function doGuessOrdinal( data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex ) { @@ -20408,15 +21740,26 @@ function doGuessOrdinal( var maxLoop = 5; if (isTypedArray(data)) { - return false; + return BE_ORDINAL.Not; } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine // always exists in source. var dimName; + var dimType; if (dimensionsDefine) { - dimName = dimensionsDefine[dimIndex]; - dimName = isObject$1(dimName) ? dimName.name : dimName; + var dimDefItem = dimensionsDefine[dimIndex]; + if (isObject$1(dimDefItem)) { + dimName = dimDefItem.name; + dimType = dimDefItem.type; + } + else if (isString(dimDefItem)) { + dimName = dimDefItem; + } + } + + if (dimType != null) { + return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not; } if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { @@ -20439,7 +21782,7 @@ function doGuessOrdinal( } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { if (!dimName) { - return; + return BE_ORDINAL.Not; } for (var i = 0; i < data.length && i < maxLoop; i++) { var item = data[i]; @@ -20450,11 +21793,11 @@ function doGuessOrdinal( } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { if (!dimName) { - return; + return BE_ORDINAL.Not; } var sample = data[dimName]; if (!sample || isTypedArray(sample)) { - return false; + return BE_ORDINAL.Not; } for (var i = 0; i < sample.length && i < maxLoop; i++) { if ((result = detectValue(sample[i])) != null) { @@ -20467,7 +21810,7 @@ function doGuessOrdinal( var item = data[i]; var val = getDataItemValue(item); if (!isArray(val)) { - return false; + return BE_ORDINAL.Not; } if ((result = detectValue(val[dimIndex])) != null) { return result; @@ -20476,17 +21819,18 @@ function doGuessOrdinal( } function detectValue(val) { + var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as "number". // `isFinit('')` get `true`. if (val != null && isFinite(val) && val !== '') { - return false; + return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not; } - else if (isString(val) && val !== '-') { - return true; + else if (beStr && val !== '-') { + return BE_ORDINAL.Must; } } - return false; + return BE_ORDINAL.Not; } /* @@ -20691,7 +22035,7 @@ var GlobalModel = Model.extend({ mainType, resultItem.keyInfo.subType, true ); - if (componentModel && componentModel instanceof ComponentModelClass) { + if (componentModel && componentModel.constructor === ComponentModelClass) { componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty(); componentModel.mergeOption(newCptOption, this); @@ -20852,8 +22196,8 @@ var GlobalModel = Model.extend({ * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} * ); * var result = findComponents( - * {mainType: 'series'}, - * function (model, index) {...} + * {mainType: 'series', + * filter: function (model, index) {...}} * ); * // result like [component0, componnet1, ...] * @@ -21025,7 +22369,7 @@ var GlobalModel = Model.extend({ * After filtering, series may be different. * frome raw series. * - * @parma {string} subType + * @param {string} subType. * @param {Function} cb * @param {*} context */ @@ -21503,7 +22847,7 @@ OptionManager.prototype = { // Caution: some series modify option data, if do not clone, // it should ensure that the repeat modify correctly // (create a new object when modify itself). - rawOption = clone$3(rawOption, true); + rawOption = clone$3(rawOption); // FIXME // 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。 @@ -21875,6 +23219,7 @@ function convertNormalEmphasis(opt, optType, useExtend) { } } } + function removeEC3NormalStatus(opt) { convertNormalEmphasis(opt, 'itemStyle'); convertNormalEmphasis(opt, 'lineStyle'); @@ -22171,15 +23516,20 @@ var backwardCompat = function (option, isTheme) { var seriesType = seriesOpt.type; - if (seriesType === 'pie' || seriesType === 'gauge') { + if (seriesType === 'line') { + if (seriesOpt.clipOverflow != null) { + seriesOpt.clip = seriesOpt.clipOverflow; + } + } + else if (seriesType === 'pie' || seriesType === 'gauge') { if (seriesOpt.clockWise != null) { seriesOpt.clockwise = seriesOpt.clockWise; } } - if (seriesType === 'gauge') { + else if (seriesType === 'gauge') { var pointerColor = get(seriesOpt, 'pointer.color'); pointerColor != null - && set$1(seriesOpt, 'itemStyle.normal.color', pointerColor); + && set$1(seriesOpt, 'itemStyle.color', pointerColor); } compatLayoutProperties(seriesOpt); @@ -22226,7 +23576,7 @@ var backwardCompat = function (option, isTheme) { // data processing stage is blocked in stream. // See // (2) Only register once when import repeatly. -// Should be executed before after series filtered and before stack calculation. +// Should be executed after series filtered and before stack calculation. var dataStack = function (ecModel) { var stackInfoMap = createHashMap(); ecModel.eachSeries(function (seriesModel) { @@ -22738,22 +24088,31 @@ var dataFormatMixin = { var name = data.getName(dataIndex); var itemOpt = data.getRawDataItem(dataIndex); var color = data.getItemVisual(dataIndex, 'color'); + var borderColor = data.getItemVisual(dataIndex, 'borderColor'); var tooltipModel = this.ecModel.getComponent('tooltip'); - var renderMode = tooltipModel && tooltipModel.get('renderMode') || 'html'; + var renderModeOption = tooltipModel && tooltipModel.get('renderMode'); + var renderMode = getTooltipRenderMode(renderModeOption); + var mainType = this.mainType; + var isSeries = mainType === 'series'; + var userOutput = data.userOutput; return { - componentType: this.mainType, + componentType: mainType, componentSubType: this.subType, - seriesType: this.mainType === 'series' ? this.subType : null, + componentIndex: this.componentIndex, + seriesType: isSeries ? this.subType : null, seriesIndex: this.seriesIndex, - seriesId: this.id, - seriesName: this.name, + seriesId: isSeries ? this.id : null, + seriesName: isSeries ? this.name : null, name: name, dataIndex: rawDataIndex, data: itemOpt, dataType: dataType, value: rawValue, color: color, + borderColor: borderColor, + dimensionNames: userOutput ? userOutput.dimensionNames : null, + encode: userOutput ? userOutput.encode : null, marker: getTooltipMarker({ color: color, renderMode: renderMode @@ -22769,7 +24128,8 @@ var dataFormatMixin = { * @param {number} dataIndex * @param {string} [status='normal'] 'normal' or 'emphasis' * @param {string} [dataType] - * @param {number} [dimIndex] + * @param {number} [dimIndex] Only used in some chart that + * use formatter in different dimensions, like radar. * @param {string} [labelProp='label'] * @return {string} If not formatter, return null/undefined */ @@ -22791,6 +24151,7 @@ var dataFormatMixin = { if (typeof formatter === 'function') { params.status = status; + params.dimensionIndex = dimIndex; return formatter(params); } else if (typeof formatter === 'string') { @@ -23216,17 +24577,22 @@ var SeriesModel = ComponentModel.extend({ defaultOption: null, /** - * Data provided for legend - * @type {Function} + * legend visual provider to the legend component + * @type {Object} */ // PENDING - legendDataProvider: null, + legendVisualProvider: null, /** * Access path of color for visual */ visualColorAccessPath: 'itemStyle.color', + /** + * Access path of borderColor for visual + */ + visualBorderColorAccessPath: 'itemStyle.borderColor', + /** * Support merge layout params. * Only support 'box' now (left/right/top/bottom/width/height). @@ -23497,7 +24863,7 @@ var SeriesModel = ComponentModel.extend({ return; } var dimType = dimInfo.type; - var markName = series.seriesIndex + 'at' + markerId; + var markName = 'sub' + series.seriesIndex + 'at' + markerId; var dimHead = getTooltipMarker({ color: color, type: 'subItem', @@ -23525,15 +24891,22 @@ var SeriesModel = ComponentModel.extend({ } } + var newLine = vertially ? (isRichText ? '\n' : '
') : ''; + var content = newLine + result.join(newLine || ', '); return { renderMode: renderMode, - content: (vertially ? isRichText : '') + result.join(vertially ? isRichText : ', '), + content: content, style: markers }; } function formatSingleValue(val) { - return encodeHTML(addCommas(val)); + // return encodeHTML(addCommas(val)); + return { + renderMode: renderMode, + content: encodeHTML(addCommas(val)), + style: markers + }; } var data = this.getData(); @@ -23554,6 +24927,7 @@ var SeriesModel = ComponentModel.extend({ : tooltipDimLen ? formatSingleValue(retrieveRawValue(data, dataIndex, tooltipDims[0])) : formatSingleValue(isValueArr ? value[0] : value); + var content = formattedValue.content; var markName = series.seriesIndex + 'at' + markerId; var colorEl = getTooltipMarker({ @@ -23579,10 +24953,10 @@ var SeriesModel = ComponentModel.extend({ var html = !multipleSeries ? seriesName + colorStr + (name - ? encodeHTML(name) + ': ' + formattedValue - : formattedValue + ? encodeHTML(name) + ': ' + content + : content ) - : colorStr + seriesName + formattedValue; + : colorStr + seriesName + content; return { html: html, @@ -23725,7 +25099,7 @@ function dataTaskReset(context) { function dataTaskProgress(param, context) { // Avoid repead cloneShallow when data just created in reset. - if (param.end > context.outputData.count()) { + if (context.outputData && param.end > context.outputData.count()) { context.model.getRawData().cloneShallow(context.outputData); } } @@ -23782,7 +25156,7 @@ function getCurrentTask(seriesModel) { * under the License. */ -var Component = function () { +var Component$1 = function () { /** * @type {module:zrender/container/Group} * @readOnly @@ -23796,9 +25170,9 @@ var Component = function () { this.uid = getUID('viewComponent'); }; -Component.prototype = { +Component$1.prototype = { - constructor: Component, + constructor: Component$1, init: function (ecModel, api) {}, @@ -23817,18 +25191,18 @@ Component.prototype = { }; -var componentProto = Component.prototype; -componentProto.updateView - = componentProto.updateLayout - = componentProto.updateVisual - = function (seriesModel, ecModel, api, payload) { +var componentProto = Component$1.prototype; +componentProto.updateView = + componentProto.updateLayout = + componentProto.updateVisual = + function (seriesModel, ecModel, api, payload) { // Do nothing; }; // Enable Component.extend. -enableClassExtend(Component); +enableClassExtend(Component$1); // Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on. -enableClassManagement(Component, {registerWhenExtend: true}); +enableClassManagement(Component$1, {registerWhenExtend: true}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -23862,8 +25236,11 @@ var createRenderPlanner = function () { var originalLarge = fields.large; var originalProgressive = fields.progressiveRender; - var large = fields.large = pipelineContext.large; - var progressive = fields.progressiveRender = pipelineContext.progressiveRender; + // FIXME: if the planner works on a filtered series, `pipelineContext` does not + // exists. See #11611 . Probably we need to modify this structure, see the comment + // on `performRawSeries` in `Schedular.js`. + var large = fields.large = pipelineContext && pipelineContext.large; + var progressive = fields.progressiveRender = pipelineContext && pipelineContext.progressiveRender; return !!((originalLarge ^ large) || (originalProgressive ^ progressive)) && 'reset'; }; @@ -24019,44 +25396,53 @@ Chart.prototype = { }; var chartProto = Chart.prototype; -chartProto.updateView - = chartProto.updateLayout - = chartProto.updateVisual - = function (seriesModel, ecModel, api, payload) { +chartProto.updateView = +chartProto.updateLayout = +chartProto.updateVisual = + function (seriesModel, ecModel, api, payload) { this.render(seriesModel, ecModel, api, payload); }; /** * Set state of single element - * @param {module:zrender/Element} el - * @param {string} state + * @param {module:zrender/Element} el + * @param {string} state 'normal'|'emphasis' + * @param {number} highlightDigit */ -function elSetState(el, state) { +function elSetState(el, state, highlightDigit) { if (el) { - el.trigger(state); - if (el.type === 'group') { - for (var i = 0; i < el.childCount(); i++) { - elSetState(el.childAt(i), state); + el.trigger(state, highlightDigit); + if (el.isGroup + // Simple optimize. + && !isHighDownDispatcher(el) + ) { + for (var i = 0, len = el.childCount(); i < len; i++) { + elSetState(el.childAt(i), state, highlightDigit); } } } } + /** - * @param {module:echarts/data/List} data - * @param {Object} payload - * @param {string} state 'normal'|'emphasis' + * @param {module:echarts/data/List} data + * @param {Object} payload + * @param {string} state 'normal'|'emphasis' */ function toggleHighlight(data, payload, state) { var dataIndex = queryDataIndex(data, payload); + var highlightDigit = (payload && payload.highlightKey != null) + ? getHighlightDigit(payload.highlightKey) + : null; + if (dataIndex != null) { each$1(normalizeToArray(dataIndex), function (dataIdx) { - elSetState(data.getItemGraphicEl(dataIdx), state); + elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit); }); } else { data.eachItemGraphicEl(function (el) { - elSetState(el, state); + elSetState(el, state, highlightDigit); }); } } @@ -24322,21 +25708,30 @@ var seriesColor = { reset: function (seriesModel, ecModel) { var data = seriesModel.getData(); var colorAccessPath = (seriesModel.visualColorAccessPath || 'itemStyle.color').split('.'); - var color = seriesModel.get(colorAccessPath) // Set in itemStyle - || seriesModel.getColorFromPalette( + // Set in itemStyle + var color = seriesModel.get(colorAccessPath); + var colorCallback = (isFunction$1(color) && !(color instanceof Gradient)) + ? color : null; + // Default color + if (!color || colorCallback) { + color = seriesModel.getColorFromPalette( // TODO series count changed. seriesModel.name, null, ecModel.getSeriesCount() - ); // Default color + ); + } - // FIXME Set color function or use the platte color data.setVisual('color', color); + var borderColorAccessPath = (seriesModel.visualBorderColorAccessPath || 'itemStyle.borderColor').split('.'); + var borderColor = seriesModel.get(borderColorAccessPath); + data.setVisual('borderColor', borderColor); + // Only visible series has each data be visual encoded if (!ecModel.isSeriesFiltered(seriesModel)) { - if (typeof color === 'function' && !(color instanceof Gradient)) { + if (colorCallback) { data.each(function (idx) { data.setItemVisual( - idx, 'color', color(seriesModel.getDataParams(idx)) + idx, 'color', colorCallback(seriesModel.getDataParams(idx)) ); }); } @@ -24345,9 +25740,13 @@ var seriesColor = { var dataEach = function (data, idx) { var itemModel = data.getItemModel(idx); var color = itemModel.get(colorAccessPath, true); + var borderColor = itemModel.get(borderColorAccessPath, true); if (color != null) { data.setItemVisual(idx, 'color', color); } + if (borderColor != null) { + data.setItemVisual(idx, 'borderColor', borderColor); + } }; return { dataEach: data.hasItemOption ? dataEach : null }; @@ -24374,8 +25773,17 @@ var seriesColor = { * under the License. */ +/** + * Language: (Simplified) Chinese. + */ var lang = { + legend: { + selector: { + all: '全选', + inverse: '反选' + } + }, toolbox: { brush: { title: { @@ -24671,11 +26079,16 @@ var loadingDefault = function (api, opts) { opts = opts || {}; defaults(opts, { text: 'loading', - color: '#c23531', textColor: '#000', + fontSize: '12px', maskColor: 'rgba(255, 255, 255, 0.8)', + showSpinner: true, + color: '#c23531', + spinnerRadius: 10, + lineWidth: 5, zlevel: 0 }); + var group = new Group(); var mask = new Rect({ style: { fill: opts.maskColor @@ -24683,24 +26096,13 @@ var loadingDefault = function (api, opts) { zlevel: opts.zlevel, z: 10000 }); - var arc = new Arc({ - shape: { - startAngle: -PI$1 / 2, - endAngle: -PI$1 / 2 + 0.1, - r: 10 - }, - style: { - stroke: opts.color, - lineCap: 'round', - lineWidth: 5 - }, - zlevel: opts.zlevel, - z: 10001 - }); + group.add(mask); + var font = opts.fontSize + ' sans-serif'; var labelRect = new Rect({ style: { fill: 'none', text: opts.text, + font: font, textPosition: 'right', textDistance: 10, textFill: opts.textColor @@ -24708,32 +26110,49 @@ var loadingDefault = function (api, opts) { zlevel: opts.zlevel, z: 10001 }); - - arc.animateShape(true) - .when(1000, { - endAngle: PI$1 * 3 / 2 - }) - .start('circularInOut'); - arc.animateShape(true) - .when(1000, { - startAngle: PI$1 * 3 / 2 - }) - .delay(300) - .start('circularInOut'); - - var group = new Group(); - group.add(arc); group.add(labelRect); - group.add(mask); + if (opts.showSpinner) { + var arc = new Arc({ + shape: { + startAngle: -PI$1 / 2, + endAngle: -PI$1 / 2 + 0.1, + r: opts.spinnerRadius + }, + style: { + stroke: opts.color, + lineCap: 'round', + lineWidth: opts.lineWidth + }, + zlevel: opts.zlevel, + z: 10001 + }); + arc.animateShape(true) + .when(1000, { + endAngle: PI$1 * 3 / 2 + }) + .start('circularInOut'); + arc.animateShape(true) + .when(1000, { + startAngle: PI$1 * 3 / 2 + }) + .delay(300) + .start('circularInOut'); + group.add(arc); + } // Inject resize group.resize = function () { - var cx = api.getWidth() / 2; + var textWidth = getWidth(opts.text, font); + var r = opts.showSpinner ? opts.spinnerRadius : 0; + // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2 + // textDistance needs to be calculated when both animation and text exist + var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 + // only show the text + - (opts.showSpinner ? 0 : textWidth / 2); var cy = api.getHeight() / 2; - arc.setShape({ + opts.showSpinner && arc.setShape({ cx: cx, cy: cy }); - var r = arc.shape.r; labelRect.setShape({ x: cx - r, y: cy - r, @@ -24861,7 +26280,7 @@ proto.getPerformArgs = function (task, isBlock) { var step = incremental ? pipeline.step : null; var modDataCount = pCtx && pCtx.modDataCount; - var modBy = modDataCount != null ? Math.ceil(modDataCount / step): null; + var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null; return {step: step, modBy: modBy, modDataCount: modDataCount}; }; @@ -25007,6 +26426,14 @@ function performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) { task.dirty(); } var performArgs = scheduler.getPerformArgs(task, opt.block); + // FIXME + // if intending to decalare `performRawSeries` in handlers, only + // stream-independent (specifically, data item independent) operations can be + // performed. Because is a series is filtered, most of the tasks will not + // be performed. A stream-dependent operation probably cause wrong biz logic. + // Perhaps we should not provide a separate callback for this case instead + // of providing the config `performRawSeries`. The stream-dependent operaions + // and stream-independent operations should better not be mixed. performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model); updatePayload(task, payload); @@ -25299,10 +26726,12 @@ ecModelMock.eachComponent = function (cond) { }; function mockMethods(target, Clz) { + /* eslint-disable */ for (var name in Clz.prototype) { // Do not use hasOwnProperty target[name] = noop; } + /* eslint-enable */ } /* @@ -25324,7 +26753,10 @@ function mockMethods(target, Clz) { * under the License. */ -var colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C','#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF']; +var colorAll = [ + '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', + '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF' +]; var lightTheme = { @@ -25389,7 +26821,10 @@ var axisCommon = function () { }; }; -var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42']; +var colorPalette = [ + '#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', + '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42' +]; var theme = { color: colorPalette, backgroundColor: '#333', @@ -25400,6 +26835,9 @@ var theme = { }, crossStyle: { color: contrastColor + }, + label: { + color: '#000' } } }, @@ -25541,7 +26979,7 @@ ComponentModel.extend({ }); -Component.extend({ +Component$1.extend({ type: 'dataset' @@ -25793,14 +27231,14 @@ SVGParser.prototype._parseText = function (xmlNode, parentGroup) { }; var nodeParsers = { - 'g': function(xmlNode, parentGroup) { + 'g': function (xmlNode, parentGroup) { var g = new Group(); inheritStyle(parentGroup, g); parseAttributes(xmlNode, g, this._defs); return g; }, - 'rect': function(xmlNode, parentGroup) { + 'rect': function (xmlNode, parentGroup) { var rect = new Rect(); inheritStyle(parentGroup, rect); parseAttributes(xmlNode, rect, this._defs); @@ -25817,7 +27255,7 @@ var nodeParsers = { return rect; }, - 'circle': function(xmlNode, parentGroup) { + 'circle': function (xmlNode, parentGroup) { var circle = new Circle(); inheritStyle(parentGroup, circle); parseAttributes(xmlNode, circle, this._defs); @@ -25830,7 +27268,7 @@ var nodeParsers = { return circle; }, - 'line': function(xmlNode, parentGroup) { + 'line': function (xmlNode, parentGroup) { var line = new Line(); inheritStyle(parentGroup, line); parseAttributes(xmlNode, line, this._defs); @@ -25844,7 +27282,7 @@ var nodeParsers = { return line; }, - 'ellipse': function(xmlNode, parentGroup) { + 'ellipse': function (xmlNode, parentGroup) { var ellipse = new Ellipse(); inheritStyle(parentGroup, ellipse); parseAttributes(xmlNode, ellipse, this._defs); @@ -25857,7 +27295,7 @@ var nodeParsers = { }); return ellipse; }, - 'polygon': function(xmlNode, parentGroup) { + 'polygon': function (xmlNode, parentGroup) { var points = xmlNode.getAttribute('points'); if (points) { points = parsePoints(points); @@ -25873,7 +27311,7 @@ var nodeParsers = { return polygon; }, - 'polyline': function(xmlNode, parentGroup) { + 'polyline': function (xmlNode, parentGroup) { var path = new Path(); inheritStyle(parentGroup, path); parseAttributes(xmlNode, path, this._defs); @@ -25890,7 +27328,7 @@ var nodeParsers = { return polyline; }, - 'image': function(xmlNode, parentGroup) { + 'image': function (xmlNode, parentGroup) { var img = new ZImage(); inheritStyle(parentGroup, img); parseAttributes(xmlNode, img, this._defs); @@ -25905,7 +27343,7 @@ var nodeParsers = { return img; }, - 'text': function(xmlNode, parentGroup) { + 'text': function (xmlNode, parentGroup) { var x = xmlNode.getAttribute('x') || 0; var y = xmlNode.getAttribute('y') || 0; var dx = xmlNode.getAttribute('dx') || 0; @@ -25945,7 +27383,7 @@ var nodeParsers = { return g; }, - 'path': function(xmlNode, parentGroup) { + 'path': function (xmlNode, parentGroup) { // TODO svg fill rule // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule // path.style.globalCompositeOperation = 'xor'; @@ -25964,11 +27402,11 @@ var nodeParsers = { var defineParsers = { - 'lineargradient': function(xmlNode) { - var x1 = parseInt(xmlNode.getAttribute('x1') || 0); - var y1 = parseInt(xmlNode.getAttribute('y1') || 0); - var x2 = parseInt(xmlNode.getAttribute('x2') || 10); - var y2 = parseInt(xmlNode.getAttribute('y2') || 0); + 'lineargradient': function (xmlNode) { + var x1 = parseInt(xmlNode.getAttribute('x1') || 0, 10); + var y1 = parseInt(xmlNode.getAttribute('y1') || 0, 10); + var x2 = parseInt(xmlNode.getAttribute('x2') || 10, 10); + var y2 = parseInt(xmlNode.getAttribute('y2') || 0, 10); var gradient = new LinearGradient(x1, y1, x2, y2); @@ -25977,7 +27415,7 @@ var defineParsers = { return gradient; }, - 'radialgradient': function(xmlNode) { + 'radialgradient': function (xmlNode) { } }; @@ -25990,9 +27428,9 @@ function _parseGradientColorStops(xmlNode, gradient) { if (stop.nodeType === 1) { var offset = stop.getAttribute('offset'); if (offset.indexOf('%') > 0) { // percentage - offset = parseInt(offset) / 100; + offset = parseInt(offset, 10) / 100; } - else if(offset) { // number from 0 to 1 + else if (offset) { // number from 0 to 1 offset = parseFloat(offset); } else { @@ -26020,9 +27458,9 @@ function parsePoints(pointsString) { var list = trim(pointsString).split(DILIMITER_REG); var points = []; - for (var i = 0; i < list.length; i+=2) { + for (var i = 0; i < list.length; i += 2) { var x = parseFloat(list[i]); - var y = parseFloat(list[i+1]); + var y = parseFloat(list[i + 1]); points.push([x, y]); } return points; @@ -26141,14 +27579,14 @@ function parseTransformAttribute(xmlNode, node) { transform = transform.replace(/,/g, ' '); var m = null; var transformOps = []; - transform.replace(transformRegex, function(str, type, value) { + transform.replace(transformRegex, function (str, type, value) { transformOps.push(type, value); }); - for(var i = transformOps.length - 1; i > 0; i-=2) { + for (var i = transformOps.length - 1; i > 0; i -= 2) { var value = transformOps[i]; - var type = transformOps[i-1]; + var type = transformOps[i - 1]; m = m || create$1(); - switch(type) { + switch (type) { case 'translate': value = trim(value).split(DILIMITER_REG); translate(m, m, [parseFloat(value[0]), parseFloat(value[1] || 0)]); @@ -26176,9 +27614,8 @@ function parseTransformAttribute(xmlNode, node) { break; } } + node.setLocalTransform(m); } - node.setLocalTransform(m); - } // Value may contain space. @@ -26375,20 +27812,24 @@ var isFunction = isFunction$1; var isObject = isObject$1; var parseClassType = ComponentModel.parseClassType; -var version = '4.1.0'; +var version = '4.8.0'; var dependencies = { - zrender: '4.0.4' + zrender: '4.3.1' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_FILTER = 1000; +var PRIORITY_PROCESSOR_SERIES_FILTER = 800; +var PRIORITY_PROCESSOR_DATASTACK = 900; var PRIORITY_PROCESSOR_STATISTIC = 5000; var PRIORITY_VISUAL_LAYOUT = 1000; +var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100; var PRIORITY_VISUAL_GLOBAL = 2000; var PRIORITY_VISUAL_CHART = 3000; +var PRIORITY_VISUAL_POST_CHART_LAYOUT = 3500; var PRIORITY_VISUAL_COMPONENT = 4000; // FIXME // necessary? @@ -26397,12 +27838,15 @@ var PRIORITY_VISUAL_BRUSH = 5000; var PRIORITY = { PROCESSOR: { FILTER: PRIORITY_PROCESSOR_FILTER, + SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER, STATISTIC: PRIORITY_PROCESSOR_STATISTIC }, VISUAL: { LAYOUT: PRIORITY_VISUAL_LAYOUT, + PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT, GLOBAL: PRIORITY_VISUAL_GLOBAL, CHART: PRIORITY_VISUAL_CHART, + POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT, COMPONENT: PRIORITY_VISUAL_COMPONENT, BRUSH: PRIORITY_VISUAL_BRUSH } @@ -26418,8 +27862,13 @@ var OPTION_UPDATED = '__optionUpdated'; var ACTION_REG = /^[a-zA-Z0-9_]+$/; -function createRegisterEventWithLowercaseName(method) { +function createRegisterEventWithLowercaseName(method, ignoreDisposed) { return function (eventName, handler, context) { + if (!ignoreDisposed && this._disposed) { + disposedWarning(this.id); + return; + } + // Event name is all lowercase eventName = eventName && eventName.toLowerCase(); Eventful.prototype[method].call(this, eventName, handler, context); @@ -26432,9 +27881,9 @@ function createRegisterEventWithLowercaseName(method) { function MessageCenter() { Eventful.call(this); } -MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on'); -MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off'); -MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one'); +MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on', true); +MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off', true); +MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one', true); mixin(MessageCenter, Eventful); /** @@ -26484,7 +27933,7 @@ function ECharts(dom, theme$$1, opts) { }); /** - * Expect 60 pfs. + * Expect 60 fps. * @type {Function} * @private */ @@ -26546,7 +27995,7 @@ function ECharts(dom, theme$$1, opts) { */ this._scheduler = new Scheduler(this, api, dataProcessorFuncs, visualFuncs); - Eventful.call(this, this._ecEventProcessor = makeEventProcessor(this)); + Eventful.call(this, this._ecEventProcessor = new EventProcessor()); /** * @type {module:echarts~MessageCenter} @@ -26670,6 +28119,10 @@ echartsProto.setOption = function (option, notMerge, lazyUpdate) { if (__DEV__) { assert(!this[IN_MAIN_PROCESS], '`setOption` should not be called during main process.'); } + if (this._disposed) { + disposedWarning(this.id); + return; + } var silent; if (isObject(notMerge)) { @@ -26683,7 +28136,7 @@ echartsProto.setOption = function (option, notMerge, lazyUpdate) { if (!this._model || notMerge) { var optionManager = new OptionManager(this._api); var theme$$1 = this._theme; - var ecModel = this._model = new GlobalModel(null, null, theme$$1, optionManager); + var ecModel = this._model = new GlobalModel(); ecModel.scheduler = this._scheduler; ecModel.init(null, null, theme$$1, optionManager); } @@ -26715,7 +28168,7 @@ echartsProto.setOption = function (option, notMerge, lazyUpdate) { * @DEPRECATED */ echartsProto.setTheme = function () { - console.log('ECharts#setTheme() is DEPRECATED in ECharts 3.0'); + console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0'); }; /** @@ -26781,7 +28234,7 @@ echartsProto.getRenderedCanvas = function (opts) { * Get svg data url * @return {string} */ -echartsProto.getSvgDataUrl = function () { +echartsProto.getSvgDataURL = function () { if (!env$1.svgSupported) { return; } @@ -26793,7 +28246,7 @@ echartsProto.getSvgDataUrl = function () { el.stopAnimation(true); }); - return zr.painter.pathToDataUrl(); + return zr.painter.toDataURL(); }; /** @@ -26805,6 +28258,11 @@ echartsProto.getSvgDataUrl = function () { * @param {string} [opts.excludeComponents] */ echartsProto.getDataURL = function (opts) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + opts = opts || {}; var excludeComponents = opts.excludeComponents; var ecModel = this._model; @@ -26824,7 +28282,7 @@ echartsProto.getDataURL = function (opts) { }); var url = this._zr.painter.getType() === 'svg' - ? this.getSvgDataUrl() + ? this.getSvgDataURL() : this.getRenderedCanvas(opts).toDataURL( 'image/' + (opts && opts.type || 'png') ); @@ -26845,9 +28303,15 @@ echartsProto.getDataURL = function (opts) { * @param {string} [opts.backgroundColor] */ echartsProto.getConnectedDataURL = function (opts) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + if (!env$1.canvasSupported) { return; } + var isSvg = opts.type === 'svg'; var groupId = this.group; var mathMin = Math.min; var mathMax = Math.max; @@ -26862,9 +28326,9 @@ echartsProto.getConnectedDataURL = function (opts) { each$1(instances, function (chart, id) { if (chart.group === groupId) { - var canvas = chart.getRenderedCanvas( - clone(opts) - ); + var canvas = isSvg + ? chart.getZr().painter.getSvgDom().innerHTML + : chart.getRenderedCanvas(clone(opts)); var boundingRect = chart.getDom().getBoundingClientRect(); left = mathMin(boundingRect.left, left); top = mathMin(boundingRect.top, top); @@ -26885,23 +28349,61 @@ echartsProto.getConnectedDataURL = function (opts) { var width = right - left; var height = bottom - top; var targetCanvas = createCanvas(); - targetCanvas.width = width; - targetCanvas.height = height; - var zr = init$1(targetCanvas); + var zr = init$1(targetCanvas, { + renderer: isSvg ? 'svg' : 'canvas' + }); + zr.resize({ + width: width, + height: height + }); - each(canvasList, function (item) { - var img = new ZImage({ - style: { - x: item.left * dpr - left, - y: item.top * dpr - top, - image: item.dom - } + if (isSvg) { + var content = ''; + each(canvasList, function (item) { + var x = item.left - left; + var y = item.top - top; + content += '' + item.dom + ''; }); - zr.add(img); - }); - zr.refreshImmediately(); + zr.painter.getSvgRoot().innerHTML = content; + + if (opts.connectedBackgroundColor) { + zr.painter.setBackgroundColor(opts.connectedBackgroundColor); + } + + zr.refreshImmediately(); + return zr.painter.toDataURL(); + } + else { + // Background between the charts + if (opts.connectedBackgroundColor) { + zr.add(new Rect({ + shape: { + x: 0, + y: 0, + width: width, + height: height + }, + style: { + fill: opts.connectedBackgroundColor + } + })); + } - return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png')); + each(canvasList, function (item) { + var img = new ZImage({ + style: { + x: item.left * dpr - left, + y: item.top * dpr - top, + image: item.dom + } + }); + zr.add(img); + }); + + zr.refreshImmediately(); + return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png')); + } } else { return this.getDataURL(opts); @@ -26949,6 +28451,11 @@ echartsProto.convertToPixel = curry(doConvertPixel, 'convertToPixel'); echartsProto.convertFromPixel = curry(doConvertPixel, 'convertFromPixel'); function doConvertPixel(methodName, finder, value) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + var ecModel = this._model; var coordSysList = this._coordSysMgr.getCoordinateSystems(); var result; @@ -26989,6 +28496,11 @@ function doConvertPixel(methodName, finder, value) { * @return {boolean} result */ echartsProto.containPixel = function (finder, value) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + var ecModel = this._model; var result; @@ -27361,6 +28873,10 @@ echartsProto.resize = function (opts) { if (__DEV__) { assert(!this[IN_MAIN_PROCESS], '`resize` should not be called during main process.'); } + if (this._disposed) { + disposedWarning(this.id); + return; + } this._zr.resize(opts); @@ -27403,6 +28919,11 @@ function updateStreamModes(ecIns, ecModel) { * @param {Object} [cfg] */ echartsProto.showLoading = function (name, cfg) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + if (isObject(name)) { cfg = name; name = ''; @@ -27427,6 +28948,11 @@ echartsProto.showLoading = function (name, cfg) { * Hide loading effect */ echartsProto.hideLoading = function () { + if (this._disposed) { + disposedWarning(this.id); + return; + } + this._loadingFX && this._zr.remove(this._loadingFX); this._loadingFX = null; }; @@ -27450,10 +28976,15 @@ echartsProto.makeActionFromEvent = function (eventObj) { * @param {boolean} [opt.flush=undefined] * true: Flush immediately, and then pixel in canvas can be fetched * immediately. Caution: it might affect performance. - * false: Not not flush. + * false: Not flush. * undefined: Auto decide whether perform flush. */ echartsProto.dispatchAction = function (payload, opt) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + if (!isObject(opt)) { opt = {silent: !!opt}; } @@ -27622,6 +29153,11 @@ function bindRenderedEvent(zr, ecIns) { * @param {Array|TypedArray} params.data */ echartsProto.appendData = function (params) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + var seriesIndex = params.seriesIndex; var ecModel = this.getModel(); var seriesModel = ecModel.getSeriesByIndex(seriesIndex); @@ -27647,9 +29183,9 @@ echartsProto.appendData = function (params) { * Register event * @method */ -echartsProto.on = createRegisterEventWithLowercaseName('on'); -echartsProto.off = createRegisterEventWithLowercaseName('off'); -echartsProto.one = createRegisterEventWithLowercaseName('one'); +echartsProto.on = createRegisterEventWithLowercaseName('on', false); +echartsProto.off = createRegisterEventWithLowercaseName('off', false); +echartsProto.one = createRegisterEventWithLowercaseName('one', false); /** * Prepare view instances of charts and components @@ -27680,7 +29216,7 @@ function prepareView(ecIns, type, ecModel, scheduler) { if (!view) { var classType = parseClassType(model.type); var Clazz = isComponent - ? Component.getClass(classType.main, classType.sub) + ? Component$1.getClass(classType.main, classType.sub) : Chart.getClass(classType.sub); if (__DEV__) { @@ -27807,7 +29343,7 @@ function renderSeries(ecIns, ecModel, api, payload, dirtyMap) { scheduler.unfinished |= unfinished; // If use hover layer - updateHoverLayerStatus(ecIns._zr, ecModel); + updateHoverLayerStatus(ecIns, ecModel); // Add aria aria(ecIns._zr.dom, ecModel); @@ -27830,7 +29366,7 @@ var MOUSE_EVENT_NAMES = [ */ echartsProto._initEvents = function () { each(MOUSE_EVENT_NAMES, function (eveName) { - this._zr.on(eveName, function (e) { + var handler = function (e) { var ecModel = this.getModel(); var el = e.target; var params; @@ -27842,16 +29378,36 @@ echartsProto._initEvents = function () { } else if (el && el.dataIndex != null) { var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex); - params = dataModel && dataModel.getDataParams(el.dataIndex, el.dataType) || {}; + params = dataModel && dataModel.getDataParams(el.dataIndex, el.dataType, el) || {}; } // If element has custom eventData of components else if (el && el.eventData) { params = extend({}, el.eventData); } + // Contract: if params prepared in mouse event, + // these properties must be specified: + // { + // componentType: string (component main type) + // componentIndex: number + // } + // Otherwise event query can not work. + if (params) { var componentType = params.componentType; - var componentIndex = params[componentType + 'Index']; + var componentIndex = params.componentIndex; + // Special handling for historic reason: when trigger by + // markLine/markPoint/markArea, the componentType is + // 'markLine'/'markPoint'/'markArea', but we should better + // enable them to be queried by seriesIndex, since their + // option is set in each series. + if (componentType === 'markLine' + || componentType === 'markPoint' + || componentType === 'markArea' + ) { + componentType = 'series'; + componentIndex = params.seriesIndex; + } var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex); var view = model && this[ @@ -27862,22 +29418,31 @@ echartsProto._initEvents = function () { // `event.componentType` and `event[componentTpype + 'Index']` must not // be missed, otherwise there is no way to distinguish source component. // See `dataFormat.getDataParams`. - assert$1(isGlobalOut || (model && view)); + if (!isGlobalOut && !(model && view)) { + console.warn('model or view can not be found by params'); + } } params.event = e; params.type = eveName; - var ecEventProcessor = this._ecEventProcessor; - ecEventProcessor.targetEl = el; - ecEventProcessor.packedEvent = params; - ecEventProcessor.model = model; - ecEventProcessor.view = view; + this._ecEventProcessor.eventInfo = { + targetEl: el, + packedEvent: params, + model: model, + view: view + }; this.trigger(eveName, params); } - - }, this); + }; + // Consider that some component (like tooltip, brush, ...) + // register zr event handler, but user event handler might + // do anything, such as call `setOption` or `dispatchAction`, + // which probably update any of the content and probably + // cause problem if it is called previous other inner handlers. + handler.zrEventfulCallAtLast = true; + this._zr.on(eveName, handler, this); }, this); each(eventActionMap, function (actionType, eventType) { @@ -27898,6 +29463,10 @@ echartsProto.isDisposed = function () { * Clear */ echartsProto.clear = function () { + if (this._disposed) { + disposedWarning(this.id); + return; + } this.setOption({ series: [] }, true); }; @@ -27906,9 +29475,7 @@ echartsProto.clear = function () { */ echartsProto.dispose = function () { if (this._disposed) { - if (__DEV__) { - console.warn('Instance ' + this.id + ' has been disposed'); - } + disposedWarning(this.id); return; } this._disposed = true; @@ -27933,19 +29500,32 @@ echartsProto.dispose = function () { mixin(ECharts, Eventful); -function updateHoverLayerStatus(zr, ecModel) { +function disposedWarning(id) { + if (__DEV__) { + console.warn('Instance ' + id + ' has been disposed'); + } +} + +function updateHoverLayerStatus(ecIns, ecModel) { + var zr = ecIns._zr; var storage = zr.storage; var elCount = 0; + storage.traverse(function (el) { - if (!el.isGroup) { - elCount++; - } + elCount++; }); + if (elCount > ecModel.get('hoverLayerThreshold') && !env$1.node) { - storage.traverse(function (el) { - if (!el.isGroup) { - // Don't switch back. - el.useHoverLayer = true; + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.preventUsingHoverLayer) { + return; + } + var chartView = ecIns._chartsMap[seriesModel.__viewId]; + if (chartView.__alive) { + chartView.group.traverse(function (el) { + // Don't switch back. + el.useHoverLayer = true; + }); } }); } @@ -28014,7 +29594,9 @@ function createExtensionAPI(ecInstance) { }); } + /** + * @class * Usage of query: * `chart.on('click', query, handler);` * The `query` can be: @@ -28023,98 +29605,115 @@ function createExtensionAPI(ecInstance) { * + The component query object, like: * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`, * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`. - * + The element query object, like: - * `{targetName: 'some'}` (only available in custom series). + * + The data query object, like: + * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`. + * + The other query object (cmponent customized query), like: + * `{element: 'some'}` (only available in custom series). * * Caveat: If a prop in the `query` object is `null/undefined`, it is the * same as there is no such prop in the `query` object. */ -function makeEventProcessor(ecIns) { - return { +function EventProcessor() { + // These info required: targetEl, packedEvent, model, view + this.eventInfo; +} +EventProcessor.prototype = { + constructor: EventProcessor, - normalizeQuery: function (query) { - var cptQuery = {}; - var dataQuery = {}; - var otherQuery = {}; + normalizeQuery: function (query) { + var cptQuery = {}; + var dataQuery = {}; + var otherQuery = {}; - // `query` is `mainType` or `mainType.subType` of component. - if (isString(query)) { - var condCptType = parseClassType(query); - // `.main` and `.sub` may be ''. - cptQuery.mainType = condCptType.main || null; - cptQuery.subType = condCptType.sub || null; - } - // `query` is an object, convert to {mainType, index, name, id}. - else { - // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved, - // can not be used in `compomentModel.filterForExposedEvent`. - var suffixes = ['Index', 'Name', 'Id']; - var dataKeys = {name: 1, dataIndex: 1, dataType: 1}; - each$1(query, function (val, key) { - var reserved; - for (var i = 0; i < suffixes.length; i++) { - var propSuffix = suffixes[i]; - var suffixPos = key.lastIndexOf(propSuffix); - if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { - var mainType = key.slice(0, suffixPos); - // Consider `dataIndex`. - if (mainType !== 'data') { - cptQuery.mainType = mainType; - cptQuery[propSuffix.toLowerCase()] = val; - reserved = true; - } + // `query` is `mainType` or `mainType.subType` of component. + if (isString(query)) { + var condCptType = parseClassType(query); + // `.main` and `.sub` may be ''. + cptQuery.mainType = condCptType.main || null; + cptQuery.subType = condCptType.sub || null; + } + // `query` is an object, convert to {mainType, index, name, id}. + else { + // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved, + // can not be used in `compomentModel.filterForExposedEvent`. + var suffixes = ['Index', 'Name', 'Id']; + var dataKeys = {name: 1, dataIndex: 1, dataType: 1}; + each$1(query, function (val, key) { + var reserved = false; + for (var i = 0; i < suffixes.length; i++) { + var propSuffix = suffixes[i]; + var suffixPos = key.lastIndexOf(propSuffix); + if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { + var mainType = key.slice(0, suffixPos); + // Consider `dataIndex`. + if (mainType !== 'data') { + cptQuery.mainType = mainType; + cptQuery[propSuffix.toLowerCase()] = val; + reserved = true; } } - if (dataKeys.hasOwnProperty(key)) { - dataQuery[key] = val; - reserved = true; - } - if (!reserved) { - otherQuery[key] = val; - } - }); - } + } + if (dataKeys.hasOwnProperty(key)) { + dataQuery[key] = val; + reserved = true; + } + if (!reserved) { + otherQuery[key] = val; + } + }); + } - return { - cptQuery: cptQuery, - dataQuery: dataQuery, - otherQuery: otherQuery - }; - }, + return { + cptQuery: cptQuery, + dataQuery: dataQuery, + otherQuery: otherQuery + }; + }, - filter: function (eventType, query, args) { - // They should be assigned before each trigger call. - var targetEl = this.targetEl; - var packedEvent = this.packedEvent; - var model = this.model; - var view = this.view; + filter: function (eventType, query, args) { + // They should be assigned before each trigger call. + var eventInfo = this.eventInfo; - // For event like 'globalout'. - if (!model || !view) { - return true; - } + if (!eventInfo) { + return true; + } - var cptQuery = query.cptQuery; - var dataQuery = query.dataQuery; + var targetEl = eventInfo.targetEl; + var packedEvent = eventInfo.packedEvent; + var model = eventInfo.model; + var view = eventInfo.view; - 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 - )); + // For event like 'globalout'. + if (!model || !view) { + return true; } - }; - function check(query, host, prop, propOnHost) { - return query[prop] == null || host[propOnHost || prop] === query[prop]; + var cptQuery = query.cptQuery; + var dataQuery = query.dataQuery; + + 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 + )); + + function check(query, host, prop, propOnHost) { + return query[prop] == null || host[propOnHost || prop] === query[prop]; + } + }, + + afterTrigger: function () { + // Make sure the eventInfo wont be used in next trigger. + this.eventInfo = null; } -} +}; + /** * @type {Object} key: actionType. @@ -28216,7 +29815,7 @@ function enableConnect(chart) { * @param {Object} [theme] * @param {Object} opts * @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default - * @param {string} [opts.renderer] Currently only 'canvas' is supported. + * @param {string} [opts.renderer] Can choose 'canvas' or 'svg' to render the chart. * @param {number} [opts.width] Use clientWidth of the input `dom` by default. * Can be 'auto' (the same as null/undefined) * @param {number} [opts.height] Use clientHeight of the input `dom` by default. @@ -28255,7 +29854,10 @@ function init(dom, theme$$1, opts) { || (!dom.clientHeight && (!opts || opts.height == null)) ) ) { - console.warn('Can\'t get dom width or height'); + console.warn('Can\'t get DOM width or height. Please check ' + + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + + 'For example, you may need to call this in the callback ' + + 'of window.onload.'); } } @@ -28314,7 +29916,7 @@ function dispose(chart) { if (typeof chart === 'string') { chart = instances[chart]; } - else if (!(chart instanceof ECharts)){ + else if (!(chart instanceof ECharts)) { // Try to treat as dom chart = getInstanceByDom(chart); } @@ -28510,7 +30112,7 @@ function extendComponentView(opts/*, superClass*/) { // var classType = parseClassType(superClass); // Clazz = ComponentView.getClass(classType.main, classType.sub, true); // } - return Component.extend(opts); + return Component$1.extend(opts); } /** @@ -28606,7 +30208,7 @@ function getMap(mapName) { registerVisual(PRIORITY_VISUAL_GLOBAL, seriesColor); registerPreprocessor(backwardCompat); -registerProcessor(PRIORITY_PROCESSOR_STATISTIC, dataStack); +registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack); registerLoading('default', loadingDefault); // Default actions @@ -28713,9 +30315,6 @@ DataDiffer.prototype = { initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter', this); initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter', this); - // Travel by inverted order to make sure order consistency - // when duplicate keys exists (consider newDataIndex.pop() below). - // For performance consideration, these code below do not look neat. for (i = 0; i < oldArr.length; i++) { var key = oldDataKeyArr[i]; var idx = newDataIndexMap[key]; @@ -28727,7 +30326,7 @@ DataDiffer.prototype = { var len = idx.length; if (len) { len === 1 && (newDataIndexMap[key] = null); - idx = idx.unshift(); + idx = idx.shift(); } else { newDataIndexMap[key] = null; @@ -28808,6 +30407,12 @@ function summarizeDimensions(data) { var defaultedLabel = []; var defaultedTooltip = []; + // See the comment of `List.js#userOutput`. + var userOutput = summary.userOutput = { + dimensionNames: data.dimensions.slice(), + encode: {} + }; + each$1(data.dimensions, function (dimName) { var dimItem = data.getDimensionInfo(dimName); @@ -28816,11 +30421,9 @@ function summarizeDimensions(data) { if (__DEV__) { assert$1(OTHER_DIMENSIONS.get(coordDim) == null); } - var coordDimArr = encode[coordDim]; - if (!encode.hasOwnProperty(coordDim)) { - coordDimArr = encode[coordDim] = []; - } - coordDimArr[dimItem.coordDimIndex] = dimName; + + var coordDimIndex = dimItem.coordDimIndex; + getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName; if (!dimItem.isExtraCoord) { notExtraCoordDimMap.set(coordDim, 1); @@ -28832,6 +30435,10 @@ function summarizeDimensions(data) { if (mayLabelDimType(dimItem.type)) { defaultedLabel[0] = dimName; } + + // User output encode do not contain generated coords. + // And it only has index. User can use index to retrieve value from the raw item array. + getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index; } if (dimItem.defaultTooltip) { defaultedTooltip.push(dimName); @@ -28839,14 +30446,11 @@ function summarizeDimensions(data) { } OTHER_DIMENSIONS.each(function (v, otherDim) { - var otherDimArr = encode[otherDim]; - if (!encode.hasOwnProperty(otherDim)) { - otherDimArr = encode[otherDim] = []; - } + var encodeArr = getOrCreateEncodeArr(encode, otherDim); var dimIndex = dimItem.otherDims[otherDim]; if (dimIndex != null && dimIndex !== false) { - otherDimArr[dimIndex] = dimItem.name; + encodeArr[dimIndex] = dimItem.name; } }); }); @@ -28889,6 +30493,13 @@ function summarizeDimensions(data) { return summary; } +function getOrCreateEncodeArr(encode, dim) { + if (!encode.hasOwnProperty(dim)) { + encode[dim] = []; + } + return encode[dim]; +} + function getDimensionTypeByAxis(axisType) { return axisType === 'category' ? 'ordinal' @@ -28935,6 +30546,140 @@ function mayLabelDimType(dimType) { * under the License. */ +/** + * @class + * @param {Object|DataDimensionInfo} [opt] All of the fields will be shallow copied. + */ +function DataDimensionInfo(opt) { + if (opt != null) { + extend(this, opt); + } + + /** + * Dimension name. + * Mandatory. + * @type {string} + */ + // this.name; + + /** + * The origin name in dimsDef, see source helper. + * If displayName given, the tooltip will displayed vertically. + * Optional. + * @type {string} + */ + // this.displayName; + + /** + * Which coordSys dimension this dimension mapped to. + * A `coordDim` can be a "coordSysDim" that the coordSys required + * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`), + * or an generated "extra coord name" if does not mapped to any "coordSysDim" + * (That is determined by whether `isExtraCoord` is `true`). + * Mandatory. + * @type {string} + */ + // this.coordDim; + + /** + * The index of this dimension in `series.encode[coordDim]`. + * Mandatory. + * @type {number} + */ + // this.coordDimIndex; + + /** + * Dimension type. The enumerable values are the key of + * `dataCtors` of `data/List`. + * Optional. + * @type {string} + */ + // this.type; + + /** + * This index of this dimension info in `data/List#_dimensionInfos`. + * Mandatory after added to `data/List`. + * @type {number} + */ + // this.index; + + /** + * The format of `otherDims` is: + * ```js + * { + * tooltip: number optional, + * label: number optional, + * itemName: number optional, + * seriesName: number optional, + * } + * ``` + * + * A `series.encode` can specified these fields: + * ```js + * encode: { + * // "3, 1, 5" is the index of data dimension. + * tooltip: [3, 1, 5], + * label: [0, 3], + * ... + * } + * ``` + * `otherDims` is the parse result of the `series.encode` above, like: + * ```js + * // Suppose the index of this data dimension is `3`. + * this.otherDims = { + * // `3` is at the index `0` of the `encode.tooltip` + * tooltip: 0, + * // `3` is at the index `1` of the `encode.tooltip` + * label: 1 + * }; + * ``` + * + * This prop should never be `null`/`undefined` after initialized. + * @type {Object} + */ + this.otherDims = {}; + + /** + * Be `true` if this dimension is not mapped to any "coordSysDim" that the + * "coordSys" required. + * Mandatory. + * @type {boolean} + */ + // this.isExtraCoord; + + /** + * @type {module:data/OrdinalMeta} + */ + // this.ordinalMeta; + + /** + * Whether to create inverted indices. + * @type {boolean} + */ + // this.createInvertedIndices; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/* global Float64Array, Int32Array, Uint32Array, Uint16Array */ + /** * List for data storage * @module echarts/data/List @@ -28943,6 +30688,7 @@ function mayLabelDimType(dimType) { var isObject$4 = isObject$1; var UNDEFINED = 'undefined'; +var INDEX_NOT_FOUND = -1; // Use prefix to avoid index to be the same as otherIdList[idx], // which will cause weird udpate animation. @@ -28962,6 +30708,7 @@ var dataCtors = { // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is // different from the Ctor of typed array. var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array; +var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array; var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array; function getIndicesCtor(list) { @@ -29008,13 +30755,9 @@ function transferProperties(target, source) { * @constructor * @alias module:echarts/data/List * - * @param {Array.} dimensions + * @param {Array.} dimensions * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius - * Spetial fields: { - * ordinalMeta: - * createInvertedIndices: - * } * @param {module:echarts/model/Model} hostModel */ var List = function (dimensions, hostModel) { @@ -29030,7 +30773,10 @@ var List = function (dimensions, hostModel) { var dimensionInfo = dimensions[i]; if (isString(dimensionInfo)) { - dimensionInfo = {name: dimensionInfo}; + dimensionInfo = new DataDimensionInfo({name: dimensionInfo}); + } + else if (!(dimensionInfo instanceof DataDimensionInfo)) { + dimensionInfo = new DataDimensionInfo(dimensionInfo); } var dimensionName = dimensionInfo.name; @@ -29210,6 +30956,21 @@ var List = function (dimensions, hostModel) { * @private */ this._calculationInfo = {}; + + /** + * User output info of this data. + * DO NOT use it in other places! + * + * When preparing user params for user callbacks, we have + * to clone these inner data structures to prevent users + * from modifying them to effect built-in logic. And for + * performance consideration we make this `userOutput` to + * avoid clone them too many times. + * + * @type {Object} + * @readOnly + */ + this.userOutput = this._dimensionsSummary.userOutput; }; var listProto = List.prototype; @@ -29223,15 +30984,31 @@ listProto.type = 'list'; listProto.hasItemOption = true; /** + * The meanings of the input parameter `dim`: + * + * + If dim is a number (e.g., `1`), it means the index of the dimension. + * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'. + * + If dim is a number-like string (e.g., `"1"`): + * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name. + * + If not, it will be converted to a number, which means the index of the dimension. + * (why? because of the backward compatbility. We have been tolerating number-like string in + * dimension setting, although now it seems that it is not a good idea.) + * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`, + * if no dimension name is defined as `"1"`. + * + If dim is a not-number-like string, it means the concrete dim name. + * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`, + * or customized in `dimensions` property of option like `"age"`. + * * Get dimension name - * @param {string|number} dim - * Dimension can be concrete names like x, y, z, lng, lat, angle, radius - * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' + * @param {string|number} dim See above. * @return {string} Concrete dim name. */ listProto.getDimension = function (dim) { - if (!isNaN(dim)) { - dim = this.dimensions[dim] || dim; + if (typeof dim === 'number' + // If being a number-like string but not being defined a dimension name. + || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim)) + ) { + dim = this.dimensions[dim]; } return dim; }; @@ -29295,7 +31072,7 @@ listProto.initData = function (data, nameList, dimValueGetter) { } if (__DEV__) { - if (!notProvider && (typeof data.getItem != 'function' || typeof data.count != 'function')) { + if (!notProvider && (typeof data.getItem !== 'function' || typeof data.count !== 'function')) { throw new Error('Inavlid data provider.'); } } @@ -29322,10 +31099,10 @@ listProto.initData = function (data, nameList, dimValueGetter) { this.defaultDimValueGetter = defaultDimValueGetters[ this._rawData.getSource().sourceFormat ]; - // Default dim value getter this._dimValueGetter = dimValueGetter = dimValueGetter || this.defaultDimValueGetter; + this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows; // Reset raw extent. this._rawExtent = {}; @@ -29342,6 +31119,9 @@ listProto.getProvider = function () { return this._rawData; }; +/** + * Caution: Can be only called on raw data (before `this._indices` created). + */ listProto.appendData = function (data) { if (__DEV__) { assert$1(!this._indices, 'appendData can only be called on raw data.'); @@ -29357,6 +31137,77 @@ listProto.appendData = function (data) { this._initDataFromProvider(start, end); }; +/** + * Caution: Can be only called on raw data (before `this._indices` created). + * This method does not modify `rawData` (`dataProvider`), but only + * add values to storage. + * + * The final count will be increased by `Math.max(values.length, names.length)`. + * + * @param {Array.>} values That is the SourceType: 'arrayRows', like + * [ + * [12, 33, 44], + * [NaN, 43, 1], + * ['-', 'asdf', 0] + * ] + * Each item is exaclty cooresponding to a dimension. + * @param {Array.} [names] + */ +listProto.appendValues = function (values, names) { + var chunkSize = this._chunkSize; + var storage = this._storage; + var dimensions = this.dimensions; + var dimLen = dimensions.length; + var rawExtent = this._rawExtent; + + var start = this.count(); + var end = start + Math.max(values.length, names ? names.length : 0); + var originalChunkCount = this._chunkCount; + + for (var i = 0; i < dimLen; i++) { + var dim = dimensions[i]; + if (!rawExtent[dim]) { + rawExtent[dim] = getInitialExtent(); + } + if (!storage[dim]) { + storage[dim] = []; + } + prepareChunks(storage, this._dimensionInfos[dim], chunkSize, originalChunkCount, end); + this._chunkCount = storage[dim].length; + } + + var emptyDataItem = new Array(dimLen); + for (var idx = start; idx < end; idx++) { + var sourceIdx = idx - start; + var chunkIndex = Math.floor(idx / chunkSize); + var chunkOffset = idx % chunkSize; + + // Store the data by dimensions + for (var k = 0; k < dimLen; k++) { + var dim = dimensions[k]; + var val = this._dimValueGetterArrayRows( + values[sourceIdx] || emptyDataItem, dim, sourceIdx, k + ); + storage[dim][chunkIndex][chunkOffset] = val; + + var dimRawExtent = rawExtent[dim]; + val < dimRawExtent[0] && (dimRawExtent[0] = val); + val > dimRawExtent[1] && (dimRawExtent[1] = val); + } + + if (names) { + this._nameList[idx] = names[sourceIdx]; + } + } + + this._rawCount = this._count = end; + + // Reset data extent + this._extent = {}; + + prepareInvertedIndex(this); +}; + listProto._initDataFromProvider = function (start, end) { // Optimize. if (start >= end) { @@ -29375,8 +31226,7 @@ listProto._initDataFromProvider = function (start, end) { var nameRepeatCount = this._nameRepeatCount = {}; var nameDimIdx; - var chunkCount = this._chunkCount; - var lastChunkIndex = chunkCount - 1; + var originalChunkCount = this._chunkCount; for (var i = 0; i < dimLen; i++) { var dim = dimensions[i]; if (!rawExtent[dim]) { @@ -29390,26 +31240,13 @@ listProto._initDataFromProvider = function (start, end) { if (dimInfo.otherDims.itemId === 0) { this._idDimIdx = i; } - var DataCtor = dataCtors[dimInfo.type]; if (!storage[dim]) { storage[dim] = []; } - var resizeChunkArray = storage[dim][lastChunkIndex]; - if (resizeChunkArray && resizeChunkArray.length < chunkSize) { - var newStore = new DataCtor(Math.min(end - lastChunkIndex * chunkSize, chunkSize)); - // The cost of the copy is probably inconsiderable - // within the initial chunkSize. - for (var j = 0; j < resizeChunkArray.length; j++) { - newStore[j] = resizeChunkArray[j]; - } - storage[dim][lastChunkIndex] = newStore; - } - // Create new chunks. - for (var k = chunkCount * chunkSize; k < end; k += chunkSize) { - storage[dim].push(new DataCtor(Math.min(end - k, chunkSize))); - } + prepareChunks(storage, dimInfo, chunkSize, originalChunkCount, end); + this._chunkCount = storage[dim].length; } @@ -29435,12 +31272,8 @@ listProto._initDataFromProvider = function (start, end) { dimStorage[chunkOffset] = val; var dimRawExtent = rawExtent[dim]; - if (val < dimRawExtent[0]) { - dimRawExtent[0] = val; - } - if (val > dimRawExtent[1]) { - dimRawExtent[1] = val; - } + val < dimRawExtent[0] && (dimRawExtent[0] = val); + val > dimRawExtent[1] && (dimRawExtent[1] = val); } // ??? FIXME not check by pure but sourceFormat? @@ -29499,6 +31332,27 @@ listProto._initDataFromProvider = function (start, end) { prepareInvertedIndex(this); }; +function prepareChunks(storage, dimInfo, chunkSize, chunkCount, end) { + var DataCtor = dataCtors[dimInfo.type]; + var lastChunkIndex = chunkCount - 1; + var dim = dimInfo.name; + var resizeChunkArray = storage[dim][lastChunkIndex]; + if (resizeChunkArray && resizeChunkArray.length < chunkSize) { + var newStore = new DataCtor(Math.min(end - lastChunkIndex * chunkSize, chunkSize)); + // The cost of the copy is probably inconsiderable + // within the initial chunkSize. + for (var j = 0; j < resizeChunkArray.length; j++) { + newStore[j] = resizeChunkArray[j]; + } + storage[dim][lastChunkIndex] = newStore; + } + + // Create new chunks. + for (var k = chunkCount * chunkSize; k < end; k += chunkSize) { + storage[dim].push(new DataCtor(Math.min(end - k, chunkSize))); + } +} + function prepareInvertedIndex(list) { var invertedIndicesMap = list._invertedIndicesMap; each$1(invertedIndicesMap, function (invertedIndices, dim) { @@ -29507,13 +31361,13 @@ function prepareInvertedIndex(list) { // Currently, only dimensions that has ordinalMeta can create inverted indices. var ordinalMeta = dimInfo.ordinalMeta; if (ordinalMeta) { - invertedIndices = invertedIndicesMap[dim] = new CtorUint32Array( + invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array( ordinalMeta.categories.length ); // The default value of TypedArray is 0. To avoid miss - // mapping to 0, we should set it as NaN. + // mapping to 0, we should set it as INDEX_NOT_FOUND. for (var i = 0; i < invertedIndices.length; i++) { - invertedIndices[i] = NaN; + invertedIndices[i] = INDEX_NOT_FOUND; } for (var i = 0; i < list._count; i++) { // Only support the case that all values are distinct. @@ -29688,14 +31542,11 @@ listProto.getValues = function (dimensions, idx /*, stack */) { */ listProto.hasValue = function (idx) { var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord; - var dimensionInfos = this._dimensionInfos; for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) { - if ( - // Ordinal type can be string or number - dimensionInfos[dataDimsOnCoord[i]].type !== 'ordinal' - // FIXME check ordinal when using index? - && isNaN(this.get(dataDimsOnCoord[i], idx)) - ) { + // Ordinal type originally can be string or number. + // But when an ordinal type is used on coord, it can + // not be string but only number. So we can also use isNaN. + if (isNaN(this.get(dataDimsOnCoord[i], idx))) { return false; } } @@ -29825,14 +31676,16 @@ listProto.getMedian = function (dim /*, stack */) { // Use quick select? // immutability & sort - var sortedDimDataArray = [].concat(dimDataArray).sort(function(a, b) { + var sortedDimDataArray = [].concat(dimDataArray).sort(function (a, b) { return a - b; }); var len = this.count(); // calculate median - return len === 0 ? 0 : - len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : - (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; + return len === 0 + ? 0 + : len % 2 === 1 + ? sortedDimDataArray[(len - 1) / 2] + : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; }; // /** @@ -29876,7 +31729,7 @@ listProto.rawIndexOf = function (dim, value) { } var rawIndex = invertedIndices[value]; if (rawIndex == null || isNaN(rawIndex)) { - return -1; + return INDEX_NOT_FOUND; } return rawIndex; }; @@ -29904,14 +31757,14 @@ listProto.indexOfName = function (name) { * @return {number} */ listProto.indexOfRawIndex = function (rawIndex) { - if (!this._indices) { - return rawIndex; - } - if (rawIndex >= this._rawCount || rawIndex < 0) { return -1; } + if (!this._indices) { + return rawIndex; + } + // Indices are ascending var indices = this._indices; @@ -29943,7 +31796,8 @@ listProto.indexOfRawIndex = function (rawIndex) { * @param {string} dim * @param {number} value * @param {number} [maxDistance=Infinity] - * @return {Array.} Considere multiple points has the same value. + * @return {Array.} If and only if multiple indices has + * the same value, they are put to the result. */ listProto.indicesOfNearest = function (dim, value, maxDistance) { var storage = this._storage; @@ -29958,23 +31812,35 @@ listProto.indicesOfNearest = function (dim, value, maxDistance) { maxDistance = Infinity; } - var minDist = Number.MAX_VALUE; + var minDist = Infinity; var minDiff = -1; + var nearestIndicesLen = 0; + + // Check the test case of `test/ut/spec/data/List.js`. for (var i = 0, len = this.count(); i < len; i++) { - var diff = value - this.get(dim, i /*, stack */); + var diff = value - this.get(dim, i); var dist = Math.abs(diff); - if (diff <= maxDistance && dist <= minDist) { - // For the case of two data are same on xAxis, which has sequence data. - // Show the nearest index - // https://github.com/ecomfe/echarts/issues/2869 - if (dist < minDist || (diff >= 0 && minDiff < 0)) { + if (dist <= maxDistance) { + // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`, + // we'd better not push both of them to `nearestIndices`, otherwise it is easy to + // get more than one item in `nearestIndices` (more specifically, in `tooltip`). + // So we chose the one that `diff >= 0` in this csae. + // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them + // should be push to `nearestIndices`. + if (dist < minDist + || (dist === minDist && diff >= 0 && minDiff < 0) + ) { minDist = dist; minDiff = diff; - nearestIndices.length = 0; + nearestIndicesLen = 0; + } + if (diff === minDiff) { + nearestIndices[nearestIndicesLen++] = i; } - nearestIndices.push(i); } } + nearestIndices.length = nearestIndicesLen; + return nearestIndices; }; @@ -30273,7 +32139,7 @@ listProto.selectRange = function (range) { var max2 = range[dimensions[1]][1]; for (var k = 0; k < this._chunkCount; k++) { var chunkStorage = dimStorage[k]; - var chunkStorage2= dimStorage2[k]; + var chunkStorage2 = dimStorage2[k]; var len = Math.min(this._count - k * this._chunkSize, this._chunkSize); for (var i = 0; i < len; i++) { var val = chunkStorage[i]; @@ -30848,8 +32714,12 @@ listProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; /** * @see {module:echarts/test/ut/spec/data/completeDimensions} * - * Complete the dimensions array, by user defined `dimension` and `encode`, - * and guessing from the data structure. + * This method builds the relationship between: + * + "what the coord sys or series requires (see `sysDims`)", + * + "what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)" + * + "what the data source provids (see `source`)". + * + * Some guess strategy will be adapted if user does not define something. * If no 'value' dimension specified, the first no-named dimension will be * named as 'value'. * @@ -30865,32 +32735,20 @@ listProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions * For example: ['asdf', {name, type}, ...]. * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3} + * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists. + * If not specified, auto find the next available data dim. + * param source {module:data/Source} + * param dimCount {number} + * return {Object} encode Never be `null/undefined`. * @param {string} [opt.generateCoord] Generate coord dim with the given name. - * If not specified, extra dim names will be: - * 'value', 'value0', 'value1', ... + * If not specified, extra dim names will be: + * 'value', 'value0', 'value1', ... * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`. - * If `generateCoordCount` specified, the generated dim names will be: - * `generateCoord` + 0, `generateCoord` + 1, ... - * can be Infinity, indicate that use all of the remain columns. + * If `generateCoordCount` specified, the generated dim names will be: + * `generateCoord` + 0, `generateCoord` + 1, ... + * can be Infinity, indicate that use all of the remain columns. * @param {number} [opt.dimCount] If not specified, guess by the first data item. - * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim. - * @return {Array.} [{ - * name: string mandatory, - * displayName: string, the origin name in dimsDef, see source helper. - * If displayName given, the tooltip will displayed vertically. - * coordDim: string mandatory, - * coordDimIndex: number mandatory, - * type: string optional, - * otherDims: { never null/undefined - * tooltip: number optional, - * label: number optional, - * itemName: number optional, - * seriesName: number optional, - * }, - * isExtraCoord: boolean true if coord is generated - * (not specified in encode and not series specified) - * other props ... - * }] + * @return {Array.} */ function completeDimensions(sysDims, source, opt) { if (!Source.isInstance(source)) { @@ -30900,7 +32758,6 @@ function completeDimensions(sysDims, source, opt) { opt = opt || {}; sysDims = (sysDims || []).slice(); var dimsDef = (opt.dimsDef || []).slice(); - var encodeDef = createHashMap(opt.encodeDef); var dataDimNameMap = createHashMap(); var coordDimNameMap = createHashMap(); // var valueCandidate; @@ -30914,7 +32771,7 @@ function completeDimensions(sysDims, source, opt) { {}, isObject$1(dimsDef[i]) ? dimsDef[i] : {name: dimsDef[i]} ); var userDimName = dimDefItem.name; - var resultItem = result[i] = {otherDims: {}}; + var resultItem = result[i] = new DataDimensionInfo(); // Name will be applied later for avoiding duplication. if (userDimName != null && dataDimNameMap.get(userDimName) == null) { // Only if `series.dimensions` is defined in option @@ -30927,9 +32784,24 @@ function completeDimensions(sysDims, source, opt) { dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); } + var encodeDef = opt.encodeDef; + if (!encodeDef && opt.encodeDefaulter) { + encodeDef = opt.encodeDefaulter(source, dimCount); + } + encodeDef = createHashMap(encodeDef); + // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`. encodeDef.each(function (dataDims, coordDim) { dataDims = normalizeToArray(dataDims).slice(); + + // Note: It is allowed that `dataDims.length` is `0`, e.g., options is + // `{encode: {x: -1, y: 1}}`. Should not filter anything in + // this case. + if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) { + encodeDef.set(coordDim, false); + return; + } + var validDataDims = encodeDef.set(coordDim, []); each$1(dataDims, function (resultDimIdx, idx) { // The input resultDimIdx can be dim name or index. @@ -30961,11 +32833,19 @@ function completeDimensions(sysDims, source, opt) { // `coordDimIndex` should not be set directly. sysDimItemDimsDef = sysDimItem.dimsDef; sysDimItemOtherDims = sysDimItem.otherDims; - sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex - = sysDimItem.dimsDef = sysDimItem.otherDims = null; + sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = + sysDimItem.dimsDef = sysDimItem.otherDims = null; } - var dataDims = normalizeToArray(encodeDef.get(coordDim)); + var dataDims = encodeDef.get(coordDim); + + // negative resultDimIdx means no need to mapping. + if (dataDims === false) { + return; + } + + var dataDims = normalizeToArray(dataDims); + // dimensions provides default dim sequences. if (!dataDims.length) { for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { @@ -31011,7 +32891,7 @@ function completeDimensions(sysDims, source, opt) { // Set dim `name` and other `coordDim` and other props. for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { - var resultItem = result[resultDimIdx] = result[resultDimIdx] || {}; + var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo(); var coordDim = resultItem.coordDim; if (coordDim == null) { @@ -31030,7 +32910,28 @@ function completeDimensions(sysDims, source, opt) { dataDimNameMap )); - if (resultItem.type == null && guessOrdinal(source, resultDimIdx, resultItem.name)) { + if (resultItem.type == null + && ( + guessOrdinal(source, resultDimIdx, resultItem.name) === BE_ORDINAL.Must + // Consider the case: + // { + // dataset: {source: [ + // ['2001', 123], + // ['2002', 456], + // ... + // ['The others', 987], + // ]}, + // series: {type: 'pie'} + // } + // The first colum should better be treated as a "ordinal" although it + // might not able to be detected as an "ordinal" by `guessOrdinal`. + || (resultItem.isExtraCoord + && (resultItem.otherDims.itemName != null + || resultItem.otherDims.seriesName != null + ) + ) + ) + ) { resultItem.type = 'ordinal'; } } @@ -31108,6 +33009,7 @@ function genName(name, map$$1, fromZero) { * @param {string} [opt.generateCoordCount] * @param {Array.} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define. * @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define. + * @param {Function} [opt.encodeDefaulter] Make default encode if user not specified. * @return {Array.} dimensionsInfo */ var createDimensions = function (source, opt) { @@ -31116,6 +33018,7 @@ var createDimensions = function (source, opt) { dimsDef: opt.dimensionsDefine || source.dimensionsDefine, encodeDef: opt.encodeDefine || source.encodeDefine, dimCount: opt.dimensionsCount, + encodeDefaulter: opt.encodeDefaulter, generateCoord: opt.generateCoord, generateCoordCount: opt.generateCoordCount }); @@ -31140,6 +33043,201 @@ var createDimensions = function (source, opt) { * under the License. */ +/** + * Helper for model references. + * There are many manners to refer axis/coordSys. + */ + +// TODO +// merge relevant logic to this file? +// check: "modelHelper" of tooltip and "BrushTargetManager". + +/** + * @class + * For example: + * { + * coordSysName: 'cartesian2d', + * coordSysDims: ['x', 'y', ...], + * axisMap: HashMap({ + * x: xAxisModel, + * y: yAxisModel + * }), + * categoryAxisMap: HashMap({ + * x: xAxisModel, + * y: undefined + * }), + * // The index of the first category axis in `coordSysDims`. + * // `null/undefined` means no category axis exists. + * firstCategoryDimIndex: 1, + * // To replace user specified encode. + * } + */ +function CoordSysInfo(coordSysName) { + /** + * @type {string} + */ + this.coordSysName = coordSysName; + /** + * @type {Array.} + */ + this.coordSysDims = []; + /** + * @type {module:zrender/core/util#HashMap} + */ + this.axisMap = createHashMap(); + /** + * @type {module:zrender/core/util#HashMap} + */ + this.categoryAxisMap = createHashMap(); + /** + * @type {number} + */ + this.firstCategoryDimIndex = null; +} + +/** + * @return {module:model/referHelper#CoordSysInfo} + */ +function getCoordSysInfoBySeries(seriesModel) { + var coordSysName = seriesModel.get('coordinateSystem'); + var result = new CoordSysInfo(coordSysName); + var fetch = fetchers[coordSysName]; + if (fetch) { + fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); + return result; + } +} + +var fetchers = { + + cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { + var xAxisModel = seriesModel.getReferringComponents('xAxis')[0]; + var yAxisModel = seriesModel.getReferringComponents('yAxis')[0]; + + if (__DEV__) { + if (!xAxisModel) { + throw new Error('xAxis "' + retrieve( + seriesModel.get('xAxisIndex'), + seriesModel.get('xAxisId'), + 0 + ) + '" not found'); + } + if (!yAxisModel) { + throw new Error('yAxis "' + retrieve( + seriesModel.get('xAxisIndex'), + seriesModel.get('yAxisId'), + 0 + ) + '" not found'); + } + } + + result.coordSysDims = ['x', 'y']; + axisMap.set('x', xAxisModel); + axisMap.set('y', yAxisModel); + + if (isCategory(xAxisModel)) { + categoryAxisMap.set('x', xAxisModel); + result.firstCategoryDimIndex = 0; + } + if (isCategory(yAxisModel)) { + categoryAxisMap.set('y', yAxisModel); + result.firstCategoryDimIndex == null & (result.firstCategoryDimIndex = 1); + } + }, + + singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { + var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0]; + + if (__DEV__) { + if (!singleAxisModel) { + throw new Error('singleAxis should be specified.'); + } + } + + result.coordSysDims = ['single']; + axisMap.set('single', singleAxisModel); + + if (isCategory(singleAxisModel)) { + categoryAxisMap.set('single', singleAxisModel); + result.firstCategoryDimIndex = 0; + } + }, + + polar: function (seriesModel, result, axisMap, categoryAxisMap) { + var polarModel = seriesModel.getReferringComponents('polar')[0]; + var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); + var angleAxisModel = polarModel.findAxisModel('angleAxis'); + + if (__DEV__) { + if (!angleAxisModel) { + throw new Error('angleAxis option not found'); + } + if (!radiusAxisModel) { + throw new Error('radiusAxis option not found'); + } + } + + result.coordSysDims = ['radius', 'angle']; + axisMap.set('radius', radiusAxisModel); + axisMap.set('angle', angleAxisModel); + + if (isCategory(radiusAxisModel)) { + categoryAxisMap.set('radius', radiusAxisModel); + result.firstCategoryDimIndex = 0; + } + if (isCategory(angleAxisModel)) { + categoryAxisMap.set('angle', angleAxisModel); + result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); + } + }, + + geo: function (seriesModel, result, axisMap, categoryAxisMap) { + result.coordSysDims = ['lng', 'lat']; + }, + + parallel: function (seriesModel, result, axisMap, categoryAxisMap) { + var ecModel = seriesModel.ecModel; + var parallelModel = ecModel.getComponent( + 'parallel', seriesModel.get('parallelIndex') + ); + var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); + + each$1(parallelModel.parallelAxisIndex, function (axisIndex, index) { + var axisModel = ecModel.getComponent('parallelAxis', axisIndex); + var axisDim = coordSysDims[index]; + axisMap.set(axisDim, axisModel); + + if (isCategory(axisModel) && result.firstCategoryDimIndex == null) { + categoryAxisMap.set(axisDim, axisModel); + result.firstCategoryDimIndex = index; + } + }); + } +}; + +function isCategory(axisModel) { + return axisModel.get('type') === 'category'; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + /** * Note that it is too complicated to support 3d stack by value * (have to create two-dimension inverted index), so in 3d case @@ -31306,6 +33404,7 @@ function getStackedDimension(data, targetDim) { * @param {module:echarts/model/Series} seriesModel * @param {Object} [opt] * @param {string} [opt.generateCoord] + * @param {boolean} [opt.useEncodeDefaulter] */ function createListFromArray(source, seriesModel, opt) { opt = opt || {}; @@ -31317,14 +33416,14 @@ function createListFromArray(source, seriesModel, opt) { var coordSysName = seriesModel.get('coordinateSystem'); var registeredCoordSys = CoordinateSystemManager.get(coordSysName); - var coordSysDefine = getCoordSysDefineBySeries(seriesModel); + var coordSysInfo = getCoordSysInfoBySeries(seriesModel); var coordSysDimDefs; - if (coordSysDefine) { - coordSysDimDefs = map(coordSysDefine.coordSysDims, function (dim) { + if (coordSysInfo) { + coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) { var dimInfo = {name: dim}; - var axisModel = coordSysDefine.axisMap.get(dim); + var axisModel = coordSysInfo.axisMap.get(dim); if (axisModel) { var axisType = axisModel.get('type'); dimInfo.type = getDimensionTypeByAxis(axisType); @@ -31345,14 +33444,17 @@ function createListFromArray(source, seriesModel, opt) { var dimInfoList = createDimensions(source, { coordDimensions: coordSysDimDefs, - generateCoord: opt.generateCoord + generateCoord: opt.generateCoord, + encodeDefaulter: opt.useEncodeDefaulter + ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) + : null }); var firstCategoryDimIndex; var hasNameEncode; - coordSysDefine && each$1(dimInfoList, function (dimInfo, dimIndex) { + coordSysInfo && each$1(dimInfoList, function (dimInfo, dimIndex) { var coordDim = dimInfo.coordDim; - var categoryAxisModel = coordSysDefine.categoryAxisMap.get(coordDim); + var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim); if (categoryAxisModel) { if (firstCategoryDimIndex == null) { firstCategoryDimIndex = dimIndex; @@ -31924,44 +34026,6 @@ function fixExtent(niceTickExtent, extent) { } } -function intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecision) { - var ticks = []; - - // If interval is 0, return []; - if (!interval) { - return ticks; - } - - // Consider this case: using dataZoom toolbox, zoom and zoom. - var safeLimit = 10000; - - if (extent[0] < niceTickExtent[0]) { - ticks.push(extent[0]); - } - var tick = niceTickExtent[0]; - - while (tick <= niceTickExtent[1]) { - ticks.push(tick); - // Avoid rounding error - tick = roundNumber$1(tick + interval, intervalPrecision); - if (tick === ticks[ticks.length - 1]) { - // Consider out of safe float point, e.g., - // -3711126.9907707 + 2e-10 === -3711126.9907707 - break; - } - if (ticks.length > safeLimit) { - return []; - } - } - // Consider this case: the last item of ticks is smaller - // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. - if (extent[1] > (ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1])) { - ticks.push(extent[1]); - } - - return ticks; -} - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -32040,12 +34104,92 @@ var IntervalScale = Scale.extend({ }, /** + * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent. * @return {Array.} */ - getTicks: function () { - return intervalScaleGetTicks( - this._interval, this._extent, this._niceExtent, this._intervalPrecision - ); + getTicks: function (expandToNicedExtent) { + var interval = this._interval; + var extent = this._extent; + var niceTickExtent = this._niceExtent; + var intervalPrecision = this._intervalPrecision; + + var ticks = []; + // If interval is 0, return []; + if (!interval) { + return ticks; + } + + // Consider this case: using dataZoom toolbox, zoom and zoom. + var safeLimit = 10000; + + if (extent[0] < niceTickExtent[0]) { + if (expandToNicedExtent) { + ticks.push(roundNumber(niceTickExtent[0] - interval, intervalPrecision)); + } + else { + ticks.push(extent[0]); + } + } + var tick = niceTickExtent[0]; + + while (tick <= niceTickExtent[1]) { + ticks.push(tick); + // Avoid rounding error + tick = roundNumber(tick + interval, intervalPrecision); + if (tick === ticks[ticks.length - 1]) { + // Consider out of safe float point, e.g., + // -3711126.9907707 + 2e-10 === -3711126.9907707 + break; + } + if (ticks.length > safeLimit) { + return []; + } + } + // Consider this case: the last item of ticks is smaller + // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. + var lastNiceTick = ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1]; + if (extent[1] > lastNiceTick) { + if (expandToNicedExtent) { + ticks.push(roundNumber(lastNiceTick + interval, intervalPrecision)); + } + else { + ticks.push(extent[1]); + } + } + + return ticks; + }, + + /** + * @param {number} [splitNumber=5] + * @return {Array.>} + */ + getMinorTicks: function (splitNumber) { + var ticks = this.getTicks(true); + var minorTicks = []; + var extent = this.getExtent(); + + for (var i = 1; i < ticks.length; i++) { + var nextTick = ticks[i]; + var prevTick = ticks[i - 1]; + var count = 0; + var minorTicksGroup = []; + var interval = nextTick - prevTick; + var minorInterval = interval / splitNumber; + + while (count < splitNumber - 1) { + var minorTick = round$1(prevTick + (count + 1) * minorInterval); + + // For the first and last interval. The count may be less than splitNumber. + if (minorTick > extent[0] && minorTick < extent[1]) { + minorTicksGroup.push(minorTick); + } + count++; + } + minorTicks.push(minorTicksGroup); + } + + return minorTicks; }, /** @@ -32187,6 +34331,8 @@ IntervalScale.create = function () { * under the License. */ +/* global Float32Array */ + var STACK_PREFIX = '__ec_stack_'; var LARGE_BAR_MIN_WIDTH = 0.5; @@ -32206,6 +34352,7 @@ function getAxisKey(axis) { * @param {number} opt.count Positive interger. * @param {number} [opt.barWidth] * @param {number} [opt.barMaxWidth] + * @param {number} [opt.barMinWidth] * @param {number} [opt.barGap] * @param {number} [opt.barCategoryGap] * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined. @@ -32250,16 +34397,101 @@ function prepareLayoutBarSeries(seriesType, ecModel) { return seriesModels; } + +/** + * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent + * values. + * This works for time axes, value axes, and log axes. + * For a single time axis, return value is in the form like + * {'x_0': [1000000]}. + * The value of 1000000 is in milliseconds. + */ +function getValueAxesMinGaps(barSeries) { + /** + * Map from axis.index to values. + * For a single time axis, axisValues is in the form like + * {'x_0': [1495555200000, 1495641600000, 1495728000000]}. + * Items in axisValues[x], e.g. 1495555200000, are time values of all + * series. + */ + var axisValues = {}; + each$1(barSeries, function (seriesModel) { + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + if (baseAxis.type !== 'time' && baseAxis.type !== 'value') { + return; + } + + var data = seriesModel.getData(); + var key = baseAxis.dim + '_' + baseAxis.index; + var dim = data.mapDimension(baseAxis.dim); + for (var i = 0, cnt = data.count(); i < cnt; ++i) { + var value = data.get(dim, i); + if (!axisValues[key]) { + // No previous data for the axis + axisValues[key] = [value]; + } + else { + // No value in previous series + axisValues[key].push(value); + } + // Ignore duplicated time values in the same axis + } + }); + + var axisMinGaps = []; + for (var key in axisValues) { + if (axisValues.hasOwnProperty(key)) { + var valuesInAxis = axisValues[key]; + if (valuesInAxis) { + // Sort axis values into ascending order to calculate gaps + valuesInAxis.sort(function (a, b) { + return a - b; + }); + + var min = null; + for (var j = 1; j < valuesInAxis.length; ++j) { + var delta = valuesInAxis[j] - valuesInAxis[j - 1]; + if (delta > 0) { + // Ignore 0 delta because they are of the same axis value + min = min === null ? delta : Math.min(min, delta); + } + } + // Set to null if only have one data + axisMinGaps[key] = min; + } + } + } + return axisMinGaps; +} + function makeColumnLayout(barSeries) { + var axisMinGaps = getValueAxesMinGaps(barSeries); + var seriesInfoList = []; each$1(barSeries, function (seriesModel) { - var data = seriesModel.getData(); var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var axisExtent = baseAxis.getExtent(); - var bandWidth = baseAxis.type === 'category' - ? baseAxis.getBandWidth() - : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); + + var bandWidth; + if (baseAxis.type === 'category') { + bandWidth = baseAxis.getBandWidth(); + } + else if (baseAxis.type === 'value' || baseAxis.type === 'time') { + var key = baseAxis.dim + '_' + baseAxis.index; + var minGap = axisMinGaps[key]; + var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]); + var scale = baseAxis.scale.getExtent(); + var scaleSpan = Math.abs(scale[1] - scale[0]); + bandWidth = minGap + ? extentSpan / scaleSpan * minGap + : extentSpan; // When there is only one data value + } + else { + var data = seriesModel.getData(); + bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); + } var barWidth = parsePercent$1( seriesModel.get('barWidth'), bandWidth @@ -32267,6 +34499,11 @@ function makeColumnLayout(barSeries) { var barMaxWidth = parsePercent$1( seriesModel.get('barMaxWidth'), bandWidth ); + var barMinWidth = parsePercent$1( + // barMinWidth by default is 1 in cartesian. Because in value axis, + // the auto-calculated bar width might be less than 1. + seriesModel.get('barMinWidth') || 1, bandWidth + ); var barGap = seriesModel.get('barGap'); var barCategoryGap = seriesModel.get('barCategoryGap'); @@ -32274,6 +34511,7 @@ function makeColumnLayout(barSeries) { bandWidth: bandWidth, barWidth: barWidth, barMaxWidth: barMaxWidth, + barMinWidth: barMinWidth, barGap: barGap, barCategoryGap: barCategoryGap, axisKey: getAxisKey(baseAxis), @@ -32317,7 +34555,6 @@ function doCalBarWidthAndOffset(seriesInfoList) { // only the attributes set on the last series will work. // Do not change this fact unless there will be a break change. - // TODO var barWidth = seriesInfo.barWidth; if (barWidth && !stacks[stackId].width) { // See #6312, do not restrict width. @@ -32328,6 +34565,8 @@ function doCalBarWidthAndOffset(seriesInfoList) { var barMaxWidth = seriesInfo.barMaxWidth; barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); + var barMinWidth = seriesInfo.barMinWidth; + barMinWidth && (stacks[stackId].minWidth = barMinWidth); var barGap = seriesInfo.barGap; (barGap != null) && (columnsOnAxis.gap = barGap); var barCategoryGap = seriesInfo.barCategoryGap; @@ -32352,15 +34591,43 @@ function doCalBarWidthAndOffset(seriesInfoList) { autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth - each$1(stacks, function (column, stack) { + each$1(stacks, function (column) { var maxWidth = column.maxWidth; - if (maxWidth && maxWidth < autoWidth) { - maxWidth = Math.min(maxWidth, remainedWidth); - if (column.width) { - maxWidth = Math.min(maxWidth, column.width); + var minWidth = column.minWidth; + + if (!column.width) { + var finalWidth = autoWidth; + if (maxWidth && maxWidth < finalWidth) { + finalWidth = Math.min(maxWidth, remainedWidth); } - remainedWidth -= maxWidth; - column.width = maxWidth; + // `minWidth` has higher priority. `minWidth` decide that wheter the + // bar is able to be visible. So `minWidth` should not be restricted + // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In + // the extreme cases for `value` axis, bars are allowed to overlap + // with each other if `minWidth` specified. + if (minWidth && minWidth > finalWidth) { + finalWidth = minWidth; + } + if (finalWidth !== autoWidth) { + column.width = finalWidth; + remainedWidth -= finalWidth + barGapPercent * finalWidth; + autoWidthCount--; + } + } + else { + // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as + // CSS does. Becuase barWidth can be a percent value, where + // `barMaxWidth` can be used to restrict the final width. + var finalWidth = column.width; + if (maxWidth) { + finalWidth = Math.min(finalWidth, maxWidth); + } + // `minWidth` has higher priority, as described above + if (minWidth) { + finalWidth = Math.max(finalWidth, minWidth); + } + column.width = finalWidth; + remainedWidth -= finalWidth + barGapPercent * finalWidth; autoWidthCount--; } }); @@ -32368,8 +34635,10 @@ function doCalBarWidthAndOffset(seriesInfoList) { // Recalculate width again autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + var widthSum = 0; var lastColumn; each$1(stacks, function (column, idx) { @@ -32386,6 +34655,7 @@ function doCalBarWidthAndOffset(seriesInfoList) { var offset = -widthSum / 2; each$1(stacks, function (column, stackId) { result[coordSysName][stackId] = result[coordSysName][stackId] || { + bandWidth: bandWidth, offset: offset, width: column.width }; @@ -32439,6 +34709,7 @@ function layout(seriesType, ecModel) { lastStackCoords[stackId] = lastStackCoords[stackId] || []; data.setLayout({ + bandWidth: columnLayoutInfo.bandWidth, offset: columnOffset, size: columnWidth }); @@ -32454,10 +34725,6 @@ function layout(seriesType, ecModel) { var value = data.get(valueDim, idx); var baseValue = data.get(baseDim, idx); - if (isNaN(value)) { - continue; - } - var sign = value >= 0 ? 'p' : 'n'; var baseCoord = valueAxisStart; @@ -32490,7 +34757,10 @@ function layout(seriesType, ecModel) { if (Math.abs(width) < barMinHeight) { width = (width < 0 ? -1 : 1) * barMinHeight; } - stacked && (lastStackCoords[stackId][baseValue][sign] += width); + // Ignore stack from NaN value + if (!isNaN(width)) { + stacked && (lastStackCoords[stackId][baseValue][sign] += width); + } } else { var coord = cartesian.dataToPoint([baseValue, value]); @@ -32503,7 +34773,10 @@ function layout(seriesType, ecModel) { // Include zero to has a positive bar height = (height <= 0 ? -1 : 1) * barMinHeight; } - stacked && (lastStackCoords[stackId][baseValue][sign] += height); + // Ignore stack from NaN value + if (!isNaN(height)) { + stacked && (lastStackCoords[stackId][baseValue][sign] += height); + } } data.setItemLayout(idx, { @@ -32531,6 +34804,7 @@ var largeLayout = { var data = seriesModel.getData(); var cartesian = seriesModel.coordinateSystem; + var coordLayout = cartesian.grid.getRect(); var baseAxis = cartesian.getBaseAxis(); var valueAxis = cartesian.getOtherAxis(baseAxis); var valueDim = data.mapDimension(valueAxis.dim); @@ -32548,25 +34822,38 @@ var largeLayout = { return {progress: progress}; function progress(params, data) { - var largePoints = new LargeArr(params.count * 2); + var count = params.count; + var largePoints = new LargeArr(count * 2); + var largeBackgroundPoints = new LargeArr(count * 2); + var largeDataIndices = new LargeArr(count); var dataIndex; var coord = []; var valuePair = []; - var offset = 0; + var pointsOffset = 0; + var idxOffset = 0; while ((dataIndex = params.next()) != null) { valuePair[valueDimIdx] = data.get(valueDim, dataIndex); valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex); coord = cartesian.dataToPoint(valuePair, null, coord); - largePoints[offset++] = coord[0]; - largePoints[offset++] = coord[1]; + // Data index might not be in order, depends on `progressiveChunkMode`. + largeBackgroundPoints[pointsOffset] = valueAxisHorizontal + ? coordLayout.x + coordLayout.width : coord[0]; + largePoints[pointsOffset++] = coord[0]; + largeBackgroundPoints[pointsOffset] = valueAxisHorizontal + ? coord[1] : coordLayout.y + coordLayout.height; + largePoints[pointsOffset++] = coord[1]; + largeDataIndices[idxOffset++] = dataIndex; } data.setLayout({ largePoints: largePoints, + largeDataIndices: largeDataIndices, + largeBackgroundPoints: largeBackgroundPoints, barWidth: barWidth, valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false), + backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y, valueAxisHorizontal: valueAxisHorizontal }); } @@ -32581,13 +34868,9 @@ function isInLargeMode(seriesModel) { return seriesModel.pipelineContext && seriesModel.pipelineContext.large; } +// See cases in `test/bar-start.html` and `#7412`, `#8747`. function getValueAxisStart(baseAxis, valueAxis, stacked) { - return ( - indexOf(baseAxis.getAxesOnZeroOf(), valueAxis) >= 0 - || stacked - ) - ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)) - : valueAxis.getGlobalExtent()[0]; + return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0)); } /* @@ -32610,11 +34893,16 @@ function getValueAxisStart(baseAxis, valueAxis, stacked) { */ /* -* The `scaleLevels` references to d3.js. The use of the source -* code of this file is also subject to the terms and consitions -* of its license (BSD-3Clause, see ). +* A third-party license is embeded for some of the code in this file: +* The "scaleLevels" was originally copied from "d3.js" with some +* modifications made for this project. +* (See more details in the comment on the definition of "scaleLevels" below.) +* The use of the source code of this file is also subject to the terms +* and consitions of the license of "d3.js" (BSD-3Clause, see +* ). */ + // [About UTC and local time zone]: // In most cases, `number.parseDate` will treat input data string as local time // (except time zone is specified in time string). And `format.formateTime` returns @@ -32642,7 +34930,7 @@ var bisect = function (a, x, lo, hi) { lo = mid + 1; } else { - hi = mid; + hi = mid; } } return lo; @@ -32757,7 +35045,12 @@ each$1(['contain', 'normalize'], function (methodName) { }; }); -// Steps from d3, see the license statement at the top of this file. +/** + * This implementation was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + */ var scaleLevels = [ // Format interval ['hh:mm:ss', ONE_SECOND], // 1s @@ -32854,14 +35147,15 @@ var LogScale = Scale.extend({ }, /** + * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent. * @return {Array.} */ - getTicks: function () { + getTicks: function (expandToNicedExtent) { var originalScale = this._originalScale; var extent = this._extent; var originalExtent = originalScale.getExtent(); - return map(intervalScaleProto$1.getTicks.call(this), function (val) { + return map(intervalScaleProto$1.getTicks.call(this, expandToNicedExtent), function (val) { var powVal = round$1(mathPow$1(this.base, val)); // Fix #4158 @@ -32876,6 +35170,12 @@ var LogScale = Scale.extend({ }, this); }, + /** + * @param {number} splitNumber + * @return {Array.>} + */ + getMinorTicks: intervalScaleProto$1.getMinorTicks, + /** * @param {number} val * @return {string} @@ -33032,8 +35332,6 @@ function getScaleExtent(scale, model) { var min = model.getMin(); var max = model.getMax(); - var fixMin = min != null; - var fixMax = max != null; var originalExtent = scale.getExtent(); var axisDataLen; @@ -33077,17 +35375,6 @@ function getScaleExtent(scale, model) { // (2) When `needCrossZero` and all data is positive/negative, should it be ensured // that the results processed by boundaryGap are positive/negative? - if (min == null) { - min = scaleType === 'ordinal' - ? (axisDataLen ? 0 : NaN) - : originalExtent[0] - boundaryGap[0] * span; - } - if (max == null) { - max = scaleType === 'ordinal' - ? (axisDataLen ? axisDataLen - 1 : NaN) - : originalExtent[1] + boundaryGap[1] * span; - } - if (min === 'dataMin') { min = originalExtent[0]; } @@ -33108,6 +35395,20 @@ function getScaleExtent(scale, model) { }); } + var fixMin = min != null; + var fixMax = max != null; + + if (min == null) { + min = scaleType === 'ordinal' + ? (axisDataLen ? 0 : NaN) + : originalExtent[0] - boundaryGap[0] * span; + } + if (max == null) { + max = scaleType === 'ordinal' + ? (axisDataLen ? axisDataLen - 1 : NaN) + : originalExtent[1] + boundaryGap[1] * span; + } + (min == null || !isFinite(min)) && (min = NaN); (max == null || !isFinite(max)) && (max = NaN); @@ -33158,7 +35459,13 @@ function getScaleExtent(scale, model) { } } - return [min, max]; + return { + extent: [min, max], + // "fix" means "fixed", the value should not be + // changed in the subsequent steps. + fixMin: fixMin, + fixMax: fixMax + }; } function adjustScaleForOverflow(min, max, model, barWidthAndOffset) { @@ -33197,9 +35504,9 @@ function adjustScaleForOverflow(min, max, model, barWidthAndOffset) { } function niceScaleExtent(scale, model) { - var extent = getScaleExtent(scale, model); - var fixMin = model.getMin() != null; - var fixMax = model.getMax() != null; + var extentInfo = getScaleExtent(scale, model); + var extent = extentInfo.extent; + var splitNumber = model.get('splitNumber'); if (scale.type === 'log') { @@ -33210,8 +35517,8 @@ function niceScaleExtent(scale, model) { scale.setExtent(extent[0], extent[1]); scale.niceExtent({ splitNumber: splitNumber, - fixMin: fixMin, - fixMax: fixMax, + fixMin: extentInfo.fixMin, + fixMax: extentInfo.fixMax, minInterval: (scaleType === 'interval' || scaleType === 'time') ? model.get('minInterval') : null, maxInterval: (scaleType === 'interval' || scaleType === 'time') @@ -33377,6 +35684,26 @@ function rotateTextRect(textRect, rotate) { return rotatedRect; } +/** + * @param {module:echarts/src/model/Model} model axisLabelModel or axisTickModel + * @return {number|String} Can be null|'auto'|number|function + */ +function getOptionCategoryInterval(model) { + var interval = model.get('interval'); + return interval == null ? 'auto' : interval; +} + +/** + * Set `categoryInterval` as 0 implicitly indicates that + * show all labels reguardless of overlap. + * @param {Object} axis axisModel.axis + * @return {boolean} + */ +function shouldShowAllLabels(axis) { + return axis.type === 'category' + && getOptionCategoryInterval(axis.getLabelModel()) === 0; +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -33396,6 +35723,8 @@ function rotateTextRect(textRect, rotate) { * under the License. */ +// import * as axisHelper from './axisHelper'; + var axisModelCommonMixin = { /** @@ -33738,21 +36067,19 @@ var SymbolClz = extendShape({ height: 0 }, - beforeBrush: function () { - var style = this.style; + calculateTextPosition: function (out, style, rect) { + var res = calculateTextPosition(out, style, rect); var shape = this.shape; - // FIXME - if (shape.symbolType === 'pin' && style.textPosition === 'inside') { - style.textPosition = ['50%', '40%']; - style.textAlign = 'center'; - style.textVerticalAlign = 'middle'; + if (shape && shape.symbolType === 'pin' && style.textPosition === 'inside') { + res.y = rect.y + rect.height * 0.4; } + return res; }, buildPath: function (ctx, shape, inBundle) { var symbolType = shape.symbolType; - var proxySymbol = symbolBuildProxies[symbolType]; - if (shape.symbolType !== 'none') { + if (symbolType !== 'none') { + var proxySymbol = symbolBuildProxies[symbolType]; if (!proxySymbol) { // Default rect symbolType = 'rect'; @@ -34090,7 +36417,7 @@ Region.prototype = { width = aspect * height; } else if (!height) { - height = width / aspect ; + height = width / aspect; } var target = new BoundingRect(x, y, width, height); var transform = rect.calculateTransform(target); @@ -34224,9 +36551,10 @@ function decodePolygon(coordinate, encodeOffsets, encodeScale) { /** * @alias module:echarts/coord/geo/parseGeoJson * @param {Object} geoJson + * @param {string} nameProperty * @return {module:zrender/container/Group} */ -var parseGeoJson$1 = function (geoJson) { +var parseGeoJson$1 = function (geoJson, nameProperty) { decode(geoJson); @@ -34264,7 +36592,7 @@ var parseGeoJson$1 = function (geoJson) { } var region = new Region( - properties.name, + properties[nameProperty || 'name'], geometries, properties.cp ); @@ -34487,7 +36815,6 @@ function calculateCategoryInterval(axis) { var width = 0; var height = 0; - // Polar is also calculated in assumptive linear layout here. // Not precise, do not consider align and vertical align // and each distance from axis line yet. var rect = getBoundingRect( @@ -34510,12 +36837,16 @@ function calculateCategoryInterval(axis) { var interval = Math.max(0, Math.floor(Math.min(dw, dh))); var cache = inner$6(axis.model); + var axisExtent = axis.getExtent(); var lastAutoInterval = cache.lastAutoInterval; var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, // otherwise the calculated interval might jitter when the zoom // window size is close to the interval-changing size. + // For example, if all of the axis labels are `a, b, c, d, e, f, g`. + // The jitter will cause that sometimes the displayed labels are + // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1). if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 @@ -34523,6 +36854,10 @@ function calculateCategoryInterval(axis) { // Always choose the bigger one, otherwise the critical // point is not the same when zooming in or zooming out. && lastAutoInterval > interval + // If the axis change is caused by chart resize, the cache should not + // be used. Otherwise some hiden labels might not be shown again. + && cache.axisExtend0 === axisExtent[0] + && cache.axisExtend1 === axisExtent[1] ) { interval = lastAutoInterval; } @@ -34531,6 +36866,8 @@ function calculateCategoryInterval(axis) { else { cache.lastTickCount = tickCount; cache.lastAutoInterval = interval; + cache.axisExtend0 = axisExtent[0]; + cache.axisExtend1 = axisExtent[1]; } return interval; @@ -34575,12 +36912,11 @@ function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { // suitable for splitLine and splitArea rendering. // (2) Scales except category always contain min max label so // do not need to perform this process. - var showMinMax = { - min: labelModel.get('showMinLabel'), - max: labelModel.get('showMaxLabel') - }; + var showAllLabel = shouldShowAllLabels(axis); + var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel; + var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel; - if (showMinMax.min && startTick !== ordinalExtent[0]) { + if (includeMinLabel && startTick !== ordinalExtent[0]) { addItem(ordinalExtent[0]); } @@ -34590,7 +36926,7 @@ function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { addItem(tickValue); } - if (showMinMax.max && tickValue !== ordinalExtent[1]) { + if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) { addItem(ordinalExtent[1]); } @@ -34632,12 +36968,6 @@ function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick return result; } -// Can be null|'auto'|number|function -function getOptionCategoryInterval(model) { - var interval = model.get('interval'); - return interval == null ? 'auto' : interval; -} - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -34717,7 +37047,7 @@ Axis.prototype = { * @return {boolean} */ containData: function (data) { - return this.contain(this.dataToCoord(data)); + return this.scale.contain(data); }, /** @@ -34805,7 +37135,7 @@ Axis.prototype = { * `axis.getTicksCoords` considers `onBand`, which is used by * `boundaryGap:true` of category axis and splitLine and splitArea. * @param {Object} [opt] - * @param {number} [opt.tickModel=axis.model.getModel('axisTick')] + * @param {Model} [opt.tickModel=axis.model.getModel('axisTick')] * @param {boolean} [opt.clamp] If `true`, the first and the last * tick must be at the axis end points. Otherwise, clip ticks * that outside the axis extent. @@ -34818,7 +37148,6 @@ Axis.prototype = { opt = opt || {}; var tickModel = opt.tickModel || this.getTickModel(); - var result = createAxisTicks(this, tickModel); var ticks = result.ticks; @@ -34830,13 +37159,41 @@ Axis.prototype = { }, this); var alignWithLabel = tickModel.get('alignWithLabel'); + fixOnBandTicksCoords( - this, ticksCoords, result.tickCategoryInterval, alignWithLabel, opt.clamp + this, ticksCoords, alignWithLabel, opt.clamp ); return ticksCoords; }, + /** + * @return {Array.>} [{ coord: ..., tickValue: ...}] + */ + getMinorTicksCoords: function () { + if (this.scale.type === 'ordinal') { + // Category axis doesn't support minor ticks + return []; + } + + var minorTickModel = this.model.getModel('minorTick'); + var splitNumber = minorTickModel.get('splitNumber'); + // Protection. + if (!(splitNumber > 0 && splitNumber < 100)) { + splitNumber = 5; + } + var minorTicks = this.scale.getMinorTicks(splitNumber); + var minorTicksCoords = map(minorTicks, function (minorTicksGroup) { + return map(minorTicksGroup, function (minorTick) { + return { + coord: this.dataToCoord(minorTick), + tickValue: minorTick + }; + }, this); + }, this); + return minorTicksCoords; + }, + /** * @return {Array.} [{ * formattedLabel: string, @@ -34924,7 +37281,7 @@ function fixExtentWithBands(extent, nTick) { // splitLine/spliteArea should layout appropriately corresponding // to displayed labels. (So we should not use `getBandWidth` in this // case). -function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) { +function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) { var ticksLen = ticksCoords.length; if (!axis.onBand || alignWithLabel || !ticksLen) { @@ -34933,26 +37290,30 @@ function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWith var axisExtent = axis.getExtent(); var last; + var diffSize; if (ticksLen === 1) { ticksCoords[0].coord = axisExtent[0]; last = ticksCoords[1] = {coord: axisExtent[0]}; } else { - var shift = (ticksCoords[1].coord - ticksCoords[0].coord); + var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; + var shift = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; + each$1(ticksCoords, function (ticksItem) { ticksItem.coord -= shift / 2; - var tickCategoryInterval = tickCategoryInterval || 0; - // Avoid split a single data item when odd interval. - if (tickCategoryInterval % 2 > 0) { - ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2); - } }); - last = {coord: ticksCoords[ticksLen - 1].coord + shift}; + + var dataExtent = axis.scale.getExtent(); + diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue; + + last = {coord: ticksCoords[ticksLen - 1].coord + shift * diffSize}; + ticksCoords.push(last); } var inverse = axisExtent[0] > axisExtent[1]; + // Handling clamp. if (littleThan(ticksCoords[0].coord, axisExtent[0])) { clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift(); } @@ -34967,6 +37328,10 @@ function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWith } function littleThan(a, b) { + // Avoid rounding error cause calculated tick coord different with extent. + // It may cause an extra unecessary tick added. + a = round$1(a); + b = round$1(b); return inverse ? a > b : a < b; } } @@ -35015,6 +37380,7 @@ each$1( 'setHoverStyle', 'setLabelStyle', 'setTextStyle', 'setText', 'getFont', 'updateProps', 'initProps', 'getTransform', 'clipPointsByRect', 'clipRectByRect', + 'registerShape', 'getShapeClass', 'Group', 'Image', 'Text', @@ -35070,7 +37436,7 @@ SeriesModel.extend({ throw new Error('Line not support coordinateSystem besides cartesian and polar'); } } - return createListFromArray(this.getSource(), this); + return createListFromArray(this.getSource(), this, {useEncodeDefaulter: true}); }, defaultOption: { @@ -35087,7 +37453,7 @@ SeriesModel.extend({ // polarIndex: 0, // If clip the overflow value - clipOverflow: true, + clip: true, // cursor: null, label: { @@ -35330,7 +37696,7 @@ symbolProto.setZ = function (zlevel, z) { symbolProto.setDraggable = function (draggable) { var symbolPath = this.childAt(0); symbolPath.draggable = draggable; - symbolPath.cursor = draggable ? 'move' : 'pointer'; + symbolPath.cursor = draggable ? 'move' : symbolPath.cursor; }; /** @@ -35411,10 +37777,18 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { strokeNoScale: true }); } + else { + symbolPath.setStyle({ + opacity: null, + shadowBlur: null, + shadowOffsetX: null, + shadowOffsetY: null, + shadowColor: null + }); + } var itemStyle = seriesScope && seriesScope.itemStyle; var hoverItemStyle = seriesScope && seriesScope.hoverItemStyle; - var symbolRotate = seriesScope && seriesScope.symbolRotate; var symbolOffset = seriesScope && seriesScope.symbolOffset; var labelModel = seriesScope && seriesScope.labelModel; var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel; @@ -35430,7 +37804,6 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { itemStyle = itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']); hoverItemStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle(); - symbolRotate = itemModel.getShallow('symbolRotate'); symbolOffset = itemModel.getShallow('symbolOffset'); labelModel = itemModel.getModel(normalLabelAccessPath); @@ -35444,6 +37817,8 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { var elStyle = symbolPath.style; + var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); + symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); if (symbolOffset) { @@ -35496,53 +37871,44 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); } - symbolPath.off('mouseover') - .off('mouseout') - .off('emphasis') - .off('normal'); - + symbolPath.__symbolOriginalScale = getScale(symbolSize); symbolPath.hoverStyle = hoverItemStyle; + symbolPath.highDownOnUpdate = ( + hoverAnimation && seriesModel.isAnimationEnabled() + ) ? highDownOnUpdate : null; - // FIXME - // Do not use symbol.trigger('emphasis'), but use symbol.highlight() instead. setHoverStyle(symbolPath); - - symbolPath.__symbolOriginalScale = getScale(symbolSize); - - if (hoverAnimation && seriesModel.isAnimationEnabled()) { - symbolPath.on('mouseover', onEmphasis) - .on('mouseout', onNormal) - .on('emphasis', onEmphasis) - .on('normal', onNormal); - } }; -function onEmphasis() { +function highDownOnUpdate(fromState, toState) { // Do not support this hover animation util some scenario required. // Animation can only be supported in hover layer when using `el.incremetal`. - if (this.incremental || this.useHoverLayer || isInEmphasis(this)) { + if (this.incremental || this.useHoverLayer) { return; } - var scale = this.__symbolOriginalScale; - var ratio = scale[1] / scale[0]; - this.animateTo({ - scale: [ - Math.max(scale[0] * 1.1, scale[0] + 3), - Math.max(scale[1] * 1.1, scale[1] + 3 * ratio) - ] - }, 400, 'elasticOut'); -} -function onNormal() { - if (this.incremental || this.useHoverLayer || isInEmphasis(this)) { - return; + if (toState === 'emphasis') { + var scale = this.__symbolOriginalScale; + var ratio = scale[1] / scale[0]; + var emphasisOpt = { + scale: [ + Math.max(scale[0] * 1.1, scale[0] + 3), + Math.max(scale[1] * 1.1, scale[1] + 3 * ratio) + ] + }; + // FIXME + // modify it after support stop specified animation. + // toState === fromState + // ? (this.stopAnimation(), this.attr(emphasisOpt)) + this.animateTo(emphasisOpt, 400, 'elasticOut'); + } + else if (toState === 'normal') { + this.animateTo({ + scale: this.__symbolOriginalScale + }, 400, 'elasticOut'); } - this.animateTo({ - scale: this.__symbolOriginalScale - }, 400, 'elasticOut'); } - /** * @param {Function} cb * @param {Object} [opt] @@ -36335,10 +38701,18 @@ function getBoundingBox(points, smoothConstraint) { if (smoothConstraint) { for (var i = 0; i < points.length; i++) { var pt = points[i]; - if (pt[0] < ptMin[0]) { ptMin[0] = pt[0]; } - if (pt[1] < ptMin[1]) { ptMin[1] = pt[1]; } - if (pt[0] > ptMax[0]) { ptMax[0] = pt[0]; } - if (pt[1] > ptMax[1]) { ptMax[1] = pt[1]; } + if (pt[0] < ptMin[0]) { + ptMin[0] = pt[0]; + } + if (pt[1] < ptMin[1]) { + ptMin[1] = pt[1]; + } + if (pt[0] > ptMax[0]) { + ptMax[0] = pt[0]; + } + if (pt[1] > ptMax[1]) { + ptMax[1] = pt[1]; + } } } return { @@ -36484,89 +38858,25 @@ var Polygon$1 = Path.extend({ * specific language governing permissions and limitations * under the License. */ - -// FIXME step not support polar - -function isPointsSame(points1, points2) { - if (points1.length !== points2.length) { - return; - } - for (var i = 0; i < points1.length; i++) { - var p1 = points1[i]; - var p2 = points2[i]; - if (p1[0] !== p2[0] || p1[1] !== p2[1]) { - return; - } - } - return true; -} - -function getSmooth(smooth) { - return typeof (smooth) === 'number' ? smooth : (smooth ? 0.5 : 0); -} - -function getAxisExtentWithGap(axis) { - var extent = axis.getGlobalExtent(); - if (axis.onBand) { - // Remove extra 1px to avoid line miter in clipped edge - var halfBandWidth = axis.getBandWidth() / 2 - 1; - var dir = extent[1] > extent[0] ? 1 : -1; - extent[0] += dir * halfBandWidth; - extent[1] -= dir * halfBandWidth; - } - return extent; -} - -/** - * @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys - * @param {module:echarts/data/List} data - * @param {Object} dataCoordInfo - * @param {Array.>} points - */ -function getStackedOnPoints(coordSys, data, dataCoordInfo) { - if (!dataCoordInfo.valueDim) { - return []; - } - - var points = []; - for (var idx = 0, len = data.count(); idx < len; idx++) { - points.push(getStackedOnPoint(dataCoordInfo, coordSys, data, idx)); - } - - return points; -} - -function createGridClipShape(cartesian, hasAnimation, forSymbol, seriesModel) { - var xExtent = getAxisExtentWithGap(cartesian.getAxis('x')); - var yExtent = getAxisExtentWithGap(cartesian.getAxis('y')); +function createGridClipPath(cartesian, hasAnimation, seriesModel) { + var rect = cartesian.getArea(); var isHorizontal = cartesian.getBaseAxis().isHorizontal(); - var x = Math.min(xExtent[0], xExtent[1]); - var y = Math.min(yExtent[0], yExtent[1]); - var width = Math.max(xExtent[0], xExtent[1]) - x; - var height = Math.max(yExtent[0], yExtent[1]) - y; + var x = rect.x; + var y = rect.y; + var width = rect.width; + var height = rect.height; - // Avoid float number rounding error for symbol on the edge of axis extent. - // See #7913 and `test/dataZoom-clip.html`. - if (forSymbol) { - x -= 0.5; - width += 0.5; - y -= 0.5; - height += 0.5; - } - else { - var lineWidth = seriesModel.get('lineStyle.width') || 2; - // Expand clip shape to avoid clipping when line value exceeds axis - var expandSize = seriesModel.get('clipOverflow') ? lineWidth / 2 : Math.max(width, height); - if (isHorizontal) { - y -= expandSize; - height += expandSize * 2; - } - else { - x -= expandSize; - width += expandSize * 2; - } - } + var lineWidth = seriesModel.get('lineStyle.width') || 2; + // Expand the clip path a bit to avoid the border is clipped and looks thinner + x -= lineWidth / 2; + y -= lineWidth / 2; + width += lineWidth; + height += lineWidth; + + // fix: https://github.com/apache/incubator-echarts/issues/11369 + x = Math.floor(x); + width = Math.round(width); var clipPath = new Rect({ shape: { @@ -36590,50 +38900,122 @@ function createGridClipShape(cartesian, hasAnimation, forSymbol, seriesModel) { return clipPath; } -function createPolarClipShape(polar, hasAnimation, forSymbol, seriesModel) { - var angleAxis = polar.getAngleAxis(); - var radiusAxis = polar.getRadiusAxis(); - - var radiusExtent = radiusAxis.getExtent().slice(); - radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); - var angleExtent = angleAxis.getExtent(); - - var RADIAN = Math.PI / 180; - +function createPolarClipPath(polar, hasAnimation, seriesModel) { + var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent. - if (forSymbol) { - radiusExtent[0] -= 0.5; - radiusExtent[1] += 0.5; - } var clipPath = new Sector({ shape: { cx: round$1(polar.cx, 1), cy: round$1(polar.cy, 1), - r0: round$1(radiusExtent[0], 1), - r: round$1(radiusExtent[1], 1), - startAngle: -angleExtent[0] * RADIAN, - endAngle: -angleExtent[1] * RADIAN, - clockwise: angleAxis.inverse + r0: round$1(sectorArea.r0, 1), + r: round$1(sectorArea.r, 1), + startAngle: sectorArea.startAngle, + endAngle: sectorArea.endAngle, + clockwise: sectorArea.clockwise } }); if (hasAnimation) { - clipPath.shape.endAngle = -angleExtent[0] * RADIAN; + clipPath.shape.endAngle = sectorArea.startAngle; initProps(clipPath, { shape: { - endAngle: -angleExtent[1] * RADIAN + endAngle: sectorArea.endAngle } }, seriesModel); } - return clipPath; } -function createClipShape(coordSys, hasAnimation, forSymbol, seriesModel) { - return coordSys.type === 'polar' - ? createPolarClipShape(coordSys, hasAnimation, forSymbol, seriesModel) - : createGridClipShape(coordSys, hasAnimation, forSymbol, seriesModel); +function createClipPath(coordSys, hasAnimation, seriesModel) { + if (!coordSys) { + return null; + } + else if (coordSys.type === 'polar') { + return createPolarClipPath(coordSys, hasAnimation, seriesModel); + } + else if (coordSys.type === 'cartesian2d') { + return createGridClipPath(coordSys, hasAnimation, seriesModel); + } + return null; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +// FIXME step not support polar + +function isPointsSame(points1, points2) { + if (points1.length !== points2.length) { + return; + } + for (var i = 0; i < points1.length; i++) { + var p1 = points1[i]; + var p2 = points2[i]; + if (p1[0] !== p2[0] || p1[1] !== p2[1]) { + return; + } + } + return true; +} + +function getBoundingDiff(points1, points2) { + var min1 = []; + var max1 = []; + + var min2 = []; + var max2 = []; + + fromPoints(points1, min1, max1); + fromPoints(points2, min2, max2); + + // Get a max value from each corner of two boundings. + return Math.max( + Math.abs(min1[0] - min2[0]), + Math.abs(min1[1] - min2[1]), + + Math.abs(max1[0] - max2[0]), + Math.abs(max1[1] - max2[1]) + ); +} + +function getSmooth(smooth) { + return typeof (smooth) === 'number' ? smooth : (smooth ? 0.5 : 0); +} + +/** + * @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys + * @param {module:echarts/data/List} data + * @param {Object} dataCoordInfo + * @param {Array.>} points + */ +function getStackedOnPoints(coordSys, data, dataCoordInfo) { + if (!dataCoordInfo.valueDim) { + return []; + } + + var points = []; + for (var idx = 0, len = data.count(); idx < len; idx++) { + points.push(getStackedOnPoint(dataCoordInfo, coordSys, data, idx)); + } + + return points; } function turnPointsIntoStep(points, coordSys, stepTurnAt) { @@ -36832,6 +39214,31 @@ function canShowAllSymbolForCategory(categoryAxis, data) { return true; } +function createLineClipPath(coordSys, hasAnimation, seriesModel) { + if (coordSys.type === 'cartesian2d') { + var isHorizontal = coordSys.getBaseAxis().isHorizontal(); + var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel); + // Expand clip shape to avoid clipping when line value exceeds axis + if (!seriesModel.get('clip', true)) { + var rectShape = clipPath.shape; + var expandSize = Math.max(rectShape.width, rectShape.height); + if (isHorizontal) { + rectShape.y -= expandSize; + rectShape.height += expandSize * 2; + } + else { + rectShape.x -= expandSize; + rectShape.width += expandSize * 2; + } + } + return clipPath; + } + else { + return createPolarClipPath(coordSys, hasAnimation, seriesModel); + } + +} + Chart.extend({ type: 'line', @@ -36896,13 +39303,30 @@ Chart.extend({ // FIXME step not support polar var step = !isCoordSysPolar && seriesModel.get('step'); + var clipShapeForSymbol; + if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) { + clipShapeForSymbol = coordSys.getArea(); + // Avoid float number rounding error for symbol on the edge of axis extent. + // See #7913 and `test/dataZoom-clip.html`. + if (clipShapeForSymbol.width != null) { + clipShapeForSymbol.x -= 0.1; + clipShapeForSymbol.y -= 0.1; + clipShapeForSymbol.width += 0.2; + clipShapeForSymbol.height += 0.2; + } + else if (clipShapeForSymbol.r0) { + clipShapeForSymbol.r0 -= 0.5; + clipShapeForSymbol.r1 += 0.5; + } + } + this._clipShapeForSymbol = clipShapeForSymbol; // Initialization animation or coordinate system changed if ( !(polyline && prevCoordSys.type === coordSys.type && step === this._step) ) { showSymbol && symbolDraw.updateData(data, { isIgnore: isIgnoreFunc, - clipShape: createClipShape(coordSys, false, true, seriesModel) + clipShape: clipShapeForSymbol }); if (step) { @@ -36918,7 +39342,7 @@ Chart.extend({ coordSys, hasAnimation ); } - lineGroup.setClipPath(createClipShape(coordSys, true, false, seriesModel)); + lineGroup.setClipPath(createLineClipPath(coordSys, true, seriesModel)); } else { if (isAreaChart && !polygon) { @@ -36935,13 +39359,13 @@ Chart.extend({ } // Update clipPath - lineGroup.setClipPath(createClipShape(coordSys, false, false, seriesModel)); + lineGroup.setClipPath(createLineClipPath(coordSys, false, seriesModel)); // Always update, or it is wrong in the case turning on legend // because points are not changed showSymbol && symbolDraw.updateData(data, { isIgnore: isIgnoreFunc, - clipShape: createClipShape(coordSys, false, true, seriesModel) + clipShape: clipShapeForSymbol }); // Stop symbol animation and sync with line points @@ -37048,6 +39472,10 @@ Chart.extend({ // Null data return; } + // fix #11360: should't draw symbol outside clipShapeForSymbol + if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(pt[0], pt[1])) { + return; + } symbol = new SymbolClz$1(data, dataIndex); symbol.position = pt; symbol.setZ( @@ -37179,6 +39607,24 @@ Chart.extend({ next = turnPointsIntoStep(diff.next, coordSys, step); stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step); } + // Don't apply animation if diff is large. + // For better result and avoid memory explosion problems like + // https://github.com/apache/incubator-echarts/issues/12229 + if (getBoundingDiff(current, next) > 3000 + || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) + ) { + polyline.setShape({ + points: next + }); + if (polygon) { + polygon.setShape({ + points: next, + stackedOnPoints: stackedOnNext + }); + } + return; + } + // `diff.current` is subset of `current` (which should be ensured by // turnPointsIntoStep), so points in `__points` can be updated when // points in `current` are update during animation. @@ -37244,11 +39690,11 @@ Chart.extend({ }); this._polyline = - this._polygon = - this._coordSys = - this._points = - this._stackedOnPoints = - this._data = null; + this._polygon = + this._coordSys = + this._points = + this._stackedOnPoints = + this._data = null; } }); @@ -37271,7 +39717,6 @@ Chart.extend({ * under the License. */ - var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { // Encoding visual for all series include which is filtered for legend drawing return { @@ -37283,15 +39728,27 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { reset: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); - var symbolType = seriesModel.get('symbol') || defaultSymbolType; + var symbolType = seriesModel.get('symbol'); var symbolSize = seriesModel.get('symbolSize'); var keepAspect = seriesModel.get('symbolKeepAspect'); - + var symbolRotate = seriesModel.get('symbolRotate'); + + var hasSymbolTypeCallback = isFunction$1(symbolType); + var hasSymbolSizeCallback = isFunction$1(symbolSize); + var hasSymbolRotateCallback = isFunction$1(symbolRotate); + var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback; + var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : defaultSymbolType; + var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null; data.setVisual({ - legendSymbol: legendSymbol || symbolType, - symbol: symbolType, - symbolSize: symbolSize, - symbolKeepAspect: keepAspect + legendSymbol: legendSymbol || seriesSymbol, + // If seting callback functions on `symbol` or `symbolSize`, for simplicity and avoiding + // to bring trouble, we do not pick a reuslt from one of its calling on data item here, + // but just use the default value. Callback on `symbol` or `symbolSize` is convenient in + // some cases but generally it is not recommanded. + symbol: seriesSymbol, + symbolSize: seriesSymbolSize, + symbolKeepAspect: keepAspect, + symbolRotate: symbolRotate }); // Only visible series has each data be visual encoded @@ -37299,23 +39756,21 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { return; } - var hasCallback = typeof symbolSize === 'function'; - function dataEach(data, idx) { - if (typeof symbolSize === 'function') { + if (hasCallback) { var rawValue = seriesModel.getRawValue(idx); - // FIXME var params = seriesModel.getDataParams(idx); - data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params)); + hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params)); + hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params)); + hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params)); } if (data.hasItemOption) { var itemModel = data.getItemModel(idx); var itemSymbolType = itemModel.getShallow('symbol', true); - var itemSymbolSize = itemModel.getShallow('symbolSize', - true); - var itemSymbolKeepAspect = - itemModel.getShallow('symbolKeepAspect',true); + var itemSymbolSize = itemModel.getShallow('symbolSize', true); + var itemSymbolRotate = itemModel.getShallow('symbolRotate', true); + var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true); // If has item symbol if (itemSymbolType != null) { @@ -37325,9 +39780,11 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { // PENDING Transform symbolSize ? data.setItemVisual(idx, 'symbolSize', itemSymbolSize); } + if (itemSymbolRotate != null) { + data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate); + } if (itemSymbolKeepAspect != null) { - data.setItemVisual(idx, 'symbolKeepAspect', - itemSymbolKeepAspect); + data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect); } } } @@ -37356,6 +39813,8 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { * under the License. */ +/* global Float32Array */ + var pointsLayout = function (seriesType) { return { seriesType: seriesType, @@ -37782,6 +40241,23 @@ Cartesian2D.prototype = { */ getOtherAxis: function (axis) { return this.getAxis(axis.dim === 'x' ? 'y' : 'x'); + }, + + /** + * Get rect area of cartesian. + * Area will have a contain function to determine if a point is in the coordinate system. + * @return {BoundingRect} + */ + getArea: function () { + var xExtent = this.getAxis('x').getGlobalExtent(); + var yExtent = this.getAxis('y').getGlobalExtent(); + var x = Math.min(xExtent[0], xExtent[1]); + var y = Math.min(yExtent[0], yExtent[1]); + var width = Math.max(xExtent[0], xExtent[1]) - x; + var height = Math.max(yExtent[0], yExtent[1]) - y; + + var rect = new BoundingRect(x, y, width, height); + return rect; } }; @@ -38014,7 +40490,7 @@ var defaultOption = { splitArea: { show: false, areaStyle: { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] } } }; @@ -38080,7 +40556,7 @@ axisDefault.valueAxis = merge({ // scale: false, // AxisTick and axisLabel and splitLine are caculated based on splitNumber. - splitNumber: 5 + splitNumber: 5, // Interval specifies the span of the ticks is mandatorily. // interval: null @@ -38091,6 +40567,30 @@ axisDefault.valueAxis = merge({ // Specify max interval when auto calculate tick interval. // maxInterval: null + minorTick: { + // Minor tick, not available for cateogry axis. + show: false, + // Split number of minor ticks. The value should be in range of (0, 100) + splitNumber: 5, + // Lenght of minor tick + length: 3, + + // Same inside with axisTick + + // Line style + lineStyle: { + // Default to be same with axisTick + } + }, + + minorSplitLine: { + show: false, + + lineStyle: { + color: '#eee', + width: 1 + } + } }, defaultOption); axisDefault.timeAxis = defaults({ @@ -38392,7 +40892,7 @@ function Grid(gridModel, ecModel, api) { this._coordsList = []; /** - * @type {Object.} + * @type {Object.>} * @private */ this._axesMap = {}; @@ -38430,11 +40930,15 @@ gridProto.update = function (ecModel, api) { each$1(axesMap.y, function (yAxis) { niceScaleExtent(yAxis.scale, yAxis.model); }); + + // Key: axisDim_axisIndex, value: boolean, whether onZero target. + var onZeroRecords = {}; + each$1(axesMap.x, function (xAxis) { - fixAxisOnZero(axesMap, 'y', xAxis); + fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords); }); each$1(axesMap.y, function (yAxis) { - fixAxisOnZero(axesMap, 'x', yAxis); + fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords); }); // Resize again if containLabel is enabled @@ -38442,11 +40946,11 @@ gridProto.update = function (ecModel, api) { this.resize(this.model, api); }; -function fixAxisOnZero(axesMap, otherAxisDim, axis) { +function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) { axis.getAxesOnZeroOf = function () { // TODO: onZero of multiple axes. - return otherAxis ? [otherAxis] : []; + return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : []; }; // onZero can not be enabled in these two situations: @@ -38454,7 +40958,7 @@ function fixAxisOnZero(axesMap, otherAxisDim, axis) { // 2. When no axis is cross 0 point. var otherAxes = axesMap[otherAxisDim]; - var otherAxis; + var otherAxisOnZeroOf; var axisModel = axis.model; var onZero = axisModel.get('axisLine.onZero'); var onZeroAxisIndex = axisModel.get('axisLine.onZeroAxisIndex'); @@ -38466,18 +40970,31 @@ function fixAxisOnZero(axesMap, otherAxisDim, axis) { // If target axis is specified. if (onZeroAxisIndex != null) { if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { - otherAxis = otherAxes[onZeroAxisIndex]; + otherAxisOnZeroOf = otherAxes[onZeroAxisIndex]; } - return; } - - // Find the first available other axis. - for (var idx in otherAxes) { - if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx])) { - otherAxis = otherAxes[idx]; - break; + else { + // Find the first available other axis. + for (var idx in otherAxes) { + if (otherAxes.hasOwnProperty(idx) + && canOnZeroToAxis(otherAxes[idx]) + // Consider that two Y axes on one value axis, + // if both onZero, the two Y axes overlap. + && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])] + ) { + otherAxisOnZeroOf = otherAxes[idx]; + break; + } } } + + if (otherAxisOnZeroOf) { + onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true; + } + + function getOnZeroRecordKey(axis) { + return axis.dim + '_' + axis.index; + } } function canOnZeroToAxis(axis) { @@ -38515,7 +41032,7 @@ gridProto.resize = function (gridModel, api, ignoreContainLabel) { if (axis.position === 'top') { gridRect.y += labelUnionRect.height + margin; } - else if (axis.position === 'left') { + else if (axis.position === 'left') { gridRect.x += labelUnionRect.width + margin; } } @@ -38735,20 +41252,14 @@ gridProto._initCartesian = function (gridModel, ecModel, api) { // Fix position if (axisPosition !== 'top' && axisPosition !== 'bottom') { // Default bottom of X - axisPosition = 'bottom'; - if (axisPositionUsed[axisPosition]) { - axisPosition = axisPosition === 'top' ? 'bottom' : 'top'; - } + axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom'; } } else { // Fix position if (axisPosition !== 'left' && axisPosition !== 'right') { // Default left of Y - axisPosition = 'left'; - if (axisPositionUsed[axisPosition]) { - axisPosition = axisPosition === 'left' ? 'right' : 'left'; - } + axisPosition = axisPositionUsed.left ? 'right' : 'left'; } } axisPositionUsed[axisPosition] = true; @@ -38980,14 +41491,6 @@ CoordinateSystemManager.register('cartesian2d', Grid); var PI$2 = Math.PI; -function makeAxisEventDataBase(axisModel) { - var eventData = { - componentType: axisModel.mainType - }; - eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; - return eventData; -} - /** * A final axis is translated and rotated from a "standard axis". * So opt.position and opt.rotation is required. @@ -39118,10 +41621,10 @@ var builders = { axisModel.getModel('axisLine.lineStyle').getLineStyle() ); - this.group.add(new Line(subPixelOptimizeLine({ + this.group.add(new Line({ // Id for animation anid: 'line', - + subPixelOptimize: true, shape: { x1: pt1[0], y1: pt1[1], @@ -39132,7 +41635,7 @@ var builders = { strokeContainThreshold: opt.strokeContainThreshold || 5, silent: true, z2: 1 - }))); + })); var arrows = axisModel.get('axisLine.symbol'); var arrowSize = axisModel.get('axisLine.symbolSize'); @@ -39188,7 +41691,8 @@ var builders = { symbol.attr({ rotation: point.rotate, position: pos, - silent: true + silent: true, + z2: 11 }); this.group.add(symbol); } @@ -39203,10 +41707,12 @@ var builders = { var axisModel = this.axisModel; var opt = this.opt; - var tickEls = buildAxisTick(this, axisModel, opt); + var ticksEls = buildAxisMajorTicks(this, axisModel, opt); var labelEls = buildAxisLabel(this, axisModel, opt); - fixMinMaxLabelShow(axisModel, labelEls, tickEls); + fixMinMaxLabelShow(axisModel, labelEls, ticksEls); + + buildAxisMinorTicks(this, axisModel, opt); }, /** @@ -39303,7 +41809,7 @@ var builders = { position: pos, rotation: labelLayout.rotation, - silent: isSilent(axisModel), + silent: isLabelSilent(axisModel), z2: 1, tooltip: (tooltipOpt && tooltipOpt.show) ? extend({ @@ -39321,8 +41827,10 @@ var builders = { textFont: textFont, textFill: textStyleModel.getTextColor() || axisModel.get('axisLine.lineStyle.color'), - textAlign: labelLayout.textAlign, - textVerticalAlign: labelLayout.textVerticalAlign + textAlign: textStyleModel.get('align') + || labelLayout.textAlign, + textVerticalAlign: textStyleModel.get('verticalAlign') + || labelLayout.textVerticalAlign }); if (axisModel.get('triggerEvent')) { @@ -39342,6 +41850,15 @@ var builders = { }; +var makeAxisEventDataBase = AxisBuilder.makeAxisEventDataBase = function (axisModel) { + var eventData = { + componentType: axisModel.mainType, + componentIndex: axisModel.componentIndex + }; + eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; + return eventData; +}; + /** * @public * @static @@ -39419,16 +41936,20 @@ function endTextLayout(opt, textPosition, textRotate, extent) { }; } -function isSilent(axisModel) { +var isLabelSilent = AxisBuilder.isLabelSilent = function (axisModel) { var tooltipOpt = axisModel.get('tooltip'); return axisModel.get('silent') // Consider mouse cursor, add these restrictions. || !( axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show) ); -} +}; function fixMinMaxLabelShow(axisModel, labelEls, tickEls) { + if (shouldShowAllLabels(axisModel.axis)) { + return; + } + // If min or max are user set, we need to check // If the tick on min(max) are overlap on their neighbour tick // If they are overlapped, we need to hide the min(max) tick label @@ -39510,65 +42031,108 @@ function isNameLocationCenter(nameLocation) { return nameLocation === 'middle' || nameLocation === 'center'; } -function buildAxisTick(axisBuilder, axisModel, opt) { - var axis = axisModel.axis; - - if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) { - return; - } - - var tickModel = axisModel.getModel('axisTick'); - - var lineStyleModel = tickModel.getModel('lineStyle'); - var tickLen = tickModel.get('length'); - - var ticksCoords = axis.getTicksCoords(); +function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, aniid) { + var tickEls = []; var pt1 = []; var pt2 = []; - var matrix = axisBuilder._transform; - - var tickEls = []; - for (var i = 0; i < ticksCoords.length; i++) { var tickCoord = ticksCoords[i].coord; pt1[0] = tickCoord; pt1[1] = 0; pt2[0] = tickCoord; - pt2[1] = opt.tickDirection * tickLen; + pt2[1] = tickEndCoord; - if (matrix) { - applyTransform(pt1, pt1, matrix); - applyTransform(pt2, pt2, matrix); + if (tickTransform) { + applyTransform(pt1, pt1, tickTransform); + applyTransform(pt2, pt2, tickTransform); } // Tick line, Not use group transform to have better line draw - var tickEl = new Line(subPixelOptimizeLine({ + var tickEl = new Line({ // Id for animation - anid: 'tick_' + ticksCoords[i].tickValue, - + anid: aniid + '_' + ticksCoords[i].tickValue, + subPixelOptimize: true, shape: { x1: pt1[0], y1: pt1[1], x2: pt2[0], y2: pt2[1] }, - style: defaults( - lineStyleModel.getLineStyle(), - { - stroke: axisModel.get('axisLine.lineStyle.color') - } - ), + style: tickLineStyle, z2: 2, silent: true - })); - axisBuilder.group.add(tickEl); + }); tickEls.push(tickEl); } - return tickEls; } +function buildAxisMajorTicks(axisBuilder, axisModel, opt) { + var axis = axisModel.axis; + + var tickModel = axisModel.getModel('axisTick'); + + if (!tickModel.get('show') || axis.scale.isBlank()) { + return; + } + + var lineStyleModel = tickModel.getModel('lineStyle'); + var tickEndCoord = opt.tickDirection * tickModel.get('length'); + + var ticksCoords = axis.getTicksCoords(); + + var ticksEls = createTicks(ticksCoords, axisBuilder._transform, tickEndCoord, defaults( + lineStyleModel.getLineStyle(), + { + stroke: axisModel.get('axisLine.lineStyle.color') + } + ), 'ticks'); + + for (var i = 0; i < ticksEls.length; i++) { + axisBuilder.group.add(ticksEls[i]); + } + + return ticksEls; +} + +function buildAxisMinorTicks(axisBuilder, axisModel, opt) { + var axis = axisModel.axis; + + var minorTickModel = axisModel.getModel('minorTick'); + + if (!minorTickModel.get('show') || axis.scale.isBlank()) { + return; + } + + var minorTicksCoords = axis.getMinorTicksCoords(); + if (!minorTicksCoords.length) { + return; + } + + var lineStyleModel = minorTickModel.getModel('lineStyle'); + var tickEndCoord = opt.tickDirection * minorTickModel.get('length'); + + var minorTickLineStyle = defaults( + lineStyleModel.getLineStyle(), + defaults( + axisModel.getModel('axisTick').getLineStyle(), + { + stroke: axisModel.get('axisLine.lineStyle.color') + } + ) + ); + + for (var i = 0; i < minorTicksCoords.length; i++) { + var minorTicksEls = createTicks( + minorTicksCoords[i], axisBuilder._transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i + ); + for (var k = 0; k < minorTicksEls.length; k++) { + axisBuilder.group.add(minorTicksEls[k]); + } + } +} + function buildAxisLabel(axisBuilder, axisModel, opt) { var axis = axisModel.axis; var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show')); @@ -39587,10 +42151,10 @@ function buildAxisLabel(axisBuilder, axisModel, opt) { ) * PI$2 / 180; var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); - var rawCategoryData = axisModel.getCategories(true); + var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true); var labelEls = []; - var silent = isSilent(axisModel); + var silent = isLabelSilent(axisModel); var triggerEvent = axisModel.get('triggerEvent'); each$1(labels, function (labelItem, index) { @@ -40179,7 +42743,7 @@ function layout$1(gridModel, axisModel, opt) { if (otherAxisOnZeroOf) { var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); - posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); + posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); } // Axis position @@ -40195,7 +42759,7 @@ function layout$1(gridModel, axisModel, opt) { var dirMap = {top: -1, bottom: 1, left: -1, right: 1}; layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition]; - layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0; + layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0; if (axisModel.get('axisTick.inside')) { layout.tickDirection = -layout.tickDirection; @@ -40233,21 +42797,124 @@ function layout$1(gridModel, axisModel, opt) { * under the License. */ +function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) { + var axis = axisModel.axis; + + if (axis.scale.isBlank()) { + return; + } + + var splitAreaModel = axisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + + var gridRect = gridModel.coordinateSystem.getRect(); + + var ticksCoords = axis.getTicksCoords({ + tickModel: splitAreaModel, + clamp: true + }); + + if (!ticksCoords.length) { + return; + } + + // For Making appropriate splitArea animation, the color and anid + // should be corresponding to previous one if possible. + var areaColorsLen = areaColors.length; + var lastSplitAreaColors = axisView.__splitAreaColors; + var newSplitAreaColors = createHashMap(); + var colorIndex = 0; + if (lastSplitAreaColors) { + for (var i = 0; i < ticksCoords.length; i++) { + var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); + if (cIndex != null) { + colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; + break; + } + } + } + + var prev = axis.toGlobalCoord(ticksCoords[0].coord); + + var areaStyle = areaStyleModel.getAreaStyle(); + areaColors = isArray(areaColors) ? areaColors : [areaColors]; + + for (var i = 1; i < ticksCoords.length; i++) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + + var x; + var y; + var width; + var height; + if (axis.isHorizontal()) { + x = prev; + y = gridRect.y; + width = tickCoord - x; + height = gridRect.height; + prev = x + width; + } + else { + x = gridRect.x; + y = prev; + width = gridRect.width; + height = tickCoord - y; + prev = y + height; + } + + var tickValue = ticksCoords[i - 1].tickValue; + tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); + + axisGroup.add(new Rect({ + anid: tickValue != null ? 'area_' + tickValue : null, + shape: { + x: x, + y: y, + width: width, + height: height + }, + style: defaults({ + fill: areaColors[colorIndex] + }, areaStyle), + silent: true + })); + + colorIndex = (colorIndex + 1) % areaColorsLen; + } + + axisView.__splitAreaColors = newSplitAreaColors; +} + +function rectCoordAxisHandleRemove(axisView) { + axisView.__splitAreaColors = null; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + var axisBuilderAttrs = [ 'axisLine', 'axisTickLabel', 'axisName' ]; var selfBuilderAttrs = [ - 'splitArea', 'splitLine' + 'splitArea', 'splitLine', 'minorSplitLine' ]; -// function getAlignWithLabel(model, axisModel) { -// var alignWithLabel = model.get('alignWithLabel'); -// if (alignWithLabel === 'auto') { -// alignWithLabel = axisModel.get('axisTick.alignWithLabel'); -// } -// return alignWithLabel; -// } - var CartesianAxisView = AxisView.extend({ type: 'cartesianAxis', @@ -40292,7 +42959,7 @@ var CartesianAxisView = AxisView.extend({ }, remove: function () { - this._splitAreaColors = null; + rectCoordAxisHandleRemove(this); }, /** @@ -40325,8 +42992,6 @@ var CartesianAxisView = AxisView.extend({ var p1 = []; var p2 = []; - // Simple optimization - // Batching the lines if color are the same var lineStyle = lineStyleModel.getLineStyle(); for (var i = 0; i < ticksCoords.length; i++) { var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); @@ -40346,8 +43011,9 @@ var CartesianAxisView = AxisView.extend({ var colorIndex = (lineCount++) % lineColors.length; var tickValue = ticksCoords[i].tickValue; - this._axisGroup.add(new Line(subPixelOptimizeLine({ + this._axisGroup.add(new Line({ anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null, + subPixelOptimize: true, shape: { x1: p1[0], y1: p1[1], @@ -40358,7 +43024,7 @@ var CartesianAxisView = AxisView.extend({ stroke: lineColors[colorIndex] }, lineStyle), silent: true - }))); + })); } }, @@ -40367,92 +43033,65 @@ var CartesianAxisView = AxisView.extend({ * @param {module:echarts/coord/cartesian/GridModel} gridModel * @private */ - _splitArea: function (axisModel, gridModel) { + _minorSplitLine: function (axisModel, gridModel) { var axis = axisModel.axis; - if (axis.scale.isBlank()) { - return; - } - - var splitAreaModel = axisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); + var minorSplitLineModel = axisModel.getModel('minorSplitLine'); + var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); var gridRect = gridModel.coordinateSystem.getRect(); + var isHorizontal = axis.isHorizontal(); - var ticksCoords = axis.getTicksCoords({ - tickModel: splitAreaModel, - clamp: true - }); - - if (!ticksCoords.length) { + var minorTicksCoords = axis.getMinorTicksCoords(); + if (!minorTicksCoords.length) { return; } + var p1 = []; + var p2 = []; - // For Making appropriate splitArea animation, the color and anid - // should be corresponding to previous one if possible. - var areaColorsLen = areaColors.length; - var lastSplitAreaColors = this._splitAreaColors; - var newSplitAreaColors = createHashMap(); - var colorIndex = 0; - if (lastSplitAreaColors) { - for (var i = 0; i < ticksCoords.length; i++) { - var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); - if (cIndex != null) { - colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; - break; - } - } - } + var lineStyle = lineStyleModel.getLineStyle(); - var prev = axis.toGlobalCoord(ticksCoords[0].coord); - var areaStyle = areaStyleModel.getAreaStyle(); - areaColors = isArray(areaColors) ? areaColors : [areaColors]; + for (var i = 0; i < minorTicksCoords.length; i++) { + for (var k = 0; k < minorTicksCoords[i].length; k++) { + var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord); - for (var i = 1; i < ticksCoords.length; i++) { - var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + if (isHorizontal) { + p1[0] = tickCoord; + p1[1] = gridRect.y; + p2[0] = tickCoord; + p2[1] = gridRect.y + gridRect.height; + } + else { + p1[0] = gridRect.x; + p1[1] = tickCoord; + p2[0] = gridRect.x + gridRect.width; + p2[1] = tickCoord; + } - var x; - var y; - var width; - var height; - if (axis.isHorizontal()) { - x = prev; - y = gridRect.y; - width = tickCoord - x; - height = gridRect.height; - prev = x + width; - } - else { - x = gridRect.x; - y = prev; - width = gridRect.width; - height = tickCoord - y; - prev = y + height; + this._axisGroup.add(new Line({ + anid: 'minor_line_' + minorTicksCoords[i][k].tickValue, + subPixelOptimize: true, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: lineStyle, + silent: true + })); } - - var tickValue = ticksCoords[i - 1].tickValue; - tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); - - this._axisGroup.add(new Rect({ - anid: tickValue != null ? 'area_' + tickValue : null, - shape: { - x: x, - y: y, - width: width, - height: height - }, - style: defaults({ - fill: areaColors[colorIndex] - }, areaStyle), - silent: true - })); - - colorIndex = (colorIndex + 1) % areaColorsLen; } + }, - this._splitAreaColors = newSplitAreaColors; + /** + * @param {module:echarts/coord/cartesian/AxisModel} axisModel + * @param {module:echarts/coord/cartesian/GridModel} gridModel + * @private + */ + _splitArea: function (axisModel, gridModel) { + rectCoordAxisBuildSplitArea(this, this._axisGroup, axisModel, gridModel); } }); @@ -40582,7 +43221,7 @@ var BaseBarSeries = SeriesModel.extend({ type: 'series.__base_bar__', getInitialData: function (option, ecModel) { - return createListFromArray(this.getSource(), this); + return createListFromArray(this.getSource(), this, {useEncodeDefaulter: true}); }, getMarkerPosition: function (value) { @@ -40623,6 +43262,10 @@ var BaseBarSeries = SeriesModel.extend({ progressiveChunkMode: 'mod', // barMaxWidth: null, + + // In cartesian, the default value is 1. Otherwise null. + // barMinWidth: null, + // 默认自适应 // barWidth: null, // 柱间距离,默认为柱形宽度的30%,可设固定值 @@ -40685,8 +43328,31 @@ BaseBarSeries.extend({ progressiveThreshold = largeThreshold; } return progressiveThreshold; - } + }, + defaultOption: { + // If clipped + // Only available on cartesian2d + clip: true, + + // If use caps on two sides of bars + // Only available on tangential polar bar + roundCap: false, + + showBackground: false, + backgroundStyle: { + color: 'rgba(180, 180, 180, 0.2)', + borderColor: null, + borderWidth: 0, + borderType: 'solid', + borderRadius: 0, + shadowBlur: 0, + shadowColor: null, + shadowOffsetX: 0, + shadowOffsetY: 0, + opacity: 1 + } + } }); /* @@ -40800,12 +43466,128 @@ var barItemStyle = { * under the License. */ +/** + * Sausage: similar to sector, but have half circle on both sides + * @public + */ +var Sausage = extendShape({ + + type: 'sausage', + + shape: { + + cx: 0, + + cy: 0, + + r0: 0, + + r: 0, + + startAngle: 0, + + endAngle: Math.PI * 2, + + clockwise: true + }, + + buildPath: function (ctx, shape) { + var x = shape.cx; + var y = shape.cy; + var r0 = Math.max(shape.r0 || 0, 0); + var r = Math.max(shape.r, 0); + var dr = (r - r0) * 0.5; + var rCenter = r0 + dr; + var startAngle = shape.startAngle; + var endAngle = shape.endAngle; + var clockwise = shape.clockwise; + + var unitStartX = Math.cos(startAngle); + var unitStartY = Math.sin(startAngle); + var unitEndX = Math.cos(endAngle); + var unitEndY = Math.sin(endAngle); + + var lessThanCircle = clockwise + ? endAngle - startAngle < Math.PI * 2 + : startAngle - endAngle < Math.PI * 2; + + if (lessThanCircle) { + ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y); + + ctx.arc( + unitStartX * rCenter + x, unitStartY * rCenter + y, dr, + -Math.PI + startAngle, startAngle, !clockwise + ); + } + + ctx.arc(x, y, r, startAngle, endAngle, !clockwise); + + ctx.moveTo(unitEndX * r + x, unitEndY * r + y); + + ctx.arc( + unitEndX * rCenter + x, unitEndY * rCenter + y, dr, + endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise + ); + + if (r0 !== 0) { + ctx.arc(x, y, r0, endAngle, startAngle, clockwise); + + ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y); + } + + ctx.closePath(); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth']; +var _eventPos = [0, 0]; // FIXME // Just for compatible with ec2. extend(Model.prototype, barItemStyle); +function getClipArea(coord, data) { + var coordSysClipArea = coord.getArea && coord.getArea(); + if (coord.type === 'cartesian2d') { + var baseAxis = coord.getBaseAxis(); + // When boundaryGap is false or using time axis. bar may exceed the grid. + // We should not clip this part. + // See test/bar2.html + if (baseAxis.type !== 'category' || !baseAxis.onBand) { + var expandWidth = data.getLayout('bandWidth'); + if (baseAxis.isHorizontal()) { + coordSysClipArea.x -= expandWidth; + coordSysClipArea.width += expandWidth * 2; + } + else { + coordSysClipArea.y -= expandWidth; + coordSysClipArea.height += expandWidth * 2; + } + } + } + + return coordSysClipArea; +} + extendChartView({ type: 'bar', @@ -40865,16 +43647,55 @@ extendChartView({ var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; + var needsClip = seriesModel.get('clip', true); + var coordSysClipArea = getClipArea(coord, data); + // If there is clipPath created in large mode. Remove it. + group.removeClipPath(); + // We don't use clipPath in normal mode because we needs a perfect animation + // And don't want the label are clipped. + + var roundCap = seriesModel.get('roundCap', true); + + var drawBackground = seriesModel.get('showBackground', true); + var backgroundModel = seriesModel.getModel('backgroundStyle'); + var barBorderRadius = backgroundModel.get('barBorderRadius') || 0; + + var bgEls = []; + var oldBgEls = this._backgroundEls || []; + data.diff(oldData) .add(function (dataIndex) { + var itemModel = data.getItemModel(dataIndex); + var layout = getLayout[coord.type](data, dataIndex, itemModel); + + if (drawBackground) { + var bgLayout = getLayout[coord.type](data, dataIndex); + var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout); + bgEl.useStyle(backgroundModel.getBarItemStyle()); + // Only cartesian2d support borderRadius. + if (coord.type === 'cartesian2d') { + bgEl.setShape('r', barBorderRadius); + } + bgEls[dataIndex] = bgEl; + } + + // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy". if (!data.hasValue(dataIndex)) { return; } - var itemModel = data.getItemModel(dataIndex); - var layout = getLayout[coord.type](data, dataIndex, itemModel); + if (needsClip) { + // Clip will modify the layout params. + // And return a boolean to determine if the shape are fully clipped. + var isClipped = clip[coord.type](coordSysClipArea, layout); + if (isClipped) { + group.remove(el); + return; + } + } + var el = elementCreator[coord.type]( - data, dataIndex, itemModel, layout, isHorizontalOrRadial, animationModel + dataIndex, layout, isHorizontalOrRadial, animationModel, false, roundCap ); data.setItemGraphicEl(dataIndex, el); group.add(el); @@ -40885,22 +43706,43 @@ extendChartView({ ); }) .update(function (newIndex, oldIndex) { - var el = oldData.getItemGraphicEl(oldIndex); + var itemModel = data.getItemModel(newIndex); + var layout = getLayout[coord.type](data, newIndex, itemModel); + if (drawBackground) { + var bgEl = oldBgEls[oldIndex]; + bgEl.useStyle(backgroundModel.getBarItemStyle()); + // Only cartesian2d support borderRadius. + if (coord.type === 'cartesian2d') { + bgEl.setShape('r', barBorderRadius); + } + bgEls[newIndex] = bgEl; + + var bgLayout = getLayout[coord.type](data, newIndex); + var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord); + updateProps(bgEl, { shape: shape }, animationModel, newIndex); + } + + var el = oldData.getItemGraphicEl(oldIndex); if (!data.hasValue(newIndex)) { group.remove(el); return; } - var itemModel = data.getItemModel(newIndex); - var layout = getLayout[coord.type](data, newIndex, itemModel); + if (needsClip) { + var isClipped = clip[coord.type](coordSysClipArea, layout); + if (isClipped) { + group.remove(el); + return; + } + } if (el) { updateProps(el, {shape: layout}, animationModel, newIndex); } else { el = elementCreator[coord.type]( - data, newIndex, itemModel, layout, isHorizontalOrRadial, animationModel, true + newIndex, layout, isHorizontalOrRadial, animationModel, true, roundCap ); } @@ -40924,15 +43766,36 @@ extendChartView({ }) .execute(); + var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group()); + bgGroup.removeAll(); + + for (var i = 0; i < bgEls.length; ++i) { + bgGroup.add(bgEls[i]); + } + group.add(bgGroup); + this._backgroundEls = bgEls; + this._data = data; }, _renderLarge: function (seriesModel, ecModel, api) { this._clear(); createLarge(seriesModel, this.group); + + // Use clipPath in large mode. + var clipPath = seriesModel.get('clip', true) + ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) + : null; + if (clipPath) { + this.group.setClipPath(clipPath); + } + else { + this.group.removeClipPath(); + } }, _incrementalRenderLarge: function (params, seriesModel) { + this._removeBackground(); createLarge(seriesModel, this.group, true); }, @@ -40946,6 +43809,9 @@ extendChartView({ var group = this.group; var data = this._data; if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) { + this._removeBackground(); + this._backgroundEls = []; + data.eachItemGraphicEl(function (el) { if (el.type === 'sector') { removeSector(el.dataIndex, ecModel, el); @@ -40959,17 +43825,74 @@ extendChartView({ group.removeAll(); } this._data = null; + }, + + _removeBackground: function () { + this.group.remove(this._backgroundGroup); + this._backgroundGroup = null; } }); +var mathMax$4 = Math.max; +var mathMin$4 = Math.min; + +var clip = { + cartesian2d: function (coordSysBoundingRect, layout) { + var signWidth = layout.width < 0 ? -1 : 1; + var signHeight = layout.height < 0 ? -1 : 1; + // Needs positive width and height + if (signWidth < 0) { + layout.x += layout.width; + layout.width = -layout.width; + } + if (signHeight < 0) { + layout.y += layout.height; + layout.height = -layout.height; + } + + var x = mathMax$4(layout.x, coordSysBoundingRect.x); + var x2 = mathMin$4(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width); + var y = mathMax$4(layout.y, coordSysBoundingRect.y); + var y2 = mathMin$4(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height); + + layout.x = x; + layout.y = y; + layout.width = x2 - x; + layout.height = y2 - y; + + var clipped = layout.width < 0 || layout.height < 0; + + // Reverse back + if (signWidth < 0) { + layout.x += layout.width; + layout.width = -layout.width; + } + if (signHeight < 0) { + layout.y += layout.height; + layout.height = -layout.height; + } + + return clipped; + }, + + polar: function (coordSysClipArea) { + return false; + } +}; + var elementCreator = { cartesian2d: function ( - data, dataIndex, itemModel, layout, isHorizontal, + dataIndex, layout, isHorizontal, animationModel, isUpdate ) { - var rect = new Rect({shape: extend({}, layout)}); + var rect = new Rect({ + shape: extend({}, layout), + z2: 1 + }); + + rect.name = 'item'; // Animation if (animationModel) { @@ -40987,18 +43910,24 @@ var elementCreator = { }, polar: function ( - data, dataIndex, itemModel, layout, isRadial, - animationModel, isUpdate + dataIndex, layout, isRadial, + animationModel, isUpdate, roundCap ) { // Keep the same logic with bar in catesion: use end value to control // direction. Notice that if clockwise is true (by default), the sector // will always draw clockwisely, no matter whether endAngle is greater // or less than startAngle. var clockwise = layout.startAngle < layout.endAngle; - var sector = new Sector({ - shape: defaults({clockwise: clockwise}, layout) + + var ShapeClass = (!isRadial && roundCap) ? Sausage : Sector; + + var sector = new ShapeClass({ + shape: defaults({clockwise: clockwise}, layout), + z2: 1 }); + sector.name = 'item'; + // Animation if (animationModel) { var sectorShape = sector.shape; @@ -41040,9 +43969,11 @@ function removeSector(dataIndex, animationModel, el) { } var getLayout = { + // itemModel is only used to get borderWidth, which is not needed + // when calculating bar background layout. cartesian2d: function (data, dataIndex, itemModel) { var layout = data.getItemLayout(dataIndex); - var fixedLineWidth = getLineWidth(itemModel, layout); + var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth var signX = layout.width > 0 ? 1 : -1; @@ -41068,11 +43999,18 @@ var getLayout = { } }; +function isZeroOnPolar(layout) { + return layout.startAngle != null + && layout.endAngle != null + && layout.startAngle === layout.endAngle; +} + function updateStyle( el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar ) { var color = data.getItemVisual(dataIndex, 'color'); var opacity = data.getItemVisual(dataIndex, 'opacity'); + var stroke = data.getVisual('borderColor'); var itemStyleModel = itemModel.getModel('itemStyle'); var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle(); @@ -41082,7 +44020,8 @@ function updateStyle( el.useStyle(defaults( { - fill: color, + stroke: isZeroOnPolar(layout) ? 'none' : stroke, + fill: isZeroOnPolar(layout) ? 'none' : color, opacity: opacity }, itemStyleModel.getBarItemStyle() @@ -41101,14 +44040,19 @@ function updateStyle( seriesModel, dataIndex, labelPositionOutside ); } - + if (isZeroOnPolar(layout)) { + hoverStyle.fill = hoverStyle.stroke = 'none'; + } setHoverStyle(el, hoverStyle); } // In case width or height are too small. function getLineWidth(itemModel, rawLayout) { var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; - return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height)); + // width or height may be NaN for empty data + var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width); + var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height); + return Math.min(lineWidth, width, height); } @@ -41123,10 +44067,10 @@ var LargePath = Path.extend({ // a whole line or drawing rects. var points = shape.points; var startPoint = this.__startPoint; - var valueIdx = this.__valueIdx; + var baseDimIdx = this.__baseDimIdx; for (var i = 0; i < points.length; i += 2) { - startPoint[this.__valueIdx] = points[i + valueIdx]; + startPoint[baseDimIdx] = points[i + baseDimIdx]; ctx.moveTo(startPoint[0], startPoint[1]); ctx.lineTo(points[i], points[i + 1]); } @@ -41137,17 +44081,93 @@ function createLarge(seriesModel, group, incremental) { // TODO support polar var data = seriesModel.getData(); var startPoint = []; - var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; - startPoint[1 - valueIdx] = data.getLayout('valueAxisStart'); + var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; + startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart'); + + var largeDataIndices = data.getLayout('largeDataIndices'); + var barWidth = data.getLayout('barWidth'); + + var backgroundModel = seriesModel.getModel('backgroundStyle'); + var drawBackground = seriesModel.get('showBackground', true); + + if (drawBackground) { + var points = data.getLayout('largeBackgroundPoints'); + var backgroundStartPoint = []; + backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart'); + + var bgEl = new LargePath({ + shape: {points: points}, + incremental: !!incremental, + __startPoint: backgroundStartPoint, + __baseDimIdx: baseDimIdx, + __largeDataIndices: largeDataIndices, + __barWidth: barWidth, + silent: true, + z2: 0 + }); + setLargeBackgroundStyle(bgEl, backgroundModel, data); + group.add(bgEl); + } var el = new LargePath({ shape: {points: data.getLayout('largePoints')}, incremental: !!incremental, __startPoint: startPoint, - __valueIdx: valueIdx + __baseDimIdx: baseDimIdx, + __largeDataIndices: largeDataIndices, + __barWidth: barWidth }); group.add(el); setLargeStyle(el, seriesModel, data); + + // Enable tooltip and user mouse/touch event handlers. + el.seriesIndex = seriesModel.seriesIndex; + + if (!seriesModel.get('silent')) { + el.on('mousedown', largePathUpdateDataIndex); + el.on('mousemove', largePathUpdateDataIndex); + } +} + +// Use throttle to avoid frequently traverse to find dataIndex. +var largePathUpdateDataIndex = throttle(function (event) { + var largePath = this; + var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY); + largePath.dataIndex = dataIndex >= 0 ? dataIndex : null; +}, 30, false); + +function largePathFindDataIndex(largePath, x, y) { + var baseDimIdx = largePath.__baseDimIdx; + var valueDimIdx = 1 - baseDimIdx; + var points = largePath.shape.points; + var largeDataIndices = largePath.__largeDataIndices; + var barWidthHalf = Math.abs(largePath.__barWidth / 2); + var startValueVal = largePath.__startPoint[valueDimIdx]; + + _eventPos[0] = x; + _eventPos[1] = y; + var pointerBaseVal = _eventPos[baseDimIdx]; + var pointerValueVal = _eventPos[1 - baseDimIdx]; + var baseLowerBound = pointerBaseVal - barWidthHalf; + var baseUpperBound = pointerBaseVal + barWidthHalf; + + for (var i = 0, len = points.length / 2; i < len; i++) { + var ii = i * 2; + var barBaseVal = points[ii + baseDimIdx]; + var barValueVal = points[ii + valueDimIdx]; + if ( + barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound + && ( + startValueVal <= barValueVal + ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal) + : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal) + ) + ) { + return largeDataIndices[i]; + } + } + + return -1; } function setLargeStyle(el, seriesModel, data) { @@ -41160,6 +44180,55 @@ function setLargeStyle(el, seriesModel, data) { el.style.lineWidth = data.getLayout('barWidth'); } +function setLargeBackgroundStyle(el, backgroundModel, data) { + var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color'); + var itemStyle = backgroundModel.getItemStyle(['color', 'borderColor']); + + el.useStyle(itemStyle); + el.style.fill = null; + el.style.stroke = borderColor; + el.style.lineWidth = data.getLayout('barWidth'); +} + +function createBackgroundShape(isHorizontalOrRadial, layout, coord) { + var coordLayout; + var isPolar = coord.type === 'polar'; + if (isPolar) { + coordLayout = coord.getArea(); + } + else { + coordLayout = coord.grid.getRect(); + } + + if (isPolar) { + return { + cx: coordLayout.cx, + cy: coordLayout.cy, + r0: isHorizontalOrRadial ? coordLayout.r0 : layout.r0, + r: isHorizontalOrRadial ? coordLayout.r : layout.r, + startAngle: isHorizontalOrRadial ? layout.startAngle : 0, + endAngle: isHorizontalOrRadial ? layout.endAngle : Math.PI * 2 + }; + } + else { + return { + x: isHorizontalOrRadial ? layout.x : coordLayout.x, + y: isHorizontalOrRadial ? coordLayout.y : layout.y, + width: isHorizontalOrRadial ? layout.width : coordLayout.width, + height: isHorizontalOrRadial ? coordLayout.height : layout.height + }; + } +} + +function createBackgroundEl(coord, isHorizontalOrRadial, layout) { + var ElementClz = coord.type === 'polar' ? Sector : Rect; + return new ElementClz({ + shape: createBackgroundShape(isHorizontalOrRadial, layout, coord), + silent: true, + z2: 0 + }); +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -41180,9 +44249,10 @@ function setLargeStyle(el, seriesModel, data) { */ // In case developer forget to include grid component -registerLayout(curry(layout, 'bar')); -// Should after normal bar layout, otherwise it is blocked by normal bar layout. -registerLayout(largeLayout); +registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar')); +// Use higher prority to avoid to be blocked by other overall layout, which do not +// only exist in this module, but probably also exist in other modules, like `barPolar`. +registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout); registerVisual({ seriesType: 'bar', @@ -41370,6 +44440,60 @@ var selectableMixin = { * under the License. */ + +/** + * LegendVisualProvider is an bridge that pick encoded color from data and + * provide to the legend component. + * @param {Function} getDataWithEncodedVisual Function to get data after filtered. It stores all the encoding info + * @param {Function} getRawData Function to get raw data before filtered. + */ +function LegendVisualProvider(getDataWithEncodedVisual, getRawData) { + this.getAllNames = function () { + var rawData = getRawData(); + // We find the name from the raw data. In case it's filtered by the legend component. + // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray. + return rawData.mapArray(rawData.getName); + }; + + this.containName = function (name) { + var rawData = getRawData(); + return rawData.indexOfName(name) >= 0; + }; + + this.indexOfName = function (name) { + // Only get data when necessary. + // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet. + // Invoking Series#getData immediately will throw an error. + var dataWithEncodedVisual = getDataWithEncodedVisual(); + return dataWithEncodedVisual.indexOfName(name); + }; + + this.getItemVisual = function (dataIndex, key) { + // Get encoded visual properties from final filtered data. + var dataWithEncodedVisual = getDataWithEncodedVisual(); + return dataWithEncodedVisual.getItemVisual(dataIndex, key); + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + var PieSeries = extendSeriesModel({ type: 'series.pie', @@ -41380,9 +44504,9 @@ var PieSeries = extendSeriesModel({ // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed - this.legendDataProvider = function () { - return this.getRawData(); - }; + this.legendVisualProvider = new LegendVisualProvider( + bind(this.getData, this), bind(this.getRawData, this) + ); this.updateSelectedMap(this._createSelectableList()); @@ -41397,7 +44521,10 @@ var PieSeries = extendSeriesModel({ }, getInitialData: function (option, ecModel) { - return createListSimply(this, ['value']); + return createListSimply(this, { + coordDimensions: ['value'], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); }, _createSelectableList: function () { @@ -41462,6 +44589,11 @@ var PieSeries = extendSeriesModel({ startAngle: 90, // 最小角度改为0 minAngle: 0, + + // If the angle of a sector less than `minShowLabelAngle`, + // the label will not be displayed. + minShowLabelAngle: 0, + // 选中时扇区偏移量 selectedOffset: 10, // 高亮扇区偏移量 @@ -41481,12 +44613,28 @@ var PieSeries = extendSeriesModel({ // cursor: null, + left: 0, + top: 0, + right: 0, + bottom: 0, + width: null, + height: null, + label: { // If rotate around circle rotate: false, show: true, // 'outer', 'inside', 'center' - position: 'outer' + position: 'outer', + // 'none', 'labelLine', 'edge'. Works only when position is 'outer' + alignTo: 'none', + // Closest distance between label and chart edge. + // Works only position is 'outer' and alignTo is 'edge'. + margin: '25%', + // Works only position is 'outer' and alignTo is not 'edge'. + bleedMargin: 10, + // Distance between text and label line. + distanceToLabelLine: 5 // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 // 默认使用全局文本样式,详见TEXTSTYLE // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 @@ -41509,9 +44657,12 @@ var PieSeries = extendSeriesModel({ borderWidth: 1 }, - // Animation type canbe expansion, scale + // Animation type. Valid values: expansion, scale animationType: 'expansion', + // Animation type when update. Valid values: transition, expansion + animationTypeUpdate: 'transition', + animationEasing: 'cubicOut' } }); @@ -41612,20 +44763,6 @@ function PiePiece(data, idx) { this.add(text); this.updateData(data, idx, true); - - // Hover to change label and labelLine - function onEmphasis() { - polyline.ignore = polyline.hoverIgnore; - text.ignore = text.hoverIgnore; - } - function onNormal() { - polyline.ignore = polyline.normalIgnore; - text.ignore = text.normalIgnore; - } - this.on('emphasis', onEmphasis) - .on('normal', onNormal) - .on('mouseover', onEmphasis) - .on('mouseout', onNormal); } var piePieceProto = PiePiece.prototype; @@ -41633,6 +44770,8 @@ var piePieceProto = PiePiece.prototype; piePieceProto.updateData = function (data, idx, firstCreate) { var sector = this.childAt(0); + var labelLine = this.childAt(1); + var labelText = this.childAt(2); var seriesModel = data.hostModel; var itemModel = data.getItemModel(idx); @@ -41640,6 +44779,8 @@ piePieceProto.updateData = function (data, idx, firstCreate) { var sectorShape = extend({}, layout); sectorShape.label = null; + var animationTypeUpdate = seriesModel.getShallow('animationTypeUpdate'); + if (firstCreate) { sector.setShape(sectorShape); @@ -41664,9 +44805,16 @@ piePieceProto.updateData = function (data, idx, firstCreate) { } else { - updateProps(sector, { - shape: sectorShape - }, seriesModel, idx); + if (animationTypeUpdate === 'expansion') { + // Sectors are set to be target shape and an overlaying clipPath is used for animation + sector.setShape(sectorShape); + } + else { + // Transition animation from the old shape + updateProps(sector, { + shape: sectorShape + }, seriesModel, idx); + } } // Update common style @@ -41690,44 +44838,53 @@ piePieceProto.updateData = function (data, idx, firstCreate) { toggleItemSelected( this, data.getItemLayout(idx), - seriesModel.isSelected(null, idx), + seriesModel.isSelected(data.getName(idx)), seriesModel.get('selectedOffset'), seriesModel.get('animation') ); - function onEmphasis() { - // Sector may has animation of updating data. Force to move to the last frame - // Or it may stopped on the wrong shape - sector.stopAnimation(true); - sector.animateTo({ - shape: { - r: layout.r + seriesModel.get('hoverOffset') - } - }, 300, 'elasticOut'); - } - function onNormal() { - sector.stopAnimation(true); - sector.animateTo({ - shape: { - r: layout.r + // Label and text animation should be applied only for transition type animation when update + var withAnimation = !firstCreate && animationTypeUpdate === 'transition'; + this._updateLabel(data, idx, withAnimation); + + this.highDownOnUpdate = !seriesModel.get('silent') + ? function (fromState, toState) { + var hasAnimation = seriesModel.isAnimationEnabled() && itemModel.get('hoverAnimation'); + if (toState === 'emphasis') { + labelLine.ignore = labelLine.hoverIgnore; + labelText.ignore = labelText.hoverIgnore; + + // Sector may has animation of updating data. Force to move to the last frame + // Or it may stopped on the wrong shape + if (hasAnimation) { + sector.stopAnimation(true); + sector.animateTo({ + shape: { + r: layout.r + seriesModel.get('hoverOffset') + } + }, 300, 'elasticOut'); + } } - }, 300, 'elasticOut'); - } - sector.off('mouseover').off('mouseout').off('emphasis').off('normal'); - if (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled()) { - sector - .on('mouseover', onEmphasis) - .on('mouseout', onNormal) - .on('emphasis', onEmphasis) - .on('normal', onNormal); - } + else { + labelLine.ignore = labelLine.normalIgnore; + labelText.ignore = labelText.normalIgnore; - this._updateLabel(data, idx); + if (hasAnimation) { + sector.stopAnimation(true); + sector.animateTo({ + shape: { + r: layout.r + } + }, 300, 'elasticOut'); + } + } + } + : null; setHoverStyle(this); }; -piePieceProto._updateLabel = function (data, idx) { +piePieceProto._updateLabel = function (data, idx, withAnimation) { var labelLine = this.childAt(1); var labelText = this.childAt(2); @@ -41738,20 +44895,39 @@ piePieceProto._updateLabel = function (data, idx) { var labelLayout = layout.label; var visualColor = data.getItemVisual(idx, 'color'); - updateProps(labelLine, { - shape: { - points: labelLayout.linePoints || [ - [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y] - ] - } - }, seriesModel, idx); + if (!labelLayout || isNaN(labelLayout.x) || isNaN(labelLayout.y)) { + labelText.ignore = labelText.normalIgnore = labelText.hoverIgnore = + labelLine.ignore = labelLine.normalIgnore = labelLine.hoverIgnore = true; + return; + } + + var targetLineShape = { + points: labelLayout.linePoints || [ + [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y] + ] + }; + var targetTextStyle = { + x: labelLayout.x, + y: labelLayout.y + }; + if (withAnimation) { + updateProps(labelLine, { + shape: targetLineShape + }, seriesModel, idx); + + updateProps(labelText, { + style: targetTextStyle + }, seriesModel, idx); + } + else { + labelLine.attr({ + shape: targetLineShape + }); + labelText.attr({ + style: targetTextStyle + }); + } - updateProps(labelText, { - style: { - x: labelLayout.x, - y: labelLayout.y - } - }, seriesModel, idx); labelText.attr({ rotation: labelLayout.rotation, origin: [labelLayout.x, labelLayout.y], @@ -41769,7 +44945,7 @@ piePieceProto._updateLabel = function (data, idx) { { labelFetcher: data.hostModel, labelDataIndex: idx, - defaultText: data.getName(idx), + defaultText: labelLayout.text, autoColor: visualColor, useInsideStyle: !!labelLayout.inside }, @@ -41829,13 +45005,13 @@ var PieView = Chart.extend({ var hasAnimation = ecModel.get('animation'); var isFirstRender = !oldData; var animationType = seriesModel.get('animationType'); + var animationTypeUpdate = seriesModel.get('animationTypeUpdate'); var onSectorClick = curry( updateDataSelected, this.uid, seriesModel, hasAnimation, api ); var selectedMode = seriesModel.get('selectedMode'); - data.diff(oldData) .add(function (idx) { var piePiece = new PiePiece(data, idx); @@ -41855,6 +45031,12 @@ var PieView = Chart.extend({ .update(function (newIdx, oldIdx) { var piePiece = oldData.getItemGraphicEl(oldIdx); + if (!isFirstRender && animationTypeUpdate !== 'transition') { + piePiece.eachChild(function (child) { + child.stopAnimation(true); + }); + } + piePiece.updateData(data, newIdx); piePiece.off('click'); @@ -41869,18 +45051,25 @@ var PieView = Chart.extend({ .execute(); if ( - hasAnimation && isFirstRender && data.count() > 0 - // Default expansion animation - && animationType !== 'scale' + hasAnimation && data.count() > 0 + && (isFirstRender ? animationType !== 'scale' : animationTypeUpdate !== 'transition') ) { var shape = data.getItemLayout(0); + for (var s = 1; isNaN(shape.startAngle) && s < data.count(); ++s) { + shape = data.getItemLayout(s); + } + var r = Math.max(api.getWidth(), api.getHeight()) / 2; var removeClipPath = bind(group.removeClipPath, group); group.setClipPath(this._createClipPath( - shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel + shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel, isFirstRender )); } + else { + // clipPath is used in first-time animation, so remove it when otherwise. See: #8994 + group.removeClipPath(); + } this._data = data; }, @@ -41888,7 +45077,7 @@ var PieView = Chart.extend({ dispose: function () {}, _createClipPath: function ( - cx, cy, r, startAngle, clockwise, cb, seriesModel + cx, cy, r, startAngle, clockwise, cb, seriesModel, isFirstRender ) { var clipPath = new Sector({ shape: { @@ -41902,7 +45091,8 @@ var PieView = Chart.extend({ } }); - initProps(clipPath, { + var initOrUpdate = isFirstRender ? initProps : updateProps; + initOrUpdate(clipPath, { shape: { endAngle: startAngle + (clockwise ? 1 : -1) * Math.PI * 2 } @@ -41976,7 +45166,8 @@ var createDataSelectAction = function (seriesType, actionInfos) { ); return { name: payload.name, - selected: selected + selected: selected, + seriesId: payload.seriesId }; }); }); @@ -42035,26 +45226,34 @@ var dataColor = function (seriesType) { var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true); - if (!singleDataColor) { + var singleDataBorderColor = filteredIdx != null + && data.getItemVisual(filteredIdx, 'borderColor', true); + + var itemModel; + if (!singleDataColor || !singleDataBorderColor) { // FIXME Performance - var itemModel = dataAll.getItemModel(rawIdx); + itemModel = dataAll.getItemModel(rawIdx); + } + if (!singleDataColor) { var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette( dataAll.getName(rawIdx) || (rawIdx + ''), seriesModel.__paletteScope, dataAll.count() ); - // Legend may use the visual info in data before processed - dataAll.setItemVisual(rawIdx, 'color', color); - // Data is not filtered if (filteredIdx != null) { data.setItemVisual(filteredIdx, 'color', color); } } - else { - // Set data all color for legend - dataAll.setItemVisual(rawIdx, 'color', singleDataColor); + + if (!singleDataBorderColor) { + var borderColor = itemModel.get('itemStyle.borderColor'); + + // Data is not filtered + if (filteredIdx != null) { + data.setItemVisual(filteredIdx, 'borderColor', borderColor); + } } }); } @@ -42082,14 +45281,19 @@ var dataColor = function (seriesType) { // FIXME emphasis label position is not same with normal label position -function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { +var RADIAN$1 = Math.PI / 180; + +function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) { list.sort(function (a, b) { return a.y - b.y; }); - // 压 function shiftDown(start, end, delta, dir) { for (var j = start; j < end; j++) { + if (list[j].y + delta > viewTop + viewHeight) { + break; + } + list[j].y += delta; if (j > start && j + 1 < end @@ -42103,9 +45307,12 @@ function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { shiftUp(end - 1, delta / 2); } - // 弹 function shiftUp(end, delta) { for (var j = end; j >= 0; j--) { + if (list[j].y - delta < viewTop) { + break; + } + list[j].y -= delta; if (j > 0 && list[j].y > list[j - 1].y + list[j - 1].height @@ -42117,18 +45324,18 @@ function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { function changeX(list, isDownList, cx, cy, r, dir) { var lastDeltaX = dir > 0 - ? isDownList // 右侧 - ? Number.MAX_VALUE // 下 - : 0 // 上 - : isDownList // 左侧 - ? Number.MAX_VALUE // 下 - : 0; // 上 + ? isDownList // right-side + ? Number.MAX_VALUE // down + : 0 // up + : isDownList // left-side + ? Number.MAX_VALUE // down + : 0; // up for (var i = 0, l = list.length; i < l; i++) { - // Not change x for center label - if (list[i].position === 'center') { + if (list[i].labelAlignTo !== 'none') { continue; } + var deltaY = Math.abs(list[i].y - cy); var length = list[i].len; var length2 = list[i].len2; @@ -42139,11 +45346,11 @@ function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { ) : Math.abs(list[i].x - cx); if (isDownList && deltaX >= lastDeltaX) { - // 右下,左下 + // right-down, left-down deltaX = lastDeltaX - 10; } if (!isDownList && deltaX <= lastDeltaX) { - // 右上,左上 + // right-up, left-up deltaX = lastDeltaX + 10; } @@ -42158,6 +45365,12 @@ function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { var upList = []; var downList = []; for (var i = 0; i < len; i++) { + if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') { + var dx = list[i].x - farthestX; + list[i].linePoints[1][0] += dx; + list[i].x = farthestX; + } + delta = list[i].y - lastY; if (delta < 0) { shiftDown(i, len, -delta, dir); @@ -42179,43 +45392,101 @@ function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { changeX(downList, true, cx, cy, r, dir); } -function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight) { +function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) { var leftList = []; var rightList = []; + var leftmostX = Number.MAX_VALUE; + var rightmostX = -Number.MAX_VALUE; for (var i = 0; i < labelLayoutList.length; i++) { + if (isPositionCenter(labelLayoutList[i])) { + continue; + } if (labelLayoutList[i].x < cx) { + leftmostX = Math.min(leftmostX, labelLayoutList[i].x); leftList.push(labelLayoutList[i]); } else { + rightmostX = Math.max(rightmostX, labelLayoutList[i].x); rightList.push(labelLayoutList[i]); } } - adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight); - adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight); + adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX); + adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX); for (var i = 0; i < labelLayoutList.length; i++) { - var linePoints = labelLayoutList[i].linePoints; + var layout = labelLayoutList[i]; + if (isPositionCenter(layout)) { + continue; + } + + var linePoints = layout.linePoints; if (linePoints) { + var isAlignToEdge = layout.labelAlignTo === 'edge'; + + var realTextWidth = layout.textRect.width; + var targetTextWidth; + if (isAlignToEdge) { + if (layout.x < cx) { + targetTextWidth = linePoints[2][0] - layout.labelDistance + - viewLeft - layout.labelMargin; + } + else { + targetTextWidth = viewLeft + viewWidth - layout.labelMargin + - linePoints[2][0] - layout.labelDistance; + } + } + else { + if (layout.x < cx) { + targetTextWidth = layout.x - viewLeft - layout.bleedMargin; + } + else { + targetTextWidth = viewLeft + viewWidth - layout.x - layout.bleedMargin; + } + } + if (targetTextWidth < layout.textRect.width) { + layout.text = truncateText(layout.text, targetTextWidth, layout.font); + if (layout.labelAlignTo === 'edge') { + realTextWidth = getWidth(layout.text, layout.font); + } + } + var dist = linePoints[1][0] - linePoints[2][0]; - if (labelLayoutList[i].x < cx) { - linePoints[2][0] = labelLayoutList[i].x + 3; + if (isAlignToEdge) { + if (layout.x < cx) { + linePoints[2][0] = viewLeft + layout.labelMargin + realTextWidth + layout.labelDistance; + } + else { + linePoints[2][0] = viewLeft + viewWidth - layout.labelMargin + - realTextWidth - layout.labelDistance; + } } else { - linePoints[2][0] = labelLayoutList[i].x - 3; + if (layout.x < cx) { + linePoints[2][0] = layout.x + layout.labelDistance; + } + else { + linePoints[2][0] = layout.x - layout.labelDistance; + } + linePoints[1][0] = linePoints[2][0] + dist; } - linePoints[1][1] = linePoints[2][1] = labelLayoutList[i].y; - linePoints[1][0] = linePoints[2][0] + dist; + linePoints[1][1] = linePoints[2][1] = layout.y; } } } -var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { +function isPositionCenter(layout) { + // Not change x for center label + return layout.position === 'center'; +} + +var labelLayout = function (seriesModel, r, viewWidth, viewHeight, viewLeft, viewTop) { var data = seriesModel.getData(); var labelLayoutList = []; var cx; var cy; var hasLabelRotate = false; + var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN$1; data.each(function (idx) { var layout = data.getItemLayout(idx); @@ -42224,10 +45495,21 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis var labelPosition = labelModel.get('position') || itemModel.get('emphasis.label.position'); + var labelDistance = labelModel.get('distanceToLabelLine'); + var labelAlignTo = labelModel.get('alignTo'); + var labelMargin = parsePercent$1(labelModel.get('margin'), viewWidth); + var bleedMargin = labelModel.get('bleedMargin'); + var font = labelModel.getFont(); var labelLineModel = itemModel.getModel('labelLine'); var labelLineLen = labelLineModel.get('length'); + labelLineLen = parsePercent$1(labelLineLen, viewWidth); var labelLineLen2 = labelLineModel.get('length2'); + labelLineLen2 = parsePercent$1(labelLineLen2, viewWidth); + + if (layout.angle < minShowLabelRadian) { + return; + } var midAngle = (layout.startAngle + layout.endAngle) / 2; var dx = Math.cos(midAngle); @@ -42241,6 +45523,12 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { cx = layout.cx; cy = layout.cy; + var text = seriesModel.getFormattedLabel(idx, 'normal') + || data.getName(idx); + var textRect = getBoundingRect( + text, font, textAlign, 'top' + ); + var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner'; if (labelPosition === 'center') { textX = layout.cx; @@ -42261,22 +45549,37 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { var x3 = x2 + ((dx < 0 ? -1 : 1) * labelLineLen2); var y3 = y2; - textX = x3 + (dx < 0 ? -5 : 5); + if (labelAlignTo === 'edge') { + // Adjust textX because text align of edge is opposite + textX = dx < 0 + ? viewLeft + labelMargin + : viewLeft + viewWidth - labelMargin; + } + else { + textX = x3 + (dx < 0 ? -labelDistance : labelDistance); + } textY = y3; linePoints = [[x1, y1], [x2, y2], [x3, y3]]; } - textAlign = isLabelInside ? 'center' : (dx > 0 ? 'left' : 'right'); + textAlign = isLabelInside + ? 'center' + : (labelAlignTo === 'edge' + ? (dx > 0 ? 'right' : 'left') + : (dx > 0 ? 'left' : 'right')); + } + + var labelRotate; + var rotate = labelModel.get('rotate'); + if (typeof rotate === 'number') { + labelRotate = rotate * (Math.PI / 180); + } + else { + labelRotate = rotate + ? (dx < 0 ? -midAngle + Math.PI : -midAngle) + : 0; } - var font = labelModel.getFont(); - var labelRotate = labelModel.get('rotate') - ? (dx < 0 ? -midAngle + Math.PI : -midAngle) : 0; - var text = seriesModel.getFormattedLabel(idx, 'normal') - || data.getName(idx); - var textRect = getBoundingRect( - text, font, textAlign, 'top' - ); hasLabelRotate = !!labelRotate; layout.label = { x: textX, @@ -42289,7 +45592,14 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { textAlign: textAlign, verticalAlign: 'middle', rotation: labelRotate, - inside: isLabelInside + inside: isLabelInside, + labelDistance: labelDistance, + labelAlignTo: labelAlignTo, + labelMargin: labelMargin, + bleedMargin: bleedMargin, + textRect: textRect, + text: text, + font: font }; // Not layout the inside label @@ -42298,7 +45608,7 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { } }); if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) { - avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight); + avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop); } }; @@ -42325,10 +45635,20 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { var PI2$4 = Math.PI * 2; var RADIAN = Math.PI / 180; +function getViewRect(seriesModel, api) { + return getLayoutRect( + seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + } + ); +} + var pieLayout = function (seriesType, ecModel, api, payload) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); + var viewRect = getViewRect(seriesModel, api); var center = seriesModel.get('center'); var radius = seriesModel.get('radius'); @@ -42340,11 +45660,11 @@ var pieLayout = function (seriesType, ecModel, api, payload) { center = [center, center]; } - var width = api.getWidth(); - var height = api.getHeight(); + var width = parsePercent$1(viewRect.width, api.getWidth()); + var height = parsePercent$1(viewRect.height, api.getHeight()); var size = Math.min(width, height); - var cx = parsePercent$1(center[0], width); - var cy = parsePercent$1(center[1], height); + var cx = parsePercent$1(center[0], width) + viewRect.x; + var cy = parsePercent$1(center[1], height) + viewRect.y; var r0 = parsePercent$1(radius[0], size / 2); var r = parsePercent$1(radius[1], size / 2); @@ -42390,7 +45710,8 @@ var pieLayout = function (seriesType, ecModel, api, payload) { r0: r0, r: roseType ? NaN - : r + : r, + viewRect: viewRect }); return; } @@ -42423,7 +45744,8 @@ var pieLayout = function (seriesType, ecModel, api, payload) { r0: r0, r: roseType ? linearMap(value, extent, [r0, r]) - : r + : r, + viewRect: viewRect }); currentAngle = endAngle; @@ -42461,7 +45783,7 @@ var pieLayout = function (seriesType, ecModel, api, payload) { } } - labelLayout(seriesModel, r, width, height); + labelLayout(seriesModel, r, viewRect.width, viewRect.height, viewRect.x, viewRect.y); }); }; @@ -42572,7 +45894,7 @@ SeriesModel.extend({ dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'], getInitialData: function (option, ecModel) { - return createListFromArray(this.getSource(), this); + return createListFromArray(this.getSource(), this, {useEncodeDefaulter: true}); }, brushSelector: 'point', @@ -42632,7 +45954,11 @@ SeriesModel.extend({ itemStyle: { opacity: 0.8 // color: 各异 - } + }, + + // If clip the overflow graphics + // Works on cartesian / polar series + clip: true // progressive: null } @@ -42658,6 +45984,8 @@ SeriesModel.extend({ * under the License. */ +/* global Float32Array */ + // TODO Batch by color var BOOST_SIZE_THRESHOLD = 4; @@ -42670,6 +45998,8 @@ var LargeSymbolPath = extendShape({ symbolProxy: null, + softClipShape: null, + buildPath: function (path, shape) { var points = shape.points; var size = shape.size; @@ -42691,6 +46021,9 @@ var LargeSymbolPath = extendShape({ if (isNaN(x) || isNaN(y)) { continue; } + if (this.softClipShape && !this.softClipShape.contain(x, y)) { + continue; + } symbolProxyShape.x = x - size[0] / 2; symbolProxyShape.y = y - size[1] / 2; @@ -42719,6 +46052,9 @@ var LargeSymbolPath = extendShape({ if (isNaN(x) || isNaN(y)) { continue; } + if (this.softClipShape && !this.softClipShape.contain(x, y)) { + continue; + } // fillRect is faster than building a rect path and draw. // And it support light globalCompositeOperation. ctx.fillRect( @@ -42770,8 +46106,10 @@ largeSymbolProto.isPersistent = function () { /** * Update symbols draw by new data * @param {module:echarts/data/List} data + * @param {Object} opt + * @param {Object} [opt.clipShape] */ -largeSymbolProto.updateData = function (data) { +largeSymbolProto.updateData = function (data, opt) { this.group.removeAll(); var symbolEl = new LargeSymbolPath({ rectHover: true, @@ -42781,7 +46119,7 @@ largeSymbolProto.updateData = function (data) { symbolEl.setShape({ points: data.getLayout('symbolPoints') }); - this._setCommon(symbolEl, data); + this._setCommon(symbolEl, data, false, opt); this.group.add(symbolEl); this._incremental = null; @@ -42822,7 +46160,7 @@ largeSymbolProto.incrementalPrepareUpdate = function (data) { } }; -largeSymbolProto.incrementalUpdate = function (taskParams, data) { +largeSymbolProto.incrementalUpdate = function (taskParams, data, opt) { var symbolEl; if (this._incremental) { symbolEl = new LargeSymbolPath(); @@ -42842,12 +46180,13 @@ largeSymbolProto.incrementalUpdate = function (taskParams, data) { symbolEl.setShape({ points: data.getLayout('symbolPoints') }); - this._setCommon(symbolEl, data, !!this._incremental); + this._setCommon(symbolEl, data, !!this._incremental, opt); }; -largeSymbolProto._setCommon = function (symbolEl, data, isIncremental) { +largeSymbolProto._setCommon = function (symbolEl, data, isIncremental, opt) { var hostModel = data.hostModel; + opt = opt || {}; // TODO // if (data.hasItemVisual.symbolSize) { // // TODO typed array? @@ -42863,6 +46202,7 @@ largeSymbolProto._setCommon = function (symbolEl, data, isIncremental) { symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]); // } + symbolEl.softClipShape = opt.clipShape || null; // Create symbolProxy to build path for each data symbolEl.symbolProxy = createSymbol( data.getVisual('symbol'), 0, 0, 0, 0 @@ -42936,7 +46276,14 @@ extendChartView({ var data = seriesModel.getData(); var symbolDraw = this._updateSymbolDraw(data, seriesModel); - symbolDraw.updateData(data); + + symbolDraw.updateData(data, { + // TODO + // If this parameter should be a shape or a bounding volume + // shape will be more general. + // But bounding volume like bounding rect will be much faster in the contain calculation + clipShape: this._getClipShape(seriesModel) + }); this._finished = true; }, @@ -42951,7 +46298,9 @@ extendChartView({ }, incrementalRender: function (taskParams, seriesModel, ecModel) { - this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData()); + this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), { + clipShape: this._getClipShape(seriesModel) + }); this._finished = taskParams.end === seriesModel.getData().count(); }, @@ -42977,6 +46326,12 @@ extendChartView({ } }, + _getClipShape: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var clipArea = coordSys && coordSys.getArea && coordSys.getArea(); + return seriesModel.get('clip', true) ? clipArea : null; + }, + _updateSymbolDraw: function (data, seriesModel) { var symbolDraw = this._symbolDraw; var pipelineContext = seriesModel.pipelineContext; @@ -43129,7 +46484,8 @@ function Radar(radarModel, ecModel, api) { this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { var dim = 'indicator_' + idx; - var indicatorAxis = new IndicatorAxis(dim, new IntervalScale()); + var indicatorAxis = new IndicatorAxis(dim, + (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()); indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis indicatorAxis.model = indicatorModel; @@ -43209,7 +46565,7 @@ Radar.prototype.pointToData = function (pt) { } } - return [closestAxisIdx, +(closestAxis && closestAxis.coodToData(radius))]; + return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))]; }; Radar.prototype.resize = function (radarModel, api) { @@ -43273,7 +46629,7 @@ Radar.prototype.update = function (ecModel, api) { } // Force all the axis fixing the maxSplitNumber. each$1(indicatorAxes, function (indicatorAxis, idx) { - var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model); + var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent; niceScaleExtent(indicatorAxis.scale, indicatorAxis.model); var axisModel = indicatorAxis.model; @@ -43282,6 +46638,7 @@ Radar.prototype.update = function (ecModel, api) { var fixedMax = axisModel.getMax(); var interval = scale.getInterval(); + if (fixedMin != null && fixedMax != null) { // User set min, max, divide to get new interval scale.setExtent(+fixedMin, +fixedMax); @@ -43317,13 +46674,10 @@ Radar.prototype.update = function (ecModel, api) { if (nicedSplitNumber > splitNumber) { interval = increaseInterval(interval); } - // PENDING - var center = Math.round((rawExtent[0] + rawExtent[1]) / 2 / interval) * interval; - var halfSplitNumber = Math.round(splitNumber / 2); - scale.setExtent( - round$1(center - halfSplitNumber * interval), - round$1(center + (splitNumber - halfSplitNumber) * interval) - ); + // TODO + var max = Math.ceil(rawExtent[1] / interval) * interval; + var min = round$1(max - interval * splitNumber); + scale.setExtent(min, max); scale.setInterval(interval); } }); @@ -43390,6 +46744,7 @@ var RadarModel = extendComponentModel({ var scale = this.get('scale'); var axisLine = this.get('axisLine'); var axisTick = this.get('axisTick'); + var axisType = this.get('axisType'); var axisLabel = this.get('axisLabel'); var nameTextStyle = this.get('name'); var showName = this.get('name.show'); @@ -43406,7 +46761,7 @@ var RadarModel = extendComponentModel({ indicatorOpt.max = 0; } var iNameTextStyle = nameTextStyle; - if(indicatorOpt.color != null) { + if (indicatorOpt.color != null) { iNameTextStyle = defaults({color: indicatorOpt.color}, nameTextStyle); } // Use same configuration @@ -43416,8 +46771,9 @@ var RadarModel = extendComponentModel({ scale: scale, axisLine: axisLine, axisTick: axisTick, + axisType: axisType, axisLabel: axisLabel, - // Competitable with 2 and use text + // Compatible with 2 and use text name: indicatorOpt.text, nameLocation: 'end', nameGap: nameGap, @@ -43493,6 +46849,7 @@ var RadarModel = extendComponentModel({ ), axisLabel: defaultsShow(valueAxisDefault.axisLabel, false), axisTick: defaultsShow(valueAxisDefault.axisTick, false), + axisType: 'interval', splitLine: defaultsShow(valueAxisDefault.splitLine, true), splitArea: defaultsShow(valueAxisDefault.splitArea, true), @@ -43743,9 +47100,10 @@ var RadarSeries = SeriesModel.extend({ // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed - this.legendDataProvider = function () { - return this.getRawData(); - }; + this.legendVisualProvider = new LegendVisualProvider( + bind(this.getData, this), bind(this.getRawData, this) + ); + }, getInitialData: function (option, ecModel) { @@ -43767,6 +47125,28 @@ var RadarSeries = SeriesModel.extend({ }).join('
'); }, + /** + * @implement + */ + getTooltipPosition: function (dataIndex) { + if (dataIndex != null) { + var data = this.getData(); + var coordSys = this.coordinateSystem; + var values = data.getValues( + map(coordSys.dimensions, function (dim) { + return data.mapDimension(dim); + }), dataIndex, true + ); + + for (var i = 0, len = values.length; i < len; i++) { + if (!isNaN(values[i])) { + var indicatorAxes = coordSys.getIndicatorAxes(); + return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i); + } + } + } + }, + defaultOption: { zlevel: 0, z: 2, @@ -43889,6 +47269,7 @@ extendChartView({ points: points } }; + polygon.shape.points = getInitialPoints(points); polyline.shape.points = getInitialPoints(points); initProps(polygon, target, seriesModel, idx); @@ -43916,6 +47297,7 @@ extendChartView({ points: data.getItemLayout(newIdx) } }; + if (!target.shape.points) { return; } @@ -43979,6 +47361,8 @@ extendChartView({ symbolGroup.eachChild(function (symbolPath) { symbolPath.setStyle(itemStyle); symbolPath.hoverStyle = clone(itemHoverStyle); + var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx); + (defaultText == null || isNaN(defaultText)) && (defaultText = ''); setLabelStyle( symbolPath.style, symbolPath.hoverStyle, labelModel, labelHoverModel, @@ -43986,27 +47370,16 @@ extendChartView({ labelFetcher: data.hostModel, labelDataIndex: idx, labelDimIndex: symbolPath.__dimIdx, - defaultText: data.get(data.dimensions[symbolPath.__dimIdx], idx), + defaultText: defaultText, autoColor: color, isRectText: true } ); }); - function onEmphasis() { - polygon.attr('ignore', hoverPolygonIgnore); - } - - function onNormal() { - polygon.attr('ignore', polygonIgnore); - } - - itemGroup.off('mouseover').off('mouseout').off('normal').off('emphasis'); - itemGroup.on('emphasis', onEmphasis) - .on('mouseover', onEmphasis) - .on('normal', onNormal) - .on('mouseout', onNormal); - + itemGroup.highDownOnUpdate = function (fromState, toState) { + polygon.attr('ignore', toState === 'emphasis' ? hoverPolygonIgnore : polygonIgnore); + }; setHoverStyle(itemGroup); }); @@ -44040,7 +47413,6 @@ extendChartView({ * under the License. */ - var radarLayout = function (ecModel) { ecModel.eachSeriesByType('radar', function (seriesModel) { var data = seriesModel.getData(); @@ -44050,23 +47422,43 @@ var radarLayout = function (ecModel) { return; } - function pointsConverter(val, idx) { - points[idx] = points[idx] || []; - points[idx][i] = coordSys.dataToPoint(val, i); - } var axes = coordSys.getIndicatorAxes(); - for (var i = 0; i < axes.length; i++) { - data.each(data.mapDimension(axes[i].dim), pointsConverter); - } + each$1(axes, function (axis, axisIndex) { + data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) { + points[dataIndex] = points[dataIndex] || []; + var point = coordSys.dataToPoint(val, axisIndex); + points[dataIndex][axisIndex] = isValidPoint(point) + ? point : getValueMissingPoint(coordSys); + }); + }); + + // Close polygon data.each(function (idx) { - // Close polygon - points[idx][0] && points[idx].push(points[idx][0].slice()); + // TODO + // Is it appropriate to connect to the next data when some data is missing? + // Or, should trade it like `connectNull` in line chart? + var firstPoint = find(points[idx], function (point) { + return isValidPoint(point); + }) || getValueMissingPoint(coordSys); + + // Copy the first actual point to the end of the array + points[idx].push(firstPoint.slice()); data.setItemLayout(idx, points[idx]); }); }); }; +function isValidPoint(point) { + return !isNaN(point[0]) && !isNaN(point[1]); +} + +function getValueMissingPoint(coordSys) { + // It is error-prone to input [NaN, NaN] into polygon, polygon. + // (probably cause problem when refreshing or animating) + return [coordSys.cx, coordSys.cy]; +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -44164,333 +47556,25 @@ registerPreprocessor(backwardCompat$1); * under the License. */ -/** - * Simple view coordinate system - * Mapping given x, y to transformd view x, y - */ - -var v2ApplyTransform$1 = applyTransform; - -// Dummy transform node -function TransformDummy() { - Transformable.call(this); -} -mixin(TransformDummy, Transformable); - -function View(name) { - /** - * @type {string} - */ - this.name = name; - - /** - * @type {Object} - */ - this.zoomLimit; - - Transformable.call(this); - - this._roamTransformable = new TransformDummy(); - - this._rawTransformable = new TransformDummy(); - - this._center; - this._zoom; -} - -View.prototype = { - - constructor: View, - - type: 'view', - - /** - * @param {Array.} - * @readOnly - */ - dimensions: ['x', 'y'], - - /** - * Set bounding rect - * @param {number} x - * @param {number} y - * @param {number} width - * @param {number} height - */ - - // PENDING to getRect - setBoundingRect: function (x, y, width, height) { - this._rect = new BoundingRect(x, y, width, height); - return this._rect; - }, - - /** - * @return {module:zrender/core/BoundingRect} - */ - // PENDING to getRect - getBoundingRect: function () { - return this._rect; - }, - - /** - * @param {number} x - * @param {number} y - * @param {number} width - * @param {number} height - */ - setViewRect: function (x, y, width, height) { - this.transformTo(x, y, width, height); - this._viewRect = new BoundingRect(x, y, width, height); - }, - - /** - * Transformed to particular position and size - * @param {number} x - * @param {number} y - * @param {number} width - * @param {number} height - */ - transformTo: function (x, y, width, height) { - var rect = this.getBoundingRect(); - var rawTransform = this._rawTransformable; - - rawTransform.transform = rect.calculateTransform( - new BoundingRect(x, y, width, height) - ); - - rawTransform.decomposeTransform(); - - this._updateTransform(); - }, - - /** - * Set center of view - * @param {Array.} [centerCoord] - */ - setCenter: function (centerCoord) { - if (!centerCoord) { - return; - } - this._center = centerCoord; - - this._updateCenterAndZoom(); - }, - - /** - * @param {number} zoom - */ - setZoom: function (zoom) { - zoom = zoom || 1; - - var zoomLimit = this.zoomLimit; - if (zoomLimit) { - if (zoomLimit.max != null) { - zoom = Math.min(zoomLimit.max, zoom); - } - if (zoomLimit.min != null) { - zoom = Math.max(zoomLimit.min, zoom); - } - } - this._zoom = zoom; - - this._updateCenterAndZoom(); - }, - - /** - * Get default center without roam - */ - getDefaultCenter: function () { - // Rect before any transform - var rawRect = this.getBoundingRect(); - var cx = rawRect.x + rawRect.width / 2; - var cy = rawRect.y + rawRect.height / 2; - - return [cx, cy]; - }, - - getCenter: function () { - return this._center || this.getDefaultCenter(); - }, - - getZoom: function () { - return this._zoom || 1; - }, - - /** - * @return {Array.} data - * @param {boolean} noRoam - * @param {Array.} [out] - * @return {Array.} - */ - dataToPoint: function (data, noRoam, out) { - var transform = noRoam ? this._rawTransform : this.transform; - out = out || []; - return transform - ? v2ApplyTransform$1(out, data, transform) - : copy(out, data); - }, - - /** - * Convert a (x, y) point to (lon, lat) data - * @param {Array.} point - * @return {Array.} - */ - pointToData: function (point) { - var invTransform = this.invTransform; - return invTransform - ? v2ApplyTransform$1([], point, invTransform) - : [point[0], point[1]]; - }, - - /** - * @implements - * see {module:echarts/CoodinateSystem} - */ - convertToPixel: curry(doConvert$1, 'dataToPoint'), - - /** - * @implements - * see {module:echarts/CoodinateSystem} - */ - convertFromPixel: curry(doConvert$1, 'pointToData'), - - /** - * @implements - * see {module:echarts/CoodinateSystem} - */ - containPoint: function (point) { - return this.getViewRectAfterRoam().contain(point[0], point[1]); - } - - /** - * @return {number} - */ - // getScalarScale: function () { - // // Use determinant square root of transform to mutiply scalar - // var m = this.transform; - // var det = Math.sqrt(Math.abs(m[0] * m[3] - m[2] * m[1])); - // return det; - // } -}; - -mixin(View, Transformable); - -function doConvert$1(methodName, ecModel, finder, value) { - var seriesModel = finder.seriesModel; - var coordSys = seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. - return coordSys === this ? coordSys[methodName](value) : null; -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - // Fix for 南海诸岛 var geoCoord = [126, 25]; var points$1 = [ - [[0,3.5],[7,11.2],[15,11.9],[30,7],[42,0.7],[52,0.7], - [56,7.7],[59,0.7],[64,0.7],[64,0],[5,0],[0,3.5]], - [[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]], - [[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]], - [[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]], - [[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]], - [[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]], - [[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]], - [[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]], - [[51,35],[51,28.7],[53,28.7],[53,35],[51,35]], - [[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]], - [[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]], - [[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4], - [1,92.4],[1,3.5],[0,3.5]] + [[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], + [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], + [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], + [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], + [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], + [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], + [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], + [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], + [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], + [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], + [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], + [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], + [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], + [1, 92.4], [1, 3.5], [0, 3.5]] ]; for (var i$1 = 0; i$1 < points$1.length; i$1++) { @@ -44537,7 +47621,7 @@ var fixNanhai = function (mapType, regions) { */ var coordsOffsetMap = { - '南海诸岛' : [32, 80], + '南海诸岛': [32, 80], // 全国 '广东': [0, -10], '香港': [10, 5], @@ -44665,9 +47749,10 @@ var geoJSONLoader = { /** * @param {string} mapName * @param {Object} mapRecord {specialAreas, geoJSON} + * @param {string} nameProperty * @return {Object} {regions, boundingRect} */ - load: function (mapName, mapRecord) { + load: function (mapName, mapRecord, nameProperty) { var parsed = inner$7(mapRecord).parsed; @@ -44681,12 +47766,14 @@ var geoJSONLoader = { // https://jsperf.com/try-catch-performance-overhead try { - regions = geoJSON ? parseGeoJson$1(geoJSON) : []; + regions = geoJSON ? parseGeoJson$1(geoJSON, nameProperty) : []; } catch (e) { throw new Error('Invalid geoJson format\n' + e.message); } + fixNanhai(mapName, regions); + each$1(regions, function (region) { var regionName = region.name; @@ -44704,8 +47791,6 @@ var geoJSONLoader = { } }); - fixNanhai(mapName, regions); - return (inner$7(mapRecord).parsed = { regions: regions, boundingRect: getBoundingRect$1(regions) @@ -44889,9 +47974,10 @@ var geoSourceManager = { /** * @param {string} mapName * @param {Object} nameMap + * @param {string} nameProperty * @return {Object} source {regions, regionsMap, nameCoordMap, boundingRect} */ - load: function (mapName, nameMap) { + load: function (mapName, nameMap, nameProperty) { var regions = []; var regionsMap = createHashMap(); var nameCoordMap = createHashMap(); @@ -44899,7 +47985,7 @@ var geoSourceManager = { var mapRecords = retrieveMap(mapName); each$1(mapRecords, function (record) { - var singleSource = loaders[record.type].load(mapName, record); + var singleSource = loaders[record.type].load(mapName, record, nameProperty); each$1(singleSource.regions, function (region) { var regionName = region.name; @@ -44962,7 +48048,7 @@ function makeInvoker(methodName) { function mapNotExistsError(mapName) { if (__DEV__) { console.error( - 'Map ' + mapName + ' not exists. You can download map file on http://echarts.baidu.com/download-map.html' + 'Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.' ); } } @@ -44998,442 +48084,6 @@ function retrieveMap(mapName) { * under the License. */ -/** - * [Geo description] - * For backward compatibility, the orginal interface: - * `name, map, geoJson, specialAreas, nameMap` is kept. - * - * @param {string|Object} name - * @param {string} map Map type - * Specify the positioned areas by left, top, width, height - * @param {Object.} [nameMap] - * Specify name alias - */ -function Geo(name, map$$1, nameMap) { - - View.call(this, name); - - /** - * Map type - * @type {string} - */ - this.map = map$$1; - - var source = geoSourceManager.load(map$$1, nameMap); - - this._nameCoordMap = source.nameCoordMap; - this._regionsMap = source.nameCoordMap; - - /** - * @readOnly - */ - this.regions = source.regions; - - /** - * @type {module:zrender/src/core/BoundingRect} - */ - this._rect = source.boundingRect; -} - -Geo.prototype = { - - constructor: Geo, - - type: 'geo', - - /** - * @param {Array.} - * @readOnly - */ - dimensions: ['lng', 'lat'], - - /** - * If contain given lng,lat coord - * @param {Array.} - * @readOnly - */ - containCoord: function (coord) { - var regions = this.regions; - for (var i = 0; i < regions.length; i++) { - if (regions[i].contain(coord)) { - return true; - } - } - return false; - }, - - /** - * @override - */ - transformTo: function (x, y, width, height) { - var rect = this.getBoundingRect(); - - // FIXME - // Should not name it as invertLng. - var invertLng = this.invertLng; - - rect = rect.clone(); - - if (invertLng) { - // Longitute is inverted - rect.y = -rect.y - rect.height; - } - - var rawTransformable = this._rawTransformable; - - rawTransformable.transform = rect.calculateTransform( - new BoundingRect(x, y, width, height) - ); - - rawTransformable.decomposeTransform(); - - if (invertLng) { - var scale = rawTransformable.scale; - scale[1] = -scale[1]; - } - - rawTransformable.updateTransform(); - - this._updateTransform(); - }, - - /** - * @param {string} name - * @return {module:echarts/coord/geo/Region} - */ - getRegion: function (name) { - return this._regionsMap.get(name); - }, - - getRegionByCoord: function (coord) { - var regions = this.regions; - for (var i = 0; i < regions.length; i++) { - if (regions[i].contain(coord)) { - return regions[i]; - } - } - }, - - /** - * Add geoCoord for indexing by name - * @param {string} name - * @param {Array.} geoCoord - */ - addGeoCoord: function (name, geoCoord) { - this._nameCoordMap.set(name, geoCoord); - }, - - /** - * Get geoCoord by name - * @param {string} name - * @return {Array.} - */ - getGeoCoord: function (name) { - return this._nameCoordMap.get(name); - }, - - /** - * @override - */ - getBoundingRect: function () { - return this._rect; - }, - - /** - * @param {string|Array.} data - * @param {boolean} noRoam - * @param {Array.} [out] - * @return {Array.} - */ - dataToPoint: function (data, noRoam, out) { - if (typeof data === 'string') { - // Map area name to geoCoord - data = this.getGeoCoord(data); - } - if (data) { - return View.prototype.dataToPoint.call(this, data, noRoam, out); - } - }, - - /** - * @override - */ - convertToPixel: curry(doConvert, 'dataToPoint'), - - /** - * @override - */ - convertFromPixel: curry(doConvert, 'pointToData') - -}; - -mixin(Geo, View); - -function doConvert(methodName, ecModel, finder, value) { - var geoModel = finder.geoModel; - var seriesModel = finder.seriesModel; - - var coordSys = geoModel - ? geoModel.coordinateSystem - : seriesModel - ? ( - seriesModel.coordinateSystem // For map. - || (seriesModel.getReferringComponents('geo')[0] || {}).coordinateSystem - ) - : null; - - return coordSys === this ? coordSys[methodName](value) : null; -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -/** - * Resize method bound to the geo - * @param {module:echarts/coord/geo/GeoModel|module:echarts/chart/map/MapModel} geoModel - * @param {module:echarts/ExtensionAPI} api - */ -function resizeGeo(geoModel, api) { - - var boundingCoords = geoModel.get('boundingCoords'); - if (boundingCoords != null) { - var leftTop = boundingCoords[0]; - var rightBottom = boundingCoords[1]; - if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) { - if (__DEV__) { - console.error('Invalid boundingCoords'); - } - } - else { - this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]); - } - } - - var rect = this.getBoundingRect(); - - var boxLayoutOption; - - var center = geoModel.get('layoutCenter'); - var size = geoModel.get('layoutSize'); - - var viewWidth = api.getWidth(); - var viewHeight = api.getHeight(); - - var aspect = rect.width / rect.height * this.aspectScale; - - var useCenterAndSize = false; - - if (center && size) { - center = [ - parsePercent$1(center[0], viewWidth), - parsePercent$1(center[1], viewHeight) - ]; - size = parsePercent$1(size, Math.min(viewWidth, viewHeight)); - - if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { - useCenterAndSize = true; - } - else { - if (__DEV__) { - console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); - } - } - } - - var viewRect; - if (useCenterAndSize) { - var viewRect = {}; - if (aspect > 1) { - // Width is same with size - viewRect.width = size; - viewRect.height = size / aspect; - } - else { - viewRect.height = size; - viewRect.width = size * aspect; - } - viewRect.y = center[1] - viewRect.height / 2; - viewRect.x = center[0] - viewRect.width / 2; - } - else { - // Use left/top/width/height - boxLayoutOption = geoModel.getBoxLayoutParams(); - - // 0.75 rate - boxLayoutOption.aspect = aspect; - - viewRect = getLayoutRect(boxLayoutOption, { - width: viewWidth, - height: viewHeight - }); - } - - this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); - - this.setCenter(geoModel.get('center')); - this.setZoom(geoModel.get('zoom')); -} - -/** - * @param {module:echarts/coord/Geo} geo - * @param {module:echarts/model/Model} model - * @inner - */ -function setGeoCoords(geo, model) { - each$1(model.get('geoCoord'), function (geoCoord, name) { - geo.addGeoCoord(name, geoCoord); - }); -} - -var geoCreator = { - - // For deciding which dimensions to use when creating list data - dimensions: Geo.prototype.dimensions, - - create: function (ecModel, api) { - var geoList = []; - - // FIXME Create each time may be slow - ecModel.eachComponent('geo', function (geoModel, idx) { - var name = geoModel.get('map'); - var geo = new Geo(name + idx, name, geoModel.get('nameMap')); - - geo.zoomLimit = geoModel.get('scaleLimit'); - geoList.push(geo); - - setGeoCoords(geo, geoModel); - - geoModel.coordinateSystem = geo; - geo.model = geoModel; - - // FIXME ??? - var aspectScale = geoModel.get('aspectScale'); - var invertLng = true; - var mapRecords = mapDataStorage.retrieveMap(name); - if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') { - aspectScale == null && (aspectScale = 1); - invertLng = false; - } - else { - aspectScale == null && (aspectScale = 0.75); - } - geo.aspectScale = aspectScale; - geo.invertLng = invertLng; - - // Inject resize method - geo.resize = resizeGeo; - - geo.resize(geoModel, api); - }); - - ecModel.eachSeries(function (seriesModel) { - var coordSys = seriesModel.get('coordinateSystem'); - if (coordSys === 'geo') { - var geoIndex = seriesModel.get('geoIndex') || 0; - seriesModel.coordinateSystem = geoList[geoIndex]; - } - }); - - // If has map series - var mapModelGroupBySeries = {}; - - ecModel.eachSeriesByType('map', function (seriesModel) { - if (!seriesModel.getHostGeoModel()) { - var mapType = seriesModel.getMapType(); - mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; - mapModelGroupBySeries[mapType].push(seriesModel); - } - }); - - each$1(mapModelGroupBySeries, function (mapSeries, mapType) { - var nameMapList = map(mapSeries, function (singleMapSeries) { - return singleMapSeries.get('nameMap'); - }); - var geo = new Geo(mapType, mapType, mergeAll(nameMapList)); - - geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { - return singleMapSeries.get('scaleLimit'); - })); - geoList.push(geo); - - // Inject resize method - geo.resize = resizeGeo; - - geo.resize(mapSeries[0], api); - - each$1(mapSeries, function (singleMapSeries) { - singleMapSeries.coordinateSystem = geo; - - setGeoCoords(geo, singleMapSeries); - }); - }); - - return geoList; - }, - - /** - * Fill given regions array - * @param {Array.} originRegionArr - * @param {string} mapName - * @param {Object} [nameMap] - * @return {Array} - */ - getFilledRegions: function (originRegionArr, mapName, nameMap) { - // Not use the original - var regionsArr = (originRegionArr || []).slice(); - - var dataNameMap = createHashMap(); - for (var i = 0; i < regionsArr.length; i++) { - dataNameMap.set(regionsArr[i].name, regionsArr[i]); - } - - var source = geoSourceManager.load(mapName, nameMap); - each$1(source.regions, function (region) { - var name = region.name; - !dataNameMap.get(name) && regionsArr.push({name: name}); - }); - - return regionsArr; - } -}; - -registerCoordinateSystem('geo', geoCreator); - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - var MapSeries = SeriesModel.extend({ type: 'series.map', @@ -45454,43 +48104,43 @@ var MapSeries = SeriesModel.extend({ */ seriesGroup: [], - init: function (option) { - - // this._fillOption(option, this.getMapType()); - // this.option = option; - - MapSeries.superApply(this, 'init', arguments); - - this.updateSelectedMap(this._createSelectableList()); - }, - getInitialData: function (option) { - return createListSimply(this, ['value']); - }, - - mergeOption: function (newOption) { - // this._fillOption(newOption, this.getMapType()); - - MapSeries.superApply(this, 'mergeOption', arguments); - - this.updateSelectedMap(this._createSelectableList()); - }, - - _createSelectableList: function () { - var data = this.getRawData(); + var data = createListSimply(this, { + coordDimensions: ['value'], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); var valueDim = data.mapDimension('value'); - var targetList = []; + var dataNameMap = createHashMap(); + var selectTargetList = []; + var toAppendNames = []; + for (var i = 0, len = data.count(); i < len; i++) { - targetList.push({ - name: data.getName(i), + var name = data.getName(i); + dataNameMap.set(name, true); + selectTargetList.push({ + name: name, value: data.get(valueDim, i), selected: retrieveRawAttr(data, i, 'selected') }); } - targetList = geoCreator.getFilledRegions(targetList, this.getMapType(), this.option.nameMap); + var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty); + each$1(geoSource.regions, function (region) { + var name = region.name; + if (!dataNameMap.get(name)) { + selectTargetList.push({name: name}); + toAppendNames.push(name); + } + }); - return targetList; + this.updateSelectedMap(selectTargetList); + + // Complete data with missing regions. The consequent processes (like visual + // map and render) can not be performed without a "full data". For example, + // find `dataIndex` by name. + data.appendValues([], toAppendNames); + + return data; }, /** @@ -45508,14 +48158,14 @@ var MapSeries = SeriesModel.extend({ return (this.getHostGeoModel() || this).option.map; }, - _fillOption: function (option, mapName) { + // _fillOption: function (option, mapName) { // Shallow clone // option = zrUtil.extend({}, option); // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap); // return option; - }, + // }, getRawValue: function (dataIndex) { // Use value stored in data instead because it is calculated from multiple series @@ -45664,7 +48314,8 @@ var MapSeries = SeriesModel.extend({ itemStyle: { areaColor: 'rgba(255,215,0,0.8)' } - } + }, + nameProperty: 'name' } }); @@ -45853,7 +48504,7 @@ mixin(RoamController, Eventful); function mousedown(e) { - if (notLeftMouse(e) + if (isMiddleOrRightButtonOnMouseUpDown(e) || (e.target && e.target.draggable) ) { return; @@ -45872,9 +48523,8 @@ function mousedown(e) { } function mousemove(e) { - if (notLeftMouse(e) + if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) - || !this._dragging || e.gestureEvent === 'pinch' || isTaken(this._zr, 'globalPan') ) { @@ -45901,7 +48551,7 @@ function mousemove(e) { } function mouseup(e) { - if (!notLeftMouse(e)) { + if (!isMiddleOrRightButtonOnMouseUpDown(e)) { this._dragging = false; } } @@ -45918,7 +48568,11 @@ function mousewheel(e) { if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) { return; } - // console.log(wheelDelta); + + // If both `shouldZoom` and `shouldMove` is true, trigger + // their event both, and the final behavior is determined + // by event listener themselves. + if (shouldZoom) { // Convenience: // Mac and VM Windows on Mac: scroll up: zoom out. @@ -45935,7 +48589,7 @@ function mousewheel(e) { scale: scale, originX: originX, originY: originY }); } - // console.log(shouldMove); + if (shouldMove) { // FIXME: Should do more test in different environment. var absDelta = Math.abs(wheelDelta); @@ -46114,7 +48768,7 @@ function onIrrelevantElement(e, api, targetCoordSysModel) { * under the License. */ -function getFixedItemStyle(model, scale) { +function getFixedItemStyle(model) { var itemStyle = model.getItemStyle(); var areaColor = model.get('areaColor'); @@ -46270,20 +48924,30 @@ MapDraw.prototype = { var regionsGroup = this._regionsGroup; var group = this.group; - var scale = geo.scale; - var transform = { - position: geo.position, - scale: scale - }; - + var transformInfo = geo.getTransformInfo(); // No animation when first draw or in action - if (!regionsGroup.childAt(0) || payload) { - group.attr(transform); + var isFirstDraw = !regionsGroup.childAt(0) || payload; + var targetScale; + if (isFirstDraw) { + group.transform = transformInfo.roamTransform; + group.decomposeTransform(); + group.dirty(); } else { - updateProps(group, transform, mapOrGeoModel); + var target = new Transformable(); + target.transform = transformInfo.roamTransform; + target.decomposeTransform(); + var props = { + scale: target.scale, + position: target.position + }; + targetScale = target.scale; + updateProps(group, props, mapOrGeoModel); } + var scale = transformInfo.rawScale; + var position = transformInfo.rawPosition; + regionsGroup.removeAll(); var itemStyleAccessPath = ['itemStyle']; @@ -46293,7 +48957,6 @@ MapDraw.prototype = { var nameMap = createHashMap(); each$1(geo.regions, function (region) { - // Consider in GeoJson properties.name may be duplicated, for example, // there is multiple region named "United Kindom" or "France" (so many // colonies). And it is not appropriate to merge them in geo, which @@ -46303,6 +48966,7 @@ MapDraw.prototype = { || nameMap.set(region.name, new Group()); var compoundPath = new CompoundPath({ + segmentIgnoreThreshold: 1, shape: { paths: [] } @@ -46313,8 +48977,8 @@ MapDraw.prototype = { var itemStyleModel = regionModel.getModel(itemStyleAccessPath); var hoverItemStyleModel = regionModel.getModel(hoverItemStyleAccessPath); - var itemStyle = getFixedItemStyle(itemStyleModel, scale); - var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale); + var itemStyle = getFixedItemStyle(itemStyleModel); + var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel); var labelModel = regionModel.getModel(labelAccessPath); var hoverLabelModel = regionModel.getModel(hoverLabelAccessPath); @@ -46333,20 +48997,38 @@ MapDraw.prototype = { } } + var transformPoint = function (point) { + return [ + point[0] * scale[0] + position[0], + point[1] * scale[1] + position[1] + ]; + }; + each$1(region.geometries, function (geometry) { if (geometry.type !== 'polygon') { return; } + var points = []; + for (var i = 0; i < geometry.exterior.length; ++i) { + points.push(transformPoint(geometry.exterior[i])); + } compoundPath.shape.paths.push(new Polygon({ + segmentIgnoreThreshold: 1, shape: { - points: geometry.exterior + points: points } })); - for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); i++) { + for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) { + var interior = geometry.interiors[i]; + var points = []; + for (var j = 0; j < interior.length; ++j) { + points.push(transformPoint(interior[j])); + } compoundPath.shape.paths.push(new Polygon({ + segmentIgnoreThreshold: 1, shape: { - points: geometry.interiors[i] + points: points } })); } @@ -46355,6 +49037,7 @@ MapDraw.prototype = { compoundPath.setStyle(itemStyle); compoundPath.style.strokeNoScale = true; compoundPath.culling = true; + // Label var showLabel = labelModel.get('show'); var hoverShowLabel = hoverLabelModel.get('show'); @@ -46368,7 +49051,7 @@ MapDraw.prototype = { if ( (isGeo || isDataNaN && (showLabel || hoverShowLabel)) || (itemLayout && itemLayout.showLabel) - ) { + ) { var query = !isGeo ? dataIdx : region.name; var labelFetcher; @@ -46378,8 +49061,12 @@ MapDraw.prototype = { } var textEl = new Text({ - position: region.center.slice(), - scale: [1 / scale[0], 1 / scale[1]], + position: transformPoint(region.center.slice()), + // FIXME + // label rotation is not support yet in geo or regions of series-map + // that has no data. The rotation will be effected by this `scale`. + // So needed to change to RectText? + scale: [1 / group.scale[0], 1 / group.scale[1]], z2: 10, silent: true }); @@ -46398,6 +49085,12 @@ MapDraw.prototype = { } ); + if (!isFirstDraw) { + // Text animation + var textScale = [1 / targetScale[0], 1 / targetScale[1]]; + updateProps(textEl, { scale: textScale }, mapOrGeoModel); + } + regionGroup.add(textEl); } @@ -46411,6 +49104,7 @@ MapDraw.prototype = { // Package custom mouse event for geo component compoundPath.eventData = { componentType: 'geo', + componentIndex: mapOrGeoModel.componentIndex, geoIndex: mapOrGeoModel.componentIndex, name: region.name, region: (regionModel && regionModel.option) || {} @@ -46420,11 +49114,8 @@ MapDraw.prototype = { var groupRegions = regionGroup.__regions || (regionGroup.__regions = []); groupRegions.push(region); - setHoverStyle( - regionGroup, - hoverItemStyle, - {hoverSilentOnTouch: !!mapOrGeoModel.get('selectedMode')} - ); + regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); + setHoverStyle(regionGroup, hoverItemStyle); regionsGroup.add(regionGroup); }); @@ -46536,6 +49227,9 @@ MapDraw.prototype = { * under the License. */ +var HIGH_DOWN_PROP = '__seriesMapHighDown'; +var RECORD_VERSION_PROP = '__seriesMapCallKey'; + extendChartView({ type: 'map', @@ -46599,12 +49293,12 @@ extendChartView({ var originalData = mapModel.originalData; var group = this.group; - originalData.each(originalData.mapDimension('value'), function (value, idx) { + originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) { if (isNaN(value)) { return; } - var layout = originalData.getItemLayout(idx); + var layout = originalData.getItemLayout(originalDataIndex); if (!layout || !layout.point) { // Not exists in map @@ -46630,59 +49324,75 @@ extendChartView({ }, silent: true, // Do not overlap the first series, on which labels are displayed. - z2: !offset ? 10 : 8 + z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0) }); - // First data on the same region + // Only the series that has the first value on the same region is in charge of rendering the label. + // But consider the case: + // series: [ + // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]}, + // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]} + // ] + // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`. + // For backward compatibility, we follow the rule that render label `A` by the + // settings on series `X` but render label `C` by the settings on series `Y`. if (!offset) { + var fullData = mapModel.mainSeries.getData(); - var name = originalData.getName(idx); + var name = originalData.getName(originalDataIndex); var fullIndex = fullData.indexOfName(name); - var itemModel = originalData.getItemModel(idx); + var itemModel = originalData.getItemModel(originalDataIndex); var labelModel = itemModel.getModel('label'); var hoverLabelModel = itemModel.getModel('emphasis.label'); - var polygonGroups = fullData.getItemGraphicEl(fullIndex); + var regionGroup = fullData.getItemGraphicEl(fullIndex); + // `getFormattedLabel` needs to use `getData` inside. Here + // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`. + // FIXME + // If this is not the `mainSeries`, the item model (like label formatter) + // set on original data item will never get. But it has been working + // like that from the begining, and this scenario is rarely encountered. + // So it won't be fixed until have to. var normalText = retrieve2( - mapModel.getFormattedLabel(idx, 'normal'), + mapModel.getFormattedLabel(fullIndex, 'normal'), name ); var emphasisText = retrieve2( - mapModel.getFormattedLabel(idx, 'emphasis'), + mapModel.getFormattedLabel(fullIndex, 'emphasis'), normalText ); - var onEmphasis = function () { - var hoverStyle = setTextStyle({}, hoverLabelModel, { - text: hoverLabelModel.get('show') ? emphasisText : null - }, {isRectText: true, useInsideStyle: false}, true); - circle.style.extendFrom(hoverStyle); - // Make label upper than others if overlaps. - circle.__mapOriginalZ2 = circle.z2; - circle.z2 += 1; - }; - - var onNormal = function () { - setTextStyle(circle.style, labelModel, { - text: labelModel.get('show') ? normalText : null, - textPosition: labelModel.getShallow('position') || 'bottom' - }, {isRectText: true, useInsideStyle: false}); - - if (circle.__mapOriginalZ2 != null) { - circle.z2 = circle.__mapOriginalZ2; - circle.__mapOriginalZ2 = null; - } - }; + var highDownRecord = regionGroup[HIGH_DOWN_PROP]; + var recordVersion = Math.random(); + + // Prevent from register listeners duplicatedly when roaming. + if (!highDownRecord) { + highDownRecord = regionGroup[HIGH_DOWN_PROP] = {}; + var onEmphasis = curry(onRegionHighDown, true); + var onNormal = curry(onRegionHighDown, false); + regionGroup.on('mouseover', onEmphasis) + .on('mouseout', onNormal) + .on('emphasis', onEmphasis) + .on('normal', onNormal); + } - polygonGroups.on('mouseover', onEmphasis) - .on('mouseout', onNormal) - .on('emphasis', onEmphasis) - .on('normal', onNormal); + // Prevent removed regions effect current grapics. + regionGroup[RECORD_VERSION_PROP] = recordVersion; + extend(highDownRecord, { + recordVersion: recordVersion, + circle: circle, + labelModel: labelModel, + hoverLabelModel: hoverLabelModel, + emphasisText: emphasisText, + normalText: normalText + }); - onNormal(); + // FIXME + // Consider set option when emphasis. + enterRegionHighDown(highDownRecord, false); } group.add(circle); @@ -46690,6 +49400,45 @@ extendChartView({ } }); +function onRegionHighDown(toHighOrDown) { + var highDownRecord = this[HIGH_DOWN_PROP]; + if (highDownRecord && highDownRecord.recordVersion === this[RECORD_VERSION_PROP]) { + enterRegionHighDown(highDownRecord, toHighOrDown); + } +} + +function enterRegionHighDown(highDownRecord, toHighOrDown) { + var circle = highDownRecord.circle; + var labelModel = highDownRecord.labelModel; + var hoverLabelModel = highDownRecord.hoverLabelModel; + var emphasisText = highDownRecord.emphasisText; + var normalText = highDownRecord.normalText; + + if (toHighOrDown) { + circle.style.extendFrom( + setTextStyle({}, hoverLabelModel, { + text: hoverLabelModel.get('show') ? emphasisText : null + }, {isRectText: true, useInsideStyle: false}, true) + ); + // Make label upper than others if overlaps. + circle.__mapOriginalZ2 = circle.z2; + circle.z2 += Z2_EMPHASIS_LIFT; + } + else { + setTextStyle(circle.style, labelModel, { + text: labelModel.get('show') ? normalText : null, + textPosition: labelModel.getShallow('position') || 'bottom' + }, {isRectText: true, useInsideStyle: false}); + // Trigger normalize style like padding. + circle.dirty(false); + + if (circle.__mapOriginalZ2 != null) { + circle.z2 = circle.__mapOriginalZ2; + circle.__mapOriginalZ2 = null; + } + } +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -46847,263 +49596,303 @@ registerAction({ * under the License. */ -var mapSymbolLayout = function (ecModel) { +/** + * Simple view coordinate system + * Mapping given x, y to transformd view x, y + */ - var processedMapType = {}; +var v2ApplyTransform$1 = applyTransform; - ecModel.eachSeriesByType('map', function (mapSeries) { - var mapType = mapSeries.getMapType(); - if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { - return; - } +// Dummy transform node +function TransformDummy() { + Transformable.call(this); +} +mixin(TransformDummy, Transformable); - var mapSymbolOffsets = {}; +function View(name) { + /** + * @type {string} + */ + this.name = name; - each$1(mapSeries.seriesGroup, function (subMapSeries) { - var geo = subMapSeries.coordinateSystem; - var data = subMapSeries.originalData; - if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { - data.each(data.mapDimension('value'), function (value, idx) { - var name = data.getName(idx); - var region = geo.getRegion(name); + /** + * @type {Object} + */ + this.zoomLimit; - // If input series.data is [11, 22, '-'/null/undefined, 44], - // it will be filled with NaN: [11, 22, NaN, 44] and NaN will - // not be drawn. So here must validate if value is NaN. - if (!region || isNaN(value)) { - return; - } + Transformable.call(this); - var offset = mapSymbolOffsets[name] || 0; + this._roamTransformable = new TransformDummy(); - var point = geo.dataToPoint(region.center); + this._rawTransformable = new TransformDummy(); - mapSymbolOffsets[name] = offset + 1; + this._center; + this._zoom; +} - data.setItemLayout(idx, { - point: point, - offset: offset - }); - }); - } - }); +View.prototype = { - // Show label of those region not has legendSymbol(which is offset 0) - var data = mapSeries.getData(); - data.each(function (idx) { - var name = data.getName(idx); - var layout = data.getItemLayout(idx) || {}; - layout.showLabel = !mapSymbolOffsets[name]; - data.setItemLayout(idx, layout); - }); + constructor: View, - processedMapType[mapType] = true; - }); -}; + type: 'view', -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + /** + * @param {Array.} + * @readOnly + */ + dimensions: ['x', 'y'], + /** + * Set bounding rect + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ -var mapVisual = function (ecModel) { - ecModel.eachSeriesByType('map', function (seriesModel) { - var colorList = seriesModel.get('color'); - var itemStyleModel = seriesModel.getModel('itemStyle'); + // PENDING to getRect + setBoundingRect: function (x, y, width, height) { + this._rect = new BoundingRect(x, y, width, height); + return this._rect; + }, - var areaColor = itemStyleModel.get('areaColor'); - var color = itemStyleModel.get('color') - || colorList[seriesModel.seriesIndex % colorList.length]; + /** + * @return {module:zrender/core/BoundingRect} + */ + // PENDING to getRect + getBoundingRect: function () { + return this._rect; + }, - seriesModel.getData().setVisual({ - 'areaColor': areaColor, - 'color': color - }); - }); -}; + /** + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ + setViewRect: function (x, y, width, height) { + this.transformTo(x, y, width, height); + this._viewRect = new BoundingRect(x, y, width, height); + }, -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + /** + * Transformed to particular position and size + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + */ + transformTo: function (x, y, width, height) { + var rect = this.getBoundingRect(); + var rawTransform = this._rawTransformable; -// FIXME 公用? -/** - * @param {Array.} datas - * @param {string} statisticType 'average' 'sum' - * @inner - */ -function dataStatistics(datas, statisticType) { - var dataNameMap = {}; + rawTransform.transform = rect.calculateTransform( + new BoundingRect(x, y, width, height) + ); - each$1(datas, function (data) { - data.each(data.mapDimension('value'), function (value, idx) { - // Add prefix to avoid conflict with Object.prototype. - var mapKey = 'ec-' + data.getName(idx); - dataNameMap[mapKey] = dataNameMap[mapKey] || []; - if (!isNaN(value)) { - dataNameMap[mapKey].push(value); - } - }); - }); + rawTransform.decomposeTransform(); - return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { - var mapKey = 'ec-' + datas[0].getName(idx); - var sum = 0; - var min = Infinity; - var max = -Infinity; - var len = dataNameMap[mapKey].length; - for (var i = 0; i < len; i++) { - min = Math.min(min, dataNameMap[mapKey][i]); - max = Math.max(max, dataNameMap[mapKey][i]); - sum += dataNameMap[mapKey][i]; - } - var result; - if (statisticType === 'min') { - result = min; - } - else if (statisticType === 'max') { - result = max; - } - else if (statisticType === 'average') { - result = sum / len; - } - else { - result = sum; + this._updateTransform(); + }, + + /** + * Set center of view + * @param {Array.} [centerCoord] + */ + setCenter: function (centerCoord) { + if (!centerCoord) { + return; } - return len === 0 ? NaN : result; - }); -} + this._center = centerCoord; -var mapDataStatistic = function (ecModel) { - var seriesGroups = {}; - ecModel.eachSeriesByType('map', function (seriesModel) { - var hostGeoModel = seriesModel.getHostGeoModel(); - var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); - (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); - }); + this._updateCenterAndZoom(); + }, - each$1(seriesGroups, function (seriesList, key) { - var data = dataStatistics( - map(seriesList, function (seriesModel) { - return seriesModel.getData(); - }), - seriesList[0].get('mapValueCalculation') - ); + /** + * @param {number} zoom + */ + setZoom: function (zoom) { + zoom = zoom || 1; - for (var i = 0; i < seriesList.length; i++) { - seriesList[i].originalData = seriesList[i].getData(); + var zoomLimit = this.zoomLimit; + if (zoomLimit) { + if (zoomLimit.max != null) { + zoom = Math.min(zoomLimit.max, zoom); + } + if (zoomLimit.min != null) { + zoom = Math.max(zoomLimit.min, zoom); + } } + this._zoom = zoom; - // FIXME Put where? - for (var i = 0; i < seriesList.length; i++) { - seriesList[i].seriesGroup = seriesList; - seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); + this._updateCenterAndZoom(); + }, - seriesList[i].setData(data.cloneShallow()); - seriesList[i].mainSeries = seriesList[0]; - } - }); -}; + /** + * Get default center without roam + */ + getDefaultCenter: function () { + // Rect before any transform + var rawRect = this.getBoundingRect(); + var cx = rawRect.x + rawRect.width / 2; + var cy = rawRect.y + rawRect.height / 2; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + return [cx, cy]; + }, -var backwardCompat$2 = function (option) { - // Save geoCoord - var mapSeries = []; - each$1(option.series, function (seriesOpt) { - if (seriesOpt && seriesOpt.type === 'map') { - mapSeries.push(seriesOpt); - seriesOpt.map = seriesOpt.map || seriesOpt.mapType; - // Put x, y, width, height, x2, y2 in the top level - defaults(seriesOpt, seriesOpt.mapLocation); - } - }); -}; + getCenter: function () { + return this._center || this.getDefaultCenter(); + }, -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + getZoom: function () { + return this._zoom || 1; + }, -registerLayout(mapSymbolLayout); -registerVisual(mapVisual); -registerProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); -registerPreprocessor(backwardCompat$2); + /** + * @return {Array.} data + * @param {boolean} noRoam + * @param {Array.} [out] + * @return {Array.} + */ + dataToPoint: function (data, noRoam, out) { + var transform = noRoam ? this._rawTransform : this.transform; + out = out || []; + return transform + ? v2ApplyTransform$1(out, data, transform) + : copy(out, data); + }, + + /** + * Convert a (x, y) point to (lon, lat) data + * @param {Array.} point + * @return {Array.} + */ + pointToData: function (point) { + var invTransform = this.invTransform; + return invTransform + ? v2ApplyTransform$1([], point, invTransform) + : [point[0], point[1]]; + }, + + /** + * @implements + * see {module:echarts/CoodinateSystem} + */ + convertToPixel: curry(doConvert$1, 'dataToPoint'), + + /** + * @implements + * see {module:echarts/CoodinateSystem} + */ + convertFromPixel: curry(doConvert$1, 'pointToData'), + + /** + * @implements + * see {module:echarts/CoodinateSystem} + */ + containPoint: function (point) { + return this.getViewRectAfterRoam().contain(point[0], point[1]); + } + + /** + * @return {number} + */ + // getScalarScale: function () { + // // Use determinant square root of transform to mutiply scalar + // var m = this.transform; + // var det = Math.sqrt(Math.abs(m[0] * m[3] - m[2] * m[1])); + // return det; + // } +}; + +mixin(View, Transformable); + +function doConvert$1(methodName, ecModel, finder, value) { + var seriesModel = finder.seriesModel; + var coordSys = seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. + return coordSys === this ? coordSys[methodName](value) : null; +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -47125,850 +49914,493 @@ createDataSelectAction('map', [{ */ /** - * Link lists and struct (graph or tree) - */ - -var each$7 = each$1; - -var DATAS = '\0__link_datas'; -var MAIN_DATA = '\0__link_mainData'; - -// Caution: -// In most case, either list or its shallow clones (see list.cloneShallow) -// is active in echarts process. So considering heap memory consumption, -// we do not clone tree or graph, but share them among list and its shallow clones. -// But in some rare case, we have to keep old list (like do animation in chart). So -// please take care that both the old list and the new list share the same tree/graph. - -/** - * @param {Object} opt - * @param {module:echarts/data/List} opt.mainData - * @param {Object} [opt.struct] For example, instance of Graph or Tree. - * @param {string} [opt.structAttr] designation: list[structAttr] = struct; - * @param {Object} [opt.datas] {dataType: data}, - * like: {node: nodeList, edge: edgeList}. - * Should contain mainData. - * @param {Object} [opt.datasAttr] {dataType: attr}, - * designation: struct[datasAttr[dataType]] = list; - */ -function linkList(opt) { - var mainData = opt.mainData; - var datas = opt.datas; - - if (!datas) { - datas = {main: mainData}; - opt.datasAttr = {main: 'data'}; - } - opt.datas = opt.mainData = null; - - linkAll(mainData, datas, opt); - - // Porxy data original methods. - each$7(datas, function (data) { - each$7(mainData.TRANSFERABLE_METHODS, function (methodName) { - data.wrapMethod(methodName, curry(transferInjection, opt)); - }); - - }); - - // Beyond transfer, additional features should be added to `cloneShallow`. - mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); - - // Only mainData trigger change, because struct.update may trigger - // another changable methods, which may bring about dead lock. - each$7(mainData.CHANGABLE_METHODS, function (methodName) { - mainData.wrapMethod(methodName, curry(changeInjection, opt)); - }); - - // Make sure datas contains mainData. - assert$1(datas[mainData.dataType] === mainData); -} - -function transferInjection(opt, res) { - if (isMainData(this)) { - // Transfer datas to new main data. - var datas = extend({}, this[DATAS]); - datas[this.dataType] = res; - linkAll(res, datas, opt); - } - else { - // Modify the reference in main data to point newData. - linkSingle(res, this.dataType, this[MAIN_DATA], opt); - } - return res; -} - -function changeInjection(opt, res) { - opt.struct && opt.struct.update(this); - return res; -} - -function cloneShallowInjection(opt, res) { - // cloneShallow, which brings about some fragilities, may be inappropriate - // to be exposed as an API. So for implementation simplicity we can make - // the restriction that cloneShallow of not-mainData should not be invoked - // outside, but only be invoked here. - each$7(res[DATAS], function (data, dataType) { - data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); - }); - return res; -} - -/** - * Supplement method to List. + * [Geo description] + * For backward compatibility, the orginal interface: + * `name, map, geoJson, specialAreas, nameMap` is kept. * - * @public - * @param {string} [dataType] If not specified, return mainData. - * @return {module:echarts/data/List} + * @param {string|Object} name + * @param {string} map Map type + * Specify the positioned areas by left, top, width, height + * @param {Object.} [nameMap] + * Specify name alias + * @param {boolean} [invertLongitute=true] */ -function getLinkedData(dataType) { - var mainData = this[MAIN_DATA]; - return (dataType == null || mainData == null) - ? mainData - : mainData[DATAS][dataType]; -} - -function isMainData(data) { - return data[MAIN_DATA] === data; -} - -function linkAll(mainData, datas, opt) { - mainData[DATAS] = {}; - each$7(datas, function (data, dataType) { - linkSingle(data, dataType, mainData, opt); - }); -} - -function linkSingle(data, dataType, mainData, opt) { - mainData[DATAS][dataType] = data; - data[MAIN_DATA] = mainData; - data.dataType = dataType; - - if (opt.struct) { - data[opt.structAttr] = opt.struct; - opt.struct[opt.datasAttr[dataType]] = data; - } - - // Supplement method. - data.getLinkedData = getLinkedData; -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +function Geo(name, map$$1, nameMap, invertLongitute) { -/** - * Tree data structure - * - * @module echarts/data/Tree - */ + View.call(this, name); -/** - * @constructor module:echarts/data/Tree~TreeNode - * @param {string} name - * @param {module:echarts/data/Tree} hostTree - */ -var TreeNode = function (name, hostTree) { /** + * Map type * @type {string} */ - this.name = name || ''; + this.map = map$$1; - /** - * Depth of node - * - * @type {number} - * @readOnly - */ - this.depth = 0; + var source = geoSourceManager.load(map$$1, nameMap); - /** - * Height of the subtree rooted at this node. - * @type {number} - * @readOnly - */ - this.height = 0; + this._nameCoordMap = source.nameCoordMap; + this._regionsMap = source.regionsMap; + this._invertLongitute = invertLongitute == null ? true : invertLongitute; /** - * @type {module:echarts/data/Tree~TreeNode} * @readOnly */ - this.parentNode = null; + this.regions = source.regions; /** - * Reference to list item. - * Do not persistent dataIndex outside, - * besause it may be changed by list. - * If dataIndex -1, - * this node is logical deleted (filtered) in list. - * - * @type {Object} - * @readOnly + * @type {module:zrender/src/core/BoundingRect} */ - this.dataIndex = -1; + this._rect = source.boundingRect; +} - /** - * @type {Array.} - * @readOnly - */ - this.children = []; +Geo.prototype = { - /** - * @type {Array.} - * @pubilc - */ - this.viewChildren = []; + constructor: Geo, + + type: 'geo', /** - * @type {moduel:echarts/data/Tree} + * @param {Array.} * @readOnly */ - this.hostTree = hostTree; -}; - -TreeNode.prototype = { - - constructor: TreeNode, + dimensions: ['lng', 'lat'], /** - * The node is removed. - * @return {boolean} is removed. + * If contain given lng,lat coord + * @param {Array.} + * @readOnly */ - isRemoved: function () { - return this.dataIndex < 0; + containCoord: function (coord) { + var regions = this.regions; + for (var i = 0; i < regions.length; i++) { + if (regions[i].contain(coord)) { + return true; + } + } + return false; }, /** - * Travel this subtree (include this node). - * Usage: - * node.eachNode(function () { ... }); // preorder - * node.eachNode('preorder', function () { ... }); // preorder - * node.eachNode('postorder', function () { ... }); // postorder - * node.eachNode( - * {order: 'postorder', attr: 'viewChildren'}, - * function () { ... } - * ); // postorder - * - * @param {(Object|string)} options If string, means order. - * @param {string=} options.order 'preorder' or 'postorder' - * @param {string=} options.attr 'children' or 'viewChildren' - * @param {Function} cb If in preorder and return false, - * its subtree will not be visited. - * @param {Object} [context] + * @override */ - eachNode: function (options, cb, context) { - if (typeof options === 'function') { - context = cb; - cb = options; - options = null; - } + transformTo: function (x, y, width, height) { + var rect = this.getBoundingRect(); + var invertLongitute = this._invertLongitute; - options = options || {}; - if (isString(options)) { - options = {order: options}; + rect = rect.clone(); + + if (invertLongitute) { + // Longitute is inverted + rect.y = -rect.y - rect.height; } - var order = options.order || 'preorder'; - var children = this[options.attr || 'children']; + var rawTransformable = this._rawTransformable; - var suppressVisitSub; - order === 'preorder' && (suppressVisitSub = cb.call(context, this)); + rawTransformable.transform = rect.calculateTransform( + new BoundingRect(x, y, width, height) + ); - for (var i = 0; !suppressVisitSub && i < children.length; i++) { - children[i].eachNode(options, cb, context); + rawTransformable.decomposeTransform(); + + if (invertLongitute) { + var scale = rawTransformable.scale; + scale[1] = -scale[1]; } - order === 'postorder' && cb.call(context, this); - }, + rawTransformable.updateTransform(); - /** - * Update depth and height of this subtree. - * - * @param {number} depth - */ - updateDepthAndHeight: function (depth) { - var height = 0; - this.depth = depth; - for (var i = 0; i < this.children.length; i++) { - var child = this.children[i]; - child.updateDepthAndHeight(depth + 1); - if (child.height > height) { - height = child.height; - } - } - this.height = height + 1; + this._updateTransform(); }, /** - * @param {string} id - * @return {module:echarts/data/Tree~TreeNode} + * @param {string} name + * @return {module:echarts/coord/geo/Region} */ - getNodeById: function (id) { - if (this.getId() === id) { - return this; - } - for (var i = 0, children = this.children, len = children.length; i < len; i++) { - var res = children[i].getNodeById(id); - if (res) { - return res; - } - } + getRegion: function (name) { + return this._regionsMap.get(name); }, - /** - * @param {module:echarts/data/Tree~TreeNode} node - * @return {boolean} - */ - contains: function (node) { - if (node === this) { - return true; - } - for (var i = 0, children = this.children, len = children.length; i < len; i++) { - var res = children[i].contains(node); - if (res) { - return res; + getRegionByCoord: function (coord) { + var regions = this.regions; + for (var i = 0; i < regions.length; i++) { + if (regions[i].contain(coord)) { + return regions[i]; } } }, /** - * @param {boolean} includeSelf Default false. - * @return {Array.} order: [root, child, grandchild, ...] - */ - getAncestors: function (includeSelf) { - var ancestors = []; - var node = includeSelf ? this : this.parentNode; - while (node) { - ancestors.push(node); - node = node.parentNode; - } - ancestors.reverse(); - return ancestors; - }, - - /** - * @param {string|Array=} [dimension='value'] Default 'value'. can be 0, 1, 2, 3 - * @return {number} Value. + * Add geoCoord for indexing by name + * @param {string} name + * @param {Array.} geoCoord */ - getValue: function (dimension) { - var data = this.hostTree.data; - return data.get(data.getDimension(dimension || 'value'), this.dataIndex); + addGeoCoord: function (name, geoCoord) { + this._nameCoordMap.set(name, geoCoord); }, /** - * @param {Object} layout - * @param {boolean=} [merge=false] + * Get geoCoord by name + * @param {string} name + * @return {Array.} */ - setLayout: function (layout, merge$$1) { - this.dataIndex >= 0 - && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge$$1); + getGeoCoord: function (name) { + return this._nameCoordMap.get(name); }, /** - * @return {Object} layout + * @override */ - getLayout: function () { - return this.hostTree.data.getItemLayout(this.dataIndex); + getBoundingRect: function () { + return this._rect; }, /** - * @param {string} [path] - * @return {module:echarts/model/Model} + * @param {string|Array.} data + * @param {boolean} noRoam + * @param {Array.} [out] + * @return {Array.} */ - getModel: function (path) { - if (this.dataIndex < 0) { - return; + dataToPoint: function (data, noRoam, out) { + if (typeof data === 'string') { + // Map area name to geoCoord + data = this.getGeoCoord(data); } - var hostTree = this.hostTree; - var itemModel = hostTree.data.getItemModel(this.dataIndex); - var levelModel = this.getLevelModel(); - var leavesModel; - if (!levelModel && (this.children.length === 0 || (this.children.length !== 0 && this.isExpand === false))) { - leavesModel = this.getLeavesModel(); + if (data) { + return View.prototype.dataToPoint.call(this, data, noRoam, out); } - return itemModel.getModel(path, (levelModel || leavesModel || hostTree.hostModel).getModel(path)); }, /** - * @return {module:echarts/model/Model} + * @override */ - getLevelModel: function () { - return (this.hostTree.levelModels || [])[this.depth]; - }, + convertToPixel: curry(doConvert, 'dataToPoint'), /** - * @return {module:echarts/model/Model} + * @override */ - getLeavesModel: function () { - return this.hostTree.leavesModel; - }, + convertFromPixel: curry(doConvert, 'pointToData') - /** - * @example - * setItemVisual('color', color); - * setItemVisual({ - * 'color': color - * }); - */ - setVisual: function (key, value) { - this.dataIndex >= 0 - && this.hostTree.data.setItemVisual(this.dataIndex, key, value); - }, +}; - /** - * Get item visual - */ - getVisual: function (key, ignoreParent) { - return this.hostTree.data.getItemVisual(this.dataIndex, key, ignoreParent); - }, +mixin(Geo, View); - /** - * @public - * @return {number} - */ - getRawIndex: function () { - return this.hostTree.data.getRawIndex(this.dataIndex); - }, +function doConvert(methodName, ecModel, finder, value) { + var geoModel = finder.geoModel; + var seriesModel = finder.seriesModel; - /** - * @public - * @return {string} - */ - getId: function () { - return this.hostTree.data.getId(this.dataIndex); - }, + var coordSys = geoModel + ? geoModel.coordinateSystem + : seriesModel + ? ( + seriesModel.coordinateSystem // For map. + || (seriesModel.getReferringComponents('geo')[0] || {}).coordinateSystem + ) + : null; - /** - * if this is an ancestor of another node - * - * @public - * @param {TreeNode} node another node - * @return {boolean} if is ancestor - */ - isAncestorOf: function (node) { - var parent = node.parentNode; - while (parent) { - if (parent === this) { - return true; - } - parent = parent.parentNode; - } - return false; - }, + return coordSys === this ? coordSys[methodName](value) : null; +} - /** - * if this is an descendant of another node - * - * @public - * @param {TreeNode} node another node - * @return {boolean} if is descendant - */ - isDescendantOf: function (node) { - return node !== this && node.isAncestorOf(this); - } -}; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ /** - * @constructor - * @alias module:echarts/data/Tree - * @param {module:echarts/model/Model} hostModel - * @param {Array.} levelOptions - * @param {Object} leavesOption + * Resize method bound to the geo + * @param {module:echarts/coord/geo/GeoModel|module:echarts/chart/map/MapModel} geoModel + * @param {module:echarts/ExtensionAPI} api */ -function Tree(hostModel, levelOptions, leavesOption) { - /** - * @type {module:echarts/data/Tree~TreeNode} - * @readOnly - */ - this.root; - - /** - * @type {module:echarts/data/List} - * @readOnly - */ - this.data; +function resizeGeo(geoModel, api) { - /** - * Index of each item is the same as the raw index of coresponding list item. - * @private - * @type {Array.} treeOptions.levels - * @param {Array.} treeOptions.leaves - * @return module:echarts/data/Tree - */ -Tree.createTree = function (dataRoot, hostModel, treeOptions) { + var rect = this.getBoundingRect(); - var tree = new Tree(hostModel, treeOptions.levels, treeOptions.leaves); - var listData = []; - var dimMax = 1; + var boxLayoutOption; - buildHierarchy(dataRoot); + var center = geoModel.get('layoutCenter'); + var size = geoModel.get('layoutSize'); - function buildHierarchy(dataNode, parentNode) { - var value = dataNode.value; - dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); + var viewWidth = api.getWidth(); + var viewHeight = api.getHeight(); - listData.push(dataNode); + var aspect = rect.width / rect.height * this.aspectScale; - var node = new TreeNode(dataNode.name, tree); - parentNode - ? addChild(node, parentNode) - : (tree.root = node); + var useCenterAndSize = false; - tree._nodes.push(node); + if (center && size) { + center = [ + parsePercent$1(center[0], viewWidth), + parsePercent$1(center[1], viewHeight) + ]; + size = parsePercent$1(size, Math.min(viewWidth, viewHeight)); - var children = dataNode.children; - if (children) { - for (var i = 0; i < children.length; i++) { - buildHierarchy(children[i], node); + if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { + useCenterAndSize = true; + } + else { + if (__DEV__) { + console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); } } } - tree.root.updateDepthAndHeight(0); - - var dimensionsInfo = createDimensions(listData, { - coordDimensions: ['value'], - dimensionsCount: dimMax - }); + var viewRect; + if (useCenterAndSize) { + var viewRect = {}; + if (aspect > 1) { + // Width is same with size + viewRect.width = size; + viewRect.height = size / aspect; + } + else { + viewRect.height = size; + viewRect.width = size * aspect; + } + viewRect.y = center[1] - viewRect.height / 2; + viewRect.x = center[0] - viewRect.width / 2; + } + else { + // Use left/top/width/height + boxLayoutOption = geoModel.getBoxLayoutParams(); - var list = new List(dimensionsInfo, hostModel); - list.initData(listData); + // 0.75 rate + boxLayoutOption.aspect = aspect; - linkList({ - mainData: list, - struct: tree, - structAttr: 'tree' - }); + viewRect = getLayoutRect(boxLayoutOption, { + width: viewWidth, + height: viewHeight + }); + } - tree.update(); + this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); - return tree; -}; + this.setCenter(geoModel.get('center')); + this.setZoom(geoModel.get('zoom')); +} /** - * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote, - * so this function is not ready and not necessary to be public. - * - * @param {(module:echarts/data/Tree~TreeNode|Object)} child + * @param {module:echarts/coord/Geo} geo + * @param {module:echarts/model/Model} model + * @inner */ -function addChild(child, node) { - var children = node.children; - if (child.parentNode === node) { - return; - } - - children.push(child); - child.parentNode = node; +function setGeoCoords(geo, model) { + each$1(model.get('geoCoord'), function (geoCoord, name) { + geo.addGeoCoord(name, geoCoord); + }); } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +var geoCreator = { -/** - * @file Create data struct and define tree view's series model - * @author Deqing Li(annong035@gmail.com) - */ + // For deciding which dimensions to use when creating list data + dimensions: Geo.prototype.dimensions, -SeriesModel.extend({ + create: function (ecModel, api) { + var geoList = []; - type: 'series.tree', + // FIXME Create each time may be slow + ecModel.eachComponent('geo', function (geoModel, idx) { + var name = geoModel.get('map'); - layoutInfo: null, + var aspectScale = geoModel.get('aspectScale'); + var invertLongitute = true; + var mapRecords = mapDataStorage.retrieveMap(name); + if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') { + aspectScale == null && (aspectScale = 1); + invertLongitute = false; + } + else { + aspectScale == null && (aspectScale = 0.75); + } - // can support the position parameters 'left', 'top','right','bottom', 'width', - // 'height' in the setOption() with 'merge' mode normal. - layoutMode: 'box', + var geo = new Geo(name + idx, name, geoModel.get('nameMap'), invertLongitute); - /** - * Init a tree data structure from data in option series - * @param {Object} option the object used to config echarts view - * @return {module:echarts/data/List} storage initial data - */ - getInitialData: function (option) { + geo.aspectScale = aspectScale; + geo.zoomLimit = geoModel.get('scaleLimit'); + geoList.push(geo); - //create an virtual root - var root = {name: option.name, children: option.data}; + setGeoCoords(geo, geoModel); - var leaves = option.leaves || {}; + geoModel.coordinateSystem = geo; + geo.model = geoModel; - var treeOption = {}; + // Inject resize method + geo.resize = resizeGeo; - treeOption.leaves = leaves; + geo.resize(geoModel, api); + }); - var tree = Tree.createTree(root, this, treeOption); + ecModel.eachSeries(function (seriesModel) { + var coordSys = seriesModel.get('coordinateSystem'); + if (coordSys === 'geo') { + var geoIndex = seriesModel.get('geoIndex') || 0; + seriesModel.coordinateSystem = geoList[geoIndex]; + } + }); - var treeDepth = 0; + // If has map series + var mapModelGroupBySeries = {}; - tree.eachNode('preorder', function (node) { - if (node.depth > treeDepth) { - treeDepth = node.depth; + ecModel.eachSeriesByType('map', function (seriesModel) { + if (!seriesModel.getHostGeoModel()) { + var mapType = seriesModel.getMapType(); + mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; + mapModelGroupBySeries[mapType].push(seriesModel); } }); - var expandAndCollapse = option.expandAndCollapse; - var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0) - ? option.initialTreeDepth : treeDepth; + each$1(mapModelGroupBySeries, function (mapSeries, mapType) { + var nameMapList = map(mapSeries, function (singleMapSeries) { + return singleMapSeries.get('nameMap'); + }); + var geo = new Geo(mapType, mapType, mergeAll(nameMapList)); - tree.root.eachNode('preorder', function (node) { - var item = node.hostTree.data.getRawDataItem(node.dataIndex); - // Add item.collapsed != null, because users can collapse node original in the series.data. - node.isExpand = (item && item.collapsed != null) - ? !item.collapsed - : node.depth <= expandTreeDepth; - }); + geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { + return singleMapSeries.get('scaleLimit'); + })); + geoList.push(geo); - return tree.data; - }, + // Inject resize method + geo.resize = resizeGeo; + geo.aspectScale = mapSeries[0].get('aspectScale'); - /** - * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. - * @returns {string} orient - */ - getOrient: function () { - var orient = this.get('orient'); - if (orient === 'horizontal') { - orient = 'LR'; - } - else if (orient === 'vertical') { - orient = 'TB'; - } - return orient; - }, + geo.resize(mapSeries[0], api); - setZoom: function (zoom) { - this.option.zoom = zoom; - }, + each$1(mapSeries, function (singleMapSeries) { + singleMapSeries.coordinateSystem = geo; - setCenter: function (center) { - this.option.center = center; + setGeoCoords(geo, singleMapSeries); + }); + }); + + return geoList; }, /** - * @override - * @param {number} dataIndex + * Fill given regions array + * @param {Array.} originRegionArr + * @param {string} mapName + * @param {Object} [nameMap] + * @return {Array} */ - formatTooltip: function (dataIndex) { - var tree = this.getData().tree; - var realRoot = tree.root.children[0]; - var node = tree.getNodeByDataIndex(dataIndex); - var value = node.getValue(); - var name = node.name; - while (node && (node !== realRoot)) { - name = node.parentNode.name + '.' + name; - node = node.parentNode; + getFilledRegions: function (originRegionArr, mapName, nameMap) { + // Not use the original + var regionsArr = (originRegionArr || []).slice(); + + var dataNameMap = createHashMap(); + for (var i = 0; i < regionsArr.length; i++) { + dataNameMap.set(regionsArr[i].name, regionsArr[i]); } - return encodeHTML(name + ( - (isNaN(value) || value == null) ? '' : ' : ' + value - )); - }, - defaultOption: { - zlevel: 0, - z: 2, - coordinateSystem: 'view', - - // the position of the whole view - left: '12%', - top: '12%', - right: '12%', - bottom: '12%', + var source = geoSourceManager.load(mapName, nameMap); + each$1(source.regions, function (region) { + var name = region.name; + !dataNameMap.get(name) && regionsArr.push({name: name}); + }); - // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' - layout: 'orthogonal', + return regionsArr; + } +}; - roam: false, - // Symbol size scale ratio in roam - nodeScaleRatio: 0.4, +registerCoordinateSystem('geo', geoCreator); - // Default on center of graph - center: null, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - zoom: 1, +var mapSymbolLayout = function (ecModel) { - // The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'. - // and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'. - orient: 'LR', + var processedMapType = {}; - symbol: 'emptyCircle', + ecModel.eachSeriesByType('map', function (mapSeries) { + var mapType = mapSeries.getMapType(); + if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { + return; + } - symbolSize: 7, + var mapSymbolOffsets = {}; - expandAndCollapse: true, + each$1(mapSeries.seriesGroup, function (subMapSeries) { + var geo = subMapSeries.coordinateSystem; + var data = subMapSeries.originalData; + if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { + data.each(data.mapDimension('value'), function (value, idx) { + var name = data.getName(idx); + var region = geo.getRegion(name); - initialTreeDepth: 2, + // If input series.data is [11, 22, '-'/null/undefined, 44], + // it will be filled with NaN: [11, 22, NaN, 44] and NaN will + // not be drawn. So here must validate if value is NaN. + if (!region || isNaN(value)) { + return; + } - lineStyle: { - color: '#ccc', - width: 1.5, - curveness: 0.5 - }, + var offset = mapSymbolOffsets[name] || 0; - itemStyle: { - color: 'lightsteelblue', - borderColor: '#c23531', - borderWidth: 1.5 - }, + var point = geo.dataToPoint(region.center); - label: { - show: true, - color: '#555' - }, + mapSymbolOffsets[name] = offset + 1; - leaves: { - label: { - show: true + data.setItemLayout(idx, { + point: point, + offset: offset + }); + }); } - }, - - animationEasing: 'linear', + }); - animationDuration: 700, + // Show label of those region not has legendSymbol(which is offset 0) + var data = mapSeries.getData(); + data.each(function (idx) { + var name = data.getName(idx); + var layout = data.getItemLayout(idx) || {}; + layout.showLabel = !mapSymbolOffsets[name]; + data.setItemLayout(idx, layout); + }); - animationDurationUpdate: 1000 - } -}); + processedMapType[mapType] = true; + }); +}; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -47989,265 +50421,337 @@ SeriesModel.extend({ * under the License. */ -/* -* The tree layout implementation references to d3.js -* (https://github.com/d3/d3-hierarchy). The use of the source -* code of this file is also subject to the terms and consitions -* of its license (BSD-3Clause, see ). -*/ -/** - * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing - * the tree. - * @see https://github.com/d3/d3-hierarchy - */ +var mapVisual = function (ecModel) { + ecModel.eachSeriesByType('map', function (seriesModel) { + var colorList = seriesModel.get('color'); + var itemStyleModel = seriesModel.getModel('itemStyle'); -/** - * Initialize all computational message for following algorithm - * @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree - */ -function init$2(root) { - root.hierNode = { - defaultAncestor: null, - ancestor: root, - prelim: 0, - modifier: 0, - change: 0, - shift: 0, - i: 0, - thread: null - }; + var areaColor = itemStyleModel.get('areaColor'); + var color = itemStyleModel.get('color') + || colorList[seriesModel.seriesIndex % colorList.length]; - var nodes = [root]; - var node; - var children; + seriesModel.getData().setVisual({ + 'areaColor': areaColor, + 'color': color + }); + }); +}; - while (node = nodes.pop()) { // jshint ignore:line - children = node.children; - if (node.isExpand && children.length) { - var n = children.length; - for (var i = n - 1; i >= 0; i--) { - var child = children[i]; - child.hierNode = { - defaultAncestor: null, - ancestor: child, - prelim: 0, - modifier: 0, - change: 0, - shift: 0, - i: i, - thread: null - }; - nodes.push(child); - } - } - } -} +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +// FIXME 公用? /** - * Computes a preliminary x coordinate for node. Before that, this function is - * applied recursively to the children of node, as well as the function - * apportion(). After spacing out the children by calling executeShifts(), the - * node is placed to the midpoint of its outermost children. - * @param {module:echarts/data/Tree~TreeNode} node - * @param {Function} separation + * @param {Array.} datas + * @param {string} statisticType 'average' 'sum' + * @inner */ -function firstWalk(node, separation) { - var children = node.isExpand ? node.children : []; - var siblings = node.parentNode.children; - var subtreeW = node.hierNode.i ? siblings[node.hierNode.i -1] : null; - if (children.length) { - executeShifts(node); - var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; - if (subtreeW) { - node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); - node.hierNode.modifier = node.hierNode.prelim - midPoint; +function dataStatistics(datas, statisticType) { + var dataNameMap = {}; + + each$1(datas, function (data) { + data.each(data.mapDimension('value'), function (value, idx) { + // Add prefix to avoid conflict with Object.prototype. + var mapKey = 'ec-' + data.getName(idx); + dataNameMap[mapKey] = dataNameMap[mapKey] || []; + if (!isNaN(value)) { + dataNameMap[mapKey].push(value); + } + }); + }); + + return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { + var mapKey = 'ec-' + datas[0].getName(idx); + var sum = 0; + var min = Infinity; + var max = -Infinity; + var len = dataNameMap[mapKey].length; + for (var i = 0; i < len; i++) { + min = Math.min(min, dataNameMap[mapKey][i]); + max = Math.max(max, dataNameMap[mapKey][i]); + sum += dataNameMap[mapKey][i]; + } + var result; + if (statisticType === 'min') { + result = min; + } + else if (statisticType === 'max') { + result = max; + } + else if (statisticType === 'average') { + result = sum / len; } else { - node.hierNode.prelim = midPoint; + result = sum; } - } - else if (subtreeW) { - node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); - } - node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation); + return len === 0 ? NaN : result; + }); } +var mapDataStatistic = function (ecModel) { + var seriesGroups = {}; + ecModel.eachSeriesByType('map', function (seriesModel) { + var hostGeoModel = seriesModel.getHostGeoModel(); + var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); + (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); + }); -/** - * Computes all real x-coordinates by summing up the modifiers recursively. - * @param {module:echarts/data/Tree~TreeNode} node - */ -function secondWalk(node) { - var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; - node.setLayout({x: nodeX}, true); - node.hierNode.modifier += node.parentNode.hierNode.modifier; -} + each$1(seriesGroups, function (seriesList, key) { + var data = dataStatistics( + map(seriesList, function (seriesModel) { + return seriesModel.getData(); + }), + seriesList[0].get('mapValueCalculation') + ); + for (var i = 0; i < seriesList.length; i++) { + seriesList[i].originalData = seriesList[i].getData(); + } -function separation(cb) { - return arguments.length ? cb : defaultSeparation; -} + // FIXME Put where? + for (var i = 0; i < seriesList.length; i++) { + seriesList[i].seriesGroup = seriesList; + seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); -/** - * Transform the common coordinate to radial coordinate - * @param {number} x - * @param {number} y - * @return {Object} - */ -function radialCoordinate(x, y) { - var radialCoor = {}; - x -= Math.PI / 2; - radialCoor.x = y * Math.cos(x); - radialCoor.y = y * Math.sin(x); - return radialCoor; -} + seriesList[i].setData(data.cloneShallow()); + seriesList[i].mainSeries = seriesList[0]; + } + }); +}; -/** - * Get the layout position of the whole view - * @param {module:echarts/model/Series} seriesModel the model object of sankey series - * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call - * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view - */ -function getViewRect(seriesModel, api) { - return getLayoutRect( - seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var backwardCompat$2 = function (option) { + // Save geoCoord + var mapSeries = []; + each$1(option.series, function (seriesOpt) { + if (seriesOpt && seriesOpt.type === 'map') { + mapSeries.push(seriesOpt); + seriesOpt.map = seriesOpt.map || seriesOpt.mapType; + // Put x, y, width, height, x2, y2 in the top level + defaults(seriesOpt, seriesOpt.mapLocation); } - ); -} + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +registerLayout(mapSymbolLayout); +registerVisual(mapVisual); +registerProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); +registerPreprocessor(backwardCompat$2); + +createDataSelectAction('map', [{ + type: 'mapToggleSelect', + event: 'mapselectchanged', + method: 'toggleSelected' +}, { + type: 'mapSelect', + event: 'mapselected', + method: 'select' +}, { + type: 'mapUnSelect', + event: 'mapunselected', + method: 'unSelect' +}]); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ /** - * All other shifts, applied to the smaller subtrees between w- and w+, are - * performed by this function. - * @param {module:echarts/data/Tree~TreeNode} node + * Link lists and struct (graph or tree) */ -function executeShifts(node) { - var children = node.children; - var n = children.length; - var shift = 0; - var change = 0; - while (--n >= 0) { - var child = children[n]; - child.hierNode.prelim += shift; - child.hierNode.modifier += shift; - change += child.hierNode.change; - shift += child.hierNode.shift + change; - } -} + +var each$7 = each$1; + +var DATAS = '\0__link_datas'; +var MAIN_DATA = '\0__link_mainData'; + +// Caution: +// In most case, either list or its shallow clones (see list.cloneShallow) +// is active in echarts process. So considering heap memory consumption, +// we do not clone tree or graph, but share them among list and its shallow clones. +// But in some rare case, we have to keep old list (like do animation in chart). So +// please take care that both the old list and the new list share the same tree/graph. /** - * The core of the algorithm. Here, a new subtree is combined with the - * previous subtrees. Threads are used to traverse the inside and outside - * contours of the left and right subtree up to the highest common level. - * Whenever two nodes of the inside contours conflict, we compute the left - * one of the greatest uncommon ancestors using the function nextAncestor() - * and call moveSubtree() to shift the subtree and prepare the shifts of - * smaller subtrees. Finally, we add a new thread (if necessary). - * @param {module:echarts/data/Tree~TreeNode} subtreeV - * @param {module:echarts/data/Tree~TreeNode} subtreeW - * @param {module:echarts/data/Tree~TreeNode} ancestor - * @param {Function} separation - * @return {module:echarts/data/Tree~TreeNode} + * @param {Object} opt + * @param {module:echarts/data/List} opt.mainData + * @param {Object} [opt.struct] For example, instance of Graph or Tree. + * @param {string} [opt.structAttr] designation: list[structAttr] = struct; + * @param {Object} [opt.datas] {dataType: data}, + * like: {node: nodeList, edge: edgeList}. + * Should contain mainData. + * @param {Object} [opt.datasAttr] {dataType: attr}, + * designation: struct[datasAttr[dataType]] = list; */ -function apportion(subtreeV, subtreeW, ancestor, separation) { +function linkList(opt) { + var mainData = opt.mainData; + var datas = opt.datas; - if (subtreeW) { - var nodeOutRight = subtreeV; - var nodeInRight = subtreeV; - var nodeOutLeft = nodeInRight.parentNode.children[0]; - var nodeInLeft = subtreeW; + if (!datas) { + datas = {main: mainData}; + opt.datasAttr = {main: 'data'}; + } + opt.datas = opt.mainData = null; - var sumOutRight = nodeOutRight.hierNode.modifier; - var sumInRight = nodeInRight.hierNode.modifier; - var sumOutLeft = nodeOutLeft.hierNode.modifier; - var sumInLeft = nodeInLeft.hierNode.modifier; + linkAll(mainData, datas, opt); - while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { - nodeOutRight = nextRight(nodeOutRight); - nodeOutLeft = nextLeft(nodeOutLeft); - nodeOutRight.hierNode.ancestor = subtreeV; - var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - - sumInRight + separation(nodeInLeft, nodeInRight); - if (shift > 0) { - moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); - sumInRight += shift; - sumOutRight += shift; - } - sumInLeft += nodeInLeft.hierNode.modifier; - sumInRight += nodeInRight.hierNode.modifier; - sumOutRight += nodeOutRight.hierNode.modifier; - sumOutLeft += nodeOutLeft.hierNode.modifier; - } - if (nodeInLeft && !nextRight(nodeOutRight)) { - nodeOutRight.hierNode.thread = nodeInLeft; - nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; + // Porxy data original methods. + each$7(datas, function (data) { + each$7(mainData.TRANSFERABLE_METHODS, function (methodName) { + data.wrapMethod(methodName, curry(transferInjection, opt)); + }); - } - if (nodeInRight && !nextLeft(nodeOutLeft)) { - nodeOutLeft.hierNode.thread = nodeInRight; - nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; - ancestor = subtreeV; - } + }); + + // Beyond transfer, additional features should be added to `cloneShallow`. + mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); + + // Only mainData trigger change, because struct.update may trigger + // another changable methods, which may bring about dead lock. + each$7(mainData.CHANGABLE_METHODS, function (methodName) { + mainData.wrapMethod(methodName, curry(changeInjection, opt)); + }); + + // Make sure datas contains mainData. + assert$1(datas[mainData.dataType] === mainData); +} + +function transferInjection(opt, res) { + if (isMainData(this)) { + // Transfer datas to new main data. + var datas = extend({}, this[DATAS]); + datas[this.dataType] = res; + linkAll(res, datas, opt); } - return ancestor; + else { + // Modify the reference in main data to point newData. + linkSingle(res, this.dataType, this[MAIN_DATA], opt); + } + return res; } -/** - * This function is used to traverse the right contour of a subtree. - * It returns the rightmost child of node or the thread of node. The function - * returns null if and only if node is on the highest depth of its subtree. - * @param {module:echarts/data/Tree~TreeNode} node - * @return {module:echarts/data/Tree~TreeNode} - */ -function nextRight(node) { - var children = node.children; - return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; +function changeInjection(opt, res) { + opt.struct && opt.struct.update(this); + return res; } -/** - * This function is used to traverse the left contour of a subtree (or a subforest). - * It returns the leftmost child of node or the thread of node. The function - * returns null if and only if node is on the highest depth of its subtree. - * @param {module:echarts/data/Tree~TreeNode} node - * @return {module:echarts/data/Tree~TreeNode} - */ -function nextLeft(node) { - var children = node.children; - return children.length && node.isExpand ? children[0] : node.hierNode.thread; +function cloneShallowInjection(opt, res) { + // cloneShallow, which brings about some fragilities, may be inappropriate + // to be exposed as an API. So for implementation simplicity we can make + // the restriction that cloneShallow of not-mainData should not be invoked + // outside, but only be invoked here. + each$7(res[DATAS], function (data, dataType) { + data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); + }); + return res; } /** - * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor. - * Otherwise, returns the specified ancestor. - * @param {module:echarts/data/Tree~TreeNode} nodeInLeft - * @param {module:echarts/data/Tree~TreeNode} node - * @param {module:echarts/data/Tree~TreeNode} ancestor - * @return {module:echarts/data/Tree~TreeNode} + * Supplement method to List. + * + * @public + * @param {string} [dataType] If not specified, return mainData. + * @return {module:echarts/data/List} */ -function nextAncestor(nodeInLeft, node, ancestor) { - return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode - ? nodeInLeft.hierNode.ancestor : ancestor; +function getLinkedData(dataType) { + var mainData = this[MAIN_DATA]; + return (dataType == null || mainData == null) + ? mainData + : mainData[DATAS][dataType]; } -/** - * Shifts the current subtree rooted at wr. This is done by increasing prelim(w+) and modifier(w+) by shift. - * @param {module:echarts/data/Tree~TreeNode} wl - * @param {module:echarts/data/Tree~TreeNode} wr - * @param {number} shift [description] - */ -function moveSubtree(wl, wr, shift) { - var change = shift / (wr.hierNode.i - wl.hierNode.i); - wr.hierNode.change -= change; - wr.hierNode.shift += shift; - wr.hierNode.modifier += shift; - wr.hierNode.prelim += shift; - wl.hierNode.change += change; +function isMainData(data) { + return data[MAIN_DATA] === data; } -function defaultSeparation(node1, node2) { - return node1.parentNode === node2.parentNode ? 1 : 2; +function linkAll(mainData, datas, opt) { + mainData[DATAS] = {}; + each$7(datas, function (data, dataType) { + linkSingle(data, dataType, mainData, opt); + }); +} + +function linkSingle(data, dataType, mainData, opt) { + mainData[DATAS][dataType] = data; + data[MAIN_DATA] = mainData; + data.dataType = dataType; + + if (opt.struct) { + data[opt.structAttr] = opt.struct; + opt.struct[opt.datasAttr[dataType]] = data; + } + + // Supplement method. + data.getLinkedData = getLinkedData; } /* @@ -48270,469 +50774,513 @@ function defaultSeparation(node1, node2) { */ /** - * @file This file used to draw tree view. - * @author Deqing Li(annong035@gmail.com) + * Tree data structure + * + * @module echarts/data/Tree */ -extendChartView({ +/** + * @constructor module:echarts/data/Tree~TreeNode + * @param {string} name + * @param {module:echarts/data/Tree} hostTree + */ +var TreeNode = function (name, hostTree) { + /** + * @type {string} + */ + this.name = name || ''; - type: 'tree', + /** + * Depth of node + * + * @type {number} + * @readOnly + */ + this.depth = 0; /** - * Init the chart - * @override - * @param {module:echarts/model/Global} ecModel - * @param {module:echarts/ExtensionAPI} api + * Height of the subtree rooted at this node. + * @type {number} + * @readOnly */ - init: function (ecModel, api) { + this.height = 0; - /** - * @private - * @type {module:echarts/data/Tree} - */ - this._oldTree; - - /** - * @private - * @type {module:zrender/container/Group} - */ - this._mainGroup = new Group(); + /** + * @type {module:echarts/data/Tree~TreeNode} + * @readOnly + */ + this.parentNode = null; - /** - * @private - * @type {module:echarts/componet/helper/RoamController} - */ - this._controller = new RoamController(api.getZr()); + /** + * Reference to list item. + * Do not persistent dataIndex outside, + * besause it may be changed by list. + * If dataIndex -1, + * this node is logical deleted (filtered) in list. + * + * @type {Object} + * @readOnly + */ + this.dataIndex = -1; - this._controllerHost = {target: this.group}; + /** + * @type {Array.} + * @readOnly + */ + this.children = []; - this.group.add(this._mainGroup); - }, + /** + * @type {Array.} + * @pubilc + */ + this.viewChildren = []; - render: function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); + /** + * @type {moduel:echarts/data/Tree} + * @readOnly + */ + this.hostTree = hostTree; +}; - var layoutInfo = seriesModel.layoutInfo; +TreeNode.prototype = { - var group = this._mainGroup; + constructor: TreeNode, - var layout = seriesModel.get('layout'); + /** + * The node is removed. + * @return {boolean} is removed. + */ + isRemoved: function () { + return this.dataIndex < 0; + }, - if (layout === 'radial') { - group.attr('position', [layoutInfo.x + layoutInfo.width / 2, layoutInfo.y + layoutInfo.height / 2]); - } - else { - group.attr('position', [layoutInfo.x, layoutInfo.y]); + /** + * Travel this subtree (include this node). + * Usage: + * node.eachNode(function () { ... }); // preorder + * node.eachNode('preorder', function () { ... }); // preorder + * node.eachNode('postorder', function () { ... }); // postorder + * node.eachNode( + * {order: 'postorder', attr: 'viewChildren'}, + * function () { ... } + * ); // postorder + * + * @param {(Object|string)} options If string, means order. + * @param {string=} options.order 'preorder' or 'postorder' + * @param {string=} options.attr 'children' or 'viewChildren' + * @param {Function} cb If in preorder and return false, + * its subtree will not be visited. + * @param {Object} [context] + */ + eachNode: function (options, cb, context) { + if (typeof options === 'function') { + context = cb; + cb = options; + options = null; } - this._updateViewCoordSys(seriesModel); - this._updateController(seriesModel, ecModel, api); - - var oldData = this._data; + options = options || {}; + if (isString(options)) { + options = {order: options}; + } - var seriesScope = { - expandAndCollapse: seriesModel.get('expandAndCollapse'), - layout: layout, - orient: seriesModel.getOrient(), - curvature: seriesModel.get('lineStyle.curveness'), - symbolRotate: seriesModel.get('symbolRotate'), - symbolOffset: seriesModel.get('symbolOffset'), - hoverAnimation: seriesModel.get('hoverAnimation'), - useNameLabel: true, - fadeIn: true - }; + var order = options.order || 'preorder'; + var children = this[options.attr || 'children']; - data.diff(oldData) - .add(function (newIdx) { - if (symbolNeedsDraw$1(data, newIdx)) { - // Create node and edge - updateNode(data, newIdx, null, group, seriesModel, seriesScope); - } - }) - .update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - if (!symbolNeedsDraw$1(data, newIdx)) { - symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); - return; - } - // Update node and edge - updateNode(data, newIdx, symbolEl, group, seriesModel, seriesScope); - }) - .remove(function (oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - // When remove a collapsed node of subtree, since the collapsed - // node haven't been initialized with a symbol element, - // you can't found it's symbol element through index. - // so if we want to remove the symbol element we should insure - // that the symbol element is not null. - if (symbolEl) { - removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); - } - }) - .execute(); + var suppressVisitSub; + order === 'preorder' && (suppressVisitSub = cb.call(context, this)); - this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); + for (var i = 0; !suppressVisitSub && i < children.length; i++) { + children[i].eachNode(options, cb, context); + } - this._updateNodeAndLinkScale(seriesModel); + order === 'postorder' && cb.call(context, this); + }, - if (seriesScope.expandAndCollapse === true) { - data.eachItemGraphicEl(function (el, dataIndex) { - el.off('click').on('click', function () { - api.dispatchAction({ - type: 'treeExpandAndCollapse', - seriesId: seriesModel.id, - dataIndex: dataIndex - }); - }); - }); + /** + * Update depth and height of this subtree. + * + * @param {number} depth + */ + updateDepthAndHeight: function (depth) { + var height = 0; + this.depth = depth; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.updateDepthAndHeight(depth + 1); + if (child.height > height) { + height = child.height; + } } - this._data = data; + this.height = height + 1; }, - _updateViewCoordSys: function (seriesModel) { - var data = seriesModel.getData(); - var points = []; - data.each(function (idx) { - var layout = data.getItemLayout(idx); - if (layout && !isNaN(layout.x) && !isNaN(layout.y)) { - points.push([+layout.x, +layout.y]); - } - }); - var min = []; - var max = []; - fromPoints(points, min, max); - // If width or height is 0 - if (max[0] - min[0] === 0) { - max[0] += 1; - min[0] -= 1; + /** + * @param {string} id + * @return {module:echarts/data/Tree~TreeNode} + */ + getNodeById: function (id) { + if (this.getId() === id) { + return this; } - if (max[1] - min[1] === 0) { - max[1] += 1; - min[1] -= 1; + for (var i = 0, children = this.children, len = children.length; i < len; i++) { + var res = children[i].getNodeById(id); + if (res) { + return res; + } } + }, - var viewCoordSys = seriesModel.coordinateSystem = new View(); - viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); - - viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); - - viewCoordSys.setCenter(seriesModel.get('center')); - viewCoordSys.setZoom(seriesModel.get('zoom')); - - // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group - this.group.attr({ - position: viewCoordSys.position, - scale: viewCoordSys.scale - }); + /** + * @param {module:echarts/data/Tree~TreeNode} node + * @return {boolean} + */ + contains: function (node) { + if (node === this) { + return true; + } + for (var i = 0, children = this.children, len = children.length; i < len; i++) { + var res = children[i].contains(node); + if (res) { + return res; + } + } + }, - this._viewCoordSys = viewCoordSys; + /** + * @param {boolean} includeSelf Default false. + * @return {Array.} order: [root, child, grandchild, ...] + */ + getAncestors: function (includeSelf) { + var ancestors = []; + var node = includeSelf ? this : this.parentNode; + while (node) { + ancestors.push(node); + node = node.parentNode; + } + ancestors.reverse(); + return ancestors; }, - _updateController: function (seriesModel, ecModel, api) { - var controller = this._controller; - var controllerHost = this._controllerHost; - var group = this.group; - controller.setPointerChecker(function (e, x, y) { - var rect = group.getBoundingRect(); - rect.applyTransform(group.transform); - return rect.contain(x, y) - && !onIrrelevantElement(e, api, seriesModel); - }); + /** + * @param {string|Array=} [dimension='value'] Default 'value'. can be 0, 1, 2, 3 + * @return {number} Value. + */ + getValue: function (dimension) { + var data = this.hostTree.data; + return data.get(data.getDimension(dimension || 'value'), this.dataIndex); + }, - controller.enable(seriesModel.get('roam')); - controllerHost.zoomLimit = seriesModel.get('scaleLimit'); - controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + /** + * @param {Object} layout + * @param {boolean=} [merge=false] + */ + setLayout: function (layout, merge$$1) { + this.dataIndex >= 0 + && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge$$1); + }, - controller - .off('pan') - .off('zoom') - .on('pan', function (e) { - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'treeRoam', - dx: e.dx, - dy: e.dy - }); - }, this) - .on('zoom', function (e) { - updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'treeRoam', - zoom: e.scale, - originX: e.originX, - originY: e.originY - }); - this._updateNodeAndLinkScale(seriesModel); - }, this); + /** + * @return {Object} layout + */ + getLayout: function () { + return this.hostTree.data.getItemLayout(this.dataIndex); }, - _updateNodeAndLinkScale: function (seriesModel) { - var data = seriesModel.getData(); + /** + * @param {string} [path] + * @return {module:echarts/model/Model} + */ + getModel: function (path) { + if (this.dataIndex < 0) { + return; + } + var hostTree = this.hostTree; + var itemModel = hostTree.data.getItemModel(this.dataIndex); + var levelModel = this.getLevelModel(); - var nodeScale = this._getNodeGlobalScale(seriesModel); - var invScale = [nodeScale, nodeScale]; + // FIXME: refactor levelModel to "beforeLink", and remove levelModel here. + if (levelModel) { + return itemModel.getModel(path, levelModel.getModel(path)); + } + else { + return itemModel.getModel(path); + } + }, - data.eachItemGraphicEl(function (el, idx) { - el.attr('scale', invScale); - }); + /** + * @return {module:echarts/model/Model} + */ + getLevelModel: function () { + return (this.hostTree.levelModels || [])[this.depth]; }, - _getNodeGlobalScale: function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys.type !== 'view') { - return 1; - } + /** + * @example + * setItemVisual('color', color); + * setItemVisual({ + * 'color': color + * }); + */ + setVisual: function (key, value) { + this.dataIndex >= 0 + && this.hostTree.data.setItemVisual(this.dataIndex, key, value); + }, - var nodeScaleRatio = this._nodeScaleRatio; + /** + * Get item visual + */ + getVisual: function (key, ignoreParent) { + return this.hostTree.data.getItemVisual(this.dataIndex, key, ignoreParent); + }, - var groupScale = coordSys.scale; - var groupZoom = (groupScale && groupScale[0]) || 1; - // Scale node when zoom changes - var roamZoom = coordSys.getZoom(); - var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + /** + * @public + * @return {number} + */ + getRawIndex: function () { + return this.hostTree.data.getRawIndex(this.dataIndex); + }, - return nodeScale / groupZoom; + /** + * @public + * @return {string} + */ + getId: function () { + return this.hostTree.data.getId(this.dataIndex); }, - dispose: function () { - this._controller && this._controller.dispose(); - this._controllerHost = {}; + /** + * if this is an ancestor of another node + * + * @public + * @param {TreeNode} node another node + * @return {boolean} if is ancestor + */ + isAncestorOf: function (node) { + var parent = node.parentNode; + while (parent) { + if (parent === this) { + return true; + } + parent = parent.parentNode; + } + return false; }, - remove: function () { - this._mainGroup.removeAll(); - this._data = null; + /** + * if this is an descendant of another node + * + * @public + * @param {TreeNode} node another node + * @return {boolean} if is descendant + */ + isDescendantOf: function (node) { + return node !== this && node.isAncestorOf(this); } +}; -}); +/** + * @constructor + * @alias module:echarts/data/Tree + * @param {module:echarts/model/Model} hostModel + * @param {Array.} levelOptions + */ +function Tree(hostModel, levelOptions) { + /** + * @type {module:echarts/data/Tree~TreeNode} + * @readOnly + */ + this.root; -function symbolNeedsDraw$1(data, dataIndex) { - var layout = data.getItemLayout(dataIndex); + /** + * @type {module:echarts/data/List} + * @readOnly + */ + this.data; - return layout - && !isNaN(layout.x) && !isNaN(layout.y) - && data.getItemVisual(dataIndex, 'symbol') !== 'none'; -} + /** + * Index of each item is the same as the raw index of coresponding list item. + * @private + * @type {Array. rootLayout.x; - if (!isLeft) { - rad = rad - Math.PI; - } - } + + for (var i = 0, len = data.count(); i < len; i++) { + nodes[data.getRawIndex(i)].dataIndex = i; } + }, - var textPosition = isLeft ? 'left' : 'right'; - symbolPath.setStyle({ - textPosition: textPosition, - textRotation: -rad, - textOrigin: 'center', - verticalAlign: 'middle' - }); + /** + * Clear all layouts + */ + clearLayouts: function () { + this.data.clearItemLayouts(); } +}; - if (node.parentNode && node.parentNode !== virtualRoot) { - var edge = symbolEl.__edge; - if (!edge) { - edge = symbolEl.__edge = new BezierCurve({ - shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout), - style: defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle) - }); - } +/** + * data node format: + * { + * name: ... + * value: ... + * children: [ + * { + * name: ... + * value: ... + * children: ... + * }, + * ... + * ] + * } + * + * @static + * @param {Object} dataRoot Root node. + * @param {module:echarts/model/Model} hostModel + * @param {Object} treeOptions + * @param {Array.} treeOptions.levels + * @return module:echarts/data/Tree + */ +Tree.createTree = function (dataRoot, hostModel, treeOptions, beforeLink) { - updateProps(edge, { - shape: getEdgeShape(seriesScope, sourceLayout, targetLayout), - style: {opacity: 1} - }, seriesModel); + var tree = new Tree(hostModel, treeOptions && treeOptions.levels); + var listData = []; + var dimMax = 1; - group.add(edge); - } -} + buildHierarchy(dataRoot); -function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { - var node = data.tree.getNodeByDataIndex(dataIndex); - var virtualRoot = data.tree.root; - var itemModel = node.getModel(); - var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); + function buildHierarchy(dataNode, parentNode) { + var value = dataNode.value; + dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); - var source = node.parentNode === virtualRoot ? node : node.parentNode || node; - var sourceLayout; - while (sourceLayout = source.getLayout(), sourceLayout == null) { - source = source.parentNode === virtualRoot ? source : source.parentNode || source; - } + listData.push(dataNode); - updateProps(symbolEl, { - position: [sourceLayout.x + 1, sourceLayout.y + 1] - }, seriesModel, function () { - group.remove(symbolEl); - data.setItemGraphicEl(dataIndex, null); - }); + var node = new TreeNode(dataNode.name, tree); + parentNode + ? addChild(node, parentNode) + : (tree.root = node); - symbolEl.fadeOut(null, {keepLabel: true}); + tree._nodes.push(node); - var edge = symbolEl.__edge; - if (edge) { - updateProps(edge, { - shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout), - style: { - opacity: 0 + var children = dataNode.children; + if (children) { + for (var i = 0; i < children.length; i++) { + buildHierarchy(children[i], node); } - }, seriesModel, function () { - group.remove(edge); - }); + } } -} -function getEdgeShape(seriesScope, sourceLayout, targetLayout) { - var cpx1; - var cpy1; - var cpx2; - var cpy2; - var orient = seriesScope.orient; + tree.root.updateDepthAndHeight(0); - if (seriesScope.layout === 'radial') { - var x1 = sourceLayout.rawX; - var y1 = sourceLayout.rawY; - var x2 = targetLayout.rawX; - var y2 = targetLayout.rawY; + var dimensionsInfo = createDimensions(listData, { + coordDimensions: ['value'], + dimensionsCount: dimMax + }); - var radialCoor1 = radialCoordinate(x1, y1); - var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * seriesScope.curvature); - var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * seriesScope.curvature); - var radialCoor4 = radialCoordinate(x2, y2); + var list = new List(dimensionsInfo, hostModel); + list.initData(listData); - return { - x1: radialCoor1.x, - y1: radialCoor1.y, - x2: radialCoor4.x, - y2: radialCoor4.y, - cpx1: radialCoor2.x, - cpy1: radialCoor2.y, - cpx2: radialCoor3.x, - cpy2: radialCoor3.y - }; - } - else { - var x1 = sourceLayout.x; - var y1 = sourceLayout.y; - var x2 = targetLayout.x; - var y2 = targetLayout.y; + beforeLink && beforeLink(list); - if (orient === 'LR' || orient === 'RL') { - cpx1 = x1 + (x2 - x1) * seriesScope.curvature; - cpy1 = y1; - cpx2 = x2 + (x1 - x2) * seriesScope.curvature; - cpy2 = y2; - } - if (orient === 'TB' || orient === 'BT') { - cpx1 = x1; - cpy1 = y1 + (y2 - y1) * seriesScope.curvature; - cpx2 = x2; - cpy2 = y2 + (y1 - y2) * seriesScope.curvature; - } - return { - x1: x1, - y1: y1, - x2: x2, - y2: y2, - cpx1: cpx1, - cpy1: cpy1, - cpx2: cpx2, - cpy2: cpy2 - }; + linkList({ + mainData: list, + struct: tree, + structAttr: 'tree' + }); + + tree.update(); + + return tree; +}; + +/** + * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote, + * so this function is not ready and not necessary to be public. + * + * @param {(module:echarts/data/Tree~TreeNode|Object)} child + */ +function addChild(child, node) { + var children = node.children; + if (child.parentNode === node) { + return; } + + children.push(child); + child.parentNode = node; } /* @@ -48754,44 +51302,177 @@ function getEdgeShape(seriesScope, sourceLayout, targetLayout) { * under the License. */ -/** - * @file Register the actions of the tree - * @author Deqing Li(annong035@gmail.com) - */ +SeriesModel.extend({ -registerAction({ - type: 'treeExpandAndCollapse', - event: 'treeExpandAndCollapse', - update: 'update' -}, function (payload, ecModel) { - ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { - var dataIndex = payload.dataIndex; - var tree = seriesModel.getData().tree; + type: 'series.tree', + + layoutInfo: null, + + // can support the position parameters 'left', 'top','right','bottom', 'width', + // 'height' in the setOption() with 'merge' mode normal. + layoutMode: 'box', + + /** + * Init a tree data structure from data in option series + * @param {Object} option the object used to config echarts view + * @return {module:echarts/data/List} storage initial data + */ + getInitialData: function (option) { + + //create an virtual root + var root = {name: option.name, children: option.data}; + + var leaves = option.leaves || {}; + var leavesModel = new Model(leaves, this, this.ecModel); + + var tree = Tree.createTree(root, this, {}, beforeLink); + + function beforeLink(nodeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + var node = tree.getNodeByDataIndex(idx); + if (!node.children.length || !node.isExpand) { + model.parentModel = leavesModel; + } + return model; + }); + } + + var treeDepth = 0; + + tree.eachNode('preorder', function (node) { + if (node.depth > treeDepth) { + treeDepth = node.depth; + } + }); + + var expandAndCollapse = option.expandAndCollapse; + var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0) + ? option.initialTreeDepth : treeDepth; + + tree.root.eachNode('preorder', function (node) { + var item = node.hostTree.data.getRawDataItem(node.dataIndex); + // Add item.collapsed != null, because users can collapse node original in the series.data. + node.isExpand = (item && item.collapsed != null) + ? !item.collapsed + : node.depth <= expandTreeDepth; + }); + + return tree.data; + }, + + /** + * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. + * @returns {string} orient + */ + getOrient: function () { + var orient = this.get('orient'); + if (orient === 'horizontal') { + orient = 'LR'; + } + else if (orient === 'vertical') { + orient = 'TB'; + } + return orient; + }, + + setZoom: function (zoom) { + this.option.zoom = zoom; + }, + + setCenter: function (center) { + this.option.center = center; + }, + + /** + * @override + * @param {number} dataIndex + */ + formatTooltip: function (dataIndex) { + var tree = this.getData().tree; + var realRoot = tree.root.children[0]; var node = tree.getNodeByDataIndex(dataIndex); - node.isExpand = !node.isExpand; + var value = node.getValue(); + var name = node.name; + while (node && (node !== realRoot)) { + name = node.parentNode.name + '.' + name; + node = node.parentNode; + } + return encodeHTML(name + ( + (isNaN(value) || value == null) ? '' : ' : ' + value + )); + }, - }); -}); + defaultOption: { + zlevel: 0, + z: 2, + coordinateSystem: 'view', -registerAction({ - type: 'treeRoam', - event: 'treeRoam', - // Here we set 'none' instead of 'update', because roam action - // just need to update the transform matrix without having to recalculate - // the layout. So don't need to go through the whole update process, such - // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. - update: 'none' -}, function (payload, ecModel) { - ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var res = updateCenterAndZoom(coordSys, payload); + // the position of the whole view + left: '12%', + top: '12%', + right: '12%', + bottom: '12%', - seriesModel.setCenter - && seriesModel.setCenter(res.center); - - seriesModel.setZoom - && seriesModel.setZoom(res.zoom); - }); + // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' + layout: 'orthogonal', + + // value can be 'polyline' + edgeShape: 'curve', + + edgeForkPosition: '50%', + + // true | false | 'move' | 'scale', see module:component/helper/RoamController. + roam: false, + + // Symbol size scale ratio in roam + nodeScaleRatio: 0.4, + + // Default on center of graph + center: null, + + zoom: 1, + + // The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'. + // and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'. + orient: 'LR', + + symbol: 'emptyCircle', + + symbolSize: 7, + + expandAndCollapse: true, + + initialTreeDepth: 2, + + lineStyle: { + color: '#ccc', + width: 1.5, + curveness: 0.5 + }, + + itemStyle: { + color: 'lightsteelblue', + borderColor: '#c23531', + borderWidth: 1.5 + }, + + label: { + show: true, + color: '#555' + }, + + leaves: { + label: { + show: true + } + }, + + animationEasing: 'linear', + + animationDuration: 700, + + animationDurationUpdate: 1000 + } }); /* @@ -48813,264 +51494,316 @@ registerAction({ * under the License. */ +/* +* A third-party license is embeded for some of the code in this file: +* The tree layoutHelper implementation was originally copied from +* "d3.js"(https://github.com/d3/d3-hierarchy) with +* some modifications made for this project. +* (see more details in the comment of the specific method below.) +* The use of the source code of this file is also subject to the terms +* and consitions of the licence of "d3.js" (BSD-3Clause, see +* ). +*/ + +/** + * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing + * the tree. + */ /** - * Traverse the tree from bottom to top and do something - * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree - * @param {Function} callback + * Initialize all computational message for following algorithm. + * + * @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree. */ -function eachAfter (root, callback, separation) { +function init$2(root) { + root.hierNode = { + defaultAncestor: null, + ancestor: root, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: 0, + thread: null + }; + var nodes = [root]; - var next = []; var node; + var children; while (node = nodes.pop()) { // jshint ignore:line - next.push(node); - if (node.isExpand) { - var children = node.children; - if (children.length) { - for (var i = 0; i < children.length; i++) { - nodes.push(children[i]); - } + children = node.children; + if (node.isExpand && children.length) { + var n = children.length; + for (var i = n - 1; i >= 0; i--) { + var child = children[i]; + child.hierNode = { + defaultAncestor: null, + ancestor: child, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: i, + thread: null + }; + nodes.push(child); } } } - - while (node = next.pop()) { // jshint ignore:line - callback(node, separation); - } } /** - * Traverse the tree from top to bottom and do something - * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree - * @param {Function} callback + * The implementation of this function was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + * + * Computes a preliminary x coordinate for node. Before that, this function is + * applied recursively to the children of node, as well as the function + * apportion(). After spacing out the children by calling executeShifts(), the + * node is placed to the midpoint of its outermost children. + * + * @param {module:echarts/data/Tree~TreeNode} node + * @param {Function} separation */ -function eachBefore (root, callback) { - var nodes = [root]; - var node; - while (node = nodes.pop()) { // jshint ignore:line - callback(node); - if (node.isExpand) { - var children = node.children; - if (children.length) { - for (var i = children.length - 1; i >= 0; i--) { - nodes.push(children[i]); - } - } +function firstWalk(node, separation) { + var children = node.isExpand ? node.children : []; + var siblings = node.parentNode.children; + var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null; + if (children.length) { + executeShifts(node); + var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; + if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + node.hierNode.modifier = node.hierNode.prelim - midPoint; + } + else { + node.hierNode.prelim = midPoint; } } + else if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + } + node.parentNode.hierNode.defaultAncestor = apportion( + node, + subtreeW, + node.parentNode.hierNode.defaultAncestor || siblings[0], + separation + ); } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -var treeLayout = function (ecModel, api) { - ecModel.eachSeriesByType('tree', function (seriesModel) { - commonLayout(seriesModel, api); - }); -}; - -function commonLayout(seriesModel, api) { - var layoutInfo = getViewRect(seriesModel, api); - seriesModel.layoutInfo = layoutInfo; - var layout = seriesModel.get('layout'); - var width = 0; - var height = 0; - var separation$$1 = null; - - if (layout === 'radial') { - width = 2 * Math.PI; - height = Math.min(layoutInfo.height, layoutInfo.width) / 2; - separation$$1 = separation(function (node1, node2) { - return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; - }); - } - else { - width = layoutInfo.width; - height = layoutInfo.height; - separation$$1 = separation(); - } +/** + * The implementation of this function was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + * + * Computes all real x-coordinates by summing up the modifiers recursively. + * + * @param {module:echarts/data/Tree~TreeNode} node + */ +function secondWalk(node) { + var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; + node.setLayout({x: nodeX}, true); + node.hierNode.modifier += node.parentNode.hierNode.modifier; +} - var virtualRoot = seriesModel.getData().tree.root; - var realRoot = virtualRoot.children[0]; - if (realRoot) { - init$2(virtualRoot); - eachAfter(realRoot, firstWalk, separation$$1); - virtualRoot.hierNode.modifier = - realRoot.hierNode.prelim; - eachBefore(realRoot, secondWalk); +function separation(cb) { + return arguments.length ? cb : defaultSeparation; +} - var left = realRoot; - var right = realRoot; - var bottom = realRoot; - eachBefore(realRoot, function (node) { - var x = node.getLayout().x; - if (x < left.getLayout().x) { - left = node; - } - if (x > right.getLayout().x) { - right = node; - } - if (node.depth > bottom.depth) { - bottom = node; - } - }); +/** + * Transform the common coordinate to radial coordinate. + * + * @param {number} x + * @param {number} y + * @return {Object} + */ +function radialCoordinate(x, y) { + var radialCoor = {}; + x -= Math.PI / 2; + radialCoor.x = y * Math.cos(x); + radialCoor.y = y * Math.sin(x); + return radialCoor; +} - var delta = left === right ? 1 : separation$$1(left, right) / 2; - var tx = delta - left.getLayout().x; - var kx = 0; - var ky = 0; - var coorX = 0; - var coorY = 0; - if (layout === 'radial') { - kx = width / (right.getLayout().x + delta + tx); - // here we use (node.depth - 1), bucause the real root's depth is 1 - ky = height / ((bottom.depth - 1) || 1); - eachBefore(realRoot, function (node) { - coorX = (node.getLayout().x + tx) * kx; - coorY = (node.depth - 1) * ky; - var finalCoor = radialCoordinate(coorX, coorY); - node.setLayout({x: finalCoor.x, y: finalCoor.y, rawX: coorX, rawY: coorY}, true); - }); - } - else { - var orient = seriesModel.getOrient(); - if (orient === 'RL' || orient === 'LR') { - ky = height / (right.getLayout().x + delta + tx); - kx = width / ((bottom.depth - 1) || 1); - eachBefore(realRoot, function (node) { - coorY = (node.getLayout().x + tx) * ky; - coorX = orient === 'LR' - ? (node.depth - 1) * kx - : width - (node.depth - 1) * kx; - node.setLayout({x: coorX, y: coorY}, true); - }); - } - else if (orient === 'TB' || orient === 'BT') { - kx = width / (right.getLayout().x + delta + tx); - ky = height / ((bottom.depth - 1) || 1); - eachBefore(realRoot, function (node) { - coorX = (node.getLayout().x + tx) * kx; - coorY = orient === 'TB' - ? (node.depth - 1) * ky - : height - (node.depth - 1) * ky; - node.setLayout({x: coorX, y: coorY}, true); - }); - } +/** + * Get the layout position of the whole view. + * + * @param {module:echarts/model/Series} seriesModel the model object of sankey series + * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call + * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view + */ +function getViewRect$1(seriesModel, api) { + return getLayoutRect( + seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() } - } + ); } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +/** + * All other shifts, applied to the smaller subtrees between w- and w+, are + * performed by this function. + * + * The implementation of this function was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + * + * @param {module:echarts/data/Tree~TreeNode} node + */ +function executeShifts(node) { + var children = node.children; + var n = children.length; + var shift = 0; + var change = 0; + while (--n >= 0) { + var child = children[n]; + child.hierNode.prelim += shift; + child.hierNode.modifier += shift; + change += child.hierNode.change; + shift += child.hierNode.shift + change; + } +} -registerVisual(visualSymbol('tree', 'circle')); -registerLayout(treeLayout); +/** + * The implementation of this function was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + * + * The core of the algorithm. Here, a new subtree is combined with the + * previous subtrees. Threads are used to traverse the inside and outside + * contours of the left and right subtree up to the highest common level. + * Whenever two nodes of the inside contours conflict, we compute the left + * one of the greatest uncommon ancestors using the function nextAncestor() + * and call moveSubtree() to shift the subtree and prepare the shifts of + * smaller subtrees. Finally, we add a new thread (if necessary). + * + * @param {module:echarts/data/Tree~TreeNode} subtreeV + * @param {module:echarts/data/Tree~TreeNode} subtreeW + * @param {module:echarts/data/Tree~TreeNode} ancestor + * @param {Function} separation + * @return {module:echarts/data/Tree~TreeNode} + */ +function apportion(subtreeV, subtreeW, ancestor, separation) { -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + if (subtreeW) { + var nodeOutRight = subtreeV; + var nodeInRight = subtreeV; + var nodeOutLeft = nodeInRight.parentNode.children[0]; + var nodeInLeft = subtreeW; -function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { - if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { - var root = seriesModel.getData().tree.root; - var targetNode = payload.targetNode; + var sumOutRight = nodeOutRight.hierNode.modifier; + var sumInRight = nodeInRight.hierNode.modifier; + var sumOutLeft = nodeOutLeft.hierNode.modifier; + var sumInLeft = nodeInLeft.hierNode.modifier; - if (typeof targetNode === 'string') { - targetNode = root.getNodeById(targetNode); + while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { + nodeOutRight = nextRight(nodeOutRight); + nodeOutLeft = nextLeft(nodeOutLeft); + nodeOutRight.hierNode.ancestor = subtreeV; + var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim + - sumInRight + separation(nodeInLeft, nodeInRight); + if (shift > 0) { + moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); + sumInRight += shift; + sumOutRight += shift; + } + sumInLeft += nodeInLeft.hierNode.modifier; + sumInRight += nodeInRight.hierNode.modifier; + sumOutRight += nodeOutRight.hierNode.modifier; + sumOutLeft += nodeOutLeft.hierNode.modifier; } + if (nodeInLeft && !nextRight(nodeOutRight)) { + nodeOutRight.hierNode.thread = nodeInLeft; + nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; - if (targetNode && root.contains(targetNode)) { - return {node: targetNode}; } - - var targetNodeId = payload.targetNodeId; - if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { - return {node: targetNode}; + if (nodeInRight && !nextLeft(nodeOutLeft)) { + nodeOutLeft.hierNode.thread = nodeInRight; + nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; + ancestor = subtreeV; } } + return ancestor; } -// Not includes the given node at the last item. -function getPathToRoot(node) { - var path = []; - while (node) { - node = node.parentNode; - node && path.push(node); - } - return path.reverse(); +/** + * This function is used to traverse the right contour of a subtree. + * It returns the rightmost child of node or the thread of node. The function + * returns null if and only if node is on the highest depth of its subtree. + * + * @param {module:echarts/data/Tree~TreeNode} node + * @return {module:echarts/data/Tree~TreeNode} + */ +function nextRight(node) { + var children = node.children; + return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; } -function aboveViewRoot(viewRoot, node) { - var viewPath = getPathToRoot(viewRoot); - return indexOf(viewPath, node) >= 0; +/** + * This function is used to traverse the left contour of a subtree (or a subforest). + * It returns the leftmost child of node or the thread of node. The function + * returns null if and only if node is on the highest depth of its subtree. + * + * @param {module:echarts/data/Tree~TreeNode} node + * @return {module:echarts/data/Tree~TreeNode} + */ +function nextLeft(node) { + var children = node.children; + return children.length && node.isExpand ? children[0] : node.hierNode.thread; } -// From root to the input node (the input node will be included). -function wrapTreePathInfo(node, seriesModel) { - var treePathInfo = []; - - while (node) { - var nodeDataIndex = node.dataIndex; - treePathInfo.push({ - name: node.name, - dataIndex: nodeDataIndex, - value: seriesModel.getRawValue(nodeDataIndex) - }); - node = node.parentNode; - } +/** + * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor. + * Otherwise, returns the specified ancestor. + * + * @param {module:echarts/data/Tree~TreeNode} nodeInLeft + * @param {module:echarts/data/Tree~TreeNode} node + * @param {module:echarts/data/Tree~TreeNode} ancestor + * @return {module:echarts/data/Tree~TreeNode} + */ +function nextAncestor(nodeInLeft, node, ancestor) { + return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode + ? nodeInLeft.hierNode.ancestor : ancestor; +} - treePathInfo.reverse(); +/** + * The implementation of this function was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + * + * Shifts the current subtree rooted at wr. + * This is done by increasing prelim(w+) and modifier(w+) by shift. + * + * @param {module:echarts/data/Tree~TreeNode} wl + * @param {module:echarts/data/Tree~TreeNode} wr + * @param {number} shift [description] + */ +function moveSubtree(wl, wr, shift) { + var change = shift / (wr.hierNode.i - wl.hierNode.i); + wr.hierNode.change -= change; + wr.hierNode.shift += shift; + wr.hierNode.modifier += shift; + wr.hierNode.prelim += shift; + wl.hierNode.change += change; +} - return treePathInfo; +/** + * The implementation of this function was originally copied from "d3.js" + * + * with some modifications made for this program. + * See the license statement at the head of this file. + */ +function defaultSeparation(node1, node2) { + return node1.parentNode === node2.parentNode ? 1 : 2; } /* @@ -49092,352 +51825,613 @@ function wrapTreePathInfo(node, seriesModel) { * under the License. */ -SeriesModel.extend({ - - type: 'series.treemap', +var TreeShape = extendShape({ + shape: { + parentPoint: [], + childPoints: [], + orient: '', + forkPosition: '' + }, - layoutMode: 'box', + style: { + stroke: '#000', + fill: null + }, - dependencies: ['grid', 'polar'], + buildPath: function (ctx, shape) { + var childPoints = shape.childPoints; + var childLen = childPoints.length; + var parentPoint = shape.parentPoint; + var firstChildPos = childPoints[0]; + var lastChildPos = childPoints[childLen - 1]; + + if (childLen === 1) { + ctx.moveTo(parentPoint[0], parentPoint[1]); + ctx.lineTo(firstChildPos[0], firstChildPos[1]); + return; + } - /** - * @type {module:echarts/data/Tree~Node} - */ - _viewRoot: null, + var orient = shape.orient; + var forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1; + var otherDim = 1 - forkDim; + var forkPosition = parsePercent$1(shape.forkPosition, 1); + var tmpPoint = []; + tmpPoint[forkDim] = parentPoint[forkDim]; + tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition; - defaultOption: { - // Disable progressive rendering - progressive: 0, - hoverLayerThreshold: Infinity, - // center: ['50%', '50%'], // not supported in ec3. - // size: ['80%', '80%'], // deprecated, compatible with ec2. - left: 'center', - top: 'middle', - right: null, - bottom: null, - width: '80%', - height: '80%', - sort: true, // Can be null or false or true - // (order by desc default, asc not supported yet (strange effect)) - clipWindow: 'origin', // Size of clipped window when zooming. 'origin' or 'fullscreen' - squareRatio: 0.5 * (1 + Math.sqrt(5)), // golden ratio - leafDepth: null, // Nodes on depth from root are regarded as leaves. - // Count from zero (zero represents only view root). - drillDownIcon: '▶', // Use html character temporarily because it is complicated - // to align specialized icon. ▷▶❒❐▼✚ + ctx.moveTo(parentPoint[0], parentPoint[1]); + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + ctx.moveTo(firstChildPos[0], firstChildPos[1]); + tmpPoint[forkDim] = firstChildPos[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + tmpPoint[forkDim] = lastChildPos[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + ctx.lineTo(lastChildPos[0], lastChildPos[1]); - zoomToNodeRatio: 0.32 * 0.32, // Be effective when using zoomToNode. Specify the proportion of the - // target node area in the view area. - roam: true, // true, false, 'scale' or 'zoom', 'move'. - nodeClick: 'zoomToNode', // Leaf node click behaviour: 'zoomToNode', 'link', false. - // If leafDepth is set and clicking a node which has children but - // be on left depth, the behaviour would be changing root. Otherwise - // use behavious defined above. - animation: true, - animationDurationUpdate: 900, - animationEasing: 'quinticInOut', - breadcrumb: { - show: true, - height: 22, - left: 'center', - top: 'bottom', - // right - // bottom - emptyItemWidth: 25, // Width of empty node. - itemStyle: { - color: 'rgba(0,0,0,0.7)', //'#5793f3', - borderColor: 'rgba(255,255,255,0.7)', - borderWidth: 1, - shadowColor: 'rgba(150,150,150,1)', - shadowBlur: 3, - shadowOffsetX: 0, - shadowOffsetY: 0, - textStyle: { - color: '#fff' - } - }, - emphasis: { - textStyle: {} - } - }, - label: { - show: true, - // Do not use textDistance, for ellipsis rect just the same as treemap node rect. - distance: 0, - padding: 5, - position: 'inside', // Can be [5, '5%'] or position stirng like 'insideTopLeft', ... - // formatter: null, - color: '#fff', - ellipsis: true - // align - // verticalAlign - }, - upperLabel: { // Label when node is parent. - show: false, - position: [0, '50%'], - height: 20, - // formatter: null, - color: '#fff', - ellipsis: true, - // align: null, - verticalAlign: 'middle' - }, - itemStyle: { - color: null, // Can be 'none' if not necessary. - colorAlpha: null, // Can be 'none' if not necessary. - colorSaturation: null, // Can be 'none' if not necessary. - borderWidth: 0, - gapWidth: 0, - borderColor: '#fff', - borderColorSaturation: null // If specified, borderColor will be ineffective, and the - // border color is evaluated by color of current node and - // borderColorSaturation. - }, - emphasis: { - upperLabel: { - show: true, - position: [0, '50%'], - color: '#fff', - ellipsis: true, - verticalAlign: 'middle' - } - }, + for (var i = 1; i < childLen - 1; i++) { + var point = childPoints[i]; + ctx.moveTo(point[0], point[1]); + tmpPoint[forkDim] = point[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + } + } +}); - visualDimension: 0, // Can be 0, 1, 2, 3. - visualMin: null, - visualMax: null, +extendChartView({ - color: [], // + treemapSeries.color should not be modified. Please only modified - // level[n].color (if necessary). - // + Specify color list of each level. level[0].color would be global - // color list if not specified. (see method `setDefault`). - // + But set as a empty array to forbid fetch color from global palette - // when using nodeModel.get('color'), otherwise nodes on deep level - // will always has color palette set and are not able to inherit color - // from parent node. - // + TreemapSeries.color can not be set as 'none', otherwise effect - // legend color fetching (see seriesColor.js). - colorAlpha: null, // Array. Specify color alpha range of each level, like [0.2, 0.8] - colorSaturation: null, // Array. Specify color saturation of each level, like [0.2, 0.5] - colorMappingBy: 'index', // 'value' or 'index' or 'id'. - visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not - // be rendered. Only works when sort is 'asc' or 'desc'. - childrenVisibleMin: null, // If area of a node less than this threshold (unit: pixel^2), - // grandchildren will not show. - // Why grandchildren? If not grandchildren but children, - // some siblings show children and some not, - // the appearance may be mess and not consistent, - levels: [] // Each item: { - // visibleMin, itemStyle, visualDimension, label - // } - // data: { - // value: [], - // children: [], - // link: 'http://xxx.xxx.xxx', - // target: 'blank' or 'self' - // } - }, + type: 'tree', /** + * Init the chart * @override + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api */ - getInitialData: function (option, ecModel) { - // Create a virtual root. - var root = {name: option.name, children: option.data}; - - completeTreeValue(root); + init: function (ecModel, api) { - var levels = option.levels || []; + /** + * @private + * @type {module:echarts/data/Tree} + */ + this._oldTree; - levels = option.levels = setDefault(levels, ecModel); + /** + * @private + * @type {module:zrender/container/Group} + */ + this._mainGroup = new Group(); - var treeOption = {}; + /** + * @private + * @type {module:echarts/componet/helper/RoamController} + */ + this._controller = new RoamController(api.getZr()); - treeOption.levels = levels; + this._controllerHost = {target: this.group}; - // Make sure always a new tree is created when setOption, - // in TreemapView, we check whether oldTree === newTree - // to choose mappings approach among old shapes and new shapes. - return Tree.createTree(root, this, treeOption).data; + this.group.add(this._mainGroup); }, - optionUpdated: function () { - this.resetViewRoot(); - }, + render: function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(); - /** - * @override - * @param {number} dataIndex - * @param {boolean} [mutipleSeries=false] - */ - formatTooltip: function (dataIndex) { - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var formattedValue = isArray(value) - ? addCommas(value[0]) : addCommas(value); - var name = data.getName(dataIndex); + var layoutInfo = seriesModel.layoutInfo; - return encodeHTML(name + ': ' + formattedValue); - }, + var group = this._mainGroup; - /** - * Add tree path to tooltip param - * - * @override - * @param {number} dataIndex - * @return {Object} - */ - getDataParams: function (dataIndex) { - var params = SeriesModel.prototype.getDataParams.apply(this, arguments); + var layout = seriesModel.get('layout'); - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treePathInfo = wrapTreePathInfo(node, this); + if (layout === 'radial') { + group.attr('position', [layoutInfo.x + layoutInfo.width / 2, layoutInfo.y + layoutInfo.height / 2]); + } + else { + group.attr('position', [layoutInfo.x, layoutInfo.y]); + } - return params; - }, + this._updateViewCoordSys(seriesModel, layoutInfo, layout); + this._updateController(seriesModel, ecModel, api); - /** - * @public - * @param {Object} layoutInfo { - * x: containerGroup x - * y: containerGroup y - * width: containerGroup width - * height: containerGroup height - * } - */ - setLayoutInfo: function (layoutInfo) { - /** - * @readOnly - * @type {Object} - */ - this.layoutInfo = this.layoutInfo || {}; - extend(this.layoutInfo, layoutInfo); - }, + var oldData = this._data; - /** - * @param {string} id - * @return {number} index - */ - mapIdToIndex: function (id) { - // A feature is implemented: - // index is monotone increasing with the sequence of - // input id at the first time. - // This feature can make sure that each data item and its - // mapped color have the same index between data list and - // color list at the beginning, which is useful for user - // to adjust data-color mapping. + var seriesScope = { + expandAndCollapse: seriesModel.get('expandAndCollapse'), + layout: layout, + edgeShape: seriesModel.get('edgeShape'), + edgeForkPosition: seriesModel.get('edgeForkPosition'), + orient: seriesModel.getOrient(), + curvature: seriesModel.get('lineStyle.curveness'), + symbolRotate: seriesModel.get('symbolRotate'), + symbolOffset: seriesModel.get('symbolOffset'), + hoverAnimation: seriesModel.get('hoverAnimation'), + useNameLabel: true, + fadeIn: true + }; - /** - * @private - * @type {Object} - */ - var idIndexMap = this._idIndexMap; + data.diff(oldData) + .add(function (newIdx) { + if (symbolNeedsDraw$1(data, newIdx)) { + // Create node and edge + updateNode(data, newIdx, null, group, seriesModel, seriesScope); + } + }) + .update(function (newIdx, oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); + if (!symbolNeedsDraw$1(data, newIdx)) { + symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); + return; + } + // Update node and edge + updateNode(data, newIdx, symbolEl, group, seriesModel, seriesScope); + }) + .remove(function (oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); + // When remove a collapsed node of subtree, since the collapsed + // node haven't been initialized with a symbol element, + // you can't found it's symbol element through index. + // so if we want to remove the symbol element we should insure + // that the symbol element is not null. + if (symbolEl) { + removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); + } + }) + .execute(); - if (!idIndexMap) { - idIndexMap = this._idIndexMap = createHashMap(); - /** - * @private - * @type {number} - */ - this._idIndexMapCount = 0; + this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); + + this._updateNodeAndLinkScale(seriesModel); + + if (seriesScope.expandAndCollapse === true) { + data.eachItemGraphicEl(function (el, dataIndex) { + el.off('click').on('click', function () { + api.dispatchAction({ + type: 'treeExpandAndCollapse', + seriesId: seriesModel.id, + dataIndex: dataIndex + }); + }); + }); } + this._data = data; + }, - var index = idIndexMap.get(id); - if (index == null) { - idIndexMap.set(id, index = this._idIndexMapCount++); + _updateViewCoordSys: function (seriesModel) { + var data = seriesModel.getData(); + var points = []; + data.each(function (idx) { + var layout = data.getItemLayout(idx); + if (layout && !isNaN(layout.x) && !isNaN(layout.y)) { + points.push([+layout.x, +layout.y]); + } + }); + var min = []; + var max = []; + fromPoints(points, min, max); + + // If don't Store min max when collapse the root node after roam, + // the root node will disappear. + var oldMin = this._min; + var oldMax = this._max; + + // If width or height is 0 + if (max[0] - min[0] === 0) { + min[0] = oldMin ? oldMin[0] : min[0] - 1; + max[0] = oldMax ? oldMax[0] : max[0] + 1; + } + if (max[1] - min[1] === 0) { + min[1] = oldMin ? oldMin[1] : min[1] - 1; + max[1] = oldMax ? oldMax[1] : max[1] + 1; } - return index; + var viewCoordSys = seriesModel.coordinateSystem = new View(); + viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); + + viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); + + viewCoordSys.setCenter(seriesModel.get('center')); + viewCoordSys.setZoom(seriesModel.get('zoom')); + + // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group + this.group.attr({ + position: viewCoordSys.position, + scale: viewCoordSys.scale + }); + + this._viewCoordSys = viewCoordSys; + this._min = min; + this._max = max; }, - getViewRoot: function () { - return this._viewRoot; + _updateController: function (seriesModel, ecModel, api) { + var controller = this._controller; + var controllerHost = this._controllerHost; + var group = this.group; + controller.setPointerChecker(function (e, x, y) { + var rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) + && !onIrrelevantElement(e, api, seriesModel); + }); + + controller.enable(seriesModel.get('roam')); + controllerHost.zoomLimit = seriesModel.get('scaleLimit'); + controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + + controller + .off('pan') + .off('zoom') + .on('pan', function (e) { + updateViewOnPan(controllerHost, e.dx, e.dy); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'treeRoam', + dx: e.dx, + dy: e.dy + }); + }, this) + .on('zoom', function (e) { + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'treeRoam', + zoom: e.scale, + originX: e.originX, + originY: e.originY + }); + this._updateNodeAndLinkScale(seriesModel); + }, this); }, - /** - * @param {module:echarts/data/Tree~Node} [viewRoot] - */ - resetViewRoot: function (viewRoot) { - viewRoot - ? (this._viewRoot = viewRoot) - : (viewRoot = this._viewRoot); + _updateNodeAndLinkScale: function (seriesModel) { + var data = seriesModel.getData(); - var root = this.getRawData().tree.root; + var nodeScale = this._getNodeGlobalScale(seriesModel); + var invScale = [nodeScale, nodeScale]; - if (!viewRoot - || (viewRoot !== root && !root.contains(viewRoot)) - ) { - this._viewRoot = root; + data.eachItemGraphicEl(function (el, idx) { + el.attr('scale', invScale); + }); + }, + + _getNodeGlobalScale: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + if (coordSys.type !== 'view') { + return 1; } + + var nodeScaleRatio = this._nodeScaleRatio; + + var groupScale = coordSys.scale; + var groupZoom = (groupScale && groupScale[0]) || 1; + // Scale node when zoom changes + var roamZoom = coordSys.getZoom(); + var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + + return nodeScale / groupZoom; + }, + + dispose: function () { + this._controller && this._controller.dispose(); + this._controllerHost = {}; + }, + + remove: function () { + this._mainGroup.removeAll(); + this._data = null; } + }); -/** - * @param {Object} dataNode - */ -function completeTreeValue(dataNode) { - // Postorder travel tree. - // If value of none-leaf node is not set, - // calculate it by suming up the value of all children. - var sum = 0; +function symbolNeedsDraw$1(data, dataIndex) { + var layout = data.getItemLayout(dataIndex); - each$1(dataNode.children, function (child) { + return layout + && !isNaN(layout.x) && !isNaN(layout.y) + && data.getItemVisual(dataIndex, 'symbol') !== 'none'; +} - completeTreeValue(child); +function getTreeNodeStyle(node, itemModel, seriesScope) { + seriesScope.itemModel = itemModel; + seriesScope.itemStyle = itemModel.getModel('itemStyle').getItemStyle(); + seriesScope.hoverItemStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + seriesScope.lineStyle = itemModel.getModel('lineStyle').getLineStyle(); + seriesScope.labelModel = itemModel.getModel('label'); + seriesScope.hoverLabelModel = itemModel.getModel('emphasis.label'); - var childValue = child.value; - isArray(childValue) && (childValue = childValue[0]); + if (node.isExpand === false && node.children.length !== 0) { + seriesScope.symbolInnerColor = seriesScope.itemStyle.fill; + } + else { + seriesScope.symbolInnerColor = '#fff'; + } - sum += childValue; - }); + return seriesScope; +} - var thisValue = dataNode.value; - if (isArray(thisValue)) { - thisValue = thisValue[0]; +function updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { + var isInit = !symbolEl; + var node = data.tree.getNodeByDataIndex(dataIndex); + var itemModel = node.getModel(); + var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); + var virtualRoot = data.tree.root; + + var source = node.parentNode === virtualRoot ? node : node.parentNode || node; + var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + var sourceLayout = source.getLayout(); + var sourceOldLayout = sourceSymbolEl + ? { + x: sourceSymbolEl.position[0], + y: sourceSymbolEl.position[1], + rawX: sourceSymbolEl.__radialOldRawX, + rawY: sourceSymbolEl.__radialOldRawY + } + : sourceLayout; + var targetLayout = node.getLayout(); + + if (isInit) { + symbolEl = new SymbolClz$1(data, dataIndex, seriesScope); + symbolEl.attr('position', [sourceOldLayout.x, sourceOldLayout.y]); + } + else { + symbolEl.updateData(data, dataIndex, seriesScope); } - if (thisValue == null || isNaN(thisValue)) { - thisValue = sum; + symbolEl.__radialOldRawX = symbolEl.__radialRawX; + symbolEl.__radialOldRawY = symbolEl.__radialRawY; + symbolEl.__radialRawX = targetLayout.rawX; + symbolEl.__radialRawY = targetLayout.rawY; + + group.add(symbolEl); + data.setItemGraphicEl(dataIndex, symbolEl); + updateProps(symbolEl, { + position: [targetLayout.x, targetLayout.y] + }, seriesModel); + + var symbolPath = symbolEl.getSymbolPath(); + + if (seriesScope.layout === 'radial') { + var realRoot = virtualRoot.children[0]; + var rootLayout = realRoot.getLayout(); + var length = realRoot.children.length; + var rad; + var isLeft; + + if (targetLayout.x === rootLayout.x && node.isExpand === true) { + var center = {}; + center.x = (realRoot.children[0].getLayout().x + realRoot.children[length - 1].getLayout().x) / 2; + center.y = (realRoot.children[0].getLayout().y + realRoot.children[length - 1].getLayout().y) / 2; + rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + isLeft = center.x < rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; + } + } + else { + rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) { + isLeft = targetLayout.x < rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; + } + } + else { + isLeft = targetLayout.x > rootLayout.x; + if (!isLeft) { + rad = rad - Math.PI; + } + } + } + + var textPosition = isLeft ? 'left' : 'right'; + var rotate = seriesScope.labelModel.get('rotate'); + var labelRotateRadian = rotate * (Math.PI / 180); + + symbolPath.setStyle({ + textPosition: seriesScope.labelModel.get('position') || textPosition, + textRotation: rotate == null ? -rad : labelRotateRadian, + textOrigin: 'center', + verticalAlign: 'middle' + }); } - // Value should not less than 0. - if (thisValue < 0) { - thisValue = 0; + + drawEdge( + seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, + sourceLayout, targetLayout, group, seriesScope + ); + +} + +function drawEdge( + seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, + sourceLayout, targetLayout, group, seriesScope +) { + + var edgeShape = seriesScope.edgeShape; + var edge = symbolEl.__edge; + if (edgeShape === 'curve') { + if (node.parentNode && node.parentNode !== virtualRoot) { + if (!edge) { + edge = symbolEl.__edge = new BezierCurve({ + shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout), + style: defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle) + }); + } + + updateProps(edge, { + shape: getEdgeShape(seriesScope, sourceLayout, targetLayout), + style: {opacity: 1} + }, seriesModel); + } } + else if (edgeShape === 'polyline') { + if (seriesScope.layout === 'orthogonal') { + if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) { + var children = node.children; + var childPoints = []; + for (var i = 0; i < children.length; i++) { + var childLayout = children[i].getLayout(); + childPoints.push([childLayout.x, childLayout.y]); + } - isArray(dataNode.value) - ? (dataNode.value[0] = thisValue) - : (dataNode.value = thisValue); + if (!edge) { + edge = symbolEl.__edge = new TreeShape({ + shape: { + parentPoint: [targetLayout.x, targetLayout.y], + childPoints: [[targetLayout.x, targetLayout.y]], + orient: seriesScope.orient, + forkPosition: seriesScope.edgeForkPosition + }, + style: defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle) + }); + } + updateProps(edge, { + shape: { + parentPoint: [targetLayout.x, targetLayout.y], + childPoints: childPoints + }, + style: {opacity: 1} + }, seriesModel); + } + } + else { + if (__DEV__) { + throw new Error('The polyline edgeShape can only be used in orthogonal layout'); + } + } + } + group.add(edge); } -/** - * set default to level configuration - */ -function setDefault(levels, ecModel) { - var globalColorList = ecModel.get('color'); +function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { + var node = data.tree.getNodeByDataIndex(dataIndex); + var virtualRoot = data.tree.root; + var itemModel = node.getModel(); + var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); - if (!globalColorList) { - return; + var source = node.parentNode === virtualRoot ? node : node.parentNode || node; + var edgeShape = seriesScope.edgeShape; + var sourceLayout; + while (sourceLayout = source.getLayout(), sourceLayout == null) { + source = source.parentNode === virtualRoot ? source : source.parentNode || source; } - levels = levels || []; - var hasColorDefine; - each$1(levels, function (levelDefine) { - var model = new Model(levelDefine); - var modelColor = model.get('color'); + updateProps(symbolEl, { + position: [sourceLayout.x + 1, sourceLayout.y + 1] + }, seriesModel, function () { + group.remove(symbolEl); + data.setItemGraphicEl(dataIndex, null); + }); - if (model.get('itemStyle.color') - || (modelColor && modelColor !== 'none') - ) { - hasColorDefine = true; + symbolEl.fadeOut(null, {keepLabel: true}); + + var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + var sourceEdge = sourceSymbolEl.__edge; + + // 1. when expand the sub tree, delete the children node should delete the edge of + // the source at the same time. because the polyline edge shape is only owned by the source. + // 2.when the node is the only children of the source, delete the node should delete the edge of + // the source at the same time. the same reason as above. + var edge = symbolEl.__edge + || ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined); + + var edgeShape = seriesScope.edgeShape; + + if (edge) { + if (edgeShape === 'curve') { + updateProps(edge, { + shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout), + style: { + opacity: 0 + } + }, seriesModel, function () { + group.remove(edge); + }); } - }); + else if (edgeShape === 'polyline' && seriesScope.layout === 'orthogonal') { + updateProps(edge, { + shape: { + parentPoint: [sourceLayout.x, sourceLayout.y], + childPoints: [[sourceLayout.x, sourceLayout.y]] + }, + style: { + opacity: 0 + } + }, seriesModel, function () { + group.remove(edge); + }); + } + } +} - if (!hasColorDefine) { - var level0 = levels[0] || (levels[0] = {}); - level0.color = globalColorList.slice(); +function getEdgeShape(seriesScope, sourceLayout, targetLayout) { + var cpx1; + var cpy1; + var cpx2; + var cpy2; + var orient = seriesScope.orient; + var x1; + var x2; + var y1; + var y2; + + if (seriesScope.layout === 'radial') { + x1 = sourceLayout.rawX; + y1 = sourceLayout.rawY; + x2 = targetLayout.rawX; + y2 = targetLayout.rawY; + + var radialCoor1 = radialCoordinate(x1, y1); + var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * seriesScope.curvature); + var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * seriesScope.curvature); + var radialCoor4 = radialCoordinate(x2, y2); + + return { + x1: radialCoor1.x, + y1: radialCoor1.y, + x2: radialCoor4.x, + y2: radialCoor4.y, + cpx1: radialCoor2.x, + cpy1: radialCoor2.y, + cpx2: radialCoor3.x, + cpy2: radialCoor3.y + }; } + else { + x1 = sourceLayout.x; + y1 = sourceLayout.y; + x2 = targetLayout.x; + y2 = targetLayout.y; + + if (orient === 'LR' || orient === 'RL') { + cpx1 = x1 + (x2 - x1) * seriesScope.curvature; + cpy1 = y1; + cpx2 = x2 + (x1 - x2) * seriesScope.curvature; + cpy2 = y2; + } + if (orient === 'TB' || orient === 'BT') { + cpx1 = x1; + cpy1 = y1 + (y2 - y1) * seriesScope.curvature; + cpx2 = x2; + cpy2 = y2 + (y1 - y2) * seriesScope.curvature; + } + } + + return { + x1: x1, + y1: y1, + x2: x2, + y2: y2, + cpx1: cpx1, + cpy1: cpy1, + cpx2: cpx2, + cpy2: cpy2 + }; - return levels; } /* @@ -49459,166 +52453,222 @@ function setDefault(levels, ecModel) { * under the License. */ -var TEXT_PADDING = 8; -var ITEM_GAP = 8; -var ARRAY_LENGTH = 5; +registerAction({ + type: 'treeExpandAndCollapse', + event: 'treeExpandAndCollapse', + update: 'update' +}, function (payload, ecModel) { + ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { + var dataIndex = payload.dataIndex; + var tree = seriesModel.getData().tree; + var node = tree.getNodeByDataIndex(dataIndex); + node.isExpand = !node.isExpand; + }); +}); -function Breadcrumb(containerGroup) { - /** - * @private - * @type {module:zrender/container/Group} - */ - this.group = new Group(); +registerAction({ + type: 'treeRoam', + event: 'treeRoam', + // Here we set 'none' instead of 'update', because roam action + // just need to update the transform matrix without having to recalculate + // the layout. So don't need to go through the whole update process, such + // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. + update: 'none' +}, function (payload, ecModel) { + ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var res = updateCenterAndZoom(coordSys, payload); - containerGroup.add(this.group); -} + seriesModel.setCenter + && seriesModel.setCenter(res.center); -Breadcrumb.prototype = { + seriesModel.setZoom + && seriesModel.setZoom(res.zoom); + }); +}); - constructor: Breadcrumb, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - render: function (seriesModel, api, targetNode, onSelect) { - var model = seriesModel.getModel('breadcrumb'); - var thisGroup = this.group; - thisGroup.removeAll(); +/** + * Traverse the tree from bottom to top and do something + * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree + * @param {Function} callback + */ +function eachAfter(root, callback, separation) { + var nodes = [root]; + var next = []; + var node; - if (!model.get('show') || !targetNode) { - return; + while (node = nodes.pop()) { // jshint ignore:line + next.push(node); + if (node.isExpand) { + var children = node.children; + if (children.length) { + for (var i = 0; i < children.length; i++) { + nodes.push(children[i]); + } + } } + } - var normalStyleModel = model.getModel('itemStyle'); - // var emphasisStyleModel = model.getModel('emphasis.itemStyle'); - var textStyleModel = normalStyleModel.getModel('textStyle'); + while (node = next.pop()) { // jshint ignore:line + callback(node, separation); + } +} - var layoutParam = { - pos: { - left: model.get('left'), - right: model.get('right'), - top: model.get('top'), - bottom: model.get('bottom') - }, - box: { - width: api.getWidth(), - height: api.getHeight() - }, - emptyItemWidth: model.get('emptyItemWidth'), - totalWidth: 0, - renderList: [] - }; +/** + * Traverse the tree from top to bottom and do something + * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree + * @param {Function} callback + */ +function eachBefore(root, callback) { + var nodes = [root]; + var node; + while (node = nodes.pop()) { // jshint ignore:line + callback(node); + if (node.isExpand) { + var children = node.children; + if (children.length) { + for (var i = children.length - 1; i >= 0; i--) { + nodes.push(children[i]); + } + } + } + } +} - this._prepare(targetNode, layoutParam, textStyleModel); - this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - positionElement(thisGroup, layoutParam.pos, layoutParam.box); - }, +var treeLayout = function (ecModel, api) { + ecModel.eachSeriesByType('tree', function (seriesModel) { + commonLayout(seriesModel, api); + }); +}; - /** - * Prepare render list and total width - * @private - */ - _prepare: function (targetNode, layoutParam, textStyleModel) { - for (var node = targetNode; node; node = node.parentNode) { - var text = node.getModel().get('name'); - var textRect = textStyleModel.getTextRect(text); - var itemWidth = Math.max( - textRect.width + TEXT_PADDING * 2, - layoutParam.emptyItemWidth - ); - layoutParam.totalWidth += itemWidth + ITEM_GAP; - layoutParam.renderList.push({node: node, text: text, width: itemWidth}); - } - }, +function commonLayout(seriesModel, api) { + var layoutInfo = getViewRect$1(seriesModel, api); + seriesModel.layoutInfo = layoutInfo; + var layout = seriesModel.get('layout'); + var width = 0; + var height = 0; + var separation$$1 = null; - /** - * @private - */ - _renderContent: function ( - seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect - ) { - // Start rendering. - var lastX = 0; - var emptyItemWidth = layoutParam.emptyItemWidth; - var height = seriesModel.get('breadcrumb.height'); - var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); - var totalWidth = layoutParam.totalWidth; - var renderList = layoutParam.renderList; + if (layout === 'radial') { + width = 2 * Math.PI; + height = Math.min(layoutInfo.height, layoutInfo.width) / 2; + separation$$1 = separation(function (node1, node2) { + return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; + }); + } + else { + width = layoutInfo.width; + height = layoutInfo.height; + separation$$1 = separation(); + } - for (var i = renderList.length - 1; i >= 0; i--) { - var item = renderList[i]; - var itemNode = item.node; - var itemWidth = item.width; - var text = item.text; + var virtualRoot = seriesModel.getData().tree.root; + var realRoot = virtualRoot.children[0]; - // Hdie text and shorten width if necessary. - if (totalWidth > availableSize.width) { - totalWidth -= itemWidth - emptyItemWidth; - itemWidth = emptyItemWidth; - text = null; + if (realRoot) { + init$2(virtualRoot); + eachAfter(realRoot, firstWalk, separation$$1); + virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim; + eachBefore(realRoot, secondWalk); + + var left = realRoot; + var right = realRoot; + var bottom = realRoot; + eachBefore(realRoot, function (node) { + var x = node.getLayout().x; + if (x < left.getLayout().x) { + left = node; + } + if (x > right.getLayout().x) { + right = node; + } + if (node.depth > bottom.depth) { + bottom = node; } + }); - var el = new Polygon({ - shape: { - points: makeItemPoints( - lastX, 0, itemWidth, height, - i === renderList.length - 1, i === 0 - ) - }, - style: defaults( - normalStyleModel.getItemStyle(), - { - lineJoin: 'bevel', - text: text, - textFill: textStyleModel.getTextColor(), - textFont: textStyleModel.getFont() - } - ), - z: 10, - onclick: curry(onSelect, itemNode) + var delta = left === right ? 1 : separation$$1(left, right) / 2; + var tx = delta - left.getLayout().x; + var kx = 0; + var ky = 0; + var coorX = 0; + var coorY = 0; + if (layout === 'radial') { + kx = width / (right.getLayout().x + delta + tx); + // here we use (node.depth - 1), bucause the real root's depth is 1 + ky = height / ((bottom.depth - 1) || 1); + eachBefore(realRoot, function (node) { + coorX = (node.getLayout().x + tx) * kx; + coorY = (node.depth - 1) * ky; + var finalCoor = radialCoordinate(coorX, coorY); + node.setLayout({x: finalCoor.x, y: finalCoor.y, rawX: coorX, rawY: coorY}, true); }); - this.group.add(el); - - packEventData(el, seriesModel, itemNode); - - lastX += itemWidth + ITEM_GAP; } - }, - - /** - * @override - */ - remove: function () { - this.group.removeAll(); + else { + var orient = seriesModel.getOrient(); + if (orient === 'RL' || orient === 'LR') { + ky = height / (right.getLayout().x + delta + tx); + kx = width / ((bottom.depth - 1) || 1); + eachBefore(realRoot, function (node) { + coorY = (node.getLayout().x + tx) * ky; + coorX = orient === 'LR' + ? (node.depth - 1) * kx + : width - (node.depth - 1) * kx; + node.setLayout({x: coorX, y: coorY}, true); + }); + } + else if (orient === 'TB' || orient === 'BT') { + kx = width / (right.getLayout().x + delta + tx); + ky = height / ((bottom.depth - 1) || 1); + eachBefore(realRoot, function (node) { + coorX = (node.getLayout().x + tx) * kx; + coorY = orient === 'TB' + ? (node.depth - 1) * ky + : height - (node.depth - 1) * ky; + node.setLayout({x: coorX, y: coorY}, true); + }); + } + } } -}; - -function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) { - var points = [ - [head ? x : x - ARRAY_LENGTH, y], - [x + itemWidth, y], - [x + itemWidth, y + itemHeight], - [head ? x : x - ARRAY_LENGTH, y + itemHeight] - ]; - !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); - !head && points.push([x, y + itemHeight / 2]); - return points; -} - -// Package custom mouse event. -function packEventData(el, seriesModel, itemNode) { - el.eventData = { - componentType: 'series', - componentSubType: 'treemap', - seriesIndex: seriesModel.componentIndex, - seriesName: seriesModel.name, - seriesType: 'treemap', - selfType: 'breadcrumb', // Distinguish with click event on treemap node. - nodeData: { - dataIndex: itemNode && itemNode.dataIndex, - name: itemNode && itemNode.name - }, - treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) - }; } /* @@ -49640,99 +52690,80 @@ function packEventData(el, seriesModel, itemNode) { * under the License. */ -/** - * @param {number} [time=500] Time in ms - * @param {string} [easing='linear'] - * @param {number} [delay=0] - * @param {Function} [callback] - * - * @example - * // Animate position - * animation - * .createWrap() - * .add(el1, {position: [10, 10]}) - * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400) - * .done(function () { // done }) - * .start('cubicOut'); - */ -function createWrap() { +registerVisual(visualSymbol('tree', 'circle')); +registerLayout(treeLayout); - var storage = []; - var elExistsMap = {}; - var doneCallback; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - return { +function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { + if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { + var root = seriesModel.getData().tree.root; + var targetNode = payload.targetNode; - /** - * Caution: a el can only be added once, otherwise 'done' - * might not be called. This method checks this (by el.id), - * suppresses adding and returns false when existing el found. - * - * @param {modele:zrender/Element} el - * @param {Object} target - * @param {number} [time=500] - * @param {number} [delay=0] - * @param {string} [easing='linear'] - * @return {boolean} Whether adding succeeded. - * - * @example - * add(el, target, time, delay, easing); - * add(el, target, time, easing); - * add(el, target, time); - * add(el, target); - */ - add: function (el, target, time, delay, easing) { - if (isString(delay)) { - easing = delay; - delay = 0; - } + if (typeof targetNode === 'string') { + targetNode = root.getNodeById(targetNode); + } - if (elExistsMap[el.id]) { - return false; - } - elExistsMap[el.id] = 1; + if (targetNode && root.contains(targetNode)) { + return {node: targetNode}; + } - storage.push( - {el: el, target: target, time: time, delay: delay, easing: easing} - ); + var targetNodeId = payload.targetNodeId; + if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { + return {node: targetNode}; + } + } +} - return true; - }, +// Not includes the given node at the last item. +function getPathToRoot(node) { + var path = []; + while (node) { + node = node.parentNode; + node && path.push(node); + } + return path.reverse(); +} - /** - * Only execute when animation finished. Will not execute when any - * of 'stop' or 'stopAnimation' called. - * - * @param {Function} callback - */ - done: function (callback) { - doneCallback = callback; - return this; - }, +function aboveViewRoot(viewRoot, node) { + var viewPath = getPathToRoot(viewRoot); + return indexOf(viewPath, node) >= 0; +} - /** - * Will stop exist animation firstly. - */ - start: function () { - var count = storage.length; +// From root to the input node (the input node will be included). +function wrapTreePathInfo(node, seriesModel) { + var treePathInfo = []; - for (var i = 0, len = storage.length; i < len; i++) { - var item = storage[i]; - item.el.animateTo(item.target, item.time, item.delay, item.easing, done); - } + while (node) { + var nodeDataIndex = node.dataIndex; + treePathInfo.push({ + name: node.name, + dataIndex: nodeDataIndex, + value: seriesModel.getRawValue(nodeDataIndex) + }); + node = node.parentNode; + } - return this; + treePathInfo.reverse(); - function done() { - count--; - if (!count) { - storage.length = 0; - elExistsMap = {}; - doneCallback && doneCallback(); - } - } - } - }; + return treePathInfo; } /* @@ -49754,560 +52785,1235 @@ function createWrap() { * under the License. */ -var bind$1 = bind; -var Group$2 = Group; -var Rect$1 = Rect; -var each$8 = each$1; +SeriesModel.extend({ -var DRAG_THRESHOLD = 3; -var PATH_LABEL_NOAMAL = ['label']; -var PATH_LABEL_EMPHASIS = ['emphasis', 'label']; -var PATH_UPPERLABEL_NORMAL = ['upperLabel']; -var PATH_UPPERLABEL_EMPHASIS = ['emphasis', 'upperLabel']; -var Z_BASE = 10; // Should bigger than every z. -var Z_BG = 1; -var Z_CONTENT = 2; + type: 'series.treemap', -var getItemStyleEmphasis = makeStyleMapper([ - ['fill', 'color'], - // `borderColor` and `borderWidth` has been occupied, - // so use `stroke` to indicate the stroke of the rect. - ['stroke', 'strokeColor'], - ['lineWidth', 'strokeWidth'], - ['shadowBlur'], - ['shadowOffsetX'], - ['shadowOffsetY'], - ['shadowColor'] -]); -var getItemStyleNormal = function (model) { - // Normal style props should include emphasis style props. - var itemStyle = getItemStyleEmphasis(model); - // Clear styles set by emphasis. - itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; - return itemStyle; -}; + layoutMode: 'box', -extendChartView({ + dependencies: ['grid', 'polar'], - type: 'treemap', + preventUsingHoverLayer: true, /** - * @override + * @type {module:echarts/data/Tree~Node} */ - init: function (o, api) { - - /** - * @private - * @type {module:zrender/container/Group} - */ - this._containerGroup; - - /** - * @private - * @type {Object.>} - */ - this._storage = createStorage(); + _viewRoot: null, - /** - * @private - * @type {module:echarts/data/Tree} - */ - this._oldTree; + defaultOption: { + // Disable progressive rendering + progressive: 0, + // center: ['50%', '50%'], // not supported in ec3. + // size: ['80%', '80%'], // deprecated, compatible with ec2. + left: 'center', + top: 'middle', + right: null, + bottom: null, + width: '80%', + height: '80%', + sort: true, // Can be null or false or true + // (order by desc default, asc not supported yet (strange effect)) + clipWindow: 'origin', // Size of clipped window when zooming. 'origin' or 'fullscreen' + squareRatio: 0.5 * (1 + Math.sqrt(5)), // golden ratio + leafDepth: null, // Nodes on depth from root are regarded as leaves. + // Count from zero (zero represents only view root). + drillDownIcon: '▶', // Use html character temporarily because it is complicated + // to align specialized icon. ▷▶❒❐▼✚ - /** - * @private - * @type {module:echarts/chart/treemap/Breadcrumb} - */ - this._breadcrumb; + zoomToNodeRatio: 0.32 * 0.32, // Be effective when using zoomToNode. Specify the proportion of the + // target node area in the view area. + roam: true, // true, false, 'scale' or 'zoom', 'move'. + nodeClick: 'zoomToNode', // Leaf node click behaviour: 'zoomToNode', 'link', false. + // If leafDepth is set and clicking a node which has children but + // be on left depth, the behaviour would be changing root. Otherwise + // use behavious defined above. + animation: true, + animationDurationUpdate: 900, + animationEasing: 'quinticInOut', + breadcrumb: { + show: true, + height: 22, + left: 'center', + top: 'bottom', + // right + // bottom + emptyItemWidth: 25, // Width of empty node. + itemStyle: { + color: 'rgba(0,0,0,0.7)', //'#5793f3', + borderColor: 'rgba(255,255,255,0.7)', + borderWidth: 1, + shadowColor: 'rgba(150,150,150,1)', + shadowBlur: 3, + shadowOffsetX: 0, + shadowOffsetY: 0, + textStyle: { + color: '#fff' + } + }, + emphasis: { + textStyle: {} + } + }, + label: { + show: true, + // Do not use textDistance, for ellipsis rect just the same as treemap node rect. + distance: 0, + padding: 5, + position: 'inside', // Can be [5, '5%'] or position stirng like 'insideTopLeft', ... + // formatter: null, + color: '#fff', + ellipsis: true + // align + // verticalAlign + }, + upperLabel: { // Label when node is parent. + show: false, + position: [0, '50%'], + height: 20, + // formatter: null, + color: '#fff', + ellipsis: true, + // align: null, + verticalAlign: 'middle' + }, + itemStyle: { + color: null, // Can be 'none' if not necessary. + colorAlpha: null, // Can be 'none' if not necessary. + colorSaturation: null, // Can be 'none' if not necessary. + borderWidth: 0, + gapWidth: 0, + borderColor: '#fff', + borderColorSaturation: null // If specified, borderColor will be ineffective, and the + // border color is evaluated by color of current node and + // borderColorSaturation. + }, + emphasis: { + upperLabel: { + show: true, + position: [0, '50%'], + color: '#fff', + ellipsis: true, + verticalAlign: 'middle' + } + }, - /** - * @private - * @type {module:echarts/component/helper/RoamController} - */ - this._controller; + visualDimension: 0, // Can be 0, 1, 2, 3. + visualMin: null, + visualMax: null, - /** - * 'ready', 'animating' - * @private - */ - this._state = 'ready'; + color: [], // + treemapSeries.color should not be modified. Please only modified + // level[n].color (if necessary). + // + Specify color list of each level. level[0].color would be global + // color list if not specified. (see method `setDefault`). + // + But set as a empty array to forbid fetch color from global palette + // when using nodeModel.get('color'), otherwise nodes on deep level + // will always has color palette set and are not able to inherit color + // from parent node. + // + TreemapSeries.color can not be set as 'none', otherwise effect + // legend color fetching (see seriesColor.js). + colorAlpha: null, // Array. Specify color alpha range of each level, like [0.2, 0.8] + colorSaturation: null, // Array. Specify color saturation of each level, like [0.2, 0.5] + colorMappingBy: 'index', // 'value' or 'index' or 'id'. + visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not + // be rendered. Only works when sort is 'asc' or 'desc'. + childrenVisibleMin: null, // If area of a node less than this threshold (unit: pixel^2), + // grandchildren will not show. + // Why grandchildren? If not grandchildren but children, + // some siblings show children and some not, + // the appearance may be mess and not consistent, + levels: [] // Each item: { + // visibleMin, itemStyle, visualDimension, label + // } + // data: { + // value: [], + // children: [], + // link: 'http://xxx.xxx.xxx', + // target: 'blank' or 'self' + // } }, /** * @override */ - render: function (seriesModel, ecModel, api, payload) { - - var models = ecModel.findComponents({ - mainType: 'series', subType: 'treemap', query: payload - }); - if (indexOf(models, seriesModel) < 0) { - return; - } + getInitialData: function (option, ecModel) { + // Create a virtual root. + var root = {name: option.name, children: option.data}; - this.seriesModel = seriesModel; - this.api = api; - this.ecModel = ecModel; + completeTreeValue(root); - var types = ['treemapZoomToNode', 'treemapRootToNode']; - var targetInfo = retrieveTargetInfo(payload, types, seriesModel); - var payloadType = payload && payload.type; - var layoutInfo = seriesModel.layoutInfo; - var isInit = !this._oldTree; - var thisStorage = this._storage; + var levels = option.levels || []; - // Mark new root when action is treemapRootToNode. - var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage) - ? { - rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], - direction: payload.direction - } - : null; + levels = option.levels = setDefault(levels, ecModel); + var levelModels = map(levels || [], function (levelDefine) { + return new Model(levelDefine, this, ecModel); + }, this); - var containerGroup = this._giveContainerGroup(layoutInfo); + // Make sure always a new tree is created when setOption, + // in TreemapView, we check whether oldTree === newTree + // to choose mappings approach among old shapes and new shapes. + var tree = Tree.createTree(root, this, null, beforeLink); - var renderResult = this._doRender(containerGroup, seriesModel, reRoot); - ( - !isInit && ( - !payloadType - || payloadType === 'treemapZoomToNode' - || payloadType === 'treemapRootToNode' - ) - ) - ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) - : renderResult.renderFinally(); + function beforeLink(nodeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + var node = tree.getNodeByDataIndex(idx); + var levelModel = levelModels[node.depth]; + levelModel && (model.parentModel = levelModel); + return model; + }); + } - this._resetController(api); + return tree.data; + }, - this._renderBreadcrumb(seriesModel, api, targetInfo); + optionUpdated: function () { + this.resetViewRoot(); }, /** - * @private + * @override + * @param {number} dataIndex + * @param {boolean} [mutipleSeries=false] */ - _giveContainerGroup: function (layoutInfo) { - var containerGroup = this._containerGroup; - if (!containerGroup) { - // FIXME - // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。 - containerGroup = this._containerGroup = new Group$2(); - this._initEvents(containerGroup); - this.group.add(containerGroup); - } - containerGroup.attr('position', [layoutInfo.x, layoutInfo.y]); + formatTooltip: function (dataIndex) { + var data = this.getData(); + var value = this.getRawValue(dataIndex); + var formattedValue = isArray(value) + ? addCommas(value[0]) : addCommas(value); + var name = data.getName(dataIndex); - return containerGroup; + return encodeHTML(name + ': ' + formattedValue); }, /** - * @private + * Add tree path to tooltip param + * + * @override + * @param {number} dataIndex + * @return {Object} */ - _doRender: function (containerGroup, seriesModel, reRoot) { - var thisTree = seriesModel.getData().tree; - var oldTree = this._oldTree; - - // Clear last shape records. - var lastsForAnimation = createStorage(); - var thisStorage = createStorage(); - var oldStorage = this._storage; - var willInvisibleEls = []; - var doRenderNode = curry( - renderNode, seriesModel, - thisStorage, oldStorage, reRoot, - lastsForAnimation, willInvisibleEls - ); - - // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow), - // the oldTree is actually losted, so we can not find all of the old graphic - // elements from tree. So we use this stragegy: make element storage, move - // from old storage to new storage, clear old storage. - - dualTravel( - thisTree.root ? [thisTree.root] : [], - (oldTree && oldTree.root) ? [oldTree.root] : [], - containerGroup, - thisTree === oldTree || !oldTree, - 0 - ); - - // Process all removing. - var willDeleteEls = clearStorage(oldStorage); - - this._oldTree = thisTree; - this._storage = thisStorage; + getDataParams: function (dataIndex) { + var params = SeriesModel.prototype.getDataParams.apply(this, arguments); - return { - lastsForAnimation: lastsForAnimation, - willDeleteEls: willDeleteEls, - renderFinally: renderFinally - }; + var node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treePathInfo = wrapTreePathInfo(node, this); - function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { - // When 'render' is triggered by action, - // 'this' and 'old' may be the same tree, - // we use rawIndex in that case. - if (sameTree) { - oldViewChildren = thisViewChildren; - each$8(thisViewChildren, function (child, index) { - !child.isRemoved() && processNode(index, index); - }); - } - // Diff hierarchically (diff only in each subtree, but not whole). - // because, consistency of view is important. - else { - (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey)) - .add(processNode) - .update(processNode) - .remove(curry(processNode, null)) - .execute(); - } + return params; + }, - function getKey(node) { - // Identify by name or raw index. - return node.getId(); - } + /** + * @public + * @param {Object} layoutInfo { + * x: containerGroup x + * y: containerGroup y + * width: containerGroup width + * height: containerGroup height + * } + */ + setLayoutInfo: function (layoutInfo) { + /** + * @readOnly + * @type {Object} + */ + this.layoutInfo = this.layoutInfo || {}; + extend(this.layoutInfo, layoutInfo); + }, - function processNode(newIndex, oldIndex) { - var thisNode = newIndex != null ? thisViewChildren[newIndex] : null; - var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; + /** + * @param {string} id + * @return {number} index + */ + mapIdToIndex: function (id) { + // A feature is implemented: + // index is monotone increasing with the sequence of + // input id at the first time. + // This feature can make sure that each data item and its + // mapped color have the same index between data list and + // color list at the beginning, which is useful for user + // to adjust data-color mapping. - var group = doRenderNode(thisNode, oldNode, parentGroup, depth); + /** + * @private + * @type {Object} + */ + var idIndexMap = this._idIndexMap; - group && dualTravel( - thisNode && thisNode.viewChildren || [], - oldNode && oldNode.viewChildren || [], - group, - sameTree, - depth + 1 - ); - } + if (!idIndexMap) { + idIndexMap = this._idIndexMap = createHashMap(); + /** + * @private + * @type {number} + */ + this._idIndexMapCount = 0; } - function clearStorage(storage) { - var willDeleteEls = createStorage(); - storage && each$8(storage, function (store, storageName) { - var delEls = willDeleteEls[storageName]; - each$8(store, function (el) { - el && (delEls.push(el), el.__tmWillDelete = 1); - }); - }); - return willDeleteEls; + var index = idIndexMap.get(id); + if (index == null) { + idIndexMap.set(id, index = this._idIndexMapCount++); } - function renderFinally() { - each$8(willDeleteEls, function (els) { - each$8(els, function (el) { - el.parent && el.parent.remove(el); - }); - }); - each$8(willInvisibleEls, function (el) { - el.invisible = true; - // Setting invisible is for optimizing, so no need to set dirty, - // just mark as invisible. - el.dirty(); - }); - } + return index; + }, + + getViewRoot: function () { + return this._viewRoot; }, /** - * @private + * @param {module:echarts/data/Tree~Node} [viewRoot] */ - _doAnimation: function (containerGroup, renderResult, seriesModel, reRoot) { - if (!seriesModel.get('animation')) { - return; - } + resetViewRoot: function (viewRoot) { + viewRoot + ? (this._viewRoot = viewRoot) + : (viewRoot = this._viewRoot); - var duration = seriesModel.get('animationDurationUpdate'); - var easing = seriesModel.get('animationEasing'); - var animationWrap = createWrap(); + var root = this.getRawData().tree.root; - // Make delete animations. - each$8(renderResult.willDeleteEls, function (store, storageName) { - each$8(store, function (el, rawIndex) { - if (el.invisible) { - return; - } + if (!viewRoot + || (viewRoot !== root && !root.contains(viewRoot)) + ) { + this._viewRoot = root; + } + } +}); - var parent = el.parent; // Always has parent, and parent is nodeGroup. - var target; +/** + * @param {Object} dataNode + */ +function completeTreeValue(dataNode) { + // Postorder travel tree. + // If value of none-leaf node is not set, + // calculate it by suming up the value of all children. + var sum = 0; - if (reRoot && reRoot.direction === 'drillDown') { - target = parent === reRoot.rootNodeGroup - // This is the content element of view root. - // Only `content` will enter this branch, because - // `background` and `nodeGroup` will not be deleted. - ? { - shape: { - x: 0, - y: 0, - width: parent.__tmNodeWidth, - height: parent.__tmNodeHeight - }, - style: { - opacity: 0 - } - } - // Others. - : {style: {opacity: 0}}; - } - else { - var targetX = 0; - var targetY = 0; + each$1(dataNode.children, function (child) { - if (!parent.__tmWillDelete) { - // Let node animate to right-bottom corner, cooperating with fadeout, - // which is appropriate for user understanding. - // Divided by 2 for reRoot rolling up effect. - targetX = parent.__tmNodeWidth / 2; - targetY = parent.__tmNodeHeight / 2; - } + completeTreeValue(child); - target = storageName === 'nodeGroup' - ? {position: [targetX, targetY], style: {opacity: 0}} - : { - shape: {x: targetX, y: targetY, width: 0, height: 0}, - style: {opacity: 0} - }; - } + var childValue = child.value; + isArray(childValue) && (childValue = childValue[0]); - target && animationWrap.add(el, target, duration, easing); - }); - }); + sum += childValue; + }); - // Make other animations - each$8(this._storage, function (store, storageName) { - each$8(store, function (el, rawIndex) { - var last = renderResult.lastsForAnimation[storageName][rawIndex]; - var target = {}; + var thisValue = dataNode.value; + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } - if (!last) { - return; - } + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum; + } + // Value should not less than 0. + if (thisValue < 0) { + thisValue = 0; + } - if (storageName === 'nodeGroup') { - if (last.old) { - target.position = el.position.slice(); - el.attr('position', last.old); - } - } - else { - if (last.old) { - target.shape = extend({}, el.shape); - el.setShape(last.old); - } + isArray(dataNode.value) + ? (dataNode.value[0] = thisValue) + : (dataNode.value = thisValue); +} - if (last.fadein) { - el.setStyle('opacity', 0); - target.style = {opacity: 1}; - } - // When animation is stopped for succedent animation starting, - // el.style.opacity might not be 1 - else if (el.style.opacity !== 1) { - target.style = {opacity: 1}; - } - } +/** + * set default to level configuration + */ +function setDefault(levels, ecModel) { + var globalColorList = ecModel.get('color'); - animationWrap.add(el, target, duration, easing); - }); - }, this); + if (!globalColorList) { + return; + } - this._state = 'animating'; + levels = levels || []; + var hasColorDefine; + each$1(levels, function (levelDefine) { + var model = new Model(levelDefine); + var modelColor = model.get('color'); - animationWrap - .done(bind$1(function () { - this._state = 'ready'; - renderResult.renderFinally(); - }, this)) - .start(); - }, + if (model.get('itemStyle.color') + || (modelColor && modelColor !== 'none') + ) { + hasColorDefine = true; + } + }); + + if (!hasColorDefine) { + var level0 = levels[0] || (levels[0] = {}); + level0.color = globalColorList.slice(); + } + + return levels; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var TEXT_PADDING = 8; +var ITEM_GAP = 8; +var ARRAY_LENGTH = 5; +function Breadcrumb(containerGroup) { /** * @private + * @type {module:zrender/container/Group} */ - _resetController: function (api) { - var controller = this._controller; + this.group = new Group(); - // Init controller. - if (!controller) { - controller = this._controller = new RoamController(api.getZr()); - controller.enable(this.seriesModel.get('roam')); - controller.on('pan', bind$1(this._onPan, this)); - controller.on('zoom', bind$1(this._onZoom, this)); + containerGroup.add(this.group); +} + +Breadcrumb.prototype = { + + constructor: Breadcrumb, + + render: function (seriesModel, api, targetNode, onSelect) { + var model = seriesModel.getModel('breadcrumb'); + var thisGroup = this.group; + + thisGroup.removeAll(); + + if (!model.get('show') || !targetNode) { + return; } - var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); - controller.setPointerChecker(function (e, x, y) { - return rect.contain(x, y); - }); + var normalStyleModel = model.getModel('itemStyle'); + // var emphasisStyleModel = model.getModel('emphasis.itemStyle'); + var textStyleModel = normalStyleModel.getModel('textStyle'); + + var layoutParam = { + pos: { + left: model.get('left'), + right: model.get('right'), + top: model.get('top'), + bottom: model.get('bottom') + }, + box: { + width: api.getWidth(), + height: api.getHeight() + }, + emptyItemWidth: model.get('emptyItemWidth'), + totalWidth: 0, + renderList: [] + }; + + this._prepare(targetNode, layoutParam, textStyleModel); + this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); + + positionElement(thisGroup, layoutParam.pos, layoutParam.box); }, /** + * Prepare render list and total width * @private */ - _clearController: function () { - var controller = this._controller; - if (controller) { - controller.dispose(); - controller = null; + _prepare: function (targetNode, layoutParam, textStyleModel) { + for (var node = targetNode; node; node = node.parentNode) { + var text = node.getModel().get('name'); + var textRect = textStyleModel.getTextRect(text); + var itemWidth = Math.max( + textRect.width + TEXT_PADDING * 2, + layoutParam.emptyItemWidth + ); + layoutParam.totalWidth += itemWidth + ITEM_GAP; + layoutParam.renderList.push({node: node, text: text, width: itemWidth}); } }, /** * @private */ - _onPan: function (e) { - if (this._state !== 'animating' - && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD) - ) { - // These param must not be cached. - var root = this.seriesModel.getData().tree.root; - - if (!root) { - return; - } + _renderContent: function ( + seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect + ) { + // Start rendering. + var lastX = 0; + var emptyItemWidth = layoutParam.emptyItemWidth; + var height = seriesModel.get('breadcrumb.height'); + var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); + var totalWidth = layoutParam.totalWidth; + var renderList = layoutParam.renderList; - var rootLayout = root.getLayout(); + for (var i = renderList.length - 1; i >= 0; i--) { + var item = renderList[i]; + var itemNode = item.node; + var itemWidth = item.width; + var text = item.text; - if (!rootLayout) { - return; + // Hdie text and shorten width if necessary. + if (totalWidth > availableSize.width) { + totalWidth -= itemWidth - emptyItemWidth; + itemWidth = emptyItemWidth; + text = null; } - this.api.dispatchAction({ - type: 'treemapMove', - from: this.uid, - seriesId: this.seriesModel.id, - rootRect: { - x: rootLayout.x + e.dx, y: rootLayout.y + e.dy, - width: rootLayout.width, height: rootLayout.height - } + var el = new Polygon({ + shape: { + points: makeItemPoints( + lastX, 0, itemWidth, height, + i === renderList.length - 1, i === 0 + ) + }, + style: defaults( + normalStyleModel.getItemStyle(), + { + lineJoin: 'bevel', + text: text, + textFill: textStyleModel.getTextColor(), + textFont: textStyleModel.getFont() + } + ), + z: 10, + onclick: curry(onSelect, itemNode) }); + this.group.add(el); + + packEventData(el, seriesModel, itemNode); + + lastX += itemWidth + ITEM_GAP; } }, /** - * @private + * @override */ - _onZoom: function (e) { - var mouseX = e.originX; - var mouseY = e.originY; + remove: function () { + this.group.removeAll(); + } +}; - if (this._state !== 'animating') { - // These param must not be cached. - var root = this.seriesModel.getData().tree.root; +function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) { + var points = [ + [head ? x : x - ARRAY_LENGTH, y], + [x + itemWidth, y], + [x + itemWidth, y + itemHeight], + [head ? x : x - ARRAY_LENGTH, y + itemHeight] + ]; + !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); + !head && points.push([x, y + itemHeight / 2]); + return points; +} - if (!root) { - return; - } +// Package custom mouse event. +function packEventData(el, seriesModel, itemNode) { + el.eventData = { + componentType: 'series', + componentSubType: 'treemap', + componentIndex: seriesModel.componentIndex, + seriesIndex: seriesModel.componentIndex, + seriesName: seriesModel.name, + seriesType: 'treemap', + selfType: 'breadcrumb', // Distinguish with click event on treemap node. + nodeData: { + dataIndex: itemNode && itemNode.dataIndex, + name: itemNode && itemNode.name + }, + treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) + }; +} - var rootLayout = root.getLayout(); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - if (!rootLayout) { - return; +/** + * @param {number} [time=500] Time in ms + * @param {string} [easing='linear'] + * @param {number} [delay=0] + * @param {Function} [callback] + * + * @example + * // Animate position + * animation + * .createWrap() + * .add(el1, {position: [10, 10]}) + * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400) + * .done(function () { // done }) + * .start('cubicOut'); + */ +function createWrap() { + + var storage = []; + var elExistsMap = {}; + var doneCallback; + + return { + + /** + * Caution: a el can only be added once, otherwise 'done' + * might not be called. This method checks this (by el.id), + * suppresses adding and returns false when existing el found. + * + * @param {modele:zrender/Element} el + * @param {Object} target + * @param {number} [time=500] + * @param {number} [delay=0] + * @param {string} [easing='linear'] + * @return {boolean} Whether adding succeeded. + * + * @example + * add(el, target, time, delay, easing); + * add(el, target, time, easing); + * add(el, target, time); + * add(el, target); + */ + add: function (el, target, time, delay, easing) { + if (isString(delay)) { + easing = delay; + delay = 0; } - var rect = new BoundingRect( - rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height - ); - var layoutInfo = this.seriesModel.layoutInfo; + if (elExistsMap[el.id]) { + return false; + } + elExistsMap[el.id] = 1; - // Transform mouse coord from global to containerGroup. - mouseX -= layoutInfo.x; - mouseY -= layoutInfo.y; + storage.push( + {el: el, target: target, time: time, delay: delay, easing: easing} + ); - // Scale root bounding rect. - var m = create$1(); - translate(m, m, [-mouseX, -mouseY]); - scale$1(m, m, [e.scale, e.scale]); - translate(m, m, [mouseX, mouseY]); + return true; + }, - rect.applyTransform(m); + /** + * Only execute when animation finished. Will not execute when any + * of 'stop' or 'stopAnimation' called. + * + * @param {Function} callback + */ + done: function (callback) { + doneCallback = callback; + return this; + }, - this.api.dispatchAction({ - type: 'treemapRender', - from: this.uid, - seriesId: this.seriesModel.id, - rootRect: { - x: rect.x, y: rect.y, - width: rect.width, height: rect.height - } - }); - } - }, + /** + * Will stop exist animation firstly. + */ + start: function () { + var count = storage.length; - /** - * @private - */ - _initEvents: function (containerGroup) { - containerGroup.on('click', function (e) { - if (this._state !== 'ready') { - return; + for (var i = 0, len = storage.length; i < len; i++) { + var item = storage[i]; + item.el.animateTo(item.target, item.time, item.delay, item.easing, done); } - var nodeClick = this.seriesModel.get('nodeClick', true); + return this; - if (!nodeClick) { - return; + function done() { + count--; + if (!count) { + storage.length = 0; + elExistsMap = {}; + doneCallback && doneCallback(); + } } + } + }; +} - var targetInfo = this.findTarget(e.offsetX, e.offsetY); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - if (!targetInfo) { - return; - } +var bind$1 = bind; +var Group$2 = Group; +var Rect$1 = Rect; +var each$8 = each$1; - var node = targetInfo.node; - if (node.getLayout().isLeafRoot) { - this._rootToNode(targetInfo); - } - else { - if (nodeClick === 'zoomToNode') { - this._zoomToNode(targetInfo); - } - else if (nodeClick === 'link') { - var itemModel = node.hostTree.data.getItemModel(node.dataIndex); - var link = itemModel.get('link', true); - var linkTarget = itemModel.get('target', true) || 'blank'; - link && window.open(link, linkTarget); - } - } +var DRAG_THRESHOLD = 3; +var PATH_LABEL_NOAMAL = ['label']; +var PATH_LABEL_EMPHASIS = ['emphasis', 'label']; +var PATH_UPPERLABEL_NORMAL = ['upperLabel']; +var PATH_UPPERLABEL_EMPHASIS = ['emphasis', 'upperLabel']; +var Z_BASE = 10; // Should bigger than every z. +var Z_BG = 1; +var Z_CONTENT = 2; - }, this); - }, +var getItemStyleEmphasis = makeStyleMapper([ + ['fill', 'color'], + // `borderColor` and `borderWidth` has been occupied, + // so use `stroke` to indicate the stroke of the rect. + ['stroke', 'strokeColor'], + ['lineWidth', 'strokeWidth'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['shadowColor'] +]); +var getItemStyleNormal = function (model) { + // Normal style props should include emphasis style props. + var itemStyle = getItemStyleEmphasis(model); + // Clear styles set by emphasis. + itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; + return itemStyle; +}; + +extendChartView({ + + type: 'treemap', /** - * @private + * @override */ - _renderBreadcrumb: function (seriesModel, api, targetInfo) { - if (!targetInfo) { - targetInfo = seriesModel.get('leafDepth', true) != null - ? {node: seriesModel.getViewRoot()} - // FIXME - // better way? - // Find breadcrumb tail on center of containerGroup. - : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); + init: function (o, api) { - if (!targetInfo) { - targetInfo = {node: seriesModel.getData().tree.root}; - } - } + /** + * @private + * @type {module:zrender/container/Group} + */ + this._containerGroup; - (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))) - .render(seriesModel, api, targetInfo.node, bind$1(onSelect, this)); + /** + * @private + * @type {Object.>} + */ + this._storage = createStorage(); - function onSelect(node) { - if (this._state !== 'animating') { - aboveViewRoot(seriesModel.getViewRoot(), node) - ? this._rootToNode({node: node}) - : this._zoomToNode({node: node}); - } - } + /** + * @private + * @type {module:echarts/data/Tree} + */ + this._oldTree; + + /** + * @private + * @type {module:echarts/chart/treemap/Breadcrumb} + */ + this._breadcrumb; + + /** + * @private + * @type {module:echarts/component/helper/RoamController} + */ + this._controller; + + /** + * 'ready', 'animating' + * @private + */ + this._state = 'ready'; }, /** * @override */ - remove: function () { - this._clearController(); + render: function (seriesModel, ecModel, api, payload) { + + var models = ecModel.findComponents({ + mainType: 'series', subType: 'treemap', query: payload + }); + if (indexOf(models, seriesModel) < 0) { + return; + } + + this.seriesModel = seriesModel; + this.api = api; + this.ecModel = ecModel; + + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, seriesModel); + var payloadType = payload && payload.type; + var layoutInfo = seriesModel.layoutInfo; + var isInit = !this._oldTree; + var thisStorage = this._storage; + + // Mark new root when action is treemapRootToNode. + var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage) + ? { + rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], + direction: payload.direction + } + : null; + + var containerGroup = this._giveContainerGroup(layoutInfo); + + var renderResult = this._doRender(containerGroup, seriesModel, reRoot); + ( + !isInit && ( + !payloadType + || payloadType === 'treemapZoomToNode' + || payloadType === 'treemapRootToNode' + ) + ) + ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) + : renderResult.renderFinally(); + + this._resetController(api); + + this._renderBreadcrumb(seriesModel, api, targetInfo); + }, + + /** + * @private + */ + _giveContainerGroup: function (layoutInfo) { + var containerGroup = this._containerGroup; + if (!containerGroup) { + // FIXME + // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。 + containerGroup = this._containerGroup = new Group$2(); + this._initEvents(containerGroup); + this.group.add(containerGroup); + } + containerGroup.attr('position', [layoutInfo.x, layoutInfo.y]); + + return containerGroup; + }, + + /** + * @private + */ + _doRender: function (containerGroup, seriesModel, reRoot) { + var thisTree = seriesModel.getData().tree; + var oldTree = this._oldTree; + + // Clear last shape records. + var lastsForAnimation = createStorage(); + var thisStorage = createStorage(); + var oldStorage = this._storage; + var willInvisibleEls = []; + + var doRenderNode = curry( + renderNode, seriesModel, + thisStorage, oldStorage, reRoot, + lastsForAnimation, willInvisibleEls + ); + + // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow), + // the oldTree is actually losted, so we can not find all of the old graphic + // elements from tree. So we use this stragegy: make element storage, move + // from old storage to new storage, clear old storage. + + dualTravel( + thisTree.root ? [thisTree.root] : [], + (oldTree && oldTree.root) ? [oldTree.root] : [], + containerGroup, + thisTree === oldTree || !oldTree, + 0 + ); + + // Process all removing. + var willDeleteEls = clearStorage(oldStorage); + + this._oldTree = thisTree; + this._storage = thisStorage; + + return { + lastsForAnimation: lastsForAnimation, + willDeleteEls: willDeleteEls, + renderFinally: renderFinally + }; + + function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { + // When 'render' is triggered by action, + // 'this' and 'old' may be the same tree, + // we use rawIndex in that case. + if (sameTree) { + oldViewChildren = thisViewChildren; + each$8(thisViewChildren, function (child, index) { + !child.isRemoved() && processNode(index, index); + }); + } + // Diff hierarchically (diff only in each subtree, but not whole). + // because, consistency of view is important. + else { + (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey)) + .add(processNode) + .update(processNode) + .remove(curry(processNode, null)) + .execute(); + } + + function getKey(node) { + // Identify by name or raw index. + return node.getId(); + } + + function processNode(newIndex, oldIndex) { + var thisNode = newIndex != null ? thisViewChildren[newIndex] : null; + var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; + + var group = doRenderNode(thisNode, oldNode, parentGroup, depth); + + group && dualTravel( + thisNode && thisNode.viewChildren || [], + oldNode && oldNode.viewChildren || [], + group, + sameTree, + depth + 1 + ); + } + } + + function clearStorage(storage) { + var willDeleteEls = createStorage(); + storage && each$8(storage, function (store, storageName) { + var delEls = willDeleteEls[storageName]; + each$8(store, function (el) { + el && (delEls.push(el), el.__tmWillDelete = 1); + }); + }); + return willDeleteEls; + } + + function renderFinally() { + each$8(willDeleteEls, function (els) { + each$8(els, function (el) { + el.parent && el.parent.remove(el); + }); + }); + each$8(willInvisibleEls, function (el) { + el.invisible = true; + // Setting invisible is for optimizing, so no need to set dirty, + // just mark as invisible. + el.dirty(); + }); + } + }, + + /** + * @private + */ + _doAnimation: function (containerGroup, renderResult, seriesModel, reRoot) { + if (!seriesModel.get('animation')) { + return; + } + + var duration = seriesModel.get('animationDurationUpdate'); + var easing = seriesModel.get('animationEasing'); + var animationWrap = createWrap(); + + // Make delete animations. + each$8(renderResult.willDeleteEls, function (store, storageName) { + each$8(store, function (el, rawIndex) { + if (el.invisible) { + return; + } + + var parent = el.parent; // Always has parent, and parent is nodeGroup. + var target; + + if (reRoot && reRoot.direction === 'drillDown') { + target = parent === reRoot.rootNodeGroup + // This is the content element of view root. + // Only `content` will enter this branch, because + // `background` and `nodeGroup` will not be deleted. + ? { + shape: { + x: 0, + y: 0, + width: parent.__tmNodeWidth, + height: parent.__tmNodeHeight + }, + style: { + opacity: 0 + } + } + // Others. + : {style: {opacity: 0}}; + } + else { + var targetX = 0; + var targetY = 0; + + if (!parent.__tmWillDelete) { + // Let node animate to right-bottom corner, cooperating with fadeout, + // which is appropriate for user understanding. + // Divided by 2 for reRoot rolling up effect. + targetX = parent.__tmNodeWidth / 2; + targetY = parent.__tmNodeHeight / 2; + } + + target = storageName === 'nodeGroup' + ? {position: [targetX, targetY], style: {opacity: 0}} + : { + shape: {x: targetX, y: targetY, width: 0, height: 0}, + style: {opacity: 0} + }; + } + + target && animationWrap.add(el, target, duration, easing); + }); + }); + + // Make other animations + each$8(this._storage, function (store, storageName) { + each$8(store, function (el, rawIndex) { + var last = renderResult.lastsForAnimation[storageName][rawIndex]; + var target = {}; + + if (!last) { + return; + } + + if (storageName === 'nodeGroup') { + if (last.old) { + target.position = el.position.slice(); + el.attr('position', last.old); + } + } + else { + if (last.old) { + target.shape = extend({}, el.shape); + el.setShape(last.old); + } + + if (last.fadein) { + el.setStyle('opacity', 0); + target.style = {opacity: 1}; + } + // When animation is stopped for succedent animation starting, + // el.style.opacity might not be 1 + else if (el.style.opacity !== 1) { + target.style = {opacity: 1}; + } + } + + animationWrap.add(el, target, duration, easing); + }); + }, this); + + this._state = 'animating'; + + animationWrap + .done(bind$1(function () { + this._state = 'ready'; + renderResult.renderFinally(); + }, this)) + .start(); + }, + + /** + * @private + */ + _resetController: function (api) { + var controller = this._controller; + + // Init controller. + if (!controller) { + controller = this._controller = new RoamController(api.getZr()); + controller.enable(this.seriesModel.get('roam')); + controller.on('pan', bind$1(this._onPan, this)); + controller.on('zoom', bind$1(this._onZoom, this)); + } + + var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); + controller.setPointerChecker(function (e, x, y) { + return rect.contain(x, y); + }); + }, + + /** + * @private + */ + _clearController: function () { + var controller = this._controller; + if (controller) { + controller.dispose(); + controller = null; + } + }, + + /** + * @private + */ + _onPan: function (e) { + if (this._state !== 'animating' + && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD) + ) { + // These param must not be cached. + var root = this.seriesModel.getData().tree.root; + + if (!root) { + return; + } + + var rootLayout = root.getLayout(); + + if (!rootLayout) { + return; + } + + this.api.dispatchAction({ + type: 'treemapMove', + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rootLayout.x + e.dx, y: rootLayout.y + e.dy, + width: rootLayout.width, height: rootLayout.height + } + }); + } + }, + + /** + * @private + */ + _onZoom: function (e) { + var mouseX = e.originX; + var mouseY = e.originY; + + if (this._state !== 'animating') { + // These param must not be cached. + var root = this.seriesModel.getData().tree.root; + + if (!root) { + return; + } + + var rootLayout = root.getLayout(); + + if (!rootLayout) { + return; + } + + var rect = new BoundingRect( + rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height + ); + var layoutInfo = this.seriesModel.layoutInfo; + + // Transform mouse coord from global to containerGroup. + mouseX -= layoutInfo.x; + mouseY -= layoutInfo.y; + + // Scale root bounding rect. + var m = create$1(); + translate(m, m, [-mouseX, -mouseY]); + scale$1(m, m, [e.scale, e.scale]); + translate(m, m, [mouseX, mouseY]); + + rect.applyTransform(m); + + this.api.dispatchAction({ + type: 'treemapRender', + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rect.x, y: rect.y, + width: rect.width, height: rect.height + } + }); + } + }, + + /** + * @private + */ + _initEvents: function (containerGroup) { + containerGroup.on('click', function (e) { + if (this._state !== 'ready') { + return; + } + + var nodeClick = this.seriesModel.get('nodeClick', true); + + if (!nodeClick) { + return; + } + + var targetInfo = this.findTarget(e.offsetX, e.offsetY); + + if (!targetInfo) { + return; + } + + var node = targetInfo.node; + if (node.getLayout().isLeafRoot) { + this._rootToNode(targetInfo); + } + else { + if (nodeClick === 'zoomToNode') { + this._zoomToNode(targetInfo); + } + else if (nodeClick === 'link') { + var itemModel = node.hostTree.data.getItemModel(node.dataIndex); + var link = itemModel.get('link', true); + var linkTarget = itemModel.get('target', true) || 'blank'; + link && windowOpen(link, linkTarget); + } + } + + }, this); + }, + + /** + * @private + */ + _renderBreadcrumb: function (seriesModel, api, targetInfo) { + if (!targetInfo) { + targetInfo = seriesModel.get('leafDepth', true) != null + ? {node: seriesModel.getViewRoot()} + // FIXME + // better way? + // Find breadcrumb tail on center of containerGroup. + : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); + + if (!targetInfo) { + targetInfo = {node: seriesModel.getData().tree.root}; + } + } + + (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))) + .render(seriesModel, api, targetInfo.node, bind$1(onSelect, this)); + + function onSelect(node) { + if (this._state !== 'animating') { + aboveViewRoot(seriesModel.getViewRoot(), node) + ? this._rootToNode({node: node}) + : this._zoomToNode({node: node}); + } + } + }, + + /** + * @override + */ + remove: function () { + this._clearController(); this._containerGroup && this._containerGroup.removeAll(); this._storage = createStorage(); this._state = 'ready'; @@ -50409,6 +54115,11 @@ function renderNode( // Start of closure variables available in "Procedures in renderNode". var thisLayout = thisNode.getLayout(); + var data = seriesModel.getData(); + + // Only for enabling highlight/downplay. Clear firstly. + // Because some node will not be rendered. + data.setItemGraphicEl(thisNode.dataIndex, null); if (!thisLayout || !thisLayout.isInView) { return; @@ -50448,14 +54159,36 @@ function renderNode( return group; } + var nodeModel = thisNode.getModel(); + // Background var bg = giveGraphic('background', Rect$1, depth, Z_BG); - bg && renderBackground(group, bg, isParent && thisLayout.upperHeight); + bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight); // No children, render content. - if (!isParent) { + if (isParent) { + // Because of the implementation about "traverse" in graphic hover style, we + // can not set hover listener on the "group" of non-leaf node. Otherwise the + // hover event from the descendents will be listenered. + if (isHighDownDispatcher(group)) { + setAsHighDownDispatcher(group, false); + } + if (bg) { + setAsHighDownDispatcher(bg, true); + // Only for enabling highlight/downplay. + data.setItemGraphicEl(thisNode.dataIndex, bg); + } + } + else { var content = giveGraphic('content', Rect$1, depth, Z_CONTENT); content && renderContent(group, content); + + if (bg && isHighDownDispatcher(bg)) { + setAsHighDownDispatcher(bg, false); + } + setAsHighDownDispatcher(group, true); + // Only for enabling highlight/downplay. + data.setItemGraphicEl(thisNode.dataIndex, group); } return group; @@ -50470,10 +54203,17 @@ function renderNode( bg.seriesIndex = seriesModel.seriesIndex; bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight}); - var visualBorderColor = thisNode.getVisual('borderColor', true); - var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor'); - updateStyle(bg, function () { + if (thisInvisible) { + // If invisible, do not set visual, otherwise the element will + // change immediately before animation. We think it is OK to + // remain its origin color when moving out of the view window. + processInvisible(bg); + } + else { + bg.invisible = false; + var visualBorderColor = thisNode.getVisual('borderColor', true); + var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor'); var normalStyle = getItemStyleNormal(itemStyleNormalModel); normalStyle.fill = visualBorderColor; var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); @@ -50493,8 +54233,8 @@ function renderNode( } bg.setStyle(normalStyle); - setHoverStyle(bg, emphasisStyle); - }); + setElementHoverStyle(bg, emphasisStyle); + } group.add(bg); } @@ -50515,8 +54255,15 @@ function renderNode( height: contentHeight }); - var visualColor = thisNode.getVisual('color', true); - updateStyle(content, function () { + if (thisInvisible) { + // If invisible, do not set visual, otherwise the element will + // change immediately before animation. We think it is OK to + // remain its origin color when moving out of the view window. + processInvisible(content); + } + else { + content.invisible = false; + var visualColor = thisNode.getVisual('color', true); var normalStyle = getItemStyleNormal(itemStyleNormalModel); normalStyle.fill = visualColor; var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); @@ -50524,42 +54271,20 @@ function renderNode( prepareText(normalStyle, emphasisStyle, visualColor, contentWidth, contentHeight); content.setStyle(normalStyle); - setHoverStyle(content, emphasisStyle); - }); + setElementHoverStyle(content, emphasisStyle); + } group.add(content); } - function updateStyle(element, cb) { - if (!thisInvisible) { - // If invisible, do not set visual, otherwise the element will - // change immediately before animation. We think it is OK to - // remain its origin color when moving out of the view window. - cb(); - - if (!element.__tmWillVisible) { - element.invisible = false; - } - } - else { - // Delay invisible setting utill animation finished, - // avoid element vanish suddenly before animation. - !element.invisible && willInvisibleEls.push(element); - } + function processInvisible(element) { + // Delay invisible setting utill animation finished, + // avoid element vanish suddenly before animation. + !element.invisible && willInvisibleEls.push(element); } function prepareText(normalStyle, emphasisStyle, visualColor, width, height, upperLabelRect) { - var nodeModel = thisNode.getModel(); - var text = retrieve( - seriesModel.getFormattedLabel( - thisNode.dataIndex, 'normal', null, null, upperLabelRect ? 'upperLabel' : 'label' - ), - nodeModel.get('name') - ); - if (!upperLabelRect && thisLayout.isLeafRoot) { - var iconChar = seriesModel.get('drillDownIcon', true); - text = iconChar ? iconChar + ' ' + text : text; - } + var defaultText = nodeModel.get('name'); var normalLabelModel = nodeModel.getModel( upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL @@ -50573,12 +54298,18 @@ function renderNode( setLabelStyle( normalStyle, emphasisStyle, normalLabelModel, emphasisLabelModel, { - defaultText: isShow ? text : null, + defaultText: isShow ? defaultText : null, autoColor: visualColor, - isRectText: true + isRectText: true, + labelFetcher: seriesModel, + labelDataIndex: thisNode.dataIndex, + labelProp: upperLabelRect ? 'upperLabel' : 'label' } ); + addDrillDownIcon(normalStyle, upperLabelRect, thisLayout); + addDrillDownIcon(emphasisStyle, upperLabelRect, thisLayout); + upperLabelRect && (normalStyle.textRect = clone(upperLabelRect)); normalStyle.truncate = (isShow && normalLabelModel.get('ellipsis')) @@ -50590,10 +54321,18 @@ function renderNode( : null; } - function giveGraphic(storageName, Ctor, depth, z) { - var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; - var lasts = lastsForAnimation[storageName]; - + function addDrillDownIcon(style, upperLabelRect, thisLayout) { + var text = style.text; + if (!upperLabelRect && thisLayout.isLeafRoot && text != null) { + var iconChar = seriesModel.get('drillDownIcon', true); + style.text = iconChar ? iconChar + ' ' + text : text; + } + } + + function giveGraphic(storageName, Ctor, depth, z) { + var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; + var lasts = lastsForAnimation[storageName]; + if (element) { // Remove from oldStorage oldStorage[storageName][oldRawIndex] = null; @@ -50646,6 +54385,7 @@ function renderNode( // Fade in, user can be aware that these nodes are new. lastCfg.fadein = storageName !== 'nodeGroup'; } + } // We can not set all backgroud with the same z, Because the behaviour of @@ -51581,8 +55321,7 @@ function mapVisual$1(nodeModel, visuals, child, index, mapping, seriesModel) { if (mapping) { var mappingType = mapping.type; var colorMappingBy = mappingType === 'color' && mapping.__drColorMappingBy; - var value = - colorMappingBy === 'index' + var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) @@ -51614,15 +55353,17 @@ function mapVisual$1(nodeModel, visuals, child, index, mapping, seriesModel) { */ /* -* The treemap layout implementation references to the treemap -* layout of d3.js (d3/src/layout/treemap.js in v3). The use of -* the source code of this file is also subject to the terms -* and consitions of its license (BSD-3Clause, see -* ). +* A third-party license is embeded for some of the code in this file: +* The treemap layout implementation was originally copied from +* "d3.js" with some modifications made for this project. +* (See more details in the comment of the method "squarify" below.) +* The use of the source code of this file is also subject to the terms +* and consitions of the license of "d3.js" (BSD-3Clause, see +* ). */ -var mathMax$4 = Math.max; -var mathMin$4 = Math.min; +var mathMax$5 = Math.max; +var mathMin$5 = Math.min; var retrieveValue = retrieve; var each$10 = each$1; @@ -51740,8 +55481,12 @@ var treemapLayout = { /** * Layout treemap with squarify algorithm. - * @see https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf - * The implementation references to the treemap layout of d3.js. + * The original presentation of this algorithm + * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk + * . + * The implementation of this algorithm was originally copied from "d3.js" + * + * with some modifications made for this program. * See the license statement at the head of this file. * * @protected @@ -51780,8 +55525,8 @@ function squarify(node, options, hideChildren, depth) { upperLabelHeight: upperLabelHeight }, true); - width = mathMax$4(width - 2 * layoutOffset, 0); - height = mathMax$4(height - layoutOffset - layoutOffsetUpper, 0); + width = mathMax$5(width - 2 * layoutOffset, 0); + height = mathMax$5(height - layoutOffset - layoutOffsetUpper, 0); var totalArea = width * height; var viewChildren = initChildren( @@ -51793,7 +55538,7 @@ function squarify(node, options, hideChildren, depth) { } var rect = {x: layoutOffset, y: layoutOffsetUpper, width: width, height: height}; - var rowFixedLength = mathMin$4(width, height); + var rowFixedLength = mathMin$5(width, height); var best = Infinity; // the best row score so far var row = []; row.area = 0; @@ -51814,7 +55559,7 @@ function squarify(node, options, hideChildren, depth) { else { row.area -= row.pop().getLayout().area; position(row, rowFixedLength, rect, halfGapWidth, false); - rowFixedLength = mathMin$4(rect.width, rect.height); + rowFixedLength = mathMin$5(rect.width, rect.height); row.length = row.area = 0; best = Infinity; } @@ -51928,7 +55673,7 @@ function sort$1(viewChildren, orderBy) { if (orderBy) { viewChildren.sort(function (a, b) { var diff = orderBy === 'asc' - ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); + ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); return diff === 0 ? (orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex @@ -52001,7 +55746,7 @@ function worst(row, rowFixedLength, ratio) { var f = rowFixedLength * rowFixedLength * ratio; return squareArea - ? mathMax$4( + ? mathMax$5( (f * areaMax) / squareArea, squareArea / (f * areaMin) ) @@ -52039,15 +55784,15 @@ function position(row, rowFixedLength, rect, halfGapWidth, flush) { var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0; - var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$4(rowOtherLength - 2 * halfGapWidth, 0); + var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$5(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width. var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last; var modWH = (i === rowLen - 1 || remain < step) ? remain : step; - var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$4(modWH - 2 * halfGapWidth, 0); + var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$5(modWH - 2 * halfGapWidth, 0); - nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$4(halfGapWidth, wh1 / 2); - nodeLayout[xy[idx0WhenH]] = last + mathMin$4(halfGapWidth, wh0 / 2); + nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$5(halfGapWidth, wh1 / 2); + nodeLayout[xy[idx0WhenH]] = last + mathMin$5(halfGapWidth, wh0 / 2); last += modWH; node.setLayout(nodeLayout, true); @@ -52222,15 +55967,8 @@ registerLayout(treemapLayout); * under the License. */ -/** - * Graph data structure - * - * @module echarts/data/Graph - * @author Yi Shen(https://www.github.com/pissang) - */ - // id may be function name of Object, add a prefix to avoid this problem. -function generateNodeKey (id) { +function generateNodeKey(id) { return '_EC_' + id; } /** @@ -52238,7 +55976,7 @@ function generateNodeKey (id) { * @constructor * @param {boolean} directed */ -var Graph = function(directed) { +var Graph = function (directed) { /** * 是否是有向图 * @type {boolean} @@ -52302,7 +56040,7 @@ graphProto.isDirected = function () { * @param {number} [dataIndex] */ graphProto.addNode = function (id, dataIndex) { - id = id || ('' + dataIndex); + id = id == null ? ('' + dataIndex) : ('' + id); var nodesMap = this._nodesMap; @@ -52420,7 +56158,8 @@ graphProto.getEdge = function (n1, n2) { if (this._directed) { return edgesMap[n1 + '-' + n2]; - } else { + } + else { return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1]; } @@ -52853,10 +56592,14 @@ var GraphSeries = extendSeriesModel({ init: function (option) { GraphSeries.superApply(this, 'init', arguments); + var self = this; + function getCategoriesData() { + return self._categoriesData; + } // Provide data for legend select - this.legendDataProvider = function () { - return this._categoriesData; - }; + this.legendVisualProvider = new LegendVisualProvider( + getCategoriesData, getCategoriesData + ); this.fillDataTextStyle(option.edges || option.links); @@ -53036,6 +56779,8 @@ var GraphSeries = extendSeriesModel({ // Node repulsion. Can be an array to represent range. repulsion: [0, 50], gravity: 0.1, + // Initial friction + friction: 0.6, // Edge length. Can be an array to represent range. edgeLength: 30, @@ -53056,7 +56801,8 @@ var GraphSeries = extendSeriesModel({ edgeSymbol: ['none', 'none'], edgeSymbolSize: 10, edgeLabel: { - position: 'middle' + position: 'middle', + distance: 5 }, draggable: false, @@ -53152,22 +56898,26 @@ var LinePath = extendShape({ }, buildPath: function (ctx, shape) { - (isLine(shape) ? straightLineProto : bezierCurveProto).buildPath(ctx, shape); + this[isLine(shape) ? '_buildPathLine' : '_buildPathCurve'](ctx, shape); }, + _buildPathLine: straightLineProto.buildPath, + _buildPathCurve: bezierCurveProto.buildPath, pointAt: function (t) { - return isLine(this.shape) - ? straightLineProto.pointAt.call(this, t) - : bezierCurveProto.pointAt.call(this, t); + return this[isLine(this.shape) ? '_pointAtLine' : '_pointAtCurve'](t); }, + _pointAtLine: straightLineProto.pointAt, + _pointAtCurve: bezierCurveProto.pointAt, tangentAt: function (t) { var shape = this.shape; var p = isLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] - : bezierCurveProto.tangentAt.call(this, t); + : this._tangentAtCurve(t); return normalize(p, p); - } + }, + _tangentAtCurve: bezierCurveProto.tangentAt + }); /* @@ -53225,22 +56975,21 @@ function createSymbol$1(name, lineData, idx) { function createLine(points) { var line = new LinePath({ - name: 'line' + name: 'line', + subPixelOptimize: true }); setLinePoints(line.shape, points); return line; } function setLinePoints(targetShape, points) { - var p1 = points[0]; - var p2 = points[1]; - var cp1 = points[2]; - targetShape.x1 = p1[0]; - targetShape.y1 = p1[1]; - targetShape.x2 = p2[0]; - targetShape.y2 = p2[1]; + targetShape.x1 = points[0][0]; + targetShape.y1 = points[0][1]; + targetShape.x2 = points[1][0]; + targetShape.y2 = points[1][1]; targetShape.percent = 1; + var cp1 = points[2]; if (cp1) { targetShape.cpx1 = cp1[0]; targetShape.cpy1 = cp1[1]; @@ -53251,7 +57000,7 @@ function setLinePoints(targetShape, points) { } } -function updateSymbolAndLabelBeforeLineUpdate () { +function updateSymbolAndLabelBeforeLineUpdate() { var lineGroup = this; var symbolFrom = lineGroup.childOfName('fromSymbol'); var symbolTo = lineGroup.childOfName('toSymbol'); @@ -53307,39 +57056,90 @@ function updateSymbolAndLabelBeforeLineUpdate () { var textPosition; var textAlign; var textVerticalAlign; - - var distance$$1 = 5 * invScale; - // End - if (label.__position === 'end') { - textPosition = [d[0] * distance$$1 + toPos[0], d[1] * distance$$1 + toPos[1]]; - textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center'); - textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle'); - } - // Middle - else if (label.__position === 'middle') { - var halfPercent = percent / 2; - var tangent = line.tangentAt(halfPercent); - var n = [tangent[1], -tangent[0]]; - var cp = line.pointAt(halfPercent); - if (n[1] > 0) { - n[0] = -n[0]; - n[1] = -n[1]; - } - textPosition = [cp[0] + n[0] * distance$$1, cp[1] + n[1] * distance$$1]; - textAlign = 'center'; - textVerticalAlign = 'bottom'; + var textOrigin; + + var distance$$1 = label.__labelDistance; + var distanceX = distance$$1[0] * invScale; + var distanceY = distance$$1[1] * invScale; + var halfPercent = percent / 2; + var tangent = line.tangentAt(halfPercent); + var n = [tangent[1], -tangent[0]]; + var cp = line.pointAt(halfPercent); + if (n[1] > 0) { + n[0] = -n[0]; + n[1] = -n[1]; + } + var dir = tangent[0] < 0 ? -1 : 1; + + if (label.__position !== 'start' && label.__position !== 'end') { var rotation = -Math.atan2(tangent[1], tangent[0]); if (toPos[0] < fromPos[0]) { rotation = Math.PI + rotation; } label.attr('rotation', rotation); } - // Start - else { - textPosition = [-d[0] * distance$$1 + fromPos[0], -d[1] * distance$$1 + fromPos[1]]; - textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center'); - textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle'); + + var dy; + switch (label.__position) { + case 'insideStartTop': + case 'insideMiddleTop': + case 'insideEndTop': + case 'middle': + dy = -distanceY; + textVerticalAlign = 'bottom'; + break; + + case 'insideStartBottom': + case 'insideMiddleBottom': + case 'insideEndBottom': + dy = distanceY; + textVerticalAlign = 'top'; + break; + + default: + dy = 0; + textVerticalAlign = 'middle'; + } + + switch (label.__position) { + case 'end': + textPosition = [d[0] * distanceX + toPos[0], d[1] * distanceY + toPos[1]]; + textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center'); + textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle'); + break; + + case 'start': + textPosition = [-d[0] * distanceX + fromPos[0], -d[1] * distanceY + fromPos[1]]; + textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center'); + textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle'); + break; + + case 'insideStartTop': + case 'insideStart': + case 'insideStartBottom': + textPosition = [distanceX * dir + fromPos[0], fromPos[1] + dy]; + textAlign = tangent[0] < 0 ? 'right' : 'left'; + textOrigin = [-distanceX * dir, -dy]; + break; + + case 'insideMiddleTop': + case 'insideMiddle': + case 'insideMiddleBottom': + case 'middle': + textPosition = [cp[0], cp[1] + dy]; + textAlign = 'center'; + textOrigin = [0, -dy]; + break; + + case 'insideEndTop': + case 'insideEnd': + case 'insideEndBottom': + textPosition = [-distanceX * dir + toPos[0], toPos[1] + dy]; + textAlign = tangent[0] >= 0 ? 'right' : 'left'; + textOrigin = [distanceX * dir, -dy]; + break; } + label.attr({ style: { // Use the user specified text align and baseline first @@ -53347,7 +57147,8 @@ function updateSymbolAndLabelBeforeLineUpdate () { textAlign: label.__textAlign || textAlign }, position: textPosition, - scale: [invScale, invScale] + scale: [invScale, invScale], + origin: textOrigin }); } } @@ -53371,7 +57172,6 @@ lineProto.beforeUpdate = updateSymbolAndLabelBeforeLineUpdate; lineProto._createLine = function (lineData, idx, seriesScope) { var seriesModel = lineData.hostModel; var linePoints = lineData.getItemLayout(idx); - var line = createLine(linePoints); line.shape.percent = 0; initProps(line, { @@ -53383,7 +57183,11 @@ lineProto._createLine = function (lineData, idx, seriesScope) { this.add(line); var label = new Text({ - name: 'label' + name: 'label', + // FIXME + // Temporary solution for `focusNodeAdjacency`. + // line label do not use the opacity of lineStyle. + lineLabelOriginalOpacity: 1 }); this.add(label); @@ -53407,6 +57211,7 @@ lineProto.updateData = function (lineData, idx, seriesScope) { var target = { shape: {} }; + setLinePoints(target.shape, linePoints); updateProps(line, target, seriesModel, idx); @@ -53519,6 +57324,12 @@ lineProto._updateCommonStl = function (lineData, idx, seriesScope) { label.__verticalAlign = labelStyle.textVerticalAlign; // 'start', 'middle', 'end' label.__position = labelModel.get('position') || 'middle'; + + var distance$$1 = labelModel.get('distance'); + if (!isArray(distance$$1)) { + distance$$1 = [distance$$1, distance$$1]; + } + label.__labelDistance = distance$$1; } if (emphasisText != null) { @@ -53688,9 +57499,13 @@ lineDrawProto.incrementalPrepareUpdate = function (lineData) { this.group.removeAll(); }; +function isEffectObject(el) { + return el.animators && el.animators.length > 0; +} + lineDrawProto.incrementalUpdate = function (taskParams, lineData) { function updateIncrementalAndHover(el) { - if (!el.isGroup) { + if (!el.isGroup && !isEffectObject(el)) { el.incremental = el.useHoverLayer = true; } } @@ -53758,6 +57573,50 @@ function lineNeedsDraw(pts) { * under the License. */ +function getNodeGlobalScale(seriesModel) { + var coordSys = seriesModel.coordinateSystem; + if (coordSys.type !== 'view') { + return 1; + } + + var nodeScaleRatio = seriesModel.option.nodeScaleRatio; + + var groupScale = coordSys.scale; + var groupZoom = (groupScale && groupScale[0]) || 1; + // Scale node when zoom changes + var roamZoom = coordSys.getZoom(); + var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + + return nodeScale / groupZoom; +} + +function getSymbolSize$1(node) { + var symbolSize = node.getVisual('symbolSize'); + if (symbolSize instanceof Array) { + symbolSize = (symbolSize[0] + symbolSize[1]) / 2; + } + return +symbolSize; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + var v1 = []; var v2 = []; var v3 = []; @@ -53835,13 +57694,6 @@ var adjustEdge = function (graph, scale$$1) { var v = []; scale$$1 /= 2; - function getSymbolSize(node) { - var symbolSize = node.getVisual('symbolSize'); - if (symbolSize instanceof Array) { - symbolSize = (symbolSize[0] + symbolSize[1]) / 2; - } - return symbolSize; - } graph.eachEdge(function (edge, idx) { var linePoints = edge.getLayout(); var fromSymbol = edge.getVisual('fromSymbol'); @@ -53862,8 +57714,8 @@ var adjustEdge = function (graph, scale$$1) { copy(pts[0], originalPoints[0]); copy(pts[1], originalPoints[2]); copy(pts[2], originalPoints[1]); - if (fromSymbol && fromSymbol != 'none') { - var symbolSize = getSymbolSize(edge.node1); + if (fromSymbol && fromSymbol !== 'none') { + var symbolSize = getSymbolSize$1(edge.node1); var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale$$1); // Subdivide and get the second @@ -53874,8 +57726,8 @@ var adjustEdge = function (graph, scale$$1) { pts[0][1] = tmp0[3]; pts[1][1] = tmp0[4]; } - if (toSymbol && toSymbol != 'none') { - var symbolSize = getSymbolSize(edge.node2); + if (toSymbol && toSymbol !== 'none') { + var symbolSize = getSymbolSize$1(edge.node2); var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale$$1); // Subdivide and get the first @@ -53898,14 +57750,14 @@ var adjustEdge = function (graph, scale$$1) { sub(v, pts2[1], pts2[0]); normalize(v, v); - if (fromSymbol && fromSymbol != 'none') { + if (fromSymbol && fromSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node1); + var symbolSize = getSymbolSize$1(edge.node1); scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale$$1); } - if (toSymbol && toSymbol != 'none') { - var symbolSize = getSymbolSize(edge.node2); + if (toSymbol && toSymbol !== 'none') { + var symbolSize = getSymbolSize$1(edge.node2); scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale$$1); } @@ -53934,17 +57786,21 @@ var adjustEdge = function (graph, scale$$1) { * under the License. */ +var FOCUS_ADJACENCY = '__focusNodeAdjacency'; +var UNFOCUS_ADJACENCY = '__unfocusNodeAdjacency'; + var nodeOpacityPath = ['itemStyle', 'opacity']; var lineOpacityPath = ['lineStyle', 'opacity']; function getItemOpacity(item, opacityPath) { - return item.getVisual('opacity') || item.getModel().get(opacityPath); + var opacity = item.getVisual('opacity'); + return opacity != null ? opacity : item.getModel().get(opacityPath); } function fadeOutItem(item, opacityPath, opacityRatio) { var el = item.getGraphicEl(); - var opacity = getItemOpacity(item, opacityPath); + if (opacityRatio != null) { opacity == null && (opacity = 1); opacity *= opacityRatio; @@ -53952,8 +57808,12 @@ function fadeOutItem(item, opacityPath, opacityRatio) { el.downplay && el.downplay(); el.traverse(function (child) { - if (child.type !== 'group') { - child.setStyle('opacity', opacity); + if (!child.isGroup) { + var opct = child.lineLabelOriginalOpacity; + if (opct == null || opacityRatio != null) { + opct = opacity; + } + child.setStyle('opacity', opct); } }); } @@ -53961,13 +57821,13 @@ function fadeOutItem(item, opacityPath, opacityRatio) { function fadeInItem(item, opacityPath) { var opacity = getItemOpacity(item, opacityPath); var el = item.getGraphicEl(); - - el.highlight && el.highlight(); + // Should go back to normal opacity first, consider hoverLayer, + // where current state is copied to elMirror, and support + // emphasis opacity here. el.traverse(function (child) { - if (child.type !== 'group') { - child.setStyle('opacity', opacity); - } + !child.isGroup && child.setStyle('opacity', opacity); }); + el.highlight && el.highlight(); } extendChartView({ @@ -53992,10 +57852,10 @@ extendChartView({ }, render: function (seriesModel, ecModel, api) { + var graphView = this; var coordSys = seriesModel.coordinateSystem; this._model = seriesModel; - this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); var symbolDraw = this._symbolDraw; var lineDraw = this._lineDraw; @@ -54015,7 +57875,7 @@ extendChartView({ } } // Fix edge contact point with node - adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); var data = seriesModel.getData(); symbolDraw.updateData(data); @@ -54057,24 +57917,21 @@ extendChartView({ } el.setDraggable(draggable && forceLayout); - el.off('mouseover', el.__focusNodeAdjacency); - el.off('mouseout', el.__unfocusNodeAdjacency); + el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]); + el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]); if (itemModel.get('focusNodeAdjacency')) { - el.on('mouseover', el.__focusNodeAdjacency = function () { + el.on('mouseover', el[FOCUS_ADJACENCY] = function () { + graphView._clearTimer(); api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, dataIndex: el.dataIndex }); }); - el.on('mouseout', el.__unfocusNodeAdjacency = function () { - api.dispatchAction({ - type: 'unfocusNodeAdjacency', - seriesId: seriesModel.id - }); + el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () { + graphView._dispatchUnfocus(api); }); - } }, this); @@ -54082,22 +57939,20 @@ extendChartView({ data.graph.eachEdge(function (edge) { var el = edge.getGraphicEl(); - el.off('mouseover', el.__focusNodeAdjacency); - el.off('mouseout', el.__unfocusNodeAdjacency); + el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]); + el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]); if (edge.getModel().get('focusNodeAdjacency')) { - el.on('mouseover', el.__focusNodeAdjacency = function () { + el.on('mouseover', el[FOCUS_ADJACENCY] = function () { + graphView._clearTimer(); api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, edgeDataIndex: edge.dataIndex }); }); - el.on('mouseout', el.__unfocusNodeAdjacency = function () { - api.dispatchAction({ - type: 'unfocusNodeAdjacency', - seriesId: seriesModel.id - }); + el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () { + graphView._dispatchUnfocus(api); }); } }); @@ -54107,6 +57962,8 @@ extendChartView({ var cx = data.getLayout('cx'); var cy = data.getLayout('cy'); data.eachItemGraphicEl(function (el, idx) { + var itemModel = data.getItemModel(idx); + var labelRotate = itemModel.get('label.rotate') || 0; var symbolPath = el.getSymbolPath(); if (circularRotateLabel) { var pos = data.getItemLayout(idx); @@ -54119,17 +57976,25 @@ extendChartView({ rad = rad - Math.PI; } var textPosition = isLeft ? 'left' : 'right'; - symbolPath.setStyle({ - textRotation: -rad, - textPosition: textPosition, - textOrigin: 'center' - }); - symbolPath.hoverStyle && (symbolPath.hoverStyle.textPosition = textPosition); + modifyLabelStyle( + symbolPath, + { + textRotation: -rad, + textPosition: textPosition, + textOrigin: 'center' + }, + { + textPosition: textPosition + } + ); } else { - symbolPath.setStyle({ - textRotation: 0 - }); + modifyLabelStyle( + symbolPath, + { + textRotation: labelRotate *= Math.PI / 180 + } + ); } }); @@ -54139,10 +58004,31 @@ extendChartView({ dispose: function () { this._controller && this._controller.dispose(); this._controllerHost = {}; + this._clearTimer(); + }, + + _dispatchUnfocus: function (api, opt) { + var self = this; + this._clearTimer(); + this._unfocusDelayTimer = setTimeout(function () { + self._unfocusDelayTimer = null; + api.dispatchAction({ + type: 'unfocusNodeAdjacency', + seriesId: self._model.id + }); + }, 500); + + }, + + _clearTimer: function () { + if (this._unfocusDelayTimer) { + clearTimeout(this._unfocusDelayTimer); + this._unfocusDelayTimer = null; + } }, focusNodeAdjacency: function (seriesModel, ecModel, api, payload) { - var data = this._model.getData(); + var data = seriesModel.getData(); var graph = data.graph; var dataIndex = payload.dataIndex; var edgeDataIndex = payload.edgeDataIndex; @@ -54180,7 +58066,7 @@ extendChartView({ }, unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) { - var graph = this._model.getData().graph; + var graph = seriesModel.getData().graph; graph.eachNode(function (node) { fadeOutItem(node, nodeOpacityPath); @@ -54246,7 +58132,7 @@ extendChartView({ originY: e.originY }); this._updateNodeAndLinkScale(); - adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); this._lineDraw.updateLayout(); }, this); }, @@ -54255,7 +58141,7 @@ extendChartView({ var seriesModel = this._model; var data = seriesModel.getData(); - var nodeScale = this._getNodeGlobalScale(seriesModel); + var nodeScale = getNodeGlobalScale(seriesModel); var invScale = [nodeScale, nodeScale]; data.eachItemGraphicEl(function (el, idx) { @@ -54263,25 +58149,8 @@ extendChartView({ }); }, - _getNodeGlobalScale: function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys.type !== 'view') { - return 1; - } - - var nodeScaleRatio = this._nodeScaleRatio; - - var groupScale = coordSys.scale; - var groupZoom = (groupScale && groupScale[0]) || 1; - // Scale node when zoom changes - var roamZoom = coordSys.getZoom(); - var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; - - return nodeScale / groupZoom; - }, - updateLayout: function (seriesModel) { - adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); this._symbolDraw.updateLayout(); this._lineDraw.updateLayout(); @@ -54471,11 +58340,19 @@ var categoryVisual = function (ecModel) { var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype. categoryNameIdxMap['ec-' + name] = idx; - var itemModel = categoriesData.getItemModel(idx); + var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(name, paletteScope); categoriesData.setItemVisual(idx, 'color', color); + + var itemStyleList = ['opacity', 'symbol', 'symbolSize', 'symbolKeepAspect']; + for (var i = 0; i < itemStyleList.length; i++) { + var itemStyle = itemModel.getShallow(itemStyleList[i], true); + if (itemStyle != null) { + categoriesData.setItemVisual(idx, itemStyleList[i], itemStyle); + } + } }); // Assign category color to visual @@ -54487,11 +58364,16 @@ var categoryVisual = function (ecModel) { if (typeof category === 'string') { category = categoryNameIdxMap['ec-' + category]; } - if (!data.getItemVisual(idx, 'color', true)) { - data.setItemVisual( - idx, 'color', - categoriesData.getItemVisual(category, 'color') - ); + + var itemStyleList = ['color', 'opacity', 'symbol', 'symbolSize', 'symbolKeepAspect']; + + for (var i = 0; i < itemStyleList.length; i++) { + if (data.getItemVisual(idx, itemStyleList[i], true) == null) { + data.setItemVisual( + idx, itemStyleList[i], + categoriesData.getItemVisual(category, itemStyleList[i]) + ); + } } } }); @@ -54698,7 +58580,33 @@ var simpleLayout = function (ecModel, api) { * under the License. */ -function circularLayout$1(seriesModel) { +var PI$3 = Math.PI; + +var _symbolRadiansHalf = []; + +/** + * `basedOn` can be: + * 'value': + * This layout is not accurate and have same bad case. For example, + * if the min value is very smaller than the max value, the nodes + * with the min value probably overlap even though there is enough + * space to layout them. So we only use this approach in the as the + * init layout of the force layout. + * FIXME + * Probably we do not need this method any more but use + * `basedOn: 'symbolSize'` in force layout if + * delay its init operations to GraphView. + * 'symbolSize': + * This approach work only if all of the symbol size calculated. + * That is, the progressive rendering is not applied to graph. + * FIXME + * If progressive rendering is applied to graph some day, + * probably we have to use `basedOn: 'value'`. + * + * @param {module:echarts/src/model/Series} seriesModel + * @param {string} basedOn 'value' or 'symbolSize' + */ +function circularLayout$1(seriesModel, basedOn) { var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; @@ -54709,33 +58617,22 @@ function circularLayout$1(seriesModel) { var nodeData = seriesModel.getData(); var graph = nodeData.graph; - var angle = 0; - var sum = nodeData.getSum('value'); - var unitAngle = Math.PI * 2 / (sum || nodeData.count()); - var cx = rect.width / 2 + rect.x; var cy = rect.height / 2 + rect.y; - var r = Math.min(rect.width, rect.height) / 2; - - graph.eachNode(function (node) { - var value = node.getValue('value'); - - angle += unitAngle * (sum ? value : 1) / 2; - - node.setLayout([ - r * Math.cos(angle) + cx, - r * Math.sin(angle) + cy - ]); - - angle += unitAngle * (sum ? value : 1) / 2; - }); + var count = nodeData.count(); nodeData.setLayout({ cx: cx, cy: cy }); + if (!count) { + return; + } + + _layoutNodesBasedOn[basedOn](seriesModel, coordSys, graph, nodeData, r, cx, cy, count); + graph.eachEdge(function (edge) { var curveness = edge.getModel().get('lineStyle.curveness') || 0; var p1 = clone$1(edge.node1.getLayout()); @@ -54754,6 +58651,65 @@ function circularLayout$1(seriesModel) { }); } +var _layoutNodesBasedOn = { + + value: function (seriesModel, coordSys, graph, nodeData, r, cx, cy, count) { + var angle = 0; + var sum = nodeData.getSum('value'); + var unitAngle = Math.PI * 2 / (sum || count); + + graph.eachNode(function (node) { + var value = node.getValue('value'); + var radianHalf = unitAngle * (sum ? value : 1) / 2; + + angle += radianHalf; + node.setLayout([ + r * Math.cos(angle) + cx, + r * Math.sin(angle) + cy + ]); + angle += radianHalf; + }); + }, + + symbolSize: function (seriesModel, coordSys, graph, nodeData, r, cx, cy, count) { + var sumRadian = 0; + _symbolRadiansHalf.length = count; + + var nodeScale = getNodeGlobalScale(seriesModel); + + graph.eachNode(function (node) { + var symbolSize = getSymbolSize$1(node); + + // Normally this case will not happen, but we still add + // some the defensive code (2px is an arbitrary value). + isNaN(symbolSize) && (symbolSize = 2); + symbolSize < 0 && (symbolSize = 0); + + symbolSize *= nodeScale; + + var symbolRadianHalf = Math.asin(symbolSize / 2 / r); + // when `symbolSize / 2` is bigger than `r`. + isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$3 / 2); + _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf; + sumRadian += symbolRadianHalf * 2; + }); + + var halfRemainRadian = (2 * PI$3 - sumRadian) / count / 2; + + var angle = 0; + graph.eachNode(function (node) { + var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; + + angle += radianHalf; + node.setLayout([ + r * Math.cos(angle) + cx, + r * Math.sin(angle) + cy + ]); + angle += radianHalf; + }); + } +}; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -54776,7 +58732,7 @@ function circularLayout$1(seriesModel) { var circularLayout = function (ecModel) { ecModel.eachSeriesByType('graph', function (seriesModel) { if (seriesModel.get('layout') === 'circular') { - circularLayout$1(seriesModel); + circularLayout$1(seriesModel, 'symbolSize'); } }); }; @@ -54801,10 +58757,13 @@ var circularLayout = function (ecModel) { */ /* -* The layout implementation references to d3.js. The use of -* the source code of this file is also subject to the terms -* and consitions of its license (BSD-3Clause, see -* ). +* A third-party license is embeded for some of the code in this file: +* Some formulas were originally copied from "d3.js" with some +* modifications made for this project. +* (See more details in the comment of the method "step" below.) +* The use of the source code of this file is also subject to the terms +* and consitions of the license of "d3.js" (BSD-3Clause, see +* ). */ var scaleAndAdd$2 = scaleAndAdd; @@ -54834,26 +58793,10 @@ function forceLayout$1(nodes, edges, opts) { for (var i = 0; i < nodes.length; i++) { var n = nodes[i]; if (!n.p) { - // Use the position from first adjecent node with defined position - // Or use a random position - // From d3 - // if (n.edges) { - // var j = -1; - // while (++j < n.edges.length) { - // var e = n.edges[j]; - // var other = adjacentNode(n, e); - // if (other.p) { - // n.p = vec2.clone(other.p); - // break; - // } - // } - // } - // if (!n.p) { - n.p = create( - width * (Math.random() - 0.5) + center[0], - height * (Math.random() - 0.5) + center[1] - ); - // } + n.p = create( + width * (Math.random() - 0.5) + center[0], + height * (Math.random() - 0.5) + center[1] + ); } n.pp = clone$1(n.p); n.edges = null; @@ -54863,11 +58806,12 @@ function forceLayout$1(nodes, edges, opts) { // var k = scale * Math.sqrt(width * height / nodes.length); // var k2 = k * k; - var friction = 0.6; + var initialFriction = opts.friction == null ? 0.6 : opts.friction; + var friction = initialFriction; return { warmUp: function () { - friction = 0.5; + friction = initialFriction * 0.8; }, setFixed: function (idx) { @@ -54878,11 +58822,20 @@ function forceLayout$1(nodes, edges, opts) { nodes[idx].fixed = false; }, + /** + * Some formulas were originally copied from "d3.js" + * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js + * with some modifications made for this project. + * See the license statement at the head of this file. + */ step: function (cb) { var v12 = []; var nLen = nodes.length; for (var i = 0; i < edges.length; i++) { var e = edges[i]; + if (e.ignoreForceLayout) { + continue; + } var n1 = e.n1; var n2 = e.n2; @@ -54988,7 +58941,7 @@ var forceLayout = function (ecModel) { simpleLayout$1(graphSeries); } else if (initLayout === 'circular') { - circularLayout$1(graphSeries); + circularLayout$1(graphSeries, 'value'); } var nodeDataExtent = nodeData.getDataExtent('value'); @@ -55024,11 +58977,13 @@ var forceLayout = function (ecModel) { if (isNaN(d)) { d = (edgeLength[0] + edgeLength[1]) / 2; } + var edgeModel = edge.getModel(); return { n1: nodes[edge.node1.dataIndex], n2: nodes[edge.node2.dataIndex], d: d, - curveness: edge.getModel().get('lineStyle.curveness') || 0 + curveness: edgeModel.get('lineStyle.curveness') || 0, + ignoreForceLayout: edgeModel.get('ignoreForceLayout') }; }); @@ -55036,7 +58991,8 @@ var forceLayout = function (ecModel) { var rect = coordSys.getBoundingRect(); var forceInstance = forceLayout$1(nodes, edges, { rect: rect, - gravity: forceModel.get('gravity') + gravity: forceModel.get('gravity'), + friction: forceModel.get('friction') }); var oldStep = forceInstance.step; forceInstance.step = function (cb) { @@ -55110,7 +59066,7 @@ var forceLayout = function (ecModel) { */ // FIXME Where to create the simple view coordinate system -function getViewRect$1(seriesModel, api, aspect) { +function getViewRect$2(seriesModel, api, aspect) { var option = seriesModel.getBoxLayoutParams(); option.aspect = aspect; return getLayoutRect(option, { @@ -55147,7 +59103,7 @@ var createView = function (ecModel, api) { } var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed? - var viewRect = getViewRect$1(seriesModel, api, aspect); + var viewRect = getViewRect$2(seriesModel, api, aspect); // Position may be NaN, use view rect instead if (isNaN(aspect)) { min = [viewRect.x, viewRect.y]; @@ -55207,7 +59163,7 @@ registerVisual(categoryVisual); registerVisual(edgeVisual); registerLayout(simpleLayout); -registerLayout(circularLayout); +registerLayout(PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout); registerLayout(forceLayout); // Graph view coordinate system @@ -55239,11 +59195,6 @@ var GaugeSeries = SeriesModel.extend({ type: 'series.gauge', getInitialData: function (option, ecModel) { - var dataOpt = option.data || []; - if (!isArray(dataOpt)) { - dataOpt = [dataOpt]; - } - option.data = dataOpt; return createListSimply(this, ['value']); }, @@ -55486,8 +59437,9 @@ var GaugeView = Chart.extend({ var prevEndAngle = startAngle; var axisLineWidth = lineStyleModel.get('width'); + var showAxis = axisLineModel.get('show'); - for (var i = 0; i < colorList.length; i++) { + for (var i = 0; showAxis && i < colorList.length; i++) { // Clamp var percent = Math.min(Math.max(colorList[i][0], 0), 1); var endAngle = startAngle + angleRangeSpan * percent; @@ -55872,15 +59824,18 @@ var FunnelSeries = extendSeriesModel({ // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed - this.legendDataProvider = function () { - return this.getRawData(); - }; + this.legendVisualProvider = new LegendVisualProvider( + bind(this.getData, this), bind(this.getRawData, this) + ); // Extend labelLine emphasis this._defaultLabelLine(option); }, getInitialData: function (option, ecModel) { - return createListSimply(this, ['value']); + return createListSimply(this, { + coordDimensions: ['value'], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); }, _defaultLabelLine: function (option) { @@ -55990,21 +59945,18 @@ function FunnelPiece(data, idx) { this.add(labelLine); this.add(text); - this.updateData(data, idx, true); + this.highDownOnUpdate = function (fromState, toState) { + if (toState === 'emphasis') { + labelLine.ignore = labelLine.hoverIgnore; + text.ignore = text.hoverIgnore; + } + else { + labelLine.ignore = labelLine.normalIgnore; + text.ignore = text.normalIgnore; + } + }; - // Hover to change label and labelLine - function onEmphasis() { - labelLine.ignore = labelLine.hoverIgnore; - text.ignore = text.hoverIgnore; - } - function onNormal() { - labelLine.ignore = labelLine.normalIgnore; - text.ignore = text.normalIgnore; - } - this.on('emphasis', onEmphasis) - .on('normal', onNormal) - .on('mouseover', onEmphasis) - .on('mouseout', onNormal); + this.updateData(data, idx, true); } var funnelPieceProto = FunnelPiece.prototype; @@ -56027,7 +59979,7 @@ funnelPieceProto.updateData = function (data, idx, firstCreate) { polygon.setShape({ points: layout.points }); - polygon.setStyle({ opacity : 0 }); + polygon.setStyle({opacity: 0}); initProps(polygon, { style: { opacity: opacity @@ -56195,7 +60147,7 @@ var FunnelView = Chart.extend({ * under the License. */ -function getViewRect$2(seriesModel, api) { +function getViewRect$3(seriesModel, api) { return getLayoutRect( seriesModel.getBoxLayoutParams(), { width: api.getWidth(), @@ -56218,7 +60170,8 @@ function getSortedIndices(data, sort) { // Add custom sortable function & none sortable opetion by "options.sort" if (typeof sort === 'function') { indices.sort(sort); - } else if (sort !== 'none') { + } + else if (sort !== 'none') { indices.sort(function (a, b) { return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; }); @@ -56238,7 +60191,8 @@ function labelLayout$1(data) { var points = layout.points; var isLabelInside = labelPosition === 'inner' - || labelPosition === 'inside' || labelPosition === 'center'; + || labelPosition === 'inside' || labelPosition === 'center' + || labelPosition === 'insideLeft' || labelPosition === 'insideRight'; var textAlign; var textX; @@ -56246,9 +60200,21 @@ function labelLayout$1(data) { var linePoints; if (isLabelInside) { - textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; - textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; - textAlign = 'center'; + if (labelPosition === 'insideLeft') { + textX = (points[0][0] + points[3][0]) / 2 + 5; + textY = (points[0][1] + points[3][1]) / 2; + textAlign = 'left'; + } + else if (labelPosition === 'insideRight') { + textX = (points[1][0] + points[2][0]) / 2 - 5; + textY = (points[1][1] + points[2][1]) / 2; + textAlign = 'right'; + } + else { + textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; + textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; + textAlign = 'center'; + } linePoints = [ [textX, textY], [textX, textY] ]; @@ -56266,6 +60232,46 @@ function labelLayout$1(data) { textX = x2 - 5; textAlign = 'right'; } + else if (labelPosition === 'right') { + // Right side + x1 = (points[1][0] + points[2][0]) / 2; + y1 = (points[1][1] + points[2][1]) / 2; + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'left'; + } + else if (labelPosition === 'rightTop') { + // RightTop side + x1 = points[1][0]; + y1 = points[1][1]; + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'top'; + } + else if (labelPosition === 'rightBottom') { + // RightBottom side + x1 = points[2][0]; + y1 = points[2][1]; + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'bottom'; + } + else if (labelPosition === 'leftTop') { + // LeftTop side + x1 = points[0][0]; + y1 = points[1][1]; + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = 'right'; + } + else if (labelPosition === 'leftBottom') { + // LeftBottom side + x1 = points[3][0]; + y1 = points[2][1]; + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = 'right'; + } else { // Right side x1 = (points[1][0] + points[2][0]) / 2; @@ -56296,7 +60302,7 @@ var funnelLayout = function (ecModel, api, payload) { var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); var sort = seriesModel.get('sort'); - var viewRect = getViewRect$2(seriesModel, api); + var viewRect = getViewRect$3(seriesModel, api); var indices = getSortedIndices(data, sort); var sizeExtent = [ @@ -56569,8 +60575,7 @@ inherits(ParallelAxis, Axis); * handleEnds will be modified in this method. * @param {Array.} extent handleEnds is restricted by extent. * extent[0] should less or equals than extent[1]. - * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds, - * where the input minSpan and maxSpan will not work. + * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds. * @param {number} [minSpan] The range of dataZoom can not be smaller than that. * If not set, handle0 and cross handle1. If set as a non-negative * number (including `0`), handles will push each other when reaching @@ -56579,9 +60584,6 @@ inherits(ParallelAxis, Axis); * @return {Array.} The input handleEnds. */ var sliderMove = function (delta, handleEnds, extent, handleIndex, minSpan, maxSpan) { - // Normalize firstly. - handleEnds[0] = restrict$1(handleEnds[0], extent); - handleEnds[1] = restrict$1(handleEnds[1], extent); delta = delta || 0; @@ -56595,10 +60597,15 @@ var sliderMove = function (delta, handleEnds, extent, handleIndex, minSpan, maxS maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); } if (handleIndex === 'all') { - minSpan = maxSpan = Math.abs(handleEnds[1] - handleEnds[0]); + var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]); + handleSpan = restrict$1(handleSpan, [0, extentSpan]); + minSpan = maxSpan = restrict$1(handleSpan, [minSpan, maxSpan]); handleIndex = 0; } + handleEnds[0] = restrict$1(handleEnds[0], extent); + handleEnds[1] = restrict$1(handleEnds[1], extent); + var originalDistSign = getSpanSign(handleEnds, handleIndex); handleEnds[handleIndex] += delta; @@ -56614,7 +60621,7 @@ var sliderMove = function (delta, handleEnds, extent, handleIndex, minSpan, maxS if (minSpan != null && ( currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan )) { - // If minSpan exists, 'cross' is forbinden. + // If minSpan exists, 'cross' is forbidden. handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; } @@ -56635,7 +60642,10 @@ function getSpanSign(handleEnds, handleIndex) { } function restrict$1(value, extend) { - return Math.min(extend[1], Math.max(extend[0], value)); + return Math.min( + extend[1] != null ? extend[1] : Infinity, + Math.max(extend[0] != null ? extend[0] : -Infinity, value) + ); } /* @@ -56663,13 +60673,13 @@ function restrict$1(value, extend) { */ var each$11 = each$1; -var mathMin$5 = Math.min; -var mathMax$5 = Math.max; +var mathMin$6 = Math.min; +var mathMax$6 = Math.max; var mathFloor$2 = Math.floor; var mathCeil$2 = Math.ceil; var round$2 = round$1; -var PI$3 = Math.PI; +var PI$4 = Math.PI; function Parallel(parallelModel, ecModel, api) { @@ -56924,7 +60934,7 @@ Parallel.prototype = { } }; var rotationTable = { - horizontal: PI$3 / 2, + horizontal: PI$4 / 2, vertical: 0 }; @@ -57115,8 +61125,8 @@ Parallel.prototype = { else { var winSize = axisExpandWindow[1] - axisExpandWindow[0]; var pos = extent[1] * pointCoord / winSize; - axisExpandWindow = [mathMax$5(0, pos - winSize / 2)]; - axisExpandWindow[1] = mathMin$5(extent[1], axisExpandWindow[0] + winSize); + axisExpandWindow = [mathMax$6(0, pos - winSize / 2)]; + axisExpandWindow[1] = mathMin$6(extent[1], axisExpandWindow[0] + winSize); axisExpandWindow[0] = axisExpandWindow[1] - winSize; } @@ -57128,7 +61138,7 @@ Parallel.prototype = { }; function restrict(len, extent) { - return mathMin$5(mathMax$5(len, extent[0]), extent[1]); + return mathMin$6(mathMax$6(len, extent[0]), extent[1]); } function layoutAxisWithoutExpand(axisIndex, layoutInfo) { @@ -57583,8 +61593,8 @@ registerAction('parallelAxisExpand', function (payload, ecModel) { var curry$2 = curry; var each$12 = each$1; var map$2 = map; -var mathMin$6 = Math.min; -var mathMax$6 = Math.max; +var mathMin$7 = Math.min; +var mathMax$7 = Math.max; var mathPow$2 = Math.pow; var COVER_Z = 10000; @@ -57736,7 +61746,8 @@ function BrushController(zr) { * @type {Object} */ this._handlers = {}; - each$12(mouseHandlers, function (handler, eventName) { + + each$12(pointerHandlers, function (handler, eventName) { this._handlers[eventName] = bind(handler, this); }, this); } @@ -57932,9 +61943,7 @@ function doEnableBrush(controller, brushOption) { take(zr, MUTEX_RESOURCE_KEY, controller._uid); } - each$12(controller._handlers, function (handler, eventName) { - zr.on(eventName, handler); - }); + mountHandlers(zr, controller._handlers); controller._brushType = brushOption.brushType; controller._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); @@ -57945,13 +61954,23 @@ function doDisableBrush(controller) { release(zr, MUTEX_RESOURCE_KEY, controller._uid); - each$12(controller._handlers, function (handler, eventName) { - zr.off(eventName, handler); - }); + unmountHandlers(zr, controller._handlers); controller._brushType = controller._brushOption = null; } +function mountHandlers(zr, handlers) { + each$12(handlers, function (handler, eventName) { + zr.on(eventName, handler); + }); +} + +function unmountHandlers(zr, handlers) { + each$12(handlers, function (handler, eventName) { + zr.off(eventName, handler); + }); +} + function createCover(controller, brushOption) { var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); cover.__brushOption = brushOption; @@ -58103,7 +62122,7 @@ function createBaseRectCover(doDrift, controller, brushOption, edgeNames) { function updateBaseRect(controller, cover, localRange, brushOption) { var lineWidth = brushOption.brushStyle.lineWidth || 0; - var handleSize = mathMax$6(lineWidth, MIN_RESIZE_LINE_WIDTH); + var handleSize = mathMax$7(lineWidth, MIN_RESIZE_LINE_WIDTH); var x = localRange[0][0]; var y = localRange[1][0]; var xa = x - lineWidth / 2; @@ -58170,8 +62189,8 @@ function makeStyle(brushOption) { } function formatRectRange(x, y, x2, y2) { - var min = [mathMin$6(x, x2), mathMin$6(y, y2)]; - var max = [mathMax$6(x, x2), mathMax$6(y, y2)]; + var min = [mathMin$7(x, x2), mathMin$7(y, y2)]; + var max = [mathMax$7(x, x2), mathMax$7(y, y2)]; return [ [min[0], max[0]], // x range @@ -58251,10 +62270,10 @@ function clipByPanel(controller, cover, data) { } function pointsToRect(points) { - var xmin = mathMin$6(points[0][0], points[1][0]); - var ymin = mathMin$6(points[0][1], points[1][1]); - var xmax = mathMax$6(points[0][0], points[1][0]); - var ymax = mathMax$6(points[0][1], points[1][1]); + var xmin = mathMin$7(points[0][0], points[1][0]); + var ymin = mathMin$7(points[0][1], points[1][1]); + var xmax = mathMax$7(points[0][0], points[1][0]); + var ymax = mathMax$7(points[0][1], points[1][1]); return { x: xmin, @@ -58265,8 +62284,14 @@ function pointsToRect(points) { } function resetCursor(controller, e, localCursorPoint) { - // Check active - if (!controller._brushType) { + if ( + // Check active + !controller._brushType + // resetCursor should be always called when mouse is in zr area, + // but not called when mouse is out of zr area to avoid bad influence + // if `mousemove`, `mouseup` are triggered from `document` event. + || isOutsideZrArea(controller, e) + ) { return; } @@ -58370,13 +62395,13 @@ function determineBrushType(brushType, panel) { return brushType; } -var mouseHandlers = { +var pointerHandlers = { mousedown: function (e) { if (this._dragging) { // In case some browser do not support globalOut, // and release mose out side the browser. - handleDragEnd.call(this, e); + handleDragEnd(this, e); } else if (!e.target || !e.target.draggable) { @@ -58395,44 +62420,51 @@ var mouseHandlers = { }, mousemove: function (e) { - var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); + var x = e.offsetX; + var y = e.offsetY; + + var localCursorPoint = this.group.transformCoordToLocal(x, y); resetCursor(this, e, localCursorPoint); if (this._dragging) { - preventDefault(e); - var eventParams = updateCoverByMouse(this, e, localCursorPoint, false); - eventParams && trigger$1(this, eventParams); } }, - mouseup: handleDragEnd //, - - // FIXME - // in tooltip, globalout should not be triggered. - // globalout: handleDragEnd + mouseup: function (e) { + handleDragEnd(this, e); + } }; -function handleDragEnd(e) { - if (this._dragging) { +function handleDragEnd(controller, e) { + if (controller._dragging) { preventDefault(e); - var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); - var eventParams = updateCoverByMouse(this, e, localCursorPoint, true); + var x = e.offsetX; + var y = e.offsetY; - this._dragging = false; - this._track = []; - this._creatingCover = null; + var localCursorPoint = controller.group.transformCoordToLocal(x, y); + var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true); + + controller._dragging = false; + controller._track = []; + controller._creatingCover = null; // trigger event shoule be at final, after procedure will be nested. - eventParams && trigger$1(this, eventParams); + eventParams && trigger$1(controller, eventParams); } } +function isOutsideZrArea(controller, x, y) { + var zr = controller._zr; + return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight(); +} + + /** * key: brushType * @type {Object} @@ -58530,8 +62562,8 @@ function getLineRenderer(xyIndex) { }, getCreatingRange: function (localTrack) { var ends = getTrackEnds(localTrack); - var min = mathMin$6(ends[0][xyIndex], ends[1][xyIndex]); - var max = mathMax$6(ends[0][xyIndex], ends[1][xyIndex]); + var min = mathMin$7(ends[0][xyIndex], ends[1][xyIndex]); + var max = mathMax$7(ends[0][xyIndex], ends[1][xyIndex]); return [min, max]; }, @@ -58935,7 +62967,7 @@ var handlers = { : { axisExpandWindow: result.axisExpandWindow, // Jumping uses animation, and sliding suppresses animation. - animation: behavior === 'jump' ? null : false + animation: behavior === 'jump' ? null : false } ); } @@ -59152,7 +63184,7 @@ var ParallelView = Chart.extend({ // First create if (!this._initialized) { this._initialized = true; - var clipPath = createGridClipShape$1( + var clipPath = createGridClipShape( coordSys, seriesModel, function () { // Callback will be invoked immediately if there is no animation setTimeout(function () { @@ -59225,7 +63257,7 @@ var ParallelView = Chart.extend({ } }); -function createGridClipShape$1(coordSys, seriesModel, cb) { +function createGridClipShape(coordSys, seriesModel, cb) { var parallelModel = coordSys.model; var rect = coordSys.getRect(); var rectEl = new Rect({ @@ -59435,30 +63467,62 @@ registerVisual(parallelVisual); * under the License. */ -/** - * @file Get initial data and define sankey view's series model - * @author Deqing Li(annong035@gmail.com) - */ - var SankeySeries = SeriesModel.extend({ type: 'series.sankey', layoutInfo: null, + levelModels: null, + /** * Init a graph data structure from data in option series * * @param {Object} option the object used to config echarts view * @return {module:echarts/data/List} storage initial data */ - getInitialData: function (option) { + getInitialData: function (option, ecModel) { var links = option.edges || option.links; var nodes = option.data || option.nodes; + var levels = option.levels; + var levelModels = this.levelModels = {}; + + for (var i = 0; i < levels.length; i++) { + if (levels[i].depth != null && levels[i].depth >= 0) { + levelModels[levels[i].depth] = new Model(levels[i], this, ecModel); + } + else { + if (__DEV__) { + throw new Error('levels[i].depth is mandatory and should be natural number'); + } + } + } if (nodes && links) { - var graph = createGraphFromNodeEdge(nodes, links, this, true); + var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink); return graph.data; } + function beforeLink(nodeData, edgeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + model.customizeGetParent(function (path) { + var parentModel = this.parentModel; + var nodeDepth = parentModel.getData().getItemLayout(idx).depth; + var levelModel = parentModel.levelModels[nodeDepth]; + return levelModel || this.parentModel; + }); + return model; + }); + + edgeData.wrapMethod('getItemModel', function (model, idx) { + model.customizeGetParent(function (path) { + var parentModel = this.parentModel; + var edge = parentModel.getGraph().getEdgeByIndex(idx); + var depth = edge.node1.getLayout().depth; + var levelModel = parentModel.levelModels[depth]; + return levelModel || this.parentModel; + }); + return model; + }); + } }, setNodePosition: function (dataIndex, localPosition) { @@ -59499,10 +63563,36 @@ var SankeySeries = SeriesModel.extend({ } return encodeHTML(html); } - + else if (dataType === 'node') { + var node = this.getGraph().getNodeByIndex(dataIndex); + var value = node.getLayout().value; + var name = this.getDataParams(dataIndex, dataType).data.name; + if (value) { + var html = name + ' : ' + value; + } + return encodeHTML(html); + } return SankeySeries.superCall(this, 'formatTooltip', dataIndex, multipleSeries); }, + optionUpdated: function () { + var option = this.option; + if (option.focusNodeAdjacency === true) { + option.focusNodeAdjacency = 'allEdges'; + } + }, + + // Override Series.getDataParams() + getDataParams: function (dataIndex, dataType) { + var params = SankeySeries.superCall(this, 'getDataParams', dataIndex, dataType); + if (params.value == null && dataType === 'node') { + var node = this.getGraph().getNodeByIndex(dataIndex); + var nodeValue = node.getLayout().value; + params.value = nodeValue; + } + return params; + }, + defaultOption: { zlevel: 0, z: 2, @@ -59511,24 +63601,28 @@ var SankeySeries = SeriesModel.extend({ layout: null, - // the position of the whole view + // The position of the whole view left: '5%', top: '5%', right: '20%', bottom: '5%', - // the dx of the node + // Value can be 'vertical' + orient: 'horizontal', + + // The dx of the node nodeWidth: 20, - // the vertical distance between two nodes + // The vertical distance between two nodes nodeGap: 8, - // control if the node can move or not + // Control if the node can move or not draggable: true, - + + // Value can be 'inEdges', 'outEdges', 'allEdges', true (the same as 'allEdges'). focusNodeAdjacency: false, - // the number of iterations to change the position of the node + // The number of iterations to change the position of the node layoutIterations: 32, label: { @@ -59538,6 +63632,11 @@ var SankeySeries = SeriesModel.extend({ fontSize: 12 }, + levels: [], + + // Value can be 'left' or 'right' + nodeAlign: 'justify', + itemStyle: { borderWidth: 1, borderColor: '#333' @@ -59554,7 +63653,7 @@ var SankeySeries = SeriesModel.extend({ show: true }, lineStyle: { - opacity: 0.6 + opacity: 0.5 } }, @@ -59584,13 +63683,10 @@ var SankeySeries = SeriesModel.extend({ * under the License. */ -/** - * @file The file used to draw sankey view - * @author Deqing Li(annong035@gmail.com) - */ - var nodeOpacityPath$1 = ['itemStyle', 'opacity']; +var hoverNodeOpacityPath = ['emphasis', 'itemStyle', 'opacity']; var lineOpacityPath$1 = ['lineStyle', 'opacity']; +var hoverLineOpacityPath = ['emphasis', 'lineStyle', 'opacity']; function getItemOpacity$1(item, opacityPath) { return item.getVisual('opacity') || item.getModel().get(opacityPath); @@ -59598,8 +63694,8 @@ function getItemOpacity$1(item, opacityPath) { function fadeOutItem$1(item, opacityPath, opacityRatio) { var el = item.getGraphicEl(); - var opacity = getItemOpacity$1(item, opacityPath); + if (opacityRatio != null) { opacity == null && (opacity = 1); opacity *= opacityRatio; @@ -59617,12 +63713,14 @@ function fadeInItem$1(item, opacityPath) { var opacity = getItemOpacity$1(item, opacityPath); var el = item.getGraphicEl(); - el.highlight && el.highlight(); el.traverse(function (child) { if (child.type !== 'group') { child.setStyle('opacity', opacity); } }); + + // Support emphasis here. + el.highlight && el.highlight(); } var SankeyShape = extendShape({ @@ -59631,25 +63729,43 @@ var SankeyShape = extendShape({ x2: 0, y2: 0, cpx1: 0, cpy1: 0, cpx2: 0, cpy2: 0, - - extent: 0 + extent: 0, + orient: '' }, buildPath: function (ctx, shape) { - var halfExtent = shape.extent / 2; - ctx.moveTo(shape.x1, shape.y1 - halfExtent); - ctx.bezierCurveTo( - shape.cpx1, shape.cpy1 - halfExtent, - shape.cpx2, shape.cpy2 - halfExtent, - shape.x2, shape.y2 - halfExtent - ); - ctx.lineTo(shape.x2, shape.y2 + halfExtent); + var extent = shape.extent; + ctx.moveTo(shape.x1, shape.y1); ctx.bezierCurveTo( - shape.cpx2, shape.cpy2 + halfExtent, - shape.cpx1, shape.cpy1 + halfExtent, - shape.x1, shape.y1 + halfExtent + shape.cpx1, shape.cpy1, + shape.cpx2, shape.cpy2, + shape.x2, shape.y2 ); + if (shape.orient === 'vertical') { + ctx.lineTo(shape.x2 + extent, shape.y2); + ctx.bezierCurveTo( + shape.cpx2 + extent, shape.cpy2, + shape.cpx1 + extent, shape.cpy1, + shape.x1 + extent, shape.y1 + ); + } + else { + ctx.lineTo(shape.x2, shape.y2 + extent); + ctx.bezierCurveTo( + shape.cpx2, shape.cpy2 + extent, + shape.cpx1, shape.cpy1 + extent, + shape.x1, shape.y1 + extent + ); + } ctx.closePath(); + }, + + highlight: function () { + this.trigger('emphasis'); + }, + + downplay: function () { + this.trigger('normal'); } }); @@ -59678,7 +63794,6 @@ extendChartView({ var width = layoutInfo.width; // view height var height = layoutInfo.height; - var nodeData = seriesModel.getData(); var edgeData = seriesModel.getData('edge'); var orient = seriesModel.get('orient'); @@ -59706,17 +63821,38 @@ extendChartView({ var dragX2 = node2Model.get('localX'); var dragY2 = node2Model.get('localY'); var edgeLayout = edge.getLayout(); + var x1; + var y1; + var x2; + var y2; + var cpx1; + var cpy1; + var cpx2; + var cpy2; curve.shape.extent = Math.max(1, edgeLayout.dy); - - var x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; - var y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy + edgeLayout.dy / 2; - var x2 = dragX2 != null ? dragX2 * width : n2Layout.x; - var y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty + edgeLayout.dy / 2; - var cpx1 = x1 * (1 - curvature) + x2 * curvature; - var cpy1 = y1; - var cpx2 = x1 * curvature + x2 * (1 - curvature); - var cpy2 = y2; + curve.shape.orient = orient; + + if (orient === 'vertical') { + x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy; + y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy; + x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty; + y2 = dragY2 != null ? dragY2 * height : n2Layout.y; + cpx1 = x1; + cpy1 = y1 * (1 - curvature) + y2 * curvature; + cpx2 = x2; + cpy2 = y1 * curvature + y2 * (1 - curvature); + } + else { + x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; + y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy; + x2 = dragX2 != null ? dragX2 * width : n2Layout.x; + y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty; + cpx1 = x1 * (1 - curvature) + x2 * curvature; + cpy1 = y1; + cpx2 = x1 * curvature + x2 * (1 - curvature); + cpy2 = y2; + } curve.setShape({ x1: x1, @@ -59788,7 +63924,7 @@ extendChartView({ rect.dataType = 'node'; }); - + nodeData.eachItemGraphicEl(function (el, dataIndex) { var itemModel = nodeData.getItemModel(dataIndex); if (itemModel.get('draggable')) { @@ -59805,13 +63941,28 @@ extendChartView({ localY: this.shape.y / height }); }; + el.ondragend = function () { + sankeyView._focusAdjacencyDisabled = false; + }; el.draggable = true; el.cursor = 'move'; } - + + el.highlight = function () { + this.trigger('emphasis'); + }; + + el.downplay = function () { + this.trigger('normal'); + }; + + el.focusNodeAdjHandler && el.off('mouseover', el.focusNodeAdjHandler); + el.unfocusNodeAdjHandler && el.off('mouseout', el.unfocusNodeAdjHandler); + if (itemModel.get('focusNodeAdjacency')) { - el.off('mouseover').on('mouseover', function () { + el.on('mouseover', el.focusNodeAdjHandler = function () { if (!sankeyView._focusAdjacencyDisabled) { + sankeyView._clearTimer(); api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, @@ -59819,12 +63970,10 @@ extendChartView({ }); } }); - el.off('mouseout').on('mouseout', function () { + + el.on('mouseout', el.unfocusNodeAdjHandler = function () { if (!sankeyView._focusAdjacencyDisabled) { - api.dispatchAction({ - type: 'unfocusNodeAdjacency', - seriesId: seriesModel.id - }); + sankeyView._dispatchUnfocus(api); } }); } @@ -59832,9 +63981,14 @@ extendChartView({ edgeData.eachItemGraphicEl(function (el, dataIndex) { var edgeModel = edgeData.getItemModel(dataIndex); + + el.focusNodeAdjHandler && el.off('mouseover', el.focusNodeAdjHandler); + el.unfocusNodeAdjHandler && el.off('mouseout', el.unfocusNodeAdjHandler); + if (edgeModel.get('focusNodeAdjacency')) { - el.off('mouseover').on('mouseover', function () { + el.on('mouseover', el.focusNodeAdjHandler = function () { if (!sankeyView._focusAdjacencyDisabled) { + sankeyView._clearTimer(); api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, @@ -59842,19 +63996,17 @@ extendChartView({ }); } }); - el.off('mouseout').on('mouseout', function () { + + el.on('mouseout', el.unfocusNodeAdjHandler = function () { if (!sankeyView._focusAdjacencyDisabled) { - api.dispatchAction({ - type: 'unfocusNodeAdjacency', - seriesId: seriesModel.id - }); + sankeyView._dispatchUnfocus(api); } }); } }); if (!this._data && seriesModel.get('animation')) { - group.setClipPath(createGridClipShape$2(group.getBoundingRect(), seriesModel, function () { + group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () { group.removeClipPath(); })); } @@ -59862,15 +64014,36 @@ extendChartView({ this._data = seriesModel.getData(); }, - dispose: function () {}, + dispose: function () { + this._clearTimer(); + }, + + _dispatchUnfocus: function (api) { + var self = this; + this._clearTimer(); + this._unfocusDelayTimer = setTimeout(function () { + self._unfocusDelayTimer = null; + api.dispatchAction({ + type: 'unfocusNodeAdjacency', + seriesId: self._model.id + }); + }, 500); + }, + + _clearTimer: function () { + if (this._unfocusDelayTimer) { + clearTimeout(this._unfocusDelayTimer); + this._unfocusDelayTimer = null; + } + }, focusNodeAdjacency: function (seriesModel, ecModel, api, payload) { - var data = this._model.getData(); + var data = seriesModel.getData(); var graph = data.graph; var dataIndex = payload.dataIndex; var itemModel = data.getItemModel(dataIndex); var edgeDataIndex = payload.edgeDataIndex; - + if (dataIndex == null && edgeDataIndex == null) { return; } @@ -59885,15 +64058,15 @@ extendChartView({ }); if (node) { - fadeInItem$1(node, nodeOpacityPath$1); + fadeInItem$1(node, hoverNodeOpacityPath); var focusNodeAdj = itemModel.get('focusNodeAdjacency'); if (focusNodeAdj === 'outEdges') { each$1(node.outEdges, function (edge) { if (edge.dataIndex < 0) { return; } - fadeInItem$1(edge, lineOpacityPath$1); - fadeInItem$1(edge.node2, nodeOpacityPath$1); + fadeInItem$1(edge, hoverLineOpacityPath); + fadeInItem$1(edge.node2, hoverNodeOpacityPath); }); } else if (focusNodeAdj === 'inEdges') { @@ -59901,8 +64074,8 @@ extendChartView({ if (edge.dataIndex < 0) { return; } - fadeInItem$1(edge, lineOpacityPath$1); - fadeInItem$1(edge.node1, nodeOpacityPath$1); + fadeInItem$1(edge, hoverLineOpacityPath); + fadeInItem$1(edge.node1, hoverNodeOpacityPath); }); } else if (focusNodeAdj === 'allEdges') { @@ -59910,21 +64083,21 @@ extendChartView({ if (edge.dataIndex < 0) { return; } - fadeInItem$1(edge, lineOpacityPath$1); - fadeInItem$1(edge.node1, nodeOpacityPath$1); - fadeInItem$1(edge.node2, nodeOpacityPath$1); + fadeInItem$1(edge, hoverLineOpacityPath); + (edge.node1 !== node) && fadeInItem$1(edge.node1, hoverNodeOpacityPath); + (edge.node2 !== node) && fadeInItem$1(edge.node2, hoverNodeOpacityPath); }); } } if (edge) { - fadeInItem$1(edge, lineOpacityPath$1); - fadeInItem$1(edge.node1, nodeOpacityPath$1); - fadeInItem$1(edge.node2, nodeOpacityPath$1); + fadeInItem$1(edge, hoverLineOpacityPath); + fadeInItem$1(edge.node1, hoverNodeOpacityPath); + fadeInItem$1(edge.node2, hoverNodeOpacityPath); } }, unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) { - var graph = this._model.getGraph(); + var graph = seriesModel.getGraph(); graph.eachNode(function (node) { fadeOutItem$1(node, nodeOpacityPath$1); @@ -59935,8 +64108,8 @@ extendChartView({ } }); -// add animation to the view -function createGridClipShape$2(rect, seriesModel, cb) { +// Add animation to the view +function createGridClipShape$1(rect, seriesModel, cb) { var rectEl = new Rect({ shape: { x: rect.x - 10, @@ -59947,8 +64120,7 @@ function createGridClipShape$2(rect, seriesModel, cb) { }); initProps(rectEl, { shape: { - width: rect.width + 20, - height: rect.height + 20 + width: rect.width + 20 } }, seriesModel, cb); @@ -59974,14 +64146,9 @@ function createGridClipShape$2(rect, seriesModel, cb) { * under the License. */ -/** - * @file The interactive action of sankey view - * @author Deqing Li(annong035@gmail.com) - */ - registerAction({ type: 'dragNode', - event: 'dragNode', + event: 'dragnode', // here can only use 'update' now, other value is not support in echarts. update: 'update' }, function (payload, ecModel) { @@ -60009,138 +64176,6 @@ registerAction({ * under the License. */ -/* -* The implementation references to d3.js. The use of the source -* code of this file is also subject to the terms and consitions -* of its license (BSD-3Clause, see ). -*/ - - -/** - * nest helper used to group by the array. - * can specified the keys and sort the keys. - */ -function nest() { - - var keysFunction = []; - var sortKeysFunction = []; - - /** - * map an Array into the mapObject. - * @param {Array} array - * @param {number} depth - */ - function map$$1(array, depth) { - if (depth >= keysFunction.length) { - return array; - } - var i = -1; - var n = array.length; - var keyFunction = keysFunction[depth++]; - var mapObject = {}; - var valuesByKey = {}; - - while (++i < n) { - var keyValue = keyFunction(array[i]); - var values = valuesByKey[keyValue]; - - if (values) { - values.push(array[i]); - } - else { - valuesByKey[keyValue] = [array[i]]; - } - } - - each$1(valuesByKey, function (value, key) { - mapObject[key] = map$$1(value, depth); - }); - - return mapObject; - } - - /** - * transform the Map Object to multidimensional Array - * @param {Object} map - * @param {number} depth - */ - function entriesMap(mapObject, depth) { - if (depth >= keysFunction.length) { - return mapObject; - } - var array = []; - var sortKeyFunction = sortKeysFunction[depth++]; - - each$1(mapObject, function (value, key) { - array.push({ - key: key, values: entriesMap(value, depth) - }); - }); - - if (sortKeyFunction) { - return array.sort(function (a, b) { - return sortKeyFunction(a.key, b.key); - }); - } - else { - return array; - } - } - - return { - /** - * specified the key to groupby the arrays. - * users can specified one more keys. - * @param {Function} d - */ - key: function (d) { - keysFunction.push(d); - return this; - }, - - /** - * specified the comparator to sort the keys - * @param {Function} order - */ - sortKeys: function (order) { - sortKeysFunction[keysFunction.length - 1] = order; - return this; - }, - - /** - * the array to be grouped by. - * @param {Array} array - */ - entries: function (array) { - return entriesMap(map$$1(array, 0), 0); - } - }; -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -/** - * @file The layout algorithm of sankey view - * @author Deqing Li(annong035@gmail.com) - */ - var sankeyLayout = function (ecModel, api, payload) { ecModel.eachSeriesByType('sankey', function (seriesModel) { @@ -60148,7 +64183,7 @@ var sankeyLayout = function (ecModel, api, payload) { var nodeWidth = seriesModel.get('nodeWidth'); var nodeGap = seriesModel.get('nodeGap'); - var layoutInfo = getViewRect$3(seriesModel, api); + var layoutInfo = getViewRect$4(seriesModel, api); seriesModel.layoutInfo = layoutInfo; @@ -60166,10 +64201,13 @@ var sankeyLayout = function (ecModel, api, payload) { return node.getLayout().value === 0; }); - var iterations = filteredNodes.length !== 0 - ? 0 : seriesModel.get('layoutIterations'); + var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations'); + + var orient = seriesModel.get('orient'); + + var nodeAlign = seriesModel.get('nodeAlign'); - layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations); + layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign); }); }; @@ -60180,7 +64218,7 @@ var sankeyLayout = function (ecModel, api, payload) { * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view */ -function getViewRect$3(seriesModel, api) { +function getViewRect$4(seriesModel, api) { return getLayoutRect( seriesModel.getBoxLayoutParams(), { width: api.getWidth(), @@ -60189,10 +64227,10 @@ function getViewRect$3(seriesModel, api) { ); } -function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations) { - computeNodeBreadths(nodes, edges, nodeWidth, width); - computeNodeDepths(nodes, edges, height, nodeGap, iterations); - computeEdgeDepths(nodes); +function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) { + computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign); + computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient); + computeEdgeDepths(nodes, orient); } /** @@ -60204,14 +64242,15 @@ function computeNodeValues(nodes) { each$1(nodes, function (node) { var value1 = sum(node.outEdges, getEdgeValue); var value2 = sum(node.inEdges, getEdgeValue); - var value = Math.max(value1, value2); + var nodeRawValue = node.getValue() || 0; + var value = Math.max(value1, value2, nodeRawValue); node.setLayout({value: value}, true); }); } /** * Compute the x-position for each node. - * + * * Here we use Kahn algorithm to detect cycle when we traverse * the node to computer the initial x position. * @@ -60219,7 +64258,7 @@ function computeNodeValues(nodes) { * @param {number} nodeWidth the dx of the node * @param {number} width the whole width of the area to draw the view */ -function computeNodeBreadths(nodes, edges, nodeWidth, width) { +function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { // Used to mark whether the edge is deleted. if it is deleted, // the value is 0, otherwise it is 1. var remainEdges = []; @@ -60227,67 +64266,117 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width) { var indegreeArr = []; //Used to storage the node with indegree is equal to 0. var zeroIndegrees = []; - var nextNode = []; + var nextTargetNode = []; var x = 0; var kx = 0; for (var i = 0; i < edges.length; i++) { remainEdges[i] = 1; } - - for (var i = 0; i < nodes.length; i++) { + for (i = 0; i < nodes.length; i++) { indegreeArr[i] = nodes[i].inEdges.length; if (indegreeArr[i] === 0) { zeroIndegrees.push(nodes[i]); } } - + var maxNodeDepth = -1; + // Traversing nodes using topological sorting to calculate the + // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical') + // position of the nodes. while (zeroIndegrees.length) { - each$1(zeroIndegrees, function (node) { - node.setLayout({x: x}, true); - node.setLayout({dx: nodeWidth}, true); - each$1(node.outEdges, function (edge) { + for (var idx = 0; idx < zeroIndegrees.length; idx++) { + var node = zeroIndegrees[idx]; + var item = node.hostGraph.data.getRawDataItem(node.dataIndex); + var isItemDepth = item.depth != null && item.depth >= 0; + if (isItemDepth && item.depth > maxNodeDepth) { + maxNodeDepth = item.depth; + } + node.setLayout({depth: isItemDepth ? item.depth : x}, true); + orient === 'vertical' + ? node.setLayout({dy: nodeWidth}, true) + : node.setLayout({dx: nodeWidth}, true); + + for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { + var edge = node.outEdges[edgeIdx]; var indexEdge = edges.indexOf(edge); remainEdges[indexEdge] = 0; var targetNode = edge.node2; var nodeIndex = nodes.indexOf(targetNode); - if (--indegreeArr[nodeIndex] === 0) { - nextNode.push(targetNode); + if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { + nextTargetNode.push(targetNode); } - }); - }); - + } + } ++x; - zeroIndegrees = nextNode; - nextNode = []; + zeroIndegrees = nextTargetNode; + nextTargetNode = []; } - - for (var i = 0; i < remainEdges.length; i++) { - if (__DEV__) { - if (remainEdges[i] === 1) { - throw new Error('Sankey is a DAG, the original data has cycle!'); - } - } + + for (i = 0; i < remainEdges.length; i++) { + if (remainEdges[i] === 1) { + throw new Error('Sankey is a DAG, the original data has cycle!'); + } } - moveSinksRight(nodes, x); - kx = (width - nodeWidth) / (x - 1); + var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; + if (nodeAlign && nodeAlign !== 'left') { + adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); + } + var kx = orient === 'vertical' + ? (height - nodeWidth) / maxDepth + : (width - nodeWidth) / maxDepth; + + scaleNodeBreadths(nodes, kx, orient); +} - scaleNodeBreadths(nodes, kx); +function isNodeDepth(node) { + var item = node.hostGraph.data.getRawDataItem(node.dataIndex); + return item.depth != null && item.depth >= 0; +} + +function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) { + if (nodeAlign === 'right') { + var nextSourceNode = []; + var remainNodes = nodes; + var nodeHeight = 0; + while (remainNodes.length) { + for (var i = 0; i < remainNodes.length; i++) { + var node = remainNodes[i]; + node.setLayout({skNodeHeight: nodeHeight}, true); + for (var j = 0; j < node.inEdges.length; j++) { + var edge = node.inEdges[j]; + if (nextSourceNode.indexOf(edge.node1) < 0) { + nextSourceNode.push(edge.node1); + } + } + } + remainNodes = nextSourceNode; + nextSourceNode = []; + ++nodeHeight; + } + + each$1(nodes, function (node) { + if (!isNodeDepth(node)) { + node.setLayout({depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)}, true); + } + }); + } + else if (nodeAlign === 'justify') { + moveSinksRight(nodes, maxDepth); + } } /** * All the node without outEgdes are assigned maximum x-position and * be aligned in the last column. * - * @param {module:echarts/data/Graph~Node} nodes node of sankey view - * @param {number} x value (x-1) use to assign to node without outEdges - * as x-position + * @param {module:echarts/data/Graph~Node} nodes. node of sankey view. + * @param {number} maxDepth. use to assign to node without outEdges as x-position. */ -function moveSinksRight(nodes, x) { +function moveSinksRight(nodes, maxDepth) { each$1(nodes, function (node) { - if (!node.outEdges.length) { - node.setLayout({x: x - 1}, true); + if (!isNodeDepth(node) && !node.outEdges.length) { + node.setLayout({depth: maxDepth}, true); } }); } @@ -60298,10 +64387,12 @@ function moveSinksRight(nodes, x) { * @param {module:echarts/data/Graph~Node} nodes node of sankey view * @param {number} kx multiple used to scale nodes */ -function scaleNodeBreadths(nodes, kx) { +function scaleNodeBreadths(nodes, kx, orient) { each$1(nodes, function (node) { - var nodeX = node.getLayout().x * kx; - node.setLayout({x: nodeX}, true); + var nodeDepth = node.getLayout().depth * kx; + orient === 'vertical' + ? node.setLayout({y: nodeDepth}, true) + : node.setLayout({x: nodeDepth}, true); }); } @@ -60315,31 +64406,40 @@ function scaleNodeBreadths(nodes, kx) { * in the same column. * @param {number} iterations the number of iterations for the algorithm */ -function computeNodeDepths(nodes, edges, height, nodeGap, iterations) { - var nodesByBreadth = nest() - .key(function (d) { - return d.getLayout().x; - }) - .sortKeys(ascending) - .entries(nodes) - .map(function (d) { - return d.values; - }); +function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) { + var nodesByBreadth = prepareNodesByBreadth(nodes, orient); - initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap); - resolveCollisions(nodesByBreadth, nodeGap, height); + initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); for (var alpha = 1; iterations > 0; iterations--) { // 0.99 is a experience parameter, ensure that each iterations of // changes as small as possible. alpha *= 0.99; - relaxRightToLeft(nodesByBreadth, alpha); - resolveCollisions(nodesByBreadth, nodeGap, height); - relaxLeftToRight(nodesByBreadth, alpha); - resolveCollisions(nodesByBreadth, nodeGap, height); + relaxRightToLeft(nodesByBreadth, alpha, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); + relaxLeftToRight(nodesByBreadth, alpha, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); } } +function prepareNodesByBreadth(nodes, orient) { + var nodesByBreadth = []; + var keyAttr = orient === 'vertical' ? 'y' : 'x'; + + var groupResult = groupData(nodes, function (node) { + return node.getLayout()[keyAttr]; + }); + groupResult.keys.sort(function (a, b) { + return a - b; + }); + each$1(groupResult.keys, function (key) { + nodesByBreadth.push(groupResult.buckets.get(key)); + }); + + return nodesByBreadth; +} + /** * Compute the original y-position for each node * @@ -60350,33 +64450,39 @@ function computeNodeDepths(nodes, edges, height, nodeGap, iterations) { * @param {number} height the whole height of the area to draw the view * @param {number} nodeGap the vertical distance between two nodes */ -function initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap) { - var kyArray = []; +function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) { + var minKy = Infinity; each$1(nodesByBreadth, function (nodes) { var n = nodes.length; var sum = 0; each$1(nodes, function (node) { sum += node.getLayout().value; }); - var ky = (height - (n - 1) * nodeGap) / sum; - kyArray.push(ky); - }); + var ky = orient === 'vertical' + ? (width - (n - 1) * nodeGap) / sum + : (height - (n - 1) * nodeGap) / sum; - kyArray.sort(function (a, b) { - return a - b; + if (ky < minKy) { + minKy = ky; + } }); - var ky0 = kyArray[0]; each$1(nodesByBreadth, function (nodes) { each$1(nodes, function (node, i) { - node.setLayout({y: i}, true); - var nodeDy = node.getLayout().value * ky0; - node.setLayout({dy: nodeDy}, true); + var nodeDy = node.getLayout().value * minKy; + if (orient === 'vertical') { + node.setLayout({x: i}, true); + node.setLayout({dx: nodeDy}, true); + } + else { + node.setLayout({y: i}, true); + node.setLayout({dy: nodeDy}, true); + } }); }); each$1(edges, function (edge) { - var edgeDy = +edge.getValue() * ky0; + var edgeDy = +edge.getValue() * minKy; edge.setLayout({dy: edgeDy}, true); }); } @@ -60389,40 +64495,49 @@ function initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap) { * @param {number} nodeGap the vertical distance between two nodes * @param {number} height the whole height of the area to draw the view */ -function resolveCollisions(nodesByBreadth, nodeGap, height) { +function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { + var keyAttr = orient === 'vertical' ? 'x' : 'y'; each$1(nodesByBreadth, function (nodes) { + nodes.sort(function (a, b) { + return a.getLayout()[keyAttr] - b.getLayout()[keyAttr]; + }); + var nodeX; var node; var dy; var y0 = 0; var n = nodes.length; - var i; - - nodes.sort(ascendingDepth); - - for (i = 0; i < n; i++) { + var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy'; + for (var i = 0; i < n; i++) { node = nodes[i]; - dy = y0 - node.getLayout().y; + dy = y0 - node.getLayout()[keyAttr]; if (dy > 0) { - var nodeY = node.getLayout().y + dy; - node.setLayout({y: nodeY}, true); + nodeX = node.getLayout()[keyAttr] + dy; + orient === 'vertical' + ? node.setLayout({x: nodeX}, true) + : node.setLayout({y: nodeX}, true); } - y0 = node.getLayout().y + node.getLayout().dy + nodeGap; + y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap; } - + var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up - dy = y0 - nodeGap - height; + dy = y0 - nodeGap - viewWidth; if (dy > 0) { - var nodeY = node.getLayout().y - dy; - node.setLayout({y: nodeY}, true); - y0 = node.getLayout().y; + nodeX = node.getLayout()[keyAttr] - dy; + orient === 'vertical' + ? node.setLayout({x: nodeX}, true) + : node.setLayout({y: nodeX}, true); + + y0 = nodeX; for (i = n - 2; i >= 0; --i) { node = nodes[i]; - dy = node.getLayout().y + node.getLayout().dy + nodeGap - y0; + dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0; if (dy > 0) { - nodeY = node.getLayout().y - dy; - node.setLayout({y: nodeY}, true); + nodeX = node.getLayout()[keyAttr] - dy; + orient === 'vertical' + ? node.setLayout({x: nodeX}, true) + : node.setLayout({y: nodeX}, true); } - y0 = node.getLayout().y; + y0 = node.getLayout()[keyAttr]; } } }); @@ -60435,20 +64550,66 @@ function resolveCollisions(nodesByBreadth, nodeGap, height) { * group by the array of all sankey nodes based on the node x-position. * @param {number} alpha parameter used to adjust the nodes y-position */ -function relaxRightToLeft(nodesByBreadth, alpha) { +function relaxRightToLeft(nodesByBreadth, alpha, orient) { each$1(nodesByBreadth.slice().reverse(), function (nodes) { each$1(nodes, function (node) { if (node.outEdges.length) { - var y = sum(node.outEdges, weightedTarget) / sum(node.outEdges, getEdgeValue); - var nodeY = node.getLayout().y + (y - center$1(node)) * alpha; - node.setLayout({y: nodeY}, true); + var y = sum(node.outEdges, weightedTarget, orient) + / sum(node.outEdges, getEdgeValue, orient); + + if (isNaN(y)) { + var len = node.outEdges.length; + y = len ? sum(node.outEdges, centerTarget, orient) / len : 0; + } + + if (orient === 'vertical') { + var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; + node.setLayout({x: nodeX}, true); + } + else { + var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; + node.setLayout({y: nodeY}, true); + } } }); }); } -function weightedTarget(edge) { - return center$1(edge.node2) * edge.getValue(); +function weightedTarget(edge, orient) { + return center$1(edge.node2, orient) * edge.getValue(); +} +function centerTarget(edge, orient) { + return center$1(edge.node2, orient); +} + +function weightedSource(edge, orient) { + return center$1(edge.node1, orient) * edge.getValue(); +} +function centerSource(edge, orient) { + return center$1(edge.node1, orient); +} + +function center$1(node, orient) { + return orient === 'vertical' + ? node.getLayout().x + node.getLayout().dx / 2 + : node.getLayout().y + node.getLayout().dy / 2; +} + +function getEdgeValue(edge) { + return edge.getValue(); +} + +function sum(array, cb, orient) { + var sum = 0; + var len = array.length; + var i = -1; + while (++i < len) { + var value = +cb.call(array, array[i], orient); + if (!isNaN(value)) { + sum += value; + } + } + return sum; } /** @@ -60458,31 +64619,46 @@ function weightedTarget(edge) { * group by the array of all sankey nodes based on the node x-position. * @param {number} alpha parameter used to adjust the nodes y-position */ -function relaxLeftToRight(nodesByBreadth, alpha) { +function relaxLeftToRight(nodesByBreadth, alpha, orient) { each$1(nodesByBreadth, function (nodes) { each$1(nodes, function (node) { if (node.inEdges.length) { - var y = sum(node.inEdges, weightedSource) / sum(node.inEdges, getEdgeValue); - var nodeY = node.getLayout().y + (y - center$1(node)) * alpha; - node.setLayout({y: nodeY}, true); + + var y = sum(node.inEdges, weightedSource, orient) + / sum(node.inEdges, getEdgeValue, orient); + + if (isNaN(y)) { + var len = node.inEdges.length; + y = len ? sum(node.inEdges, centerSource, orient) / len : 0; + } + + if (orient === 'vertical') { + var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; + node.setLayout({x: nodeX}, true); + } + else { + var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; + node.setLayout({y: nodeY}, true); + } } }); }); } -function weightedSource(edge) { - return center$1(edge.node1) * edge.getValue(); -} - /** * Compute the depth(y-position) of each edge * * @param {module:echarts/data/Graph~Node} nodes node of sankey view */ -function computeEdgeDepths(nodes) { +function computeEdgeDepths(nodes, orient) { + var keyAttr = orient === 'vertical' ? 'x' : 'y'; each$1(nodes, function (node) { - node.outEdges.sort(ascendingTargetDepth); - node.inEdges.sort(ascendingSourceDepth); + node.outEdges.sort(function (a, b) { + return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr]; + }); + node.inEdges.sort(function (a, b) { + return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr]; + }); }); each$1(nodes, function (node) { var sy = 0; @@ -60498,43 +64674,6 @@ function computeEdgeDepths(nodes) { }); } -function ascendingTargetDepth(a, b) { - return a.node2.getLayout().y - b.node2.getLayout().y; -} - -function ascendingSourceDepth(a, b) { - return a.node1.getLayout().y - b.node1.getLayout().y; -} - -function sum(array, f) { - var sum = 0; - var len = array.length; - var i = -1; - while (++i < len) { - var value = +f.call(array, array[i], i); - if (!isNaN(value)) { - sum += value; - } - } - return sum; -} - -function center$1(node) { - return node.getLayout().y + node.getLayout().dy / 2; -} - -function ascendingDepth(a, b) { - return a.getLayout().y - b.getLayout().y; -} - -function ascending(a, b) { - return a - b; -} - -function getEdgeValue(edge) { - return edge.getValue(); -} - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -60554,11 +64693,6 @@ function getEdgeValue(edge) { * under the License. */ -/** - * @file Visual encoding for sankey view - * @author Deqing Li(annong035@gmail.com) - */ - var sankeyVisual = function (ecModel, payload) { ecModel.eachSeriesByType('sankey', function (seriesModel) { var graph = seriesModel.getGraph(); @@ -60575,7 +64709,7 @@ var sankeyVisual = function (ecModel, payload) { maxValue = nodeValue; } }); - + each$1(nodes, function (node) { var mapping = new VisualMapping({ type: 'color', @@ -60583,15 +64717,12 @@ var sankeyVisual = function (ecModel, payload) { dataExtent: [minValue, maxValue], visual: seriesModel.get('color') }); - + var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); - node.setVisual('color', mapValueToColor); - // If set itemStyle.normal.color - var itemModel = node.getModel(); - var customColor = itemModel.get('itemStyle.color'); - if (customColor != null) { - node.setVisual('color', customColor); - } + var customColor = node.getModel().get('itemStyle.color'); + customColor != null + ? node.setVisual('color', customColor) + : node.setVisual('color', mapValueToColor); }); } }); @@ -60664,14 +64795,14 @@ var seriesModelMixin = { var addOrdinal; // FIXME - // 考虑时间轴 + // Consider time axis. if (xAxisType === 'category') { option.layout = 'horizontal'; ordinalMeta = xAxisModel.getOrdinalMeta(); addOrdinal = true; } - else if (yAxisType === 'category') { + else if (yAxisType === 'category') { option.layout = 'vertical'; ordinalMeta = yAxisModel.getOrdinalMeta(); addOrdinal = true; @@ -60712,25 +64843,29 @@ var seriesModelMixin = { } var defaultValueDimensions = this.defaultValueDimensions; + var coordDimensions = [{ + name: baseAxisDim, + type: getDimensionTypeByAxis(baseAxisType), + ordinalMeta: ordinalMeta, + otherDims: { + tooltip: false, + itemName: 0 + }, + dimsDef: ['base'] + }, { + name: otherAxisDim, + type: getDimensionTypeByAxis(otherAxisType), + dimsDef: defaultValueDimensions.slice() + }]; return createListSimply( this, { - coordDimensions: [{ - name: baseAxisDim, - type: getDimensionTypeByAxis(baseAxisType), - ordinalMeta: ordinalMeta, - otherDims: { - tooltip: false, - itemName: 0 - }, - dimsDef: ['base'] - }, { - name: otherAxisDim, - type: getDimensionTypeByAxis(otherAxisType), - dimsDef: defaultValueDimensions.slice() - }], - dimensionsCount: defaultValueDimensions.length + 1 + coordDimensions: coordDimensions, + dimensionsCount: defaultValueDimensions.length + 1, + encodeDefaulter: curry( + makeSeriesEncodeForAxisCoordSys, coordDimensions, this + ) } ); }, @@ -61329,6 +65464,8 @@ var CandlestickSeries = SeriesModel.extend({ layout: null, // 'horizontal' or 'vertical' + clip: true, + itemStyle: { color: '#c23531', // 阳线 positive color0: '#314656', // 阴线 negative '#c23531', '#314656' @@ -61401,12 +65538,14 @@ var NORMAL_ITEM_STYLE_PATH$1 = ['itemStyle']; var EMPHASIS_ITEM_STYLE_PATH$1 = ['emphasis', 'itemStyle']; var SKIP_PROPS = ['color', 'color0', 'borderColor', 'borderColor0']; - var CandlestickView = Chart.extend({ type: 'candlestick', render: function (seriesModel, ecModel, api) { + // If there is clipPath created in large mode. Remove it. + this.group.removeClipPath(); + this._updateDrawMode(seriesModel); this._isLargeDraw @@ -61439,6 +65578,10 @@ var CandlestickView = Chart.extend({ var group = this.group; var isSimpleBox = data.getLayout('isSimpleBox'); + var needsClip = seriesModel.get('clip', true); + var coord = seriesModel.coordinateSystem; + var clipArea = coord.getArea && coord.getArea(); + // There is no old data only when first rendering or switching from // stream mode to normal mode, where previous elements should be removed. if (!this._data) { @@ -61451,12 +65594,18 @@ var CandlestickView = Chart.extend({ var el; var itemLayout = data.getItemLayout(newIdx); + + if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { + return; + } + el = createNormalBox$1(itemLayout, newIdx, true); initProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx); setBoxCommon(el, data, newIdx, isSimpleBox); group.add(el); + data.setItemGraphicEl(newIdx, el); } }) @@ -61470,6 +65619,11 @@ var CandlestickView = Chart.extend({ } var itemLayout = data.getItemLayout(newIdx); + if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { + group.remove(el); + return; + } + if (!el) { el = createNormalBox$1(itemLayout, newIdx); } @@ -61493,7 +65647,19 @@ var CandlestickView = Chart.extend({ _renderLarge: function (seriesModel) { this._clear(); + createLarge$1(seriesModel, this.group); + + var clipPath = seriesModel.get('clip', true) + ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) + : null; + if (clipPath) { + this.group.setClipPath(clipPath); + } + else { + this.group.removeClipPath(); + } + }, _incrementalRenderNormal: function (params, seriesModel) { @@ -61559,6 +65725,7 @@ var NormalBoxPath = Path.extend({ } }); + function createNormalBox$1(itemLayout, dataIndex, isInit) { var ends = itemLayout.ends; return new NormalBoxPath({ @@ -61571,6 +65738,18 @@ function createNormalBox$1(itemLayout, dataIndex, isInit) { }); } +function isNormalBoxClipped(clipArea, itemLayout) { + var clipped = true; + for (var i = 0; i < itemLayout.ends.length; i++) { + // If any point are in the region. + if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) { + clipped = false; + break; + } + } + return clipped; +} + function setBoxCommon(el, data, dataIndex, isSimpleBox) { var itemModel = data.getItemModel(dataIndex); var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH$1); @@ -61733,7 +65912,6 @@ var candlestickVisual = { reset: function (seriesModel, ecModel) { var data = seriesModel.getData(); - var isLargeRender = seriesModel.pipelineContext.large; data.setVisual({ legendSymbol: 'roundRect', @@ -61748,6 +65926,7 @@ var candlestickVisual = { return; } + var isLargeRender = seriesModel.pipelineContext.large; return !isLargeRender && {progress: progress}; @@ -61802,6 +65981,8 @@ var candlestickVisual = { * under the License. */ +/* global Float32Array */ + var LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array; var candlestickLayout = { @@ -61926,7 +66107,7 @@ var candlestickLayout = { function largeProgress(params, data) { // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...] - var points = new LargeArr$1(params.count * 5); + var points = new LargeArr$1(params.count * 4); var offset = 0; var point; var tmpIn = []; @@ -61942,7 +66123,7 @@ var candlestickLayout = { if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { points[offset++] = NaN; - offset += 4; + offset += 3; continue; } @@ -62059,7 +66240,7 @@ SeriesModel.extend({ dependencies: ['grid', 'polar'], getInitialData: function (option, ecModel) { - return createListFromArray(this.getSource(), this); + return createListFromArray(this.getSource(), this, {useEncodeDefaulter: true}); }, brushSelector: 'point', @@ -62145,13 +66326,14 @@ function normalizeSymbolSize$1(symbolSize) { } function updateRipplePath(rippleGroup, effectCfg) { + var color = effectCfg.rippleEffectColor || effectCfg.color; rippleGroup.eachChild(function (ripplePath) { ripplePath.attr({ z: effectCfg.z, zlevel: effectCfg.zlevel, style: { - stroke: effectCfg.brushType === 'stroke' ? effectCfg.color : null, - fill: effectCfg.brushType === 'fill' ? effectCfg.color : null + stroke: effectCfg.brushType === 'stroke' ? color : null, + fill: effectCfg.brushType === 'fill' ? color : null } }); }); @@ -62188,9 +66370,6 @@ effectSymbolProto.startEffectAnimation = function (effectCfg) { var rippleGroup = this.childAt(1); for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) { - // var ripplePath = createSymbol( - // symbolType, -0.5, -0.5, 1, 1, color - // ); // If width/height are set too small (e.g., set to 1) on ios10 // and macOS Sierra, a circle stroke become a rect, no matter what // the scale is set. So we set width/height as 2. See #4136. @@ -62292,7 +66471,8 @@ effectSymbolProto.updateData = function (data, idx) { pos[0] = parsePercent$1(symbolOffset[0], symbolSize[0]); pos[1] = parsePercent$1(symbolOffset[1], symbolSize[1]); } - rippleGroup.rotation = (itemModel.getShallow('symbolRotate') || 0) * Math.PI / 180 || 0; + var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); + rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; var effectCfg = {}; @@ -62305,6 +66485,7 @@ effectSymbolProto.updateData = function (data, idx) { effectCfg.zlevel = itemModel.getShallow('zlevel') || 0; effectCfg.symbolType = symbolType; effectCfg.color = color; + effectCfg.rippleEffectColor = itemModel.get('rippleEffect.color'); this.off('mouseover').off('mouseout').off('emphasis').off('normal'); @@ -62452,6 +66633,8 @@ registerLayout(pointsLayout('effectScatter')); * under the License. */ +/* global Uint32Array, Float64Array, Float32Array */ + var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array; var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array; @@ -62548,7 +66731,9 @@ var LinesSeries = SeriesModel.extend({ if (__DEV__) { if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { - throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); + throw new Error( + 'Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.' + ); } } return coords; @@ -62740,6 +66925,10 @@ var LinesSeries = SeriesModel.extend({ // polyline not support curveness, label, animation polyline: false, + // If clip the overflow. + // Available when coordinateSystem is cartesian or polar. + clip: true, + label: { show: false, position: 'end' @@ -62835,6 +67024,7 @@ effectLineProto._updateEffectSymbol = function (lineData, idx) { symbol.attr('scale', size); this._symbolType = symbolType; + this._symbolScale = size; this._updateEffectAnimation(lineData, effectModel, idx); }; @@ -62925,6 +67115,7 @@ effectLineProto.updateSymbolPosition = function (symbol) { var cp1 = symbol.__cp1; var t = symbol.__t; var pos = symbol.position; + var lastPos = [pos[0], pos[1]]; var quadraticAt$$1 = quadraticAt; var quadraticDerivativeAt$$1 = quadraticDerivativeAt; pos[0] = quadraticAt$$1(p1[0], cp1[0], p2[0], t); @@ -62935,7 +67126,27 @@ effectLineProto.updateSymbolPosition = function (symbol) { var ty = quadraticDerivativeAt$$1(p1[1], cp1[1], p2[1], t); symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; - + // enable continuity trail for 'line', 'rect', 'roundRect' symbolType + if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') { + if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) { + var scaleY = dist(lastPos, pos) * 1.05; + symbol.attr('scale', [symbol.scale[0], scaleY]); + // make sure the last segment render within endPoint + if (t === 1) { + pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2; + pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2; + } + } + else if (symbol.__lastT === 1) { + // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly. + var scaleY = 2 * dist(p1, pos); + symbol.attr('scale', [symbol.scale[0], scaleY ]); + } + else { + symbol.attr('scale', this._symbolScale); + } + } + symbol.__lastT = symbol.__t; symbol.ignore = false; }; @@ -63431,6 +67642,8 @@ largeLineProto._clearIncremental = function () { * under the License. */ +/* global Float32Array */ + var linesLayout = { seriesType: 'lines', @@ -63573,6 +67786,16 @@ extendChartView({ lineDraw.updateData(data); + var clipPath = seriesModel.get('clip', true) && createClipPath( + seriesModel.coordinateSystem, false, seriesModel + ); + if (clipPath) { + this.group.setClipPath(clipPath); + } + else { + this.group.removeClipPath(); + } + this._lastZlevel = zlevel; this._finished = true; @@ -63841,13 +68064,7 @@ SeriesModel.extend({ * under the License. */ -/** - * @file defines echarts Heatmap Chart - * @author Ovilia (me@zhangwenli.com) - * Inspired by https://github.com/mourner/simpleheat - * - * @module - */ +/* global Uint8ClampedArray */ var GRADIENT_LEVELS = 256; @@ -63876,7 +68093,7 @@ Heatmap.prototype = { * @param {number} width canvas width * @param {number} height canvas height */ - update: function(data, width, height, normalize, colorFunc, isInRange) { + update: function (data, width, height, normalize, colorFunc, isInRange) { var brush = this._getBrush(); var gradientInRange = this._getGradient(data, colorFunc, 'inRange'); var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange'); @@ -63917,7 +68134,7 @@ Heatmap.prototype = { var maxOpacity = this.maxOpacity; var diffOpacity = maxOpacity - minOpacity; - while(offset < pixelLen) { + while (offset < pixelLen) { var alpha = pixels[offset + 3] / 256; var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data @@ -63944,7 +68161,7 @@ Heatmap.prototype = { * @private * @returns {Object} circle brush canvas */ - _getBrush: function() { + _getBrush: function () { var brushCanvas = this._brushCanvas || (this._brushCanvas = createCanvas()); // set brush size var r = this.pointSize + this.blurSize; @@ -64173,10 +68390,10 @@ extendChartView({ rect = new Rect({ shape: { - x: point[0] - width / 2, - y: point[1] - height / 2, - width: width, - height: height + x: Math.floor(Math.round(point[0]) - width / 2), + y: Math.floor(Math.round(point[1]) - height / 2), + width: Math.ceil(width), + height: Math.ceil(height) }, style: { fill: data.getItemVisual(idx, 'color'), @@ -65015,12 +69232,12 @@ function updateHoverAnimation(path, symbolMeta) { var scale = symbolMeta.symbolScale.slice(); symbolMeta.hoverAnimation && path - .on('emphasis', function() { + .on('emphasis', function () { this.animateTo({ scale: [scale[0] * 1.1, scale[1] * 1.1] }, 400, 'elasticOut'); }) - .on('normal', function() { + .on('normal', function () { this.animateTo({ scale: scale.slice() }, 400, 'elasticOut'); @@ -65471,7 +69688,7 @@ Single.prototype = { var isHorizontal = axis.isHorizontal(); var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; - var idx = axis.reverse ? 1 : 0; + var idx = axis.reverse ? 1 : 0; axis.setExtent(extent[idx], extent[1 - idx]); @@ -65625,7 +69842,7 @@ Single.prototype = { function create$3(ecModel, api) { var singles = []; - ecModel.eachComponent('singleAxis', function(axisModel, idx) { + ecModel.eachComponent('singleAxis', function (axisModel, idx) { var single = new Single(axisModel, ecModel, api); single.name = 'single_' + idx; @@ -65711,9 +69928,8 @@ function layout$2(axisModel, opt) { var directionMap = {top: -1, bottom: 1, right: 1, left: -1}; - layout.labelDirection = layout.tickDirection - = layout.nameDirection - = directionMap[axisPosition]; + layout.labelDirection = layout.tickDirection = + layout.nameDirection = directionMap[axisPosition]; if (axisModel.get('axisTick.inside')) { layout.tickDirection = -layout.tickDirection; @@ -65756,7 +69972,7 @@ var axisBuilderAttrs$2 = [ 'axisLine', 'axisTickLabel', 'axisName' ]; -var selfBuilderAttr = 'splitLine'; +var selfBuilderAttrs$1 = ['splitArea', 'splitLine']; var SingleAxisView = AxisView.extend({ @@ -65770,22 +69986,34 @@ var SingleAxisView = AxisView.extend({ group.removeAll(); - var layout = layout$2(axisModel); + var oldAxisGroup = this._axisGroup; + this._axisGroup = new Group(); + + var layout = layout$2(axisModel); var axisBuilder = new AxisBuilder(axisModel, layout); each$1(axisBuilderAttrs$2, axisBuilder.add, axisBuilder); + group.add(this._axisGroup); group.add(axisBuilder.getGroup()); - if (axisModel.get(selfBuilderAttr + '.show')) { - this['_' + selfBuilderAttr](axisModel); - } + each$1(selfBuilderAttrs$1, function (name) { + if (axisModel.get(name + '.show')) { + this['_' + name](axisModel); + } + }, this); + + groupTransition(oldAxisGroup, this._axisGroup, axisModel); SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); }, - _splitLine: function(axisModel) { + remove: function () { + rectCoordAxisHandleRemove(this); + }, + + _splitLine: function (axisModel) { var axis = axisModel.axis; if (axis.scale.isBlank()) { @@ -65828,19 +70056,19 @@ var SingleAxisView = AxisView.extend({ } var colorIndex = (lineCount++) % lineColors.length; splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(new Line( - subPixelOptimizeLine({ - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - style: { - lineWidth: lineWidth - }, - silent: true - }))); + splitLines[colorIndex].push(new Line({ + subPixelOptimize: true, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: { + lineWidth: lineWidth + }, + silent: true + })); } for (var i = 0; i < splitLines.length; ++i) { @@ -65853,6 +70081,10 @@ var SingleAxisView = AxisView.extend({ silent: true })); } + }, + + _splitArea: function (axisModel) { + rectCoordAxisBuildSplitArea(this, this._axisGroup, axisModel, axisModel); } }); @@ -65916,7 +70148,7 @@ var defaultOption$2 = { axisLine: { show: true, lineStyle: { - width: 2, + width: 1, type: 'solid' } }, @@ -65932,7 +70164,7 @@ var defaultOption$2 = { show: true, length: 6, lineStyle: { - width: 2 + width: 1 } }, @@ -66470,7 +70702,7 @@ var AxisPointerModel = extendComponentModel({ zlevel: 0, z: 50, - type: 'line', + type: 'line', // 'line' 'shadow' 'cross' 'none'. // axispointer triggered by tootip determine snap automatically, // see `modelHelper`. snap: false, @@ -66527,7 +70759,9 @@ var AxisPointerModel = extendComponentModel({ handle: { show: false, + /* eslint-disable */ icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line + /* eslint-enable */ size: 45, // handle margin is from symbol center to axis, which is stable when circular move. margin: 50, @@ -66775,7 +71009,7 @@ var bind$2 = bind; * Base axis pointer class in 2D. * Implemenents {module:echarts/component/axis/IAxisPointer}. */ -function BaseAxisPointer () { +function BaseAxisPointer() { } BaseAxisPointer.prototype = { @@ -66980,7 +71214,7 @@ BaseAxisPointer.prototype = { */ updatePointerEl: function (group, elOption, updateProps$$1) { var pointerEl = inner$11(group).pointerEl; - if (pointerEl) { + if (pointerEl && elOption.pointer) { pointerEl.setStyle(elOption.pointer.style); updateProps$$1(pointerEl, {shape: elOption.pointer.shape}); } @@ -67362,6 +71596,7 @@ function buildLabelElOption( textFont: font, textFill: labelModel.getTextColor(), textPosition: 'inside', + textPadding: paddings, fill: bgColor, stroke: labelModel.get('borderColor') || 'transparent', lineWidth: labelModel.get('borderWidth') || 0, @@ -67406,6 +71641,8 @@ function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { if (formatter) { var params = { value: getAxisRawValue(axis, value), + axisDimension: axis.dim, + axisIndex: axis.index, seriesData: [] }; each$1(seriesDataIndices, function (idxItem) { @@ -67433,7 +71670,7 @@ function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { * rotation, position, labelOffset, labelDirection, labelMargin * } */ -function getTransformedPosition (axis, value, layoutInfo) { +function getTransformedPosition(axis, value, layoutInfo) { var transform = create$1(); rotate(transform, transform, layoutInfo.rotation); translate(transform, transform, layoutInfo.position); @@ -67535,7 +71772,7 @@ var CartesianAxisPointer = BaseAxisPointer.extend({ if (axisPointerType && axisPointerType !== 'none') { var elStyle = buildElStyle(axisPointerModel); var pointerOption = pointerShapeBuilder[axisPointerType]( - axis, pixelValue, otherExtent, elStyle + axis, pixelValue, otherExtent ); pointerOption.style = elStyle; elOption.graphicKey = pointerOption.type; @@ -67602,23 +71839,20 @@ function getCartesian(grid, axis) { var pointerShapeBuilder = { - line: function (axis, pixelValue, otherExtent, elStyle) { + line: function (axis, pixelValue, otherExtent) { var targetShape = makeLineShape( [pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis) ); - subPixelOptimizeLine({ - shape: targetShape, - style: elStyle - }); return { type: 'Line', + subPixelOptimize: true, shape: targetShape }; }, - shadow: function (axis, pixelValue, otherExtent, elStyle) { + shadow: function (axis, pixelValue, otherExtent) { var bandWidth = Math.max(1, axis.getBandWidth()); var span = otherExtent[1] - otherExtent[0]; return { @@ -67681,8 +71915,8 @@ registerPreprocessor(function (option) { registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) { // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. // allAxesInfo should be updated when setOption performed. - ecModel.getComponent('axisPointer').coordSysAxesInfo - = collect(ecModel, api); + ecModel.getComponent('axisPointer').coordSysAxesInfo = + collect(ecModel, api); }); // Broadcast to all views. @@ -67729,7 +71963,7 @@ var SingleAxisPointer = BaseAxisPointer.extend({ if (axisPointerType && axisPointerType !== 'none') { var elStyle = buildElStyle(axisPointerModel); var pointerOption = pointerShapeBuilder$1[axisPointerType]( - axis, pixelValue, otherExtent, elStyle + axis, pixelValue, otherExtent ); pointerOption.style = elStyle; @@ -67785,23 +72019,20 @@ var SingleAxisPointer = BaseAxisPointer.extend({ var pointerShapeBuilder$1 = { - line: function (axis, pixelValue, otherExtent, elStyle) { + line: function (axis, pixelValue, otherExtent) { var targetShape = makeLineShape( [pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis) ); - subPixelOptimizeLine({ - shape: targetShape, - style: elStyle - }); return { type: 'Line', + subPixelOptimize: true, shape: targetShape }; }, - shadow: function (axis, pixelValue, otherExtent, elStyle) { + shadow: function (axis, pixelValue, otherExtent) { var bandWidth = axis.getBandWidth(); var span = otherExtent[1] - otherExtent[0]; return { @@ -67868,11 +72099,6 @@ extendComponentView({ * under the License. */ -/** - * @file Define the themeRiver view's series model - * @author Deqing Li(annong035@gmail.com) - */ - var DATA_NAME_INDEX = 2; var ThemeRiverSeries = SeriesModel.extend({ @@ -67891,14 +72117,15 @@ var ThemeRiverSeries = SeriesModel.extend({ * @override */ init: function (option) { + // eslint-disable-next-line ThemeRiverSeries.superApply(this, 'init', arguments); // Put this function here is for the sake of consistency of code style. // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed - this.legendDataProvider = function () { - return this.getRawData(); - }; + this.legendVisualProvider = new LegendVisualProvider( + bind(this.getData, this), bind(this.getRawData, this) + ); }, /** @@ -67911,18 +72138,12 @@ var ThemeRiverSeries = SeriesModel.extend({ var rawDataLength = data.length; // grouped data by name - var dataByName = nest() - .key(function (dataItem) { - return dataItem[2]; - }) - .entries(data); - - // data group in each layer - var layData = map(dataByName, function (d) { - return { - name: d.key, - dataList: d.values - }; + var groupResult = groupData(data, function (item) { + return item[2]; + }); + var layData = []; + groupResult.buckets.each(function (items, key) { + layData.push({name: key, dataList: items}); }); var layerNum = layData.length; @@ -68043,36 +72264,27 @@ var ThemeRiverSeries = SeriesModel.extend({ for (var i = 0; i < lenCount; ++i) { indexArr[i] = i; } - // data group by name - var dataByName = nest() - .key(function (index) { - return data.get('name', index); - }) - .entries(indexArr); - - var layerSeries = map(dataByName, function (d) { - return { - name: d.key, - indices: d.values - }; - }); var timeDim = data.mapDimension('single'); - for (var j = 0; j < layerSeries.length; ++j) { - layerSeries[j].indices.sort(comparer); - } - - function comparer(index1, index2) { - return data.get(timeDim, index1) - data.get(timeDim, index2); - } + // data group by name + var groupResult = groupData(indexArr, function (index) { + return data.get('name', index); + }); + var layerSeries = []; + groupResult.buckets.each(function (items, key) { + items.sort(function (index1, index2) { + return data.get(timeDim, index1) - data.get(timeDim, index2); + }); + layerSeries.push({name: key, indices: items}); + }); return layerSeries; }, /** * Get data indices for show tooltip content - * + * @param {Array.|string} dim single coordinate dimension * @param {number} value axis value * @param {module:echarts/coord/single/SingleAxis} baseAxis single Axis used @@ -68173,11 +72385,6 @@ var ThemeRiverSeries = SeriesModel.extend({ * under the License. */ -/** - * @file The file used to draw themeRiver view - * @author Deqing Li(annong035@gmail.com) - */ - extendChartView({ type: 'themeRiver', @@ -68265,7 +72472,7 @@ extendChartView({ layerGroup.add(text); group.add(layerGroup); - polygon.setClipPath(createGridClipShape$3(polygon.getBoundingRect(), seriesModel, function () { + polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () { polygon.removeClipPath(); })); } @@ -68318,7 +72525,7 @@ extendChartView({ }); // add animation to the view -function createGridClipShape$3(rect, seriesModel, cb) { +function createGridClipShape$2(rect, seriesModel, cb) { var rectEl = new Rect({ shape: { x: rect.x - 10, @@ -68356,11 +72563,6 @@ function createGridClipShape$3(rect, seriesModel, cb) { * under the License. */ -/** - * @file Using layout algorithm transform the raw data to layout information. - * @author Deqing Li(annong035@gmail.com) - */ - var themeRiverLayout = function (ecModel, api) { ecModel.eachSeriesByType('themeRiver', function (seriesModel) { @@ -68515,11 +72717,6 @@ function computeBaseline(data) { * under the License. */ -/** - * @file Visual encoding for themeRiver view - * @author Deqing Li(annong035@gmail.com) - */ - var themeRiverVisual = function (ecModel) { ecModel.eachSeriesByType('themeRiver', function (seriesModel) { var data = seriesModel.getData(); @@ -68671,19 +72868,29 @@ SeriesModel.extend({ align: 'center', position: 'inside', distance: 5, - silent: true, - emphasis: {} + silent: true }, itemStyle: { borderWidth: 1, borderColor: 'white', - opacity: 1, - emphasis: {}, - highlight: { + borderType: 'solid', + shadowBlur: 0, + shadowColor: 'rgba(0, 0, 0, 0.2)', + shadowOffsetX: 0, + shadowOffsetY: 0, + opacity: 1 + }, + highlight: { + itemStyle: { opacity: 1 + } + }, + downplay: { + itemStyle: { + opacity: 0.5 }, - downplay: { - opacity: 0.9 + label: { + opacity: 0.6 } }, @@ -68857,14 +73064,16 @@ SunburstPieceProto.updateData = function ( var itemModel = node.getModel(); var layout = node.getLayout(); - if (!layout) { - console.log(node.getLayout()); - } + // if (!layout) { + // console.log(node.getLayout()); + // } var sectorShape = extend({}, layout); sectorShape.label = null; var visualColor = getNodeColor(node, seriesModel, ecModel); + fillDefaultColor(node, seriesModel, visualColor); + var normalStyle = itemModel.getModel('itemStyle').getItemStyle(); var style; if (state === 'normal') { @@ -68927,6 +73136,8 @@ SunburstPieceProto.updateData = function ( this._seriesModel = seriesModel || this._seriesModel; this._ecModel = ecModel || this._ecModel; + + setHoverStyle(this); }; SunburstPieceProto.onEmphasis = function (highlightPolicy) { @@ -68972,7 +73183,7 @@ SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) { var text = retrieve( seriesModel.getFormattedLabel( - this.node.dataIndex, 'normal', null, null, 'label' + this.node.dataIndex, state, null, null, 'label' ), this.node.name ); @@ -69061,7 +73272,8 @@ SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) { else if (rotate < -Math.PI / 2) { rotate += Math.PI; } - } else if (typeof rotateType === 'number') { + } + else if (typeof rotateType === 'number') { rotate = rotateType * Math.PI / 180; } label.attr('rotation', rotate); @@ -69180,6 +73392,12 @@ function isNodeHighlighted(node, activeNode, policy) { } } +// Fix tooltip callback function params.color incorrect when pick a default color +function fillDefaultColor(node, seriesModel, color) { + var data = seriesModel.getData(); + data.setItemVisual(node.dataIndex, 'color', color); +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -69383,7 +73601,7 @@ var SunburstView = Chart.extend({ if (link) { var linkTarget = itemModel.get('target', true) || '_blank'; - window.open(link, linkTarget); + windowOpen(link, linkTarget); } } targetFound = true; @@ -69537,7 +73755,8 @@ registerAction( */ -var RADIAN$1 = Math.PI / 180; +// var PI2 = Math.PI * 2; +var RADIAN$2 = Math.PI / 180; var sunburstLayout = function (seriesType, ecModel, api, payload) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { @@ -69559,8 +73778,8 @@ var sunburstLayout = function (seriesType, ecModel, api, payload) { var r0 = parsePercent$1(radius[0], size / 2); var r = parsePercent$1(radius[1], size / 2); - var startAngle = -seriesModel.get('startAngle') * RADIAN$1; - var minAngle = seriesModel.get('minAngle') * RADIAN$1; + var startAngle = -seriesModel.get('startAngle') * RADIAN$2; + var minAngle = seriesModel.get('minAngle') * RADIAN$2; var virtualRoot = seriesModel.getData().tree.root; var treeRoot = seriesModel.getViewRoot(); @@ -69589,6 +73808,9 @@ var sunburstLayout = function (seriesType, ecModel, api, payload) { var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle + // var restAngle = PI2; + // var valueSumLargerThanMinAngle = 0; + var dir = clockwise ? 1 : -1; /** @@ -69611,11 +73833,11 @@ var sunburstLayout = function (seriesType, ecModel, api, payload) { ? unitRadian : (value * unitRadian); if (angle < minAngle) { angle = minAngle; - - } - else { - + // restAngle -= minAngle; } + // else { + // valueSumLargerThanMinAngle += value; + // } endAngle = startAngle + dir * angle; @@ -70034,6 +74256,7 @@ var prepareCalendar = function (coordSys) { * under the License. */ +var CACHED_LABEL_STYLE_PROPERTIES$1 = CACHED_LABEL_STYLE_PROPERTIES; var ITEM_STYLE_NORMAL_PATH = ['itemStyle']; var ITEM_STYLE_EMPHASIS_PATH = ['emphasis', 'itemStyle']; var LABEL_NORMAL = ['label']; @@ -70042,6 +74265,7 @@ var LABEL_EMPHASIS = ['emphasis', 'label']; // which will cause weird udpate animation. var GROUP_DIFF_PREFIX = 'e\0\0'; + /** * To reduce total package size of each coordinate systems, the modules `prepareCustom` * of each coordinate systems are not required by each coordinate systems directly, but @@ -70061,11 +74285,12 @@ var prepareCustoms = { calendar: prepareCalendar }; + // ------ // Model // ------ -extendSeriesModel({ +SeriesModel.extend({ type: 'series.custom', @@ -70077,7 +74302,13 @@ extendSeriesModel({ z: 2, legendHoverLink: true, - useTransform: true + useTransform: true, + + // Custom series will not clip by default. + // Some case will use custom series to draw label + // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight + // Only works on polar and cartesian2d coordinate system. + clip: false // Cartesian coordinate system // xAxisIndex: 0, @@ -70093,8 +74324,20 @@ extendSeriesModel({ // itemStyle: {} }, + /** + * @override + */ getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this); + }, + + /** + * @override + */ + getDataParams: function (dataIndex, dataType, el) { + var params = SeriesModel.prototype.getDataParams.apply(this, arguments); + el && (params.info = el.info); + return params; } }); @@ -70102,7 +74345,7 @@ extendSeriesModel({ // View // ----- -extendChartView({ +Chart.extend({ type: 'custom', @@ -70144,6 +74387,17 @@ extendChartView({ }) .execute(); + // Do clipping + var clipPath = customSeries.get('clip', true) + ? createClipPath(customSeries.coordinateSystem, false, customSeries) + : null; + if (clipPath) { + group.setClipPath(clipPath); + } + else { + group.removeClipPath(); + } + this._data = data; }, @@ -70176,15 +74430,15 @@ extendChartView({ * @override */ filterForExposedEvent: function (eventType, query, targetEl, packedEvent) { - var targetName = query.target; - if (targetName == null || targetEl.name === targetName) { + var elementName = query.element; + if (elementName == null || targetEl.name === elementName) { return true; } // Enable to give a name on a group made by `renderItem`, and listen // events that triggerd by its descendents. while ((targetEl = targetEl.parent) && targetEl !== this.group) { - if (targetEl.name === targetName) { + if (targetEl.name === elementName) { return true; } } @@ -70198,33 +74452,40 @@ function createEl(elOption) { var graphicType = elOption.type; var el; + // Those graphic elements are not shapes. They should not be + // overwritten by users, so do them first. if (graphicType === 'path') { var shape = elOption.shape; - el = makePath( - shape.pathData, - null, - { + // Using pathRect brings convenience to users sacle svg path. + var pathRect = (shape.width != null && shape.height != null) + ? { x: shape.x || 0, y: shape.y || 0, - width: shape.width || 0, - height: shape.height || 0 - }, - 'center' - ); - el.__customPathData = elOption.pathData; + width: shape.width, + height: shape.height + } + : null; + var pathData = getPathData(shape); + // Path is also used for icon, so layout 'center' by default. + el = makePath(pathData, null, pathRect, shape.layout || 'center'); + el.__customPathData = pathData; } else if (graphicType === 'image') { - el = new ZImage({ - }); + el = new ZImage({}); el.__customImagePath = elOption.style.image; } else if (graphicType === 'text') { - el = new Text({ - }); + el = new Text({}); el.__customText = elOption.style.text; } + else if (graphicType === 'group') { + el = new Group(); + } + else if (graphicType === 'compoundPath') { + throw new Error('"compoundPath" is not supported yet.'); + } else { - var Clz = graphic[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)]; + var Clz = getShapeClass(graphicType); if (__DEV__) { assert$1(Clz, 'graphic type "' + graphicType + '" can not be found.'); @@ -70240,24 +74501,24 @@ function createEl(elOption) { } function updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot) { - var targetProps = {}; + var transitionProps = {}; var elOptionStyle = elOption.style || {}; - elOption.shape && (targetProps.shape = clone(elOption.shape)); - elOption.position && (targetProps.position = elOption.position.slice()); - elOption.scale && (targetProps.scale = elOption.scale.slice()); - elOption.origin && (targetProps.origin = elOption.origin.slice()); - elOption.rotation && (targetProps.rotation = elOption.rotation); + elOption.shape && (transitionProps.shape = clone(elOption.shape)); + elOption.position && (transitionProps.position = elOption.position.slice()); + elOption.scale && (transitionProps.scale = elOption.scale.slice()); + elOption.origin && (transitionProps.origin = elOption.origin.slice()); + elOption.rotation && (transitionProps.rotation = elOption.rotation); if (el.type === 'image' && elOption.style) { - var targetStyle = targetProps.style = {}; + var targetStyle = transitionProps.style = {}; each$1(['x', 'y', 'width', 'height'], function (prop) { prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit); }); } if (el.type === 'text' && elOption.style) { - var targetStyle = targetProps.style = {}; + var targetStyle = transitionProps.style = {}; each$1(['x', 'y'], function (prop) { prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit); }); @@ -70284,35 +74545,32 @@ function updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot } if (isInit) { - el.attr(targetProps); + el.attr(transitionProps); } else { - updateProps(el, targetProps, animatableModel, dataIndex); + updateProps(el, transitionProps, animatableModel, dataIndex); } + // Merge by default. // z2 must not be null/undefined, otherwise sort error may occur. - el.attr({ - z2: elOption.z2 || 0, - silent: elOption.silent, - invisible: elOption.invisible, - ignore: elOption.ignore - }); + elOption.hasOwnProperty('z2') && el.attr('z2', elOption.z2 || 0); + elOption.hasOwnProperty('silent') && el.attr('silent', elOption.silent); + elOption.hasOwnProperty('invisible') && el.attr('invisible', elOption.invisible); + elOption.hasOwnProperty('ignore') && el.attr('ignore', elOption.ignore); + // `elOption.info` enables user to mount some info on + // elements and use them in event handlers. + // Update them only when user specified, otherwise, remain. + elOption.hasOwnProperty('info') && el.attr('info', elOption.info); // If `elOption.styleEmphasis` is `false`, remove hover style. The // logic is ensured by `graphicUtil.setElementHoverStyle`. var styleEmphasis = elOption.styleEmphasis; - var disableStyleEmphasis = styleEmphasis === false; - if (!( - // Try to escapse setting hover style for performance. - (el.__cusHasEmphStl && styleEmphasis == null) - || (!el.__cusHasEmphStl && disableStyleEmphasis) - )) { - // Should not use graphicUtil.setHoverStyle, since the styleEmphasis - // should not be share by group and its descendants. - setElementHoverStyle(el, styleEmphasis); - el.__cusHasEmphStl = !disableStyleEmphasis; + // hoverStyle should always be set here, because if the hover style + // may already be changed, where the inner cache should be reset. + setElementHoverStyle(el, styleEmphasis); + if (isRoot) { + setAsHighDownDispatcher(el, styleEmphasis !== false); } - isRoot && setAsHoverStyleTrigger(el, !disableStyleEmphasis); } function prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) { @@ -70388,7 +74646,7 @@ function makeRenderItem(customSeries, data, ecModel, api) { actionType: payload ? payload.type : null }, userParams), userAPI - ) || {}; + ); }; // Do not update cache until api called. @@ -70434,19 +74692,24 @@ function makeRenderItem(customSeries, data, ecModel, api) { var opacity = data.getItemVisual(dataIndexInside, 'opacity'); opacity != null && (itemStyle.opacity = opacity); - setTextStyle(itemStyle, currLabelNormalModel, null, { + var labelModel = extra + ? applyExtraBefore(extra, currLabelNormalModel) + : currLabelNormalModel; + + setTextStyle(itemStyle, labelModel, null, { autoColor: currVisualColor, isRectText: true }); - itemStyle.text = currLabelNormalModel.getShallow('show') + itemStyle.text = labelModel.getShallow('show') ? retrieve2( customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside) ) : null; - extra && extend(itemStyle, extra); + extra && applyExtraAfter(itemStyle, extra); + return itemStyle; } @@ -70461,11 +74724,15 @@ function makeRenderItem(customSeries, data, ecModel, api) { var itemStyle = currItemModel.getModel(ITEM_STYLE_EMPHASIS_PATH).getItemStyle(); - setTextStyle(itemStyle, currLabelEmphasisModel, null, { + var labelModel = extra + ? applyExtraBefore(extra, currLabelEmphasisModel) + : currLabelEmphasisModel; + + setTextStyle(itemStyle, labelModel, null, { isRectText: true }, true); - itemStyle.text = currLabelEmphasisModel.getShallow('show') + itemStyle.text = labelModel.getShallow('show') ? retrieve3( customSeries.getFormattedLabel(dataIndexInside, 'emphasis'), customSeries.getFormattedLabel(dataIndexInside, 'normal'), @@ -70473,7 +74740,8 @@ function makeRenderItem(customSeries, data, ecModel, api) { ) : null; - extra && extend(itemStyle, extra); + extra && applyExtraAfter(itemStyle, extra); + return itemStyle; } @@ -70492,6 +74760,7 @@ function makeRenderItem(customSeries, data, ecModel, api) { * @param {number} opt.count Positive interger. * @param {number} [opt.barWidth] * @param {number} [opt.barMaxWidth] + * @param {number} [opt.barMinWidth] * @param {number} [opt.barGap] * @param {number} [opt.barCategoryGap] * @return {Object} {width, offset, offsetCenter} is not support, return undefined. @@ -70546,18 +74815,39 @@ function createOrUpdate$1(el, dataIndex, elOption, animatableModel, group, data) } function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, isRoot) { - elOption = elOption || {}; + // [Rule] + // By default, follow merge mode. + // (It probably brings benifit for performance in some cases of large data, where + // user program can be optimized to that only updated props needed to be re-calculated, + // or according to `actionType` some calculation can be skipped.) + // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing. + // (It seems that violate the "merge" principle, but most of users probably intuitively + // regard "return;" as "show nothing element whatever", so make a exception to meet the + // most cases.) + + var simplyRemove = !elOption; // `null`/`undefined`/`false` + elOption = elOption || {}; var elOptionType = elOption.type; + var elOptionShape = elOption.shape; + var elOptionStyle = elOption.style; + if (el && ( - // Also consider that if `renderItem` returns nothing, the original element - // (if exists) will be removed (elOption is an empty object in that case). - elOptionType == null - || elOption.$merge === false - || (elOptionType !== el.__customGraphicType - && (elOptionType !== 'path' || elOption.pathData !== el.__customPathData) - && (elOptionType !== 'image' || elOption.style.image !== el.__customImagePath) - && (elOptionType !== 'text' || elOption.style.text !== el.__customText) + simplyRemove + // || elOption.$merge === false + // If `elOptionType` is `null`, follow the merge principle. + || (elOptionType != null + && elOptionType !== el.__customGraphicType + ) + || (elOptionType === 'path' + && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== el.__customPathData + ) + || (elOptionType === 'image' + && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== el.__customImagePath + ) + // FIXME test and remove this restriction? + || (elOptionType === 'text' + && hasOwn(elOptionShape, 'text') && elOptionStyle.text !== el.__customText ) )) { group.remove(el); @@ -70565,7 +74855,7 @@ function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, } // `elOption.type` is undefined when `renderItem` returns nothing. - if (elOptionType == null) { + if (simplyRemove) { return; } @@ -70593,6 +74883,8 @@ function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, // by child.name. But that might be lower performance. // (3) If `elOption.$mergeChildren` is `false`, the existing children will be // replaced totally. +// (4) If `!elOption.children`, following the "merge" principle, nothing will happen. +// // For implementation simpleness, do not provide a direct way to remove sinlge // child (otherwise the total indicies of the children array have to be modified). // User can remove a single child by set its `ignore` as `true` or replace @@ -70679,12 +74971,48 @@ function processAddUpdate(newIndex, oldIndex) { ); } +// `graphic#applyDefaultTextStyle` will cache +// textFill, textStroke, textStrokeWidth. +// We have to do this trick. +function applyExtraBefore(extra, model) { + var dummyModel = new Model({}, model); + each$1(CACHED_LABEL_STYLE_PROPERTIES$1, function (stylePropName, modelPropName) { + if (extra.hasOwnProperty(stylePropName)) { + dummyModel.option[modelPropName] = extra[stylePropName]; + } + }); + return dummyModel; +} + +function applyExtraAfter(itemStyle, extra) { + for (var key in extra) { + if (extra.hasOwnProperty(key) + || !CACHED_LABEL_STYLE_PROPERTIES$1.hasOwnProperty(key) + ) { + itemStyle[key] = extra[key]; + } + } +} + function processRemove(oldIndex) { var context = this.context; var child = context.oldChildren[oldIndex]; child && context.group.remove(child); } +function getPathData(shape) { + // "d" follows the SVG convention. + return shape && (shape.pathData || shape.d); +} + +function hasOwnPathData(shape) { + return shape && (shape.hasOwnProperty('pathData') || shape.hasOwnProperty('d')); +} + +function hasOwn(host, prop) { + return host && host.hasOwnProperty(prop); +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -70704,510 +75032,298 @@ function processRemove(oldIndex) { * under the License. */ -// ------------- -// Preprocessor -// ------------- - -registerPreprocessor(function (option) { - var graphicOption = option.graphic; - - // Convert - // {graphic: [{left: 10, type: 'circle'}, ...]} - // or - // {graphic: {left: 10, type: 'circle'}} - // to - // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} - if (isArray(graphicOption)) { - if (!graphicOption[0] || !graphicOption[0].elements) { - option.graphic = [{elements: graphicOption}]; - } - else { - // Only one graphic instance can be instantiated. (We dont - // want that too many views are created in echarts._viewMap) - option.graphic = [option.graphic[0]]; - } - } - else if (graphicOption && !graphicOption.elements) { - option.graphic = [{elements: [graphicOption]}]; - } -}); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -// ------ -// Model -// ------ +function getSeriesStackId$1(seriesModel) { + return seriesModel.get('stack') + || '__ec_stack_' + seriesModel.seriesIndex; +} -var GraphicModel = extendComponentModel({ +function getAxisKey$1(polar, axis) { + return axis.dim + polar.model.componentIndex; +} - type: 'graphic', +/** + * @param {string} seriesType + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + */ +function barLayoutPolar(seriesType, ecModel, api) { - defaultOption: { + var lastStackCoords = {}; - // Extra properties for each elements: - // - // left/right/top/bottom: (like 12, '22%', 'center', default undefined) - // If left/rigth is set, shape.x/shape.cx/position will not be used. - // If top/bottom is set, shape.y/shape.cy/position will not be used. - // This mechanism is useful when you want to position a group/element - // against the right side or the center of this container. - // - // width/height: (can only be pixel value, default 0) - // Only be used to specify contianer(group) size, if needed. And - // can not be percentage value (like '33%'). See the reason in the - // layout algorithm below. - // - // bounding: (enum: 'all' (default) | 'raw') - // Specify how to calculate boundingRect when locating. - // 'all': Get uioned and transformed boundingRect - // from both itself and its descendants. - // This mode simplies confining a group of elements in the bounding - // of their ancester container (e.g., using 'right: 0'). - // 'raw': Only use the boundingRect of itself and before transformed. - // This mode is similar to css behavior, which is useful when you - // want an element to be able to overflow its container. (Consider - // a rotated circle needs to be located in a corner.) + var barWidthAndOffset = calRadialBar( + filter( + ecModel.getSeriesByType(seriesType), + function (seriesModel) { + return !ecModel.isSeriesFiltered(seriesModel) + && seriesModel.coordinateSystem + && seriesModel.coordinateSystem.type === 'polar'; + } + ) + ); - // Note: elements is always behind its ancestors in this elements array. - elements: [], - parentId: null - }, + ecModel.eachSeriesByType(seriesType, function (seriesModel) { - /** - * Save el options for the sake of the performance (only update modified graphics). - * The order is the same as those in option. (ancesters -> descendants) - * - * @private - * @type {Array.} - */ - _elOptionsToUpdate: null, + // Check series coordinate, do layout for polar only + if (seriesModel.coordinateSystem.type !== 'polar') { + return; + } - /** - * @override - */ - mergeOption: function (option) { - // Prevent default merge to elements - var elements = this.option.elements; - this.option.elements = null; + var data = seriesModel.getData(); + var polar = seriesModel.coordinateSystem; + var baseAxis = polar.getBaseAxis(); + var axisKey = getAxisKey$1(polar, baseAxis); - GraphicModel.superApply(this, 'mergeOption', arguments); + var stackId = getSeriesStackId$1(seriesModel); + var columnLayoutInfo = barWidthAndOffset[axisKey][stackId]; + var columnOffset = columnLayoutInfo.offset; + var columnWidth = columnLayoutInfo.width; + var valueAxis = polar.getOtherAxis(baseAxis); - this.option.elements = elements; - }, + var cx = seriesModel.coordinateSystem.cx; + var cy = seriesModel.coordinateSystem.cy; - /** - * @override - */ - optionUpdated: function (newOption, isInit) { - var thisOption = this.option; - var newList = (isInit ? thisOption : newOption).elements; - var existList = thisOption.elements = isInit ? [] : thisOption.elements; + var barMinHeight = seriesModel.get('barMinHeight') || 0; + var barMinAngle = seriesModel.get('barMinAngle') || 0; - var flattenedList = []; - this._flatten(newList, flattenedList); + lastStackCoords[stackId] = lastStackCoords[stackId] || []; - var mappingResult = mappingToExists(existList, flattenedList); - makeIdAndName(mappingResult); + var valueDim = data.mapDimension(valueAxis.dim); + var baseDim = data.mapDimension(baseAxis.dim); + var stacked = isDimensionStacked(data, valueDim /*, baseDim*/); + var clampLayout = baseAxis.dim !== 'radius' + || !seriesModel.get('roundCap', true); - // Clear elOptionsToUpdate - var elOptionsToUpdate = this._elOptionsToUpdate = []; + var valueAxisStart = valueAxis.getExtent()[0]; - each$1(mappingResult, function (resultItem, index) { - var newElOption = resultItem.option; + for (var idx = 0, len = data.count(); idx < len; idx++) { + var value = data.get(valueDim, idx); + var baseValue = data.get(baseDim, idx); - if (__DEV__) { - assert$1( - isObject$1(newElOption) || resultItem.exist, - 'Empty graphic option definition' - ); - } + var sign = value >= 0 ? 'p' : 'n'; + var baseCoord = valueAxisStart; - if (!newElOption) { - return; + // Because of the barMinHeight, we can not use the value in + // stackResultDimension directly. + // Only ordinal axis can be stacked. + if (stacked) { + if (!lastStackCoords[stackId][baseValue]) { + lastStackCoords[stackId][baseValue] = { + p: valueAxisStart, // Positive stack + n: valueAxisStart // Negative stack + }; + } + // Should also consider #4243 + baseCoord = lastStackCoords[stackId][baseValue][sign]; } - elOptionsToUpdate.push(newElOption); - - setKeyInfoToNewElOption(resultItem, newElOption); + var r0; + var r; + var startAngle; + var endAngle; - mergeNewElOptionToExist(existList, index, newElOption); + // radial sector + if (valueAxis.dim === 'radius') { + var radiusSpan = valueAxis.dataToRadius(value) - valueAxisStart; + var angle = baseAxis.dataToAngle(baseValue); - setLayoutInfoToExist(existList[index], newElOption); + if (Math.abs(radiusSpan) < barMinHeight) { + radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; + } - }, this); + r0 = baseCoord; + r = baseCoord + radiusSpan; + startAngle = angle - columnOffset; + endAngle = startAngle - columnWidth; - // Clean - for (var i = existList.length - 1; i >= 0; i--) { - if (existList[i] == null) { - existList.splice(i, 1); + stacked && (lastStackCoords[stackId][baseValue][sign] = r); } + // tangential sector else { - // $action should be volatile, otherwise option gotten from - // `getOption` will contain unexpected $action. - delete existList[i].$action; - } - } - }, - - /** - * Convert - * [{ - * type: 'group', - * id: 'xx', - * children: [{type: 'circle'}, {type: 'polygon'}] - * }] - * to - * [ - * {type: 'group', id: 'xx'}, - * {type: 'circle', parentId: 'xx'}, - * {type: 'polygon', parentId: 'xx'} - * ] - * - * @private - * @param {Array.} optionList option list - * @param {Array.} result result of flatten - * @param {Object} parentOption parent option - */ - _flatten: function (optionList, result, parentOption) { - each$1(optionList, function (option) { - if (!option) { - return; - } + var angleSpan = valueAxis.dataToAngle(value, clampLayout) - valueAxisStart; + var radius = baseAxis.dataToRadius(baseValue); - if (parentOption) { - option.parentOption = parentOption; - } + if (Math.abs(angleSpan) < barMinAngle) { + angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; + } - result.push(option); + r0 = radius + columnOffset; + r = r0 + columnWidth; + startAngle = baseCoord; + endAngle = baseCoord + angleSpan; - var children = option.children; - if (option.type === 'group' && children) { - this._flatten(children, result, option); + // if the previous stack is at the end of the ring, + // add a round to differentiate it from origin + // var extent = angleAxis.getExtent(); + // var stackCoord = angle; + // if (stackCoord === extent[0] && value > 0) { + // stackCoord = extent[1]; + // } + // else if (stackCoord === extent[1] && value < 0) { + // stackCoord = extent[0]; + // } + stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); } - // Deleting for JSON output, and for not affecting group creation. - delete option.children; - }, this); - }, - // FIXME - // Pass to view using payload? setOption has a payload? - useElOptionsToUpdate: function () { - var els = this._elOptionsToUpdate; - // Clear to avoid render duplicately when zooming. - this._elOptionsToUpdate = null; - return els; - } -}); + data.setItemLayout(idx, { + cx: cx, + cy: cy, + r0: r0, + r: r, + // Consider that positive angle is anti-clockwise, + // while positive radian of sector is clockwise + startAngle: -startAngle * Math.PI / 180, + endAngle: -endAngle * Math.PI / 180 + }); -// ----- -// View -// ----- + } -extendComponentView({ + }, this); - type: 'graphic', +} - /** - * @override - */ - init: function (ecModel, api) { +/** + * Calculate bar width and offset for radial bar charts + */ +function calRadialBar(barSeries, api) { + // Columns info on each category axis. Key is polar name + var columnsMap = {}; - /** - * @private - * @type {module:zrender/core/util.HashMap} - */ - this._elMap = createHashMap(); + each$1(barSeries, function (seriesModel, idx) { + var data = seriesModel.getData(); + var polar = seriesModel.coordinateSystem; - /** - * @private - * @type {module:echarts/graphic/GraphicModel} - */ - this._lastGraphicModel; - }, + var baseAxis = polar.getBaseAxis(); + var axisKey = getAxisKey$1(polar, baseAxis); - /** - * @override - */ - render: function (graphicModel, ecModel, api) { + var axisExtent = baseAxis.getExtent(); + var bandWidth = baseAxis.type === 'category' + ? baseAxis.getBandWidth() + : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); - // Having leveraged between use cases and algorithm complexity, a very - // simple layout mechanism is used: - // The size(width/height) can be determined by itself or its parent (not - // implemented yet), but can not by its children. (Top-down travel) - // The location(x/y) can be determined by the bounding rect of itself - // (can including its descendants or not) and the size of its parent. - // (Bottom-up travel) + var columnsOnAxis = columnsMap[axisKey] || { + bandWidth: bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: '20%', + gap: '30%', + stacks: {} + }; + var stacks = columnsOnAxis.stacks; + columnsMap[axisKey] = columnsOnAxis; - // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, - // view will be reused. - if (graphicModel !== this._lastGraphicModel) { - this._clear(); - } - this._lastGraphicModel = graphicModel; + var stackId = getSeriesStackId$1(seriesModel); - this._updateElements(graphicModel, api); - this._relocate(graphicModel, api); - }, + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; - /** - * Update graphic elements. - * - * @private - * @param {Object} graphicModel graphic model - * @param {module:echarts/ExtensionAPI} api extension API - */ - _updateElements: function (graphicModel, api) { - var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); + var barWidth = parsePercent$1( + seriesModel.get('barWidth'), + bandWidth + ); + var barMaxWidth = parsePercent$1( + seriesModel.get('barMaxWidth'), + bandWidth + ); + var barGap = seriesModel.get('barGap'); + var barCategoryGap = seriesModel.get('barCategoryGap'); - if (!elOptionsToUpdate) { - return; + if (barWidth && !stacks[stackId].width) { + barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); + stacks[stackId].width = barWidth; + columnsOnAxis.remainedWidth -= barWidth; } - var elMap = this._elMap; - var rootGroup = this.group; - - // Top-down tranverse to assign graphic settings to each elements. - each$1(elOptionsToUpdate, function (elOption) { - var $action = elOption.$action; - var id = elOption.id; - var existEl = elMap.get(id); - var parentId = elOption.parentId; - var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; + barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); + (barGap != null) && (columnsOnAxis.gap = barGap); + (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap); + }); - if (elOption.type === 'text') { - var elOptionStyle = elOption.style; - // In top/bottom mode, textVerticalAlign should not be used, which cause - // inaccurately locating. - if (elOption.hv && elOption.hv[1]) { - elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = null; - } + var result = {}; - // Compatible with previous setting: both support fill and textFill, - // stroke and textStroke. - !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && ( - elOptionStyle.textFill = elOptionStyle.fill - ); - !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && ( - elOptionStyle.textStroke = elOptionStyle.stroke - ); - } + each$1(columnsMap, function (columnsOnAxis, coordSysName) { - // Remove unnecessary props to avoid potential problems. - var elOptionCleaned = getCleanedElOption(elOption); + result[coordSysName] = {}; - // For simple, do not support parent change, otherwise reorder is needed. - if (__DEV__) { - existEl && assert$1( - targetElParent === existEl.parent, - 'Changing parent is not supported.' - ); - } + var stacks = columnsOnAxis.stacks; + var bandWidth = columnsOnAxis.bandWidth; + var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); + var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); - if (!$action || $action === 'merge') { - existEl - ? existEl.attr(elOptionCleaned) - : createEl$1(id, targetElParent, elOptionCleaned, elMap); - } - else if ($action === 'replace') { - removeEl(existEl, elMap); - createEl$1(id, targetElParent, elOptionCleaned, elMap); - } - else if ($action === 'remove') { - removeEl(existEl, elMap); - } + var remainedWidth = columnsOnAxis.remainedWidth; + var autoWidthCount = columnsOnAxis.autoWidthCount; + var autoWidth = (remainedWidth - categoryGap) + / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); - var el = elMap.get(id); - if (el) { - el.__ecGraphicWidth = elOption.width; - el.__ecGraphicHeight = elOption.height; + // Find if any auto calculated bar exceeded maxBarWidth + each$1(stacks, function (column, stack) { + var maxWidth = column.maxWidth; + if (maxWidth && maxWidth < autoWidth) { + maxWidth = Math.min(maxWidth, remainedWidth); + if (column.width) { + maxWidth = Math.min(maxWidth, column.width); + } + remainedWidth -= maxWidth; + column.width = maxWidth; + autoWidthCount--; } }); - }, - - /** - * Locate graphic elements. - * - * @private - * @param {Object} graphicModel graphic model - * @param {module:echarts/ExtensionAPI} api extension API - */ - _relocate: function (graphicModel, api) { - var elOptions = graphicModel.option.elements; - var rootGroup = this.group; - var elMap = this._elMap; - // Bottom-up tranvese all elements (consider ec resize) to locate elements. - for (var i = elOptions.length - 1; i >= 0; i--) { - var elOption = elOptions[i]; - var el = elMap.get(elOption.id); + // Recalculate width again + autoWidth = (remainedWidth - categoryGap) + / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); - if (!el) { - continue; + var widthSum = 0; + var lastColumn; + each$1(stacks, function (column, idx) { + if (!column.width) { + column.width = autoWidth; } - - var parentEl = el.parent; - var containerInfo = parentEl === rootGroup - ? { - width: api.getWidth(), - height: api.getHeight() - } - : { // Like 'position:absolut' in css, default 0. - width: parentEl.__ecGraphicWidth || 0, - height: parentEl.__ecGraphicHeight || 0 - }; - - positionElement( - el, elOption, containerInfo, null, - {hv: elOption.hv, boundingMode: elOption.bounding} - ); - } - }, - - /** - * Clear all elements. - * - * @private - */ - _clear: function () { - var elMap = this._elMap; - elMap.each(function (el) { - removeEl(el, elMap); + lastColumn = column; + widthSum += column.width * (1 + barGapPercent); }); - this._elMap = createHashMap(); - }, - - /** - * @override - */ - dispose: function () { - this._clear(); - } -}); - -function createEl$1(id, targetElParent, elOption, elMap) { - var graphicType = elOption.type; - - if (__DEV__) { - assert$1(graphicType, 'graphic type MUST be set'); - } - - var Clz = graphic[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)]; - - if (__DEV__) { - assert$1(Clz, 'graphic type can not be found'); - } + if (lastColumn) { + widthSum -= lastColumn.width * barGapPercent; + } - var el = new Clz(elOption); - targetElParent.add(el); - elMap.set(id, el); - el.__ecGraphicId = id; -} + var offset = -widthSum / 2; + each$1(stacks, function (column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + offset: offset, + width: column.width + }; -function removeEl(existEl, elMap) { - var existElParent = existEl && existEl.parent; - if (existElParent) { - existEl.type === 'group' && existEl.traverse(function (el) { - removeEl(el, elMap); + offset += column.width * (1 + barGapPercent); }); - elMap.removeKey(existEl.__ecGraphicId); - existElParent.remove(existEl); - } -} - -// Remove unnecessary props to avoid potential problems. -function getCleanedElOption(elOption) { - elOption = extend({}, elOption); - each$1( - ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS), - function (name) { - delete elOption[name]; - } - ); - return elOption; -} - -function isSetLoc(obj, props) { - var isSet; - each$1(props, function (prop) { - obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); }); - return isSet; -} - -function setKeyInfoToNewElOption(resultItem, newElOption) { - var existElOption = resultItem.exist; - - // Set id and type after id assigned. - newElOption.id = resultItem.keyInfo.id; - !newElOption.type && existElOption && (newElOption.type = existElOption.type); - - // Set parent id if not specified - if (newElOption.parentId == null) { - var newElParentOption = newElOption.parentOption; - if (newElParentOption) { - newElOption.parentId = newElParentOption.id; - } - else if (existElOption) { - newElOption.parentId = existElOption.parentId; - } - } - - // Clear - newElOption.parentOption = null; -} - -function mergeNewElOptionToExist(existList, index, newElOption) { - // Update existing options, for `getOption` feature. - var newElOptCopy = extend({}, newElOption); - var existElOption = existList[index]; - - var $action = newElOption.$action || 'merge'; - if ($action === 'merge') { - if (existElOption) { - - if (__DEV__) { - var newType = newElOption.type; - assert$1( - !newType || existElOption.type === newType, - 'Please set $action: "replace" to change `type`' - ); - } - - // We can ensure that newElOptCopy and existElOption are not - // the same object, so `merge` will not change newElOptCopy. - merge(existElOption, newElOptCopy, true); - // Rigid body, use ignoreSize. - mergeLayoutParam(existElOption, newElOptCopy, {ignoreSize: true}); - // Will be used in render. - copyLayoutParams(newElOption, existElOption); - } - else { - existList[index] = newElOptCopy; - } - } - else if ($action === 'replace') { - existList[index] = newElOptCopy; - } - else if ($action === 'remove') { - // null will be cleaned later. - existElOption && (existList[index] = null); - } -} -function setLayoutInfoToExist(existItem, newElOption) { - if (!existItem) { - return; - } - existItem.hv = newElOption.hv = [ - // Rigid body, dont care `width`. - isSetLoc(newElOption, ['left', 'right']), - // Rigid body, dont care `height`. - isSetLoc(newElOption, ['top', 'bottom']) - ]; - // Give default group size. Otherwise layout error may occur. - if (existItem.type === 'group') { - existItem.width == null && (existItem.width = newElOption.width = 0); - existItem.height == null && (existItem.height = newElOption.height = 0); - } + return result; } /* @@ -71229,6 +75345,39 @@ function setLayoutInfoToExist(existItem, newElOption) { * under the License. */ +function RadiusAxis(scale, radiusExtent) { + + Axis.call(this, 'radius', scale, radiusExtent); + + /** + * Axis type + * - 'category' + * - 'value' + * - 'time' + * - 'log' + * @type {string} + */ + this.type = 'category'; +} + +RadiusAxis.prototype = { + + constructor: RadiusAxis, + + /** + * @override + */ + pointToData: function (point, clamp) { + return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; + }, + + dataToRadius: Axis.prototype.dataToCoord, + + radiusToData: Axis.prototype.coordToData +}; + +inherits(RadiusAxis, Axis); + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -71248,229 +75397,402 @@ function setLayoutInfoToExist(existItem, newElOption) { * under the License. */ -var LegendModel = extendComponentModel({ - - type: 'legend.plain', - - dependencies: ['series'], +var inner$12 = makeInner(); - layoutMode: { - type: 'box', - // legend.width/height are maxWidth/maxHeight actually, - // whereas realy width/height is calculated by its content. - // (Setting {left: 10, right: 10} does not make sense). - // So consider the case: - // `setOption({legend: {left: 10});` - // then `setOption({legend: {right: 10});` - // The previous `left` should be cleared by setting `ignoreSize`. - ignoreSize: true - }, +function AngleAxis(scale, angleExtent) { - init: function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); + angleExtent = angleExtent || [0, 360]; - option.selected = option.selected || {}; - }, + Axis.call(this, 'angle', scale, angleExtent); - mergeOption: function (option) { - LegendModel.superCall(this, 'mergeOption', option); - }, + /** + * Axis type + * - 'category' + * - 'value' + * - 'time' + * - 'log' + * @type {string} + */ + this.type = 'category'; +} - optionUpdated: function () { - this._updateData(this.ecModel); +AngleAxis.prototype = { - var legendData = this._data; + constructor: AngleAxis, - // If selectedMode is single, try to select one - if (legendData[0] && this.get('selectedMode') === 'single') { - var hasSelected = false; - // If has any selected in option.selected - for (var i = 0; i < legendData.length; i++) { - var name = legendData[i].get('name'); - if (this.isSelected(name)) { - // Force to unselect others - this.select(name); - hasSelected = true; - break; - } - } - // Try select the first if selectedMode is single - !hasSelected && this.select(legendData[0].get('name')); - } + /** + * @override + */ + pointToData: function (point, clamp) { + return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; }, - _updateData: function (ecModel) { - var potentialData = []; - var availableNames = []; + dataToAngle: Axis.prototype.dataToCoord, - ecModel.eachRawSeries(function (seriesModel) { - var seriesName = seriesModel.name; - availableNames.push(seriesName); - var isPotential; + angleToData: Axis.prototype.coordToData, - if (seriesModel.legendDataProvider) { - var data = seriesModel.legendDataProvider(); - var names = data.mapArray(data.getName); + /** + * Only be called in category axis. + * Angle axis uses text height to decide interval + * + * @override + * @return {number} Auto interval for cateogry axis tick and label + */ + calculateCategoryInterval: function () { + var axis = this; + var labelModel = axis.getLabelModel(); - if (!ecModel.isSeriesFiltered(seriesModel)) { - availableNames = availableNames.concat(names); - } + var ordinalScale = axis.scale; + var ordinalExtent = ordinalScale.getExtent(); + // Providing this method is for optimization: + // avoid generating a long array by `getTicks` + // in large category data case. + var tickCount = ordinalScale.count(); - if (names.length) { - potentialData = potentialData.concat(names); - } - else { - isPotential = true; - } - } - else { - isPotential = true; - } + if (ordinalExtent[1] - ordinalExtent[0] < 1) { + return 0; + } - if (isPotential && isNameSpecified(seriesModel)) { - potentialData.push(seriesModel.name); - } - }); + var tickValue = ordinalExtent[0]; + var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); + var unitH = Math.abs(unitSpan); - /** - * @type {Array.} - * @private - */ - this._availableNames = availableNames; + // Not precise, just use height as text width + // and each distance from axis line yet. + var rect = getBoundingRect( + tickValue, labelModel.getFont(), 'center', 'top' + ); + var maxH = Math.max(rect.height, 7); + + var dh = maxH / unitH; + // 0/0 is NaN, 1/0 is Infinity. + isNaN(dh) && (dh = Infinity); + var interval = Math.max(0, Math.floor(dh)); + + var cache = inner$12(axis.model); + var lastAutoInterval = cache.lastAutoInterval; + var lastTickCount = cache.lastTickCount; + + // Use cache to keep interval stable while moving zoom window, + // otherwise the calculated interval might jitter when the zoom + // window size is close to the interval-changing size. + if (lastAutoInterval != null + && lastTickCount != null + && Math.abs(lastAutoInterval - interval) <= 1 + && Math.abs(lastTickCount - tickCount) <= 1 + // Always choose the bigger one, otherwise the critical + // point is not the same when zooming in or zooming out. + && lastAutoInterval > interval + ) { + interval = lastAutoInterval; + } + // Only update cache if cache not used, otherwise the + // changing of interval is too insensitive. + else { + cache.lastTickCount = tickCount; + cache.lastAutoInterval = interval; + } - // If legend.data not specified in option, use availableNames as data, - // which is convinient for user preparing option. - var rawData = this.get('data') || potentialData; + return interval; + } +}; - var legendData = map(rawData, function (dataItem) { - // Can be string or number - if (typeof dataItem === 'string' || typeof dataItem === 'number') { - dataItem = { - name: dataItem - }; - } - return new Model(dataItem, this, this.ecModel); - }, this); +inherits(AngleAxis, Axis); - /** - * @type {Array.} - * @private - */ - this._data = legendData; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/** + * @module echarts/coord/polar/Polar + */ + +/** + * @alias {module:echarts/coord/polar/Polar} + * @constructor + * @param {string} name + */ +var Polar = function (name) { + + /** + * @type {string} + */ + this.name = name || ''; + + /** + * x of polar center + * @type {number} + */ + this.cx = 0; + + /** + * y of polar center + * @type {number} + */ + this.cy = 0; + + /** + * @type {module:echarts/coord/polar/RadiusAxis} + * @private + */ + this._radiusAxis = new RadiusAxis(); + + /** + * @type {module:echarts/coord/polar/AngleAxis} + * @private + */ + this._angleAxis = new AngleAxis(); + + this._radiusAxis.polar = this._angleAxis.polar = this; +}; + +Polar.prototype = { + + type: 'polar', + + axisPointerEnabled: true, + + constructor: Polar, + + /** + * @param {Array.} + * @readOnly + */ + dimensions: ['radius', 'angle'], + + /** + * @type {module:echarts/coord/PolarModel} + */ + model: null, + + /** + * If contain coord + * @param {Array.} point + * @return {boolean} + */ + containPoint: function (point) { + var coord = this.pointToCoord(point); + return this._radiusAxis.contain(coord[0]) + && this._angleAxis.contain(coord[1]); }, /** - * @return {Array.} + * If contain data + * @param {Array.} data + * @return {boolean} */ - getData: function () { - return this._data; + containData: function (data) { + return this._radiusAxis.containData(data[0]) + && this._angleAxis.containData(data[1]); }, /** - * @param {string} name + * @param {string} dim + * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} */ - select: function (name) { - var selected = this.option.selected; - var selectedMode = this.get('selectedMode'); - if (selectedMode === 'single') { - var data = this._data; - each$1(data, function (dataItem) { - selected[dataItem.get('name')] = false; - }); - } - selected[name] = true; + getAxis: function (dim) { + return this['_' + dim + 'Axis']; }, /** - * @param {string} name + * @return {Array.} */ - unSelect: function (name) { - if (this.get('selectedMode') !== 'single') { - this.option.selected[name] = false; - } + getAxes: function () { + return [this._radiusAxis, this._angleAxis]; }, /** - * @param {string} name + * Get axes by type of scale + * @param {string} scaleType + * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} */ - toggleSelected: function (name) { - var selected = this.option.selected; - // Default is true - if (!selected.hasOwnProperty(name)) { - selected[name] = true; - } - this[selected[name] ? 'unSelect' : 'select'](name); + getAxesByScale: function (scaleType) { + var axes = []; + var angleAxis = this._angleAxis; + var radiusAxis = this._radiusAxis; + angleAxis.scale.type === scaleType && axes.push(angleAxis); + radiusAxis.scale.type === scaleType && axes.push(radiusAxis); + + return axes; }, /** - * @param {string} name + * @return {module:echarts/coord/polar/AngleAxis} */ - isSelected: function (name) { - var selected = this.option.selected; - return !(selected.hasOwnProperty(name) && !selected[name]) - && indexOf(this._availableNames, name) >= 0; + getAngleAxis: function () { + return this._angleAxis; }, - defaultOption: { - // 一级层叠 - zlevel: 0, - // 二级层叠 - z: 4, - show: true, + /** + * @return {module:echarts/coord/polar/RadiusAxis} + */ + getRadiusAxis: function () { + return this._radiusAxis; + }, - // 布局方式,默认为水平布局,可选为: - // 'horizontal' | 'vertical' - orient: 'horizontal', + /** + * @param {module:echarts/coord/polar/Axis} + * @return {module:echarts/coord/polar/Axis} + */ + getOtherAxis: function (axis) { + var angleAxis = this._angleAxis; + return axis === angleAxis ? this._radiusAxis : angleAxis; + }, - left: 'center', - // right: 'center', + /** + * Base axis will be used on stacking. + * + * @return {module:echarts/coord/polar/Axis} + */ + getBaseAxis: function () { + return this.getAxesByScale('ordinal')[0] + || this.getAxesByScale('time')[0] + || this.getAngleAxis(); + }, - top: 0, - // bottom: null, + /** + * @param {string} [dim] 'radius' or 'angle' or 'auto' or null/undefined + * @return {Object} {baseAxes: [], otherAxes: []} + */ + getTooltipAxes: function (dim) { + var baseAxis = (dim != null && dim !== 'auto') + ? this.getAxis(dim) : this.getBaseAxis(); + return { + baseAxes: [baseAxis], + otherAxes: [this.getOtherAxis(baseAxis)] + }; + }, - // 水平对齐 - // 'auto' | 'left' | 'right' - // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐 - align: 'auto', + /** + * Convert a single data item to (x, y) point. + * Parameter data is an array which the first element is radius and the second is angle + * @param {Array.} data + * @param {boolean} [clamp=false] + * @return {Array.} + */ + dataToPoint: function (data, clamp) { + return this.coordToPoint([ + this._radiusAxis.dataToRadius(data[0], clamp), + this._angleAxis.dataToAngle(data[1], clamp) + ]); + }, - backgroundColor: 'rgba(0,0,0,0)', - // 图例边框颜色 - borderColor: '#ccc', - borderRadius: 0, - // 图例边框线宽,单位px,默认为0(无边框) - borderWidth: 0, - // 图例内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - padding: 5, - // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemGap: 10, - // 图例图形宽度 - itemWidth: 25, - // 图例图形高度 - itemHeight: 14, + /** + * Convert a (x, y) point to data + * @param {Array.} point + * @param {boolean} [clamp=false] + * @return {Array.} + */ + pointToData: function (point, clamp) { + var coord = this.pointToCoord(point); + return [ + this._radiusAxis.radiusToData(coord[0], clamp), + this._angleAxis.angleToData(coord[1], clamp) + ]; + }, - // 图例关闭时候的颜色 - inactiveColor: '#ccc', + /** + * Convert a (x, y) point to (radius, angle) coord + * @param {Array.} point + * @return {Array.} + */ + pointToCoord: function (point) { + var dx = point[0] - this.cx; + var dy = point[1] - this.cy; + var angleAxis = this.getAngleAxis(); + var extent = angleAxis.getExtent(); + var minAngle = Math.min(extent[0], extent[1]); + var maxAngle = Math.max(extent[0], extent[1]); + // Fix fixed extent in polarCreator + // FIXME + angleAxis.inverse + ? (minAngle = maxAngle - 360) + : (maxAngle = minAngle + 360); - textStyle: { - // 图例文字颜色 - color: '#333' - }, - // formatter: '', - // 选择模式,默认开启图例开关 - selectedMode: true, - // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 - // selected: null, - // 图例内容(详见legend.data,数组中每一项代表一个item - // data: [], + var radius = Math.sqrt(dx * dx + dy * dy); + dx /= radius; + dy /= radius; - // Tooltip 相关配置 - tooltip: { - show: false + var radian = Math.atan2(-dy, dx) / Math.PI * 180; + + // move to angleExtent + var dir = radian < minAngle ? 1 : -1; + while (radian < minAngle || radian > maxAngle) { + radian += dir * 360; } + + return [radius, radian]; + }, + + /** + * Convert a (radius, angle) coord to (x, y) point + * @param {Array.} coord + * @return {Array.} + */ + coordToPoint: function (coord) { + var radius = coord[0]; + var radian = coord[1] / 180 * Math.PI; + var x = Math.cos(radian) * radius + this.cx; + // Inverse the y + var y = -Math.sin(radian) * radius + this.cy; + + return [x, y]; + }, + + /** + * Get ring area of cartesian. + * Area will have a contain function to determine if a point is in the coordinate system. + * @return {Ring} + */ + getArea: function () { + + var angleAxis = this.getAngleAxis(); + var radiusAxis = this.getRadiusAxis(); + + var radiusExtent = radiusAxis.getExtent().slice(); + radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); + var angleExtent = angleAxis.getExtent(); + + var RADIAN = Math.PI / 180; + + return { + cx: this.cx, + cy: this.cy, + r0: radiusExtent[0], + r: radiusExtent[1], + startAngle: -angleExtent[0] * RADIAN, + endAngle: -angleExtent[1] * RADIAN, + clockwise: angleAxis.inverse, + contain: function (x, y) { + // It's a ring shape. + // Start angle and end angle don't matter + var dx = x - this.cx; + var dy = y - this.cy; + var d2 = dx * dx + dy * dy; + var r = this.r; + var r0 = this.r0; + + return d2 <= r * r && d2 >= r0 * r0; + } + }; } -}); + +}; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -71491,159 +75813,61 @@ var LegendModel = extendComponentModel({ * under the License. */ -function legendSelectActionHandler(methodName, payload, ecModel) { - var selectedMap = {}; - var isToggleSelect = methodName === 'toggleSelected'; - var isSelected; - // Update all legend components - ecModel.eachComponent('legend', function (legendModel) { - if (isToggleSelect && isSelected != null) { - // Force other legend has same selected status - // Or the first is toggled to true and other are toggled to false - // In the case one legend has some item unSelected in option. And if other legend - // doesn't has the item, they will assume it is selected. - legendModel[isSelected ? 'select' : 'unSelect'](payload.name); - } - else { - legendModel[methodName](payload.name); - isSelected = legendModel.isSelected(payload.name); - } - var legendData = legendModel.getData(); - each$1(legendData, function (model) { - var name = model.get('name'); - // Wrap element - if (name === '\n' || name === '') { - return; - } - var isItemSelected = legendModel.isSelected(name); - if (selectedMap.hasOwnProperty(name)) { - // Unselected if any legend is unselected - selectedMap[name] = selectedMap[name] && isItemSelected; - } - else { - selectedMap[name] = isItemSelected; - } - }); - }); - // Return the event explicitly - return { - name: payload.name, - selected: selectedMap - }; -} -/** - * @event legendToggleSelect - * @type {Object} - * @property {string} type 'legendToggleSelect' - * @property {string} [from] - * @property {string} name Series name or data item name - */ -registerAction( - 'legendToggleSelect', 'legendselectchanged', - curry(legendSelectActionHandler, 'toggleSelected') -); +var PolarAxisModel = ComponentModel.extend({ -/** - * @event legendSelect - * @type {Object} - * @property {string} type 'legendSelect' - * @property {string} name Series name or data item name - */ -registerAction( - 'legendSelect', 'legendselected', - curry(legendSelectActionHandler, 'select') -); + type: 'polarAxis', -/** - * @event legendUnSelect - * @type {Object} - * @property {string} type 'legendUnSelect' - * @property {string} name Series name or data item name - */ -registerAction( - 'legendUnSelect', 'legendunselected', - curry(legendSelectActionHandler, 'unSelect') -); + /** + * @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} + */ + axis: null, -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + /** + * @override + */ + getCoordSysModel: function () { + return this.ecModel.queryComponents({ + mainType: 'polar', + index: this.option.polarIndex, + id: this.option.polarId + })[0]; + } -/** - * Layout list like component. - * It will box layout each items in group of component and then position the whole group in the viewport - * @param {module:zrender/group/Group} group - * @param {module:echarts/model/Component} componentModel - * @param {module:echarts/ExtensionAPI} - */ -function layout$3(group, componentModel, api) { - var boxLayoutParams = componentModel.getBoxLayoutParams(); - var padding = componentModel.get('padding'); - var viewportSize = {width: api.getWidth(), height: api.getHeight()}; +}); - var rect = getLayoutRect( - boxLayoutParams, - viewportSize, - padding - ); +merge(PolarAxisModel.prototype, axisModelCommonMixin); - box( - componentModel.get('orient'), - group, - componentModel.get('itemGap'), - rect.width, - rect.height - ); +var polarAxisDefaultExtendedOption = { + angle: { + // polarIndex: 0, + // polarId: '', - positionElement( - group, - boxLayoutParams, - viewportSize, - padding - ); -} + startAngle: 90, -function makeBackground(rect, componentModel) { - var padding = normalizeCssArray$1( - componentModel.get('padding') - ); - var style = componentModel.getItemStyle(['color', 'opacity']); - style.fill = componentModel.get('backgroundColor'); - var rect = new Rect({ - shape: { - x: rect.x - padding[3], - y: rect.y - padding[0], - width: rect.width + padding[1] + padding[3], - height: rect.height + padding[0] + padding[2], - r: componentModel.get('borderRadius') - }, - style: style, - silent: true, - z2: -1 - }); - // FIXME - // `subPixelOptimizeRect` may bring some gap between edge of viewpart - // and background rect when setting like `left: 0`, `top: 0`. - // graphic.subPixelOptimizeRect(rect); + clockwise: true, - return rect; + splitNumber: 12, + + axisLabel: { + rotate: false + } + }, + radius: { + // polarIndex: 0, + // polarId: '', + + splitNumber: 5 + } +}; + +function getAxisType$3(axisDim, option) { + // Default axis with data is category axis + return option.type || (option.data ? 'category' : 'value'); } +axisModelCreator('angle', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.angle); +axisModelCreator('radius', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.radius); + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -71663,367 +75887,219 @@ function makeBackground(rect, componentModel) { * under the License. */ -var curry$4 = curry; -var each$16 = each$1; -var Group$3 = Group; - -var LegendView = extendComponentView({ - - type: 'legend.plain', - - newlineDisabled: false, - - /** - * @override - */ - init: function () { +extendComponentModel({ - /** - * @private - * @type {module:zrender/container/Group} - */ - this.group.add(this._contentGroup = new Group$3()); + type: 'polar', - /** - * @private - * @type {module:zrender/Element} - */ - this._backgroundEl; - }, + dependencies: ['polarAxis', 'angleAxis'], /** - * @protected + * @type {module:echarts/coord/polar/Polar} */ - getContentGroup: function () { - return this._contentGroup; - }, + coordinateSystem: null, /** - * @override + * @param {string} axisType + * @return {module:echarts/coord/polar/AxisModel} */ - render: function (legendModel, ecModel, api) { - - this.resetInner(); - - if (!legendModel.get('show', true)) { - return; - } - - var itemAlign = legendModel.get('align'); - if (!itemAlign || itemAlign === 'auto') { - itemAlign = ( - legendModel.get('left') === 'right' - && legendModel.get('orient') === 'vertical' - ) ? 'right' : 'left'; - } - - this.renderInner(itemAlign, legendModel, ecModel, api); - - // Perform layout. - var positionInfo = legendModel.getBoxLayoutParams(); - var viewportSize = {width: api.getWidth(), height: api.getHeight()}; - var padding = legendModel.get('padding'); - - var maxSize = getLayoutRect(positionInfo, viewportSize, padding); - var mainRect = this.layoutInner(legendModel, itemAlign, maxSize); - - // Place mainGroup, based on the calculated `mainRect`. - var layoutRect = getLayoutRect( - defaults({width: mainRect.width, height: mainRect.height}, positionInfo), - viewportSize, - padding - ); - this.group.attr('position', [layoutRect.x - mainRect.x, layoutRect.y - mainRect.y]); - - // Render background after group is layout. - this.group.add( - this._backgroundEl = makeBackground(mainRect, legendModel) - ); - }, + findAxisModel: function (axisType) { + var foundAxisModel; + var ecModel = this.ecModel; - /** - * @protected - */ - resetInner: function () { - this.getContentGroup().removeAll(); - this._backgroundEl && this.group.remove(this._backgroundEl); + ecModel.eachComponent(axisType, function (axisModel) { + if (axisModel.getCoordSysModel() === this) { + foundAxisModel = axisModel; + } + }, this); + return foundAxisModel; }, - /** - * @protected - */ - renderInner: function (itemAlign, legendModel, ecModel, api) { - var contentGroup = this.getContentGroup(); - var legendDrawnMap = createHashMap(); - var selectMode = legendModel.get('selectedMode'); - - var excludeSeriesId = []; - ecModel.eachRawSeries(function (seriesModel) { - !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); - }); - - each$16(legendModel.getData(), function (itemModel, dataIndex) { - var name = itemModel.get('name'); + defaultOption: { - // Use empty string or \n as a newline string - if (!this.newlineDisabled && (name === '' || name === '\n')) { - contentGroup.add(new Group$3({ - newline: true - })); - return; - } + zlevel: 0, - // Representitive series. - var seriesModel = ecModel.getSeriesByName(name)[0]; + z: 0, - if (legendDrawnMap.get(name)) { - // Have been drawed - return; - } + center: ['50%', '50%'], - // Series legend - if (seriesModel) { - var data = seriesModel.getData(); - var color = data.getVisual('color'); + radius: '80%' + } +}); - // If color is a callback function - if (typeof color === 'function') { - // Use the first data - color = color(seriesModel.getDataParams(0)); - } +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // Using rect symbol defaultly - var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect'; - var symbolType = data.getVisual('symbol'); +// TODO Axis scale - var itemGroup = this._createItem( - name, dataIndex, itemModel, legendModel, - legendSymbolType, symbolType, - itemAlign, color, - selectMode - ); +/** + * Resize method bound to the polar + * @param {module:echarts/coord/polar/PolarModel} polarModel + * @param {module:echarts/ExtensionAPI} api + */ +function resizePolar(polar, polarModel, api) { + var center = polarModel.get('center'); + var width = api.getWidth(); + var height = api.getHeight(); - itemGroup.on('click', curry$4(dispatchSelectAction, name, api)) - .on('mouseover', curry$4(dispatchHighlightAction, seriesModel, null, api, excludeSeriesId)) - .on('mouseout', curry$4(dispatchDownplayAction, seriesModel, null, api, excludeSeriesId)); + polar.cx = parsePercent$1(center[0], width); + polar.cy = parsePercent$1(center[1], height); - legendDrawnMap.set(name, true); - } - else { - // Data legend of pie, funnel - ecModel.eachRawSeries(function (seriesModel) { - // In case multiple series has same data name - if (legendDrawnMap.get(name)) { - return; - } + var radiusAxis = polar.getRadiusAxis(); + var size = Math.min(width, height) / 2; - if (seriesModel.legendDataProvider) { - var data = seriesModel.legendDataProvider(); - var idx = data.indexOfName(name); - if (idx < 0) { - return; - } + var radius = polarModel.get('radius'); + if (radius == null) { + radius = [0, '100%']; + } + else if (!isArray(radius)) { + // r0 = 0 + radius = [0, radius]; + } + radius = [ + parsePercent$1(radius[0], size), + parsePercent$1(radius[1], size) + ]; - var color = data.getItemVisual(idx, 'color'); + radiusAxis.inverse + ? radiusAxis.setExtent(radius[1], radius[0]) + : radiusAxis.setExtent(radius[0], radius[1]); +} - var legendSymbolType = 'roundRect'; +/** + * Update polar + */ +function updatePolarScale(ecModel, api) { + var polar = this; + var angleAxis = polar.getAngleAxis(); + var radiusAxis = polar.getRadiusAxis(); + // Reset scale + angleAxis.scale.setExtent(Infinity, -Infinity); + radiusAxis.scale.setExtent(Infinity, -Infinity); - var itemGroup = this._createItem( - name, dataIndex, itemModel, legendModel, - legendSymbolType, null, - itemAlign, color, - selectMode - ); + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.coordinateSystem === polar) { + var data = seriesModel.getData(); + each$1(data.mapDimension('radius', true), function (dim) { + radiusAxis.scale.unionExtentFromData( + data, getStackedDimension(data, dim) + ); + }); + each$1(data.mapDimension('angle', true), function (dim) { + angleAxis.scale.unionExtentFromData( + data, getStackedDimension(data, dim) + ); + }); + } + }); - // FIXME: consider different series has items with the same name. - itemGroup.on('click', curry$4(dispatchSelectAction, name, api)) - // FIXME Should not specify the series name - .on('mouseover', curry$4(dispatchHighlightAction, seriesModel, name, api, excludeSeriesId)) - .on('mouseout', curry$4(dispatchDownplayAction, seriesModel, name, api, excludeSeriesId)); + niceScaleExtent(angleAxis.scale, angleAxis.model); + niceScaleExtent(radiusAxis.scale, radiusAxis.model); - legendDrawnMap.set(name, true); - } + // Fix extent of category angle axis + if (angleAxis.type === 'category' && !angleAxis.onBand) { + var extent = angleAxis.getExtent(); + var diff = 360 / angleAxis.scale.count(); + angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff); + angleAxis.setExtent(extent[0], extent[1]); + } +} - }, this); - } +/** + * Set common axis properties + * @param {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} + * @param {module:echarts/coord/polar/AxisModel} + * @inner + */ +function setAxis(axis, axisModel) { + axis.type = axisModel.get('type'); + axis.scale = createScaleByModel(axisModel); + axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; + axis.inverse = axisModel.get('inverse'); - if (__DEV__) { - if (!legendDrawnMap.get(name)) { - console.warn(name + ' series not exists. Legend data should be same with series name or data name.'); - } - } - }, this); - }, + if (axisModel.mainType === 'angleAxis') { + axis.inverse ^= axisModel.get('clockwise'); + var startAngle = axisModel.get('startAngle'); + axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360)); + } - _createItem: function ( - name, dataIndex, itemModel, legendModel, - legendSymbolType, symbolType, - itemAlign, color, selectMode - ) { - var itemWidth = legendModel.get('itemWidth'); - var itemHeight = legendModel.get('itemHeight'); - var inactiveColor = legendModel.get('inactiveColor'); - var symbolKeepAspect = legendModel.get('symbolKeepAspect'); + // Inject axis instance + axisModel.axis = axis; + axis.model = axisModel; +} - var isSelected = legendModel.isSelected(name); - var itemGroup = new Group$3(); - var textStyleModel = itemModel.getModel('textStyle'); +var polarCreator = { - var itemIcon = itemModel.get('icon'); + dimensions: Polar.prototype.dimensions, - var tooltipModel = itemModel.getModel('tooltip'); - var legendGlobalTooltipModel = tooltipModel.parentModel; + create: function (ecModel, api) { + var polarList = []; + ecModel.eachComponent('polar', function (polarModel, idx) { + var polar = new Polar(idx); + // Inject resize and update method + polar.update = updatePolarScale; - // Use user given icon first - legendSymbolType = itemIcon || legendSymbolType; - itemGroup.add(createSymbol( - legendSymbolType, - 0, - 0, - itemWidth, - itemHeight, - isSelected ? color : inactiveColor, - // symbolKeepAspect default true for legend - symbolKeepAspect == null ? true : symbolKeepAspect - )); + var radiusAxis = polar.getRadiusAxis(); + var angleAxis = polar.getAngleAxis(); - // Compose symbols - // PENDING - if (!itemIcon && symbolType - // At least show one symbol, can't be all none - && ((symbolType !== legendSymbolType) || symbolType == 'none') - ) { - var size = itemHeight * 0.8; - if (symbolType === 'none') { - symbolType = 'circle'; - } - // Put symbol in the center - itemGroup.add(createSymbol( - symbolType, - (itemWidth - size) / 2, - (itemHeight - size) / 2, - size, - size, - isSelected ? color : inactiveColor, - // symbolKeepAspect default true for legend - symbolKeepAspect == null ? true : symbolKeepAspect - )); - } + var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); + var angleAxisModel = polarModel.findAxisModel('angleAxis'); - var textX = itemAlign === 'left' ? itemWidth + 5 : -5; - var textAlign = itemAlign; + setAxis(radiusAxis, radiusAxisModel); + setAxis(angleAxis, angleAxisModel); - var formatter = legendModel.get('formatter'); - var content = name; - if (typeof formatter === 'string' && formatter) { - content = formatter.replace('{name}', name != null ? name : ''); - } - else if (typeof formatter === 'function') { - content = formatter(name); - } + resizePolar(polar, polarModel, api); - itemGroup.add(new Text({ - style: setTextStyle({}, textStyleModel, { - text: content, - x: textX, - y: itemHeight / 2, - textFill: isSelected ? textStyleModel.getTextColor() : inactiveColor, - textAlign: textAlign, - textVerticalAlign: 'middle' - }) - })); + polarList.push(polar); - // Add a invisible rect to increase the area of mouse hover - var hitRect = new Rect({ - shape: itemGroup.getBoundingRect(), - invisible: true, - tooltip: tooltipModel.get('show') ? extend({ - content: name, - // Defaul formatter - formatter: legendGlobalTooltipModel.get('formatter', true) || function () { - return name; - }, - formatterParams: { - componentType: 'legend', - legendIndex: legendModel.componentIndex, - name: name, - $vars: ['name'] - } - }, tooltipModel.option) : null + polarModel.coordinateSystem = polar; + polar.model = polarModel; }); - itemGroup.add(hitRect); + // Inject coordinateSystem to series + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.get('coordinateSystem') === 'polar') { + var polarModel = ecModel.queryComponents({ + mainType: 'polar', + index: seriesModel.get('polarIndex'), + id: seriesModel.get('polarId') + })[0]; - itemGroup.eachChild(function (child) { - child.silent = true; + if (__DEV__) { + if (!polarModel) { + throw new Error( + 'Polar "' + retrieve( + seriesModel.get('polarIndex'), + seriesModel.get('polarId'), + 0 + ) + '" not found' + ); + } + } + seriesModel.coordinateSystem = polarModel.coordinateSystem; + } }); - hitRect.silent = !selectMode; - - this.getContentGroup().add(itemGroup); - - setHoverStyle(itemGroup); - - itemGroup.__legendDataIndex = dataIndex; - - return itemGroup; - }, - - /** - * @protected - */ - layoutInner: function (legendModel, itemAlign, maxSize) { - var contentGroup = this.getContentGroup(); - - // Place items in contentGroup. - box( - legendModel.get('orient'), - contentGroup, - legendModel.get('itemGap'), - maxSize.width, - maxSize.height - ); - - var contentRect = contentGroup.getBoundingRect(); - contentGroup.attr('position', [-contentRect.x, -contentRect.y]); - - return this.group.getBoundingRect(); - } - -}); - -function dispatchSelectAction(name, api) { - api.dispatchAction({ - type: 'legendToggleSelect', - name: name - }); -} - -function dispatchHighlightAction(seriesModel, dataName, api, excludeSeriesId) { - // If element hover will move to a hoverLayer. - var el = api.getZr().storage.getDisplayList()[0]; - if (!(el && el.useHoverLayer)) { - api.dispatchAction({ - type: 'highlight', - seriesName: seriesModel.name, - name: dataName, - excludeSeriesId: excludeSeriesId - }); + return polarList; } -} +}; -function dispatchDownplayAction(seriesModel, dataName, api, excludeSeriesId) { - // If element hover will move to a hoverLayer. - var el = api.getZr().storage.getDisplayList()[0]; - if (!(el && el.useHoverLayer)) { - api.dispatchAction({ - type: 'downplay', - seriesName: seriesModel.name, - name: dataName, - excludeSeriesId: excludeSeriesId - }); - } -} +CoordinateSystemManager.register('polar', polarCreator); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -72044,143 +76120,350 @@ function dispatchDownplayAction(seriesModel, dataName, api, excludeSeriesId) { * under the License. */ -var legendFilter = function (ecModel) { +var elementList$1 = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea']; - var legendModels = ecModel.findComponents({ - mainType: 'legend' - }); - if (legendModels && legendModels.length) { - ecModel.filterSeries(function (series) { - // If in any legend component the status is not selected. - // Because in legend series is assumed selected when it is not in the legend data. - for (var i = 0; i < legendModels.length; i++) { - if (!legendModels[i].isSelected(series.name)) { - return false; - } - } - return true; - }); - } +function getAxisLineShape(polar, rExtent, angle) { + rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); + var start = polar.coordToPoint([rExtent[0], angle]); + var end = polar.coordToPoint([rExtent[1], angle]); -}; + return { + x1: start[0], + y1: start[1], + x2: end[0], + y2: end[1] + }; +} -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +function getRadiusIdx(polar) { + var radiusAxis = polar.getRadiusAxis(); + return radiusAxis.inverse ? 0 : 1; +} +// Remove the last tick which will overlap the first tick +function fixAngleOverlap(list) { + var firstItem = list[0]; + var lastItem = list[list.length - 1]; + if (firstItem + && lastItem + && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4 + ) { + list.pop(); + } +} -// Do not contain scrollable legend, for sake of file size. +AxisView.extend({ -// Series Filter -registerProcessor(legendFilter); + type: 'angleAxis', -ComponentModel.registerSubTypeDefaulter('legend', function () { - // Default 'plain' when no type specified. - return 'plain'; -}); + axisPointerClass: 'PolarAxisPointer', -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + render: function (angleAxisModel, ecModel) { + this.group.removeAll(); + if (!angleAxisModel.get('show')) { + return; + } -var ScrollableLegendModel = LegendModel.extend({ + var angleAxis = angleAxisModel.axis; + var polar = angleAxis.polar; + var radiusExtent = polar.getRadiusAxis().getExtent(); - type: 'legend.scroll', + var ticksAngles = angleAxis.getTicksCoords(); + var minorTickAngles = angleAxis.getMinorTicksCoords(); + + var labels = map(angleAxis.getViewLabels(), function (labelItem) { + var labelItem = clone(labelItem); + labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue); + return labelItem; + }); + + fixAngleOverlap(labels); + fixAngleOverlap(ticksAngles); + + each$1(elementList$1, function (name) { + if (angleAxisModel.get(name + '.show') + && (!angleAxis.scale.isBlank() || name === 'axisLine') + ) { + this['_' + name](angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels); + } + }, this); + }, /** - * @param {number} scrollDataIndex + * @private */ - setScrollDataIndex: function (scrollDataIndex) { - this.option.scrollDataIndex = scrollDataIndex; + _axisLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle'); + + // extent id of the axis radius (r0 and r) + var rId = getRadiusIdx(polar); + var r0Id = rId ? 0 : 1; + + var shape; + if (radiusExtent[r0Id] === 0) { + shape = new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[rId] + }, + style: lineStyleModel.getLineStyle(), + z2: 1, + silent: true + }); + } + else { + shape = new Ring({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[rId], + r0: radiusExtent[r0Id] + }, + style: lineStyleModel.getLineStyle(), + z2: 1, + silent: true + }); + } + shape.style.fill = null; + this.group.add(shape); }, - defaultOption: { - scrollDataIndex: 0, - pageButtonItemGap: 5, - pageButtonGap: null, - pageButtonPosition: 'end', // 'start' or 'end' - pageFormatter: '{current}/{total}', // If null/undefined, do not show page. - pageIcons: { - horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'], - vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z'] - }, - pageIconColor: '#2f4554', - pageIconInactiveColor: '#aaa', - pageIconSize: 15, // Can be [10, 3], which represents [width, height] - pageTextStyle: { - color: '#333' - }, + /** + * @private + */ + _axisTick: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + var tickModel = angleAxisModel.getModel('axisTick'); - animationDurationUpdate: 800 + var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length'); + var radius = radiusExtent[getRadiusIdx(polar)]; + + var lines = map(ticksAngles, function (tickAngleItem) { + return new Line({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) + }); + }); + this.group.add(mergePath( + lines, { + style: defaults( + tickModel.getModel('lineStyle').getLineStyle(), + { + stroke: angleAxisModel.get('axisLine.lineStyle.color') + } + ) + } + )); }, /** - * @override + * @private */ - init: function (option, parentModel, ecModel, extraOpt) { - var inputPositionParams = getLayoutParams(option); + _minorTick: function (angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) { + if (!minorTickAngles.length) { + return; + } - ScrollableLegendModel.superCall(this, 'init', option, parentModel, ecModel, extraOpt); + var tickModel = angleAxisModel.getModel('axisTick'); + var minorTickModel = angleAxisModel.getModel('minorTick'); + + var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length'); + var radius = radiusExtent[getRadiusIdx(polar)]; + + var lines = []; + + for (var i = 0; i < minorTickAngles.length; i++) { + for (var k = 0; k < minorTickAngles[i].length; k++) { + lines.push(new Line({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord) + })); + } + } - mergeAndNormalizeLayoutParams(this, option, inputPositionParams); + this.group.add(mergePath( + lines, { + style: defaults( + minorTickModel.getModel('lineStyle').getLineStyle(), + defaults( + tickModel.getLineStyle(), { + stroke: angleAxisModel.get('axisLine.lineStyle.color') + } + ) + ) + } + )); }, /** - * @override + * @private */ - mergeOption: function (option, extraOpt) { - ScrollableLegendModel.superCall(this, 'mergeOption', option, extraOpt); + _axisLabel: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) { + var rawCategoryData = angleAxisModel.getCategories(true); + + var commonLabelModel = angleAxisModel.getModel('axisLabel'); + + var labelMargin = commonLabelModel.get('margin'); + var triggerEvent = angleAxisModel.get('triggerEvent'); + + // Use length of ticksAngles because it may remove the last tick to avoid overlapping + each$1(labels, function (labelItem, idx) { + var labelModel = commonLabelModel; + var tickValue = labelItem.tickValue; + + var r = radiusExtent[getRadiusIdx(polar)]; + var p = polar.coordToPoint([r + labelMargin, labelItem.coord]); + var cx = polar.cx; + var cy = polar.cy; + + var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 + ? 'center' : (p[0] > cx ? 'left' : 'right'); + var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 + ? 'middle' : (p[1] > cy ? 'top' : 'bottom'); + + if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { + labelModel = new Model( + rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel + ); + } + + var textEl = new Text({ + silent: AxisBuilder.isLabelSilent(angleAxisModel) + }); + this.group.add(textEl); + setTextStyle(textEl.style, labelModel, { + x: p[0], + y: p[1], + textFill: labelModel.getTextColor() || angleAxisModel.get('axisLine.lineStyle.color'), + text: labelItem.formattedLabel, + textAlign: labelTextAlign, + textVerticalAlign: labelTextVerticalAlign + }); + + // Pack data for mouse event + if (triggerEvent) { + textEl.eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel); + textEl.eventData.targetType = 'axisLabel'; + textEl.eventData.value = labelItem.rawLabel; + } - mergeAndNormalizeLayoutParams(this, this.option, option); + }, this); }, - getOrient: function () { - return this.get('orient') === 'vertical' - ? {index: 1, name: 'vertical'} - : {index: 0, name: 'horizontal'}; - } + /** + * @private + */ + _splitLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + var splitLineModel = angleAxisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + var lineCount = 0; -}); + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; -// Do not `ignoreSize` to enable setting {left: 10, right: 10}. -function mergeAndNormalizeLayoutParams(legendModel, target, raw) { - var orient = legendModel.getOrient(); - var ignoreSize = [1, 1]; - ignoreSize[orient.index] = 0; - mergeLayoutParam(target, raw, { - type: 'box', ignoreSize: ignoreSize - }); -} + var splitLines = []; + + for (var i = 0; i < ticksAngles.length; i++) { + var colorIndex = (lineCount++) % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new Line({ + shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) + })); + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitLines.length; i++) { + this.group.add(mergePath(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length] + }, lineStyleModel.getLineStyle()), + silent: true, + z: angleAxisModel.get('z') + })); + } + }, + + /** + * @private + */ + _minorSplitLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + if (!minorTickAngles.length) { + return; + } + + var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine'); + var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); + + var lines = []; + + for (var i = 0; i < minorTickAngles.length; i++) { + for (var k = 0; k < minorTickAngles[i].length; k++) { + lines.push(new Line({ + shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord) + })); + } + } + + this.group.add(mergePath(lines, { + style: lineStyleModel.getLineStyle(), + silent: true, + z: angleAxisModel.get('z') + })); + }, + + /** + * @private + */ + _splitArea: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + if (!ticksAngles.length) { + return; + } + + var splitAreaModel = angleAxisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + var lineCount = 0; + + areaColors = areaColors instanceof Array ? areaColors : [areaColors]; + + var splitAreas = []; + + var RADIAN = Math.PI / 180; + var prevAngle = -ticksAngles[0].coord * RADIAN; + var r0 = Math.min(radiusExtent[0], radiusExtent[1]); + var r1 = Math.max(radiusExtent[0], radiusExtent[1]); + + var clockwise = angleAxisModel.get('clockwise'); + + for (var i = 1; i < ticksAngles.length; i++) { + var colorIndex = (lineCount++) % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0: r0, + r: r1, + startAngle: prevAngle, + endAngle: -ticksAngles[i].coord * RADIAN, + clockwise: clockwise + }, + silent: true + })); + prevAngle = -ticksAngles[i].coord * RADIAN; + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitAreas.length; i++) { + this.group.add(mergePath(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); + } + } +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -72201,418 +76484,197 @@ function mergeAndNormalizeLayoutParams(legendModel, target, raw) { * under the License. */ -/** - * Separate legend and scrollable legend to reduce package size. - */ - -var Group$4 = Group; - -var WH$1 = ['width', 'height']; -var XY$1 = ['x', 'y']; - -var ScrollableLegendView = LegendView.extend({ - - type: 'legend.scroll', +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - newlineDisabled: true, +var axisBuilderAttrs$3 = [ + 'axisLine', 'axisTickLabel', 'axisName' +]; +var selfBuilderAttrs$2 = [ + 'splitLine', 'splitArea', 'minorSplitLine' +]; - init: function () { +AxisView.extend({ - ScrollableLegendView.superCall(this, 'init'); + type: 'radiusAxis', - /** - * @private - * @type {number} For `scroll`. - */ - this._currentIndex = 0; + axisPointerClass: 'PolarAxisPointer', - /** - * @private - * @type {module:zrender/container/Group} - */ - this.group.add(this._containerGroup = new Group$4()); - this._containerGroup.add(this.getContentGroup()); + render: function (radiusAxisModel, ecModel) { + this.group.removeAll(); + if (!radiusAxisModel.get('show')) { + return; + } + var radiusAxis = radiusAxisModel.axis; + var polar = radiusAxis.polar; + var angleAxis = polar.getAngleAxis(); + var ticksCoords = radiusAxis.getTicksCoords(); + var minorTicksCoords = radiusAxis.getMinorTicksCoords(); + var axisAngle = angleAxis.getExtent()[0]; + var radiusExtent = radiusAxis.getExtent(); - /** - * @private - * @type {module:zrender/container/Group} - */ - this.group.add(this._controllerGroup = new Group$4()); + var layout = layoutAxis(polar, radiusAxisModel, axisAngle); + var axisBuilder = new AxisBuilder(radiusAxisModel, layout); + each$1(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); + this.group.add(axisBuilder.getGroup()); - /** - * - * @private - */ - this._showController; + each$1(selfBuilderAttrs$2, function (name) { + if (radiusAxisModel.get(name + '.show') && !radiusAxis.scale.isBlank()) { + this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords); + } + }, this); }, /** - * @override + * @private */ - resetInner: function () { - ScrollableLegendView.superCall(this, 'resetInner'); + _splitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + var splitLineModel = radiusAxisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + var lineCount = 0; - this._controllerGroup.removeAll(); - this._containerGroup.removeClipPath(); - this._containerGroup.__rectSize = null; + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + + var splitLines = []; + + for (var i = 0; i < ticksCoords.length; i++) { + var colorIndex = (lineCount++) % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: ticksCoords[i].coord + } + })); + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitLines.length; i++) { + this.group.add(mergePath(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length], + fill: null + }, lineStyleModel.getLineStyle()), + silent: true + })); + } }, /** - * @override + * @private */ - renderInner: function (itemAlign, legendModel, ecModel, api) { - var me = this; + _minorSplitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) { + if (!minorTicksCoords.length) { + return; + } - // Render content items. - ScrollableLegendView.superCall(this, 'renderInner', itemAlign, legendModel, ecModel, api); + var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine'); + var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); - var controllerGroup = this._controllerGroup; + var lines = []; - var pageIconSize = legendModel.get('pageIconSize', true); - if (!isArray(pageIconSize)) { - pageIconSize = [pageIconSize, pageIconSize]; + for (var i = 0; i < minorTicksCoords.length; i++) { + for (var k = 0; k < minorTicksCoords[i].length; k++) { + lines.push(new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: minorTicksCoords[i][k].coord + } + })); + } } - createPageButton('pagePrev', 0); - - var pageTextStyleModel = legendModel.getModel('pageTextStyle'); - controllerGroup.add(new Text({ - name: 'pageText', - style: { - textFill: pageTextStyleModel.getTextColor(), - font: pageTextStyleModel.getFont(), - textVerticalAlign: 'middle', - textAlign: 'center' - }, + this.group.add(mergePath(lines, { + style: defaults({ + fill: null + }, lineStyleModel.getLineStyle()), silent: true })); - - createPageButton('pageNext', 1); - - function createPageButton(name, iconIdx) { - var pageDataIndexName = name + 'DataIndex'; - var icon = createIcon( - legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], - { - // Buttons will be created in each render, so we do not need - // to worry about avoiding using legendModel kept in scope. - onclick: bind( - me._pageGo, me, pageDataIndexName, legendModel, api - ) - }, - { - x: -pageIconSize[0] / 2, - y: -pageIconSize[1] / 2, - width: pageIconSize[0], - height: pageIconSize[1] - } - ); - icon.name = name; - controllerGroup.add(icon); - } }, /** - * @override + * @private */ - layoutInner: function (legendModel, itemAlign, maxSize) { - var contentGroup = this.getContentGroup(); - var containerGroup = this._containerGroup; - var controllerGroup = this._controllerGroup; - - var orientIdx = legendModel.getOrient().index; - var wh = WH$1[orientIdx]; - var hw = WH$1[1 - orientIdx]; - var yx = XY$1[1 - orientIdx]; + _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + if (!ticksCoords.length) { + return; + } - // Place items in contentGroup. - box( - legendModel.get('orient'), - contentGroup, - legendModel.get('itemGap'), - !orientIdx ? null : maxSize.width, - orientIdx ? null : maxSize.height - ); + var splitAreaModel = radiusAxisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + var lineCount = 0; - box( - // Buttons in controller are layout always horizontally. - 'horizontal', - controllerGroup, - legendModel.get('pageButtonItemGap', true) - ); + areaColors = areaColors instanceof Array ? areaColors : [areaColors]; - var contentRect = contentGroup.getBoundingRect(); - var controllerRect = controllerGroup.getBoundingRect(); - var showController = this._showController = contentRect[wh] > maxSize[wh]; + var splitAreas = []; - var contentPos = [-contentRect.x, -contentRect.y]; - // Remain contentPos when scroll animation perfroming. - contentPos[orientIdx] = contentGroup.position[orientIdx]; + var prevRadius = ticksCoords[0].coord; + for (var i = 1; i < ticksCoords.length; i++) { + var colorIndex = (lineCount++) % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0: prevRadius, + r: ticksCoords[i].coord, + startAngle: 0, + endAngle: Math.PI * 2 + }, + silent: true + })); + prevRadius = ticksCoords[i].coord; + } - // Layout container group based on 0. - var containerPos = [0, 0]; - var controllerPos = [-controllerRect.x, -controllerRect.y]; - var pageButtonGap = retrieve2( - legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true) - ); - - // Place containerGroup and controllerGroup and contentGroup. - if (showController) { - var pageButtonPosition = legendModel.get('pageButtonPosition', true); - // controller is on the right / bottom. - if (pageButtonPosition === 'end') { - controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; - } - // controller is on the left / top. - else { - containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; - } - } - - // Always align controller to content as 'middle'. - controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; - - contentGroup.attr('position', contentPos); - containerGroup.attr('position', containerPos); - controllerGroup.attr('position', controllerPos); - - // Calculate `mainRect` and set `clipPath`. - // mainRect should not be calculated by `this.group.getBoundingRect()` - // for sake of the overflow. - var mainRect = this.group.getBoundingRect(); - var mainRect = {x: 0, y: 0}; - // Consider content may be overflow (should be clipped). - mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; - mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); - // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. - mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); - - containerGroup.__rectSize = maxSize[wh]; - if (showController) { - var clipShape = {x: 0, y: 0}; - clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); - clipShape[hw] = mainRect[hw]; - containerGroup.setClipPath(new Rect({shape: clipShape})); - // Consider content may be larger than container, container rect - // can not be obtained from `containerGroup.getBoundingRect()`. - containerGroup.__rectSize = clipShape[wh]; - } - else { - // Do not remove or ignore controller. Keep them set as place holders. - controllerGroup.eachChild(function (child) { - child.attr({invisible: true, silent: true}); - }); - } - - // Content translate animation. - var pageInfo = this._getPageInfo(legendModel); - pageInfo.pageIndex != null && updateProps( - contentGroup, - {position: pageInfo.contentPosition}, - // When switch from "show controller" to "not show controller", view should be - // updated immediately without animation, otherwise causes weird efffect. - showController ? legendModel : false - ); - - this._updatePageInfoView(legendModel, pageInfo); - - return mainRect; - }, - - _pageGo: function (to, legendModel, api) { - var scrollDataIndex = this._getPageInfo(legendModel)[to]; - - scrollDataIndex != null && api.dispatchAction({ - type: 'legendScroll', - scrollDataIndex: scrollDataIndex, - legendId: legendModel.id - }); - }, - - _updatePageInfoView: function (legendModel, pageInfo) { - var controllerGroup = this._controllerGroup; - - each$1(['pagePrev', 'pageNext'], function (name) { - var canJump = pageInfo[name + 'DataIndex'] != null; - var icon = controllerGroup.childOfName(name); - if (icon) { - icon.setStyle( - 'fill', - canJump - ? legendModel.get('pageIconColor', true) - : legendModel.get('pageIconInactiveColor', true) - ); - icon.cursor = canJump ? 'pointer' : 'default'; - } - }); - - var pageText = controllerGroup.childOfName('pageText'); - var pageFormatter = legendModel.get('pageFormatter'); - var pageIndex = pageInfo.pageIndex; - var current = pageIndex != null ? pageIndex + 1 : 0; - var total = pageInfo.pageCount; - - pageText && pageFormatter && pageText.setStyle( - 'text', - isString(pageFormatter) - ? pageFormatter.replace('{current}', current).replace('{total}', total) - : pageFormatter({current: current, total: total}) - ); - }, - - /** - * @param {module:echarts/model/Model} legendModel - * @return {Object} { - * contentPosition: Array., null when data item not found. - * pageIndex: number, null when data item not found. - * pageCount: number, always be a number, can be 0. - * pagePrevDataIndex: number, null when no next page. - * pageNextDataIndex: number, null when no previous page. - * } - */ - _getPageInfo: function (legendModel) { - // Align left or top by the current dataIndex. - var currDataIndex = legendModel.get('scrollDataIndex', true); - var contentGroup = this.getContentGroup(); - var contentRect = contentGroup.getBoundingRect(); - var containerRectSize = this._containerGroup.__rectSize; - - var orientIdx = legendModel.getOrient().index; - var wh = WH$1[orientIdx]; - var hw = WH$1[1 - orientIdx]; - var xy = XY$1[orientIdx]; - var contentPos = contentGroup.position.slice(); - - var pageIndex; - var pagePrevDataIndex; - var pageNextDataIndex; - - var targetItemGroup; - if (this._showController) { - contentGroup.eachChild(function (child) { - if (child.__legendDataIndex === currDataIndex) { - targetItemGroup = child; - } - }); - } - else { - targetItemGroup = contentGroup.childAt(0); - } - - var pageCount = containerRectSize ? Math.ceil(contentRect[wh] / containerRectSize) : 0; - - if (targetItemGroup) { - var itemRect = targetItemGroup.getBoundingRect(); - var itemLoc = targetItemGroup.position[orientIdx] + itemRect[xy]; - contentPos[orientIdx] = -itemLoc - contentRect[xy]; - pageIndex = Math.floor( - pageCount * (itemLoc + itemRect[xy] + containerRectSize / 2) / contentRect[wh] - ); - pageIndex = (contentRect[wh] && pageCount) - ? Math.max(0, Math.min(pageCount - 1, pageIndex)) - : -1; - - var winRect = {x: 0, y: 0}; - winRect[wh] = containerRectSize; - winRect[hw] = contentRect[hw]; - winRect[xy] = -contentPos[orientIdx] - contentRect[xy]; - - var startIdx; - var children = contentGroup.children(); - - contentGroup.eachChild(function (child, index) { - var itemRect = getItemRect(child); - - if (itemRect.intersect(winRect)) { - startIdx == null && (startIdx = index); - // It is user-friendly that the last item shown in the - // current window is shown at the begining of next window. - pageNextDataIndex = child.__legendDataIndex; - } - - // If the last item is shown entirely, no next page. - if (index === children.length - 1 - && itemRect[xy] + itemRect[wh] <= winRect[xy] + winRect[wh] - ) { - pageNextDataIndex = null; - } - }); - - // Always align based on the left/top most item, so the left/top most - // item in the previous window is needed to be found here. - if (startIdx != null) { - var startItem = children[startIdx]; - var startRect = getItemRect(startItem); - winRect[xy] = startRect[xy] + startRect[wh] - winRect[wh]; - - // If the first item is shown entirely, no previous page. - if (startIdx <= 0 && startRect[xy] >= winRect[xy]) { - pagePrevDataIndex = null; - } - else { - while (startIdx > 0 && getItemRect(children[startIdx - 1]).intersect(winRect)) { - startIdx--; - } - pagePrevDataIndex = children[startIdx].__legendDataIndex; - } - } - } - - return { - contentPosition: contentPos, - pageIndex: pageIndex, - pageCount: pageCount, - pagePrevDataIndex: pagePrevDataIndex, - pageNextDataIndex: pageNextDataIndex - }; - - function getItemRect(el) { - var itemRect = el.getBoundingRect().clone(); - itemRect[xy] += el.position[orientIdx]; - return itemRect; + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitAreas.length; i++) { + this.group.add(mergePath(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); } } - }); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - /** - * @event legendScroll - * @type {Object} - * @property {string} type 'legendScroll' - * @property {string} scrollDataIndex + * @inner */ -registerAction( - 'legendScroll', 'legendscroll', - function (payload, ecModel) { - var scrollDataIndex = payload.scrollDataIndex; - - scrollDataIndex != null && ecModel.eachComponent( - {mainType: 'legend', subType: 'scroll', query: payload}, - function (legendModel) { - legendModel.setScrollDataIndex(scrollDataIndex); - } - ); - } -); +function layoutAxis(polar, radiusAxisModel, axisAngle) { + return { + position: [polar.cx, polar.cy], + rotation: axisAngle / 180 * Math.PI, + labelDirection: -1, + tickDirection: -1, + nameDirection: 1, + labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'), + // Over splitLine and splitArea + z2: 1 + }; +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -72633,10 +76695,6 @@ registerAction( * under the License. */ -/** - * Legend component entry file8 - */ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -72656,112 +76714,162 @@ registerAction( * under the License. */ -extendComponentModel({ - - type: 'tooltip', - - dependencies: ['axisPointer'], - - defaultOption: { - zlevel: 0, - - z: 8, - - show: true, - - // tooltip主体内容 - showContent: true, - - // 'trigger' only works on coordinate system. - // 'item' | 'axis' | 'none' - trigger: 'item', - - // 'click' | 'mousemove' | 'none' - triggerOn: 'mousemove|click', - - alwaysShowContent: false, +var PolarAxisPointer = BaseAxisPointer.extend({ - displayMode: 'single', // 'single' | 'multipleByCoordSys' + /** + * @override + */ + makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; - renderMode: 'auto', // 'auto' | 'html' | 'richText' - // 'auto': use html by default, and use non-html if `document` is not defined - // 'html': use html for tooltip - // 'richText': use canvas, svg, and etc. for tooltip + if (axis.dim === 'angle') { + this.animationThreshold = Math.PI / 18; + } - // 位置 {Array} | {Function} - // position: null - // Consider triggered from axisPointer handle, verticalAlign should be 'middle' - // align: null, - // verticalAlign: null, + var polar = axis.polar; + var otherAxis = polar.getOtherAxis(axis); + var otherExtent = otherAxis.getExtent(); - // 是否约束 content 在 viewRect 中。默认 false 是为了兼容以前版本。 - confine: false, + var coordValue; + coordValue = axis['dataTo' + capitalFirst(axis.dim)](value); - // 内容格式器:{string}(Template) ¦ {Function} - // formatter: null + var axisPointerType = axisPointerModel.get('type'); + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder$2[axisPointerType]( + axis, polar, coordValue, otherExtent, elStyle + ); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } - showDelay: 0, + var labelMargin = axisPointerModel.get('label.margin'); + var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); + buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); + } - // 隐藏延迟,单位ms - hideDelay: 100, + // Do not support handle, utill any user requires it. - // 动画变换时间,单位s - transitionDuration: 0.4, +}); - enterable: false, +function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { + var axis = axisModel.axis; + var coord = axis.dataToCoord(value); + var axisAngle = polar.getAngleAxis().getExtent()[0]; + axisAngle = axisAngle / 180 * Math.PI; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var position; + var align; + var verticalAlign; - // 提示背景颜色,默认为透明度为0.7的黑色 - backgroundColor: 'rgba(50,50,50,0.7)', + if (axis.dim === 'radius') { + var transform = create$1(); + rotate(transform, transform, axisAngle); + translate(transform, transform, [polar.cx, polar.cy]); + position = applyTransform$1([coord, -labelMargin], transform); - // 提示边框颜色 - borderColor: '#333', + var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; + var labelLayout = AxisBuilder.innerTextLayout( + axisAngle, labelRotation * Math.PI / 180, -1 + ); + align = labelLayout.textAlign; + verticalAlign = labelLayout.textVerticalAlign; + } + else { // angle axis + var r = radiusExtent[1]; + position = polar.coordToPoint([r + labelMargin, coord]); + var cx = polar.cx; + var cy = polar.cy; + align = Math.abs(position[0] - cx) / r < 0.3 + ? 'center' : (position[0] > cx ? 'left' : 'right'); + verticalAlign = Math.abs(position[1] - cy) / r < 0.3 + ? 'middle' : (position[1] > cy ? 'top' : 'bottom'); + } - // 提示边框圆角,单位px,默认为4 - borderRadius: 4, + return { + position: position, + align: align, + verticalAlign: verticalAlign + }; +} - // 提示边框线宽,单位px,默认为0(无边框) - borderWidth: 0, - // 提示内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - padding: 5, +var pointerShapeBuilder$2 = { - // Extra css text - extraCssText: '', + line: function (axis, polar, coordValue, otherExtent, elStyle) { + return axis.dim === 'angle' + ? { + type: 'Line', + shape: makeLineShape( + polar.coordToPoint([otherExtent[0], coordValue]), + polar.coordToPoint([otherExtent[1], coordValue]) + ) + } + : { + type: 'Circle', + shape: { + cx: polar.cx, + cy: polar.cy, + r: coordValue + } + }; + }, - // 坐标轴指示器,坐标轴触发有效 - axisPointer: { - // 默认为直线 - // 可选为:'line' | 'shadow' | 'cross' - type: 'line', + shadow: function (axis, polar, coordValue, otherExtent, elStyle) { + var bandWidth = Math.max(1, axis.getBandWidth()); + var radian = Math.PI / 180; - // type 为 line 的时候有效,指定 tooltip line 所在的轴,可选 - // 可选 'x' | 'y' | 'angle' | 'radius' | 'auto' - // 默认 'auto',会选择类型为 category 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴 - // 极坐标系会默认选择 angle 轴 - axis: 'auto', + return axis.dim === 'angle' + ? { + type: 'Sector', + shape: makeSectorShape( + polar.cx, polar.cy, + otherExtent[0], otherExtent[1], + // In ECharts y is negative if angle is positive + (-coordValue - bandWidth / 2) * radian, + (-coordValue + bandWidth / 2) * radian + ) + } + : { + type: 'Sector', + shape: makeSectorShape( + polar.cx, polar.cy, + coordValue - bandWidth / 2, + coordValue + bandWidth / 2, + 0, Math.PI * 2 + ) + }; + } +}; - animation: 'auto', - animationDurationUpdate: 200, - animationEasingUpdate: 'exponentialOut', +AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); - crossStyle: { - color: '#999', - width: 1, - type: 'dashed', +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // TODO formatter - textStyle: {} - } +// For reducing size of echarts.min, barLayoutPolar is required by polar. +registerLayout(curry(barLayoutPolar, 'bar')); - // lineStyle and shadowStyle should not be specified here, - // otherwise it will always override those styles on option.axisPointer. - }, - textStyle: { - color: '#fff', - fontSize: 14 - } - } +// Polar view +extendComponentView({ + type: 'polar' }); /* @@ -72783,284 +76891,157 @@ extendComponentModel({ * under the License. */ -var each$18 = each$1; -var toCamelCase$1 = toCamelCase; +var GeoModel = ComponentModel.extend({ -var vendors = ['', '-webkit-', '-moz-', '-o-']; + type: 'geo', -var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;'; + /** + * @type {module:echarts/coord/geo/Geo} + */ + coordinateSystem: null, -/** - * @param {number} duration - * @return {string} - * @inner - */ -function assembleTransition(duration) { - var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)'; - var transitionText = 'left ' + duration + 's ' + transitionCurve + ',' - + 'top ' + duration + 's ' + transitionCurve; - return map(vendors, function (vendorPrefix) { - return vendorPrefix + 'transition:' + transitionText; - }).join(';'); -} + layoutMode: 'box', -/** - * @param {Object} textStyle - * @return {string} - * @inner - */ -function assembleFont(textStyleModel) { - var cssText = []; + init: function (option) { + ComponentModel.prototype.init.apply(this, arguments); - var fontSize = textStyleModel.get('fontSize'); - var color = textStyleModel.getTextColor(); + // Default label emphasis `show` + defaultEmphasis(option, 'label', ['show']); + }, - color && cssText.push('color:' + color); + optionUpdated: function () { + var option = this.option; + var self = this; - cssText.push('font:' + textStyleModel.getFont()); + option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap); - fontSize && - cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px'); + this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { + if (regionOpt.name) { + optionModelMap.set(regionOpt.name, new Model(regionOpt, self)); + } + return optionModelMap; + }, createHashMap()); - each$18(['decoration', 'align'], function (name) { - var val = textStyleModel.get(name); - val && cssText.push('text-' + name + ':' + val); - }); + this.updateSelectedMap(option.regions); + }, - return cssText.join(';'); -} + defaultOption: { -/** - * @param {Object} tooltipModel - * @return {string} - * @inner - */ -function assembleCssText(tooltipModel) { + zlevel: 0, - var cssText = []; + z: 0, - var transitionDuration = tooltipModel.get('transitionDuration'); - var backgroundColor = tooltipModel.get('backgroundColor'); - var textStyleModel = tooltipModel.getModel('textStyle'); - var padding = tooltipModel.get('padding'); + show: true, - // Animation transition. Do not animate when transitionDuration is 0. - transitionDuration && - cssText.push(assembleTransition(transitionDuration)); + left: 'center', - if (backgroundColor) { - if (env$1.canvasSupported) { - cssText.push('background-Color:' + backgroundColor); - } - else { - // for ie - cssText.push( - 'background-Color:#' + toHex(backgroundColor) - ); - cssText.push('filter:alpha(opacity=70)'); - } - } + top: 'center', - // Border style - each$18(['width', 'color', 'radius'], function (name) { - var borderName = 'border-' + name; - var camelCase = toCamelCase$1(borderName); - var val = tooltipModel.get(camelCase); - val != null && - cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); - }); - // Text style - cssText.push(assembleFont(textStyleModel)); + // width:, + // height:, + // right + // bottom - // Padding - if (padding != null) { - cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px'); - } + // Aspect is width / height. Inited to be geoJson bbox aspect + // This parameter is used for scale this aspect + // If svg used, aspectScale is 1 by default. + // aspectScale: 0.75, + aspectScale: null, - return cssText.join(';') + ';'; -} + ///// Layout with center and size + // If you wan't to put map in a fixed size box with right aspect ratio + // This two properties may more conveninet + // layoutCenter: [50%, 50%] + // layoutSize: 100 -/** - * @alias module:echarts/component/tooltip/TooltipContent - * @constructor - */ -function TooltipContent(container, api) { - if (env$1.wxa) { - return null; - } + silent: false, - var el = document.createElement('div'); - var zr = this._zr = api.getZr(); + // Map type + map: '', - this.el = el; + // Define left-top, right-bottom coords to control view + // For example, [ [180, 90], [-180, -90] ] + boundingCoords: null, - this._x = api.getWidth() / 2; - this._y = api.getHeight() / 2; + // Default on center of map + center: null, - container.appendChild(el); + zoom: 1, - this._container = container; + scaleLimit: null, - this._show = false; + // selectedMode: false - /** - * @private - */ - this._hideTimeout; + label: { + show: false, + color: '#000' + }, - var self = this; - el.onmouseenter = function () { - // clear the timeout in hideLater and keep showing tooltip - if (self._enterable) { - clearTimeout(self._hideTimeout); - self._show = true; - } - self._inContent = true; - }; - el.onmousemove = function (e) { - e = e || window.event; - if (!self._enterable) { - // Try trigger zrender event to avoid mouse - // in and out shape too frequently - var handler = zr.handler; - normalizeEvent(container, e, true); - handler.dispatch('mousemove', e); - } - }; - el.onmouseleave = function () { - if (self._enterable) { - if (self._show) { - self.hideLater(self._hideDelay); - } - } - self._inContent = false; - }; -} + itemStyle: { + // color: 各异, + borderWidth: 0.5, + borderColor: '#444', + color: '#eee' + }, -TooltipContent.prototype = { + emphasis: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + color: 'rgba(255,215,0,0.8)' + } + }, - constructor: TooltipContent, + regions: [] + }, /** - * @private - * @type {boolean} + * Get model of region + * @param {string} name + * @return {module:echarts/model/Model} */ - _enterable: true, + getRegionModel: function (name) { + return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); + }, /** - * Update when tooltip is rendered + * Format label + * @param {string} name Region name + * @param {string} [status='normal'] 'normal' or 'emphasis' + * @return {string} */ - update: function () { - // FIXME - // Move this logic to ec main? - var container = this._container; - var stl = container.currentStyle - || document.defaultView.getComputedStyle(container); - var domStyle = container.style; - if (domStyle.position !== 'absolute' && stl.position !== 'absolute') { - domStyle.position = 'relative'; - } - // Hide the tooltip - // PENDING - // this.hide(); - }, - - show: function (tooltipModel) { - clearTimeout(this._hideTimeout); - var el = this.el; - - el.style.cssText = gCssText + assembleCssText(tooltipModel) - // http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore - + ';left:' + this._x + 'px;top:' + this._y + 'px;' - + (tooltipModel.get('extraCssText') || ''); - - el.style.display = el.innerHTML ? 'block' : 'none'; - - // If mouse occsionally move over the tooltip, a mouseout event will be - // triggered by canvas, and cuase some unexpectable result like dragging - // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve - // it. Although it is not suppored by IE8~IE10, fortunately it is a rare - // scenario. - el.style.pointerEvents = this._enterable ? 'auto' : 'none'; - - this._show = true; - }, - - setContent: function (content) { - this.el.innerHTML = content == null ? '' : content; - }, - - setEnterable: function (enterable) { - this._enterable = enterable; - }, - - getSize: function () { - var el = this.el; - return [el.clientWidth, el.clientHeight]; - }, - - moveTo: function (x, y) { - // xy should be based on canvas root. But tooltipContent is - // the sibling of canvas root. So padding of ec container - // should be considered here. - var zr = this._zr; - var viewportRootOffset; - if (zr && zr.painter && (viewportRootOffset = zr.painter.getViewportRootOffset())) { - x += viewportRootOffset.offsetLeft; - y += viewportRootOffset.offsetTop; + getFormattedLabel: function (name, status) { + var regionModel = this.getRegionModel(name); + var formatter = regionModel.get( + 'label' + + (status === 'normal' ? '.' : status + '.') + + 'formatter' + ); + var params = { + name: name + }; + if (typeof formatter === 'function') { + params.status = status; + return formatter(params); } - - var style = this.el.style; - style.left = x + 'px'; - style.top = y + 'px'; - - this._x = x; - this._y = y; - }, - - hide: function () { - this.el.style.display = 'none'; - this._show = false; - }, - - hideLater: function (time) { - if (this._show && !(this._inContent && this._enterable)) { - if (time) { - this._hideDelay = time; - // Set show false to avoid invoke hideLater mutiple times - this._show = false; - this._hideTimeout = setTimeout(bind(this.hide, this), time); - } - else { - this.hide(); - } + else if (typeof formatter === 'string') { + return formatter.replace('{a}', name != null ? name : ''); } }, - isShow: function () { - return this._show; + setZoom: function (zoom) { + this.option.zoom = zoom; }, - getOuterSize: function () { - var width = this.el.clientWidth; - var height = this.el.clientHeight; - - // Consider browser compatibility. - // IE8 does not support getComputedStyle. - if (document.defaultView && document.defaultView.getComputedStyle) { - var stl = document.defaultView.getComputedStyle(this.el); - if (stl) { - width += parseInt(stl.paddingLeft, 10) + parseInt(stl.paddingRight, 10) - + parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10); - height += parseInt(stl.paddingTop, 10) + parseInt(stl.paddingBottom, 10) - + parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10); - } - } - - return {width: width, height: height}; + setCenter: function (center) { + this.option.center = center; } -}; +}); + +mixin(GeoModel, selectableMixin); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -73081,156 +77062,96 @@ TooltipContent.prototype = { * under the License. */ -/** - * @alias module:echarts/component/tooltip/TooltipRichContent - * @constructor - */ -function TooltipRichContent(api) { - // this.el = new Group(); - - var zr = this._zr = api.getZr(); - // zr.add(this.el); - - this._show = false; - - /** - * @private - */ - this._hideTimeout; -} - -TooltipRichContent.prototype = { +extendComponentView({ - constructor: TooltipRichContent, + type: 'geo', - /** - * @private - * @type {boolean} - */ - _enterable: true, + init: function (ecModel, api) { + var mapDraw = new MapDraw(api, true); + this._mapDraw = mapDraw; - /** - * Update when tooltip is rendered - */ - update: function () { - // noop + this.group.add(mapDraw.group); }, - show: function (tooltipModel) { - if (this._hideTimeout) { - clearTimeout(this._hideTimeout); + render: function (geoModel, ecModel, api, payload) { + // Not render if it is an toggleSelect action from self + if (payload && payload.type === 'geoToggleSelect' + && payload.from === this.uid + ) { + return; } - this.el.attr('show', true); - this._show = true; - }, - - /** - * Set tooltip content - * - * @param {string} content rich text string of content - * @param {Object} markerRich rich text style - * @param {Object} tooltipModel tooltip model - */ - setContent: function (content, markerRich, tooltipModel) { - if (this.el) { - this._zr.remove(this.el); + var mapDraw = this._mapDraw; + if (geoModel.get('show')) { + mapDraw.draw(geoModel, ecModel, api, this, payload); } - - var markers = {}; - var text = content; - var prefix = '{marker'; - var suffix = '|}'; - var startId = text.indexOf(prefix); - while (startId >= 0) { - var endId = text.indexOf(suffix); - var name = text.substr(startId + prefix.length, endId - startId - prefix.length); - markers['marker' + name] = { - textWidth: 12, - textHeight: 12, - textBorderRadius: 6, - textBackgroundColor: markerRich[name] - }; - - text = text.substr(endId + 1); - startId = text.indexOf('{marker'); + else { + this._mapDraw.group.removeAll(); } - this.el = new Text({ - style: { - rich: markers, - text: content, - textLineHeight: 20, - textBackgroundColor: tooltipModel.get('backgroundColor'), - textBorderRadius: tooltipModel.get('borderRadius'), - textFill: tooltipModel.get('textStyle.color'), - textPadding: tooltipModel.get('padding') - }, - z: tooltipModel.get('z') - }); - this._zr.add(this.el); - - var self = this; - this.el.on('mouseover', function () { - // clear the timeout in hideLater and keep showing tooltip - if (self._enterable) { - clearTimeout(self._hideTimeout); - self._show = true; - } - self._inContent = true; - }); - this.el.on('mouseout', function () { - if (self._enterable) { - if (self._show) { - self.hideLater(self._hideDelay); - } - } - self._inContent = false; - }); + this.group.silent = geoModel.get('silent'); }, - setEnterable: function (enterable) { - this._enterable = enterable; - }, + dispose: function () { + this._mapDraw && this._mapDraw.remove(); + } - getSize: function () { - var bounding = this.el.getBoundingRect(); - return [bounding.width, bounding.height]; - }, +}); - moveTo: function (x, y) { - if (this.el) { - this.el.attr('position', [x, y]); - } - }, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - hide: function () { - this.el.hide(); - this._show = false; - }, +function makeAction(method, actionInfo) { + actionInfo.update = 'updateView'; + registerAction(actionInfo, function (payload, ecModel) { + var selected = {}; - hideLater: function (time) { - if (this._show && !(this._inContent && this._enterable)) { - if (time) { - this._hideDelay = time; - // Set show false to avoid invoke hideLater mutiple times - this._show = false; - this._hideTimeout = setTimeout(bind(this.hide, this), time); - } - else { - this.hide(); + ecModel.eachComponent( + { mainType: 'geo', query: payload}, + function (geoModel) { + geoModel[method](payload.name); + var geo = geoModel.coordinateSystem; + each$1(geo.regions, function (region) { + selected[region.name] = geoModel.isSelected(region.name) || false; + }); } - } - }, + ); - isShow: function () { - return this._show; - }, + return { + selected: selected, + name: payload.name + }; + }); +} - getOuterSize: function () { - return this.getSize(); - } -}; +makeAction('toggleSelected', { + type: 'geoToggleSelect', + event: 'geoselectchanged' +}); +makeAction('select', { + type: 'geoSelect', + event: 'geoselected' +}); +makeAction('unSelect', { + type: 'geoUnSelect', + event: 'geounselected' +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -73251,815 +77172,468 @@ TooltipRichContent.prototype = { * under the License. */ -var bind$3 = bind; -var each$17 = each$1; -var parsePercent$2 = parsePercent$1; +// (24*60*60*1000) +var PROXIMATE_ONE_DAY = 86400000; -var proxyRect = new Rect({ - shape: {x: -1, y: -1, width: 2, height: 2} -}); +/** + * Calendar + * + * @constructor + * + * @param {Object} calendarModel calendarModel + * @param {Object} ecModel ecModel + * @param {Object} api api + */ +function Calendar(calendarModel, ecModel, api) { + this._model = calendarModel; +} -extendComponentView({ +Calendar.prototype = { - type: 'tooltip', + constructor: Calendar, - init: function (ecModel, api) { - if (env$1.node) { - return; - } + type: 'calendar', - var tooltipModel = ecModel.getComponent('tooltip'); - var renderMode = tooltipModel.get('renderMode'); - this._renderMode = 'html'; - if (renderMode === 'auto') { - // using html when `document` exists, use richText otherwise - this._renderMode = env$1.domSupported ? 'html' : 'richText'; - } - else { - this._renderMode = renderMode || this._renderMode; - } + dimensions: ['time', 'value'], - var tooltipContent; - if (this._renderMode === 'html') { - tooltipContent = new TooltipContent(api.getDom(), api); - this._newLine = '
'; - } - else { - tooltipContent = new TooltipRichContent(api); - this._newLine = '\n'; - } + // Required in createListFromData + getDimensionsInfo: function () { + return [{name: 'time', type: 'time'}, 'value']; + }, - this._tooltipContent = tooltipContent; + getRangeInfo: function () { + return this._rangeInfo; }, - render: function (tooltipModel, ecModel, api) { - if (env$1.node || env$1.wxa) { - return; - } + getModel: function () { + return this._model; + }, - // Reset - this.group.removeAll(); + getRect: function () { + return this._rect; + }, - /** - * @private - * @type {module:echarts/component/tooltip/TooltipModel} - */ - this._tooltipModel = tooltipModel; + getCellWidth: function () { + return this._sw; + }, - /** - * @private - * @type {module:echarts/model/Global} - */ - this._ecModel = ecModel; + getCellHeight: function () { + return this._sh; + }, - /** - * @private - * @type {module:echarts/ExtensionAPI} - */ - this._api = api; + getOrient: function () { + return this._orient; + }, - /** - * Should be cleaned when render. - * @private - * @type {Array.>} - */ - this._lastDataByCoordSys = null; + /** + * getFirstDayOfWeek + * + * @example + * 0 : start at Sunday + * 1 : start at Monday + * + * @return {number} + */ + getFirstDayOfWeek: function () { + return this._firstDayOfWeek; + }, - /** - * @private - * @type {boolean} - */ - this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); + /** + * get date info + * + * @param {string|number} date date + * @return {Object} + * { + * y: string, local full year, eg., '1940', + * m: string, local month, from '01' ot '12', + * d: string, local date, from '01' to '31' (if exists), + * day: It is not date.getDay(). It is the location of the cell in a week, from 0 to 6, + * time: timestamp, + * formatedDate: string, yyyy-MM-dd, + * date: original date object. + * } + */ + getDateInfo: function (date) { - var tooltipContent = this._tooltipContent; - tooltipContent.update(); - tooltipContent.setEnterable(tooltipModel.get('enterable')); + date = parseDate(date); - this._initGlobalListener(); + var y = date.getFullYear(); - this._keepShow(); - }, + var m = date.getMonth() + 1; + m = m < 10 ? '0' + m : m; - _initGlobalListener: function () { - var tooltipModel = this._tooltipModel; - var triggerOn = tooltipModel.get('triggerOn'); + var d = date.getDate(); + d = d < 10 ? '0' + d : d; - register( - 'itemTooltip', - this._api, - bind$3(function (currTrigger, e, dispatchAction) { - // If 'none', it is not controlled by mouse totally. - if (triggerOn !== 'none') { - if (triggerOn.indexOf(currTrigger) >= 0) { - this._tryShow(e, dispatchAction); - } - else if (currTrigger === 'leave') { - this._hide(dispatchAction); - } - } - }, this) - ); - }, + var day = date.getDay(); - _keepShow: function () { - var tooltipModel = this._tooltipModel; - var ecModel = this._ecModel; - var api = this._api; + day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); - // Try to keep the tooltip show when refreshing - if (this._lastX != null - && this._lastY != null - // When user is willing to control tooltip totally using API, - // self.manuallyShowTip({x, y}) might cause tooltip hide, - // which is not expected. - && tooltipModel.get('triggerOn') !== 'none' - ) { - var self = this; - clearTimeout(this._refreshUpdateTimeout); - this._refreshUpdateTimeout = setTimeout(function () { - // Show tip next tick after other charts are rendered - // In case highlight action has wrong result - // FIXME - self.manuallyShowTip(tooltipModel, ecModel, api, { - x: self._lastX, - y: self._lastY - }); - }); - } + return { + y: y, + m: m, + d: d, + day: day, + time: date.getTime(), + formatedDate: y + '-' + m + '-' + d, + date: date + }; }, - /** - * Show tip manually by - * dispatchAction({ - * type: 'showTip', - * x: 10, - * y: 10 - * }); - * Or - * dispatchAction({ - * type: 'showTip', - * seriesIndex: 0, - * dataIndex or dataIndexInside or name - * }); - * - * TODO Batch - */ - manuallyShowTip: function (tooltipModel, ecModel, api, payload) { - if (payload.from === this.uid || env$1.node) { - return; + getNextNDay: function (date, n) { + n = n || 0; + if (n === 0) { + return this.getDateInfo(date); } - var dispatchAction = makeDispatchAction$1(payload, api); + date = new Date(this.getDateInfo(date).time); + date.setDate(date.getDate() + n); - // Reset ticket - this._ticket = ''; + return this.getDateInfo(date); + }, - // When triggered from axisPointer. - var dataByCoordSys = payload.dataByCoordSys; + update: function (ecModel, api) { - if (payload.tooltip && payload.x != null && payload.y != null) { - var el = proxyRect; - el.position = [payload.x, payload.y]; - el.update(); - el.tooltip = payload.tooltip; - // Manually show tooltip while view is not using zrender elements. - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - target: el - }, dispatchAction); - } - else if (dataByCoordSys) { - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - position: payload.position, - event: {}, - dataByCoordSys: payload.dataByCoordSys, - tooltipOption: payload.tooltipOption - }, dispatchAction); - } - else if (payload.seriesIndex != null) { + this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay'); + this._orient = this._model.get('orient'); + this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0; - if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { - return; + + this._rangeInfo = this._getRangeInfo(this._initRangeOption()); + var weeks = this._rangeInfo.weeks || 1; + var whNames = ['width', 'height']; + var cellSize = this._model.get('cellSize').slice(); + var layoutParams = this._model.getBoxLayoutParams(); + var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; + + each$1([0, 1], function (idx) { + if (cellSizeSpecified(cellSize, idx)) { + layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; } + }); - var pointInfo = findPointFromSeries(payload, ecModel); - var cx = pointInfo.point[0]; - var cy = pointInfo.point[1]; - if (cx != null && cy != null) { - this._tryShow({ - offsetX: cx, - offsetY: cy, - position: payload.position, - target: pointInfo.el, - event: {} - }, dispatchAction); + var whGlobal = { + width: api.getWidth(), + height: api.getHeight() + }; + var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); + + each$1([0, 1], function (idx) { + if (!cellSizeSpecified(cellSize, idx)) { + cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; } - } - else if (payload.x != null && payload.y != null) { - // FIXME - // should wrap dispatchAction like `axisPointer/globalListener` ? - api.dispatchAction({ - type: 'updateAxisPointer', - x: payload.x, - y: payload.y - }); + }); - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - position: payload.position, - target: api.getZr().findHover(payload.x, payload.y).target, - event: {} - }, dispatchAction); + function cellSizeSpecified(cellSize, idx) { + return cellSize[idx] != null && cellSize[idx] !== 'auto'; } + + this._sw = cellSize[0]; + this._sh = cellSize[1]; }, - manuallyHideTip: function (tooltipModel, ecModel, api, payload) { - var tooltipContent = this._tooltipContent; - if (!this._alwaysShowContent && this._tooltipModel) { - tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); - } + /** + * Convert a time data(time, value) item to (x, y) point. + * + * @override + * @param {Array|number} data data + * @param {boolean} [clamp=true] out of range + * @return {Array} point + */ + dataToPoint: function (data, clamp) { + isArray(data) && (data = data[0]); + clamp == null && (clamp = true); - this._lastX = this._lastY = null; + var dayInfo = this.getDateInfo(data); + var range = this._rangeInfo; + var date = dayInfo.formatedDate; - if (payload.from !== this.uid) { - this._hide(makeDispatchAction$1(payload, api)); + // if not in range return [NaN, NaN] + if (clamp && !( + dayInfo.time >= range.start.time + && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY + )) { + return [NaN, NaN]; } - }, - // Be compatible with previous design, that is, when tooltip.type is 'axis' and - // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer - // and tooltip. - _manuallyAxisShowTip: function (tooltipModel, ecModel, api, payload) { - var seriesIndex = payload.seriesIndex; - var dataIndex = payload.dataIndex; - var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; + var week = dayInfo.day; + var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek; - if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { - return; - } + if (this._orient === 'vertical') { + return [ + this._rect.x + week * this._sw + this._sw / 2, + this._rect.y + nthWeek * this._sh + this._sh / 2 + ]; - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - if (!seriesModel) { - return; } - var data = seriesModel.getData(); - var tooltipModel = buildTooltipModel([ - data.getItemModel(dataIndex), - seriesModel, - (seriesModel.coordinateSystem || {}).model, - tooltipModel - ]); + return [ + this._rect.x + nthWeek * this._sw + this._sw / 2, + this._rect.y + week * this._sh + this._sh / 2 + ]; - if (tooltipModel.get('trigger') !== 'axis') { - return; - } + }, - api.dispatchAction({ - type: 'updateAxisPointer', - seriesIndex: seriesIndex, - dataIndex: dataIndex, - position: payload.position - }); + /** + * Convert a (x, y) point to time data + * + * @override + * @param {string} point point + * @return {string} data + */ + pointToData: function (point) { - return true; + var date = this.pointToDate(point); + + return date && date.time; }, - _tryShow: function (e, dispatchAction) { - var el = e.target; - var tooltipModel = this._tooltipModel; + /** + * Convert a time date item to (x, y) four point. + * + * @param {Array} data date[0] is date + * @param {boolean} [clamp=true] out of range + * @return {Object} point + */ + dataToRect: function (data, clamp) { + var point = this.dataToPoint(data, clamp); - if (!tooltipModel) { - return; - } + return { + contentShape: { + x: point[0] - (this._sw - this._lineWidth) / 2, + y: point[1] - (this._sh - this._lineWidth) / 2, + width: this._sw - this._lineWidth, + height: this._sh - this._lineWidth + }, - // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed - this._lastX = e.offsetX; - this._lastY = e.offsetY; + center: point, - var dataByCoordSys = e.dataByCoordSys; - if (dataByCoordSys && dataByCoordSys.length) { - this._showAxisTooltip(dataByCoordSys, e); - } - // Always show item tooltip if mouse is on the element with dataIndex - else if (el && el.dataIndex != null) { - this._lastDataByCoordSys = null; - this._showSeriesItemTooltip(e, el, dispatchAction); - } - // Tooltip provided directly. Like legend. - else if (el && el.tooltip) { - this._lastDataByCoordSys = null; - this._showComponentItemTooltip(e, el, dispatchAction); - } - else { - this._lastDataByCoordSys = null; - this._hide(dispatchAction); - } - }, + tl: [ + point[0] - this._sw / 2, + point[1] - this._sh / 2 + ], - _showOrMove: function (tooltipModel, cb) { - // showDelay is used in this case: tooltip.enterable is set - // as true. User intent to move mouse into tooltip and click - // something. `showDelay` makes it easyer to enter the content - // but tooltip do not move immediately. - var delay = tooltipModel.get('showDelay'); - cb = bind(cb, this); - clearTimeout(this._showTimout); - delay > 0 - ? (this._showTimout = setTimeout(cb, delay)) - : cb(); - }, + tr: [ + point[0] + this._sw / 2, + point[1] - this._sh / 2 + ], - _showAxisTooltip: function (dataByCoordSys, e) { - var ecModel = this._ecModel; - var globalTooltipModel = this._tooltipModel; - var point = [e.offsetX, e.offsetY]; - var singleDefaultHTML = []; - var singleParamsList = []; - var singleTooltipModel = buildTooltipModel([ - e.tooltipOption, - globalTooltipModel - ]); + br: [ + point[0] + this._sw / 2, + point[1] + this._sh / 2 + ], - var renderMode = this._renderMode; - var newLine = this._newLine; + bl: [ + point[0] - this._sw / 2, + point[1] + this._sh / 2 + ] - var markers = {}; + }; + }, - each$17(dataByCoordSys, function (itemCoordSys) { - // var coordParamList = []; - // var coordDefaultHTML = []; - // var coordTooltipModel = buildTooltipModel([ - // e.tooltipOption, - // itemCoordSys.tooltipOption, - // ecModel.getComponent(itemCoordSys.coordSysMainType, itemCoordSys.coordSysIndex), - // globalTooltipModel - // ]); - // var displayMode = coordTooltipModel.get('displayMode'); - // var paramsList = displayMode === 'single' ? singleParamsList : []; + /** + * Convert a (x, y) point to time date + * + * @param {Array} point point + * @return {Object} date + */ + pointToDate: function (point) { + var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; + var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; + var range = this._rangeInfo.range; - each$17(itemCoordSys.dataByAxis, function (item) { - var axisModel = ecModel.getComponent(item.axisDim + 'Axis', item.axisIndex); - var axisValue = item.value; - var seriesDefaultHTML = []; + if (this._orient === 'vertical') { + return this._getDateByWeeksAndDay(nthY, nthX - 1, range); + } - if (!axisModel || axisValue == null) { - return; - } + return this._getDateByWeeksAndDay(nthX, nthY - 1, range); + }, - var valueLabel = getValueLabel( - axisValue, axisModel.axis, ecModel, - item.seriesDataIndices, - item.valueLabelOpt - ); + /** + * @inheritDoc + */ + convertToPixel: curry(doConvert$2, 'dataToPoint'), - each$1(item.seriesDataIndices, function (idxItem) { - var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); - var dataIndex = idxItem.dataIndexInside; - var dataParams = series && series.getDataParams(dataIndex); - dataParams.axisDim = item.axisDim; - dataParams.axisIndex = item.axisIndex; - dataParams.axisType = item.axisType; - dataParams.axisId = item.axisId; - dataParams.axisValue = getAxisRawValue(axisModel.axis, axisValue); - dataParams.axisValueLabel = valueLabel; + /** + * @inheritDoc + */ + convertFromPixel: curry(doConvert$2, 'pointToData'), - if (dataParams) { - singleParamsList.push(dataParams); - var seriesTooltip = series.formatTooltip(dataIndex, true, null, renderMode); + /** + * initRange + * + * @private + * @return {Array} [start, end] + */ + _initRangeOption: function () { + var range = this._model.get('range'); - var html; - if (isObject$1(seriesTooltip)) { - html = seriesTooltip.html; - var newMarkers = seriesTooltip.markers; - merge(markers, newMarkers); - } - else { - html = seriesTooltip; - } - seriesDefaultHTML.push(html); - } - }); + var rg = range; - // Default tooltip content - // FIXME - // (1) shold be the first data which has name? - // (2) themeRiver, firstDataIndex is array, and first line is unnecessary. - var firstLine = valueLabel; - if (renderMode !== 'html') { - singleDefaultHTML.push(seriesDefaultHTML.join(newLine)); - } - else { - singleDefaultHTML.push( - (firstLine ? encodeHTML(firstLine) + newLine : '') - + seriesDefaultHTML.join(newLine) - ); - } - }); - }, this); + if (isArray(rg) && rg.length === 1) { + rg = rg[0]; + } - // In most case, the second axis is shown upper than the first one. - singleDefaultHTML.reverse(); - singleDefaultHTML = singleDefaultHTML.join(this._newLine + this._newLine); + if (/^\d{4}$/.test(rg)) { + range = [rg + '-01-01', rg + '-12-31']; + } - var positionExpr = e.position; - this._showOrMove(singleTooltipModel, function () { - if (this._updateContentNotChangedOnAxis(dataByCoordSys)) { - this._updatePosition( - singleTooltipModel, - positionExpr, - point[0], point[1], - this._tooltipContent, - singleParamsList - ); - } - else { - this._showTooltipContent( - singleTooltipModel, singleDefaultHTML, singleParamsList, Math.random(), - point[0], point[1], positionExpr, undefined, markers - ); - } - }); + if (/^\d{4}[\/|-]\d{1,2}$/.test(rg)) { - // Do not trigger events here, because this branch only be entered - // from dispatchAction. - }, + var start = this.getDateInfo(rg); + var firstDay = start.date; + firstDay.setMonth(firstDay.getMonth() + 1); - _showSeriesItemTooltip: function (e, el, dispatchAction) { - var ecModel = this._ecModel; - // Use dataModel in element if possible - // Used when mouseover on a element like markPoint or edge - // In which case, the data is not main data in series. - var seriesIndex = el.seriesIndex; - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - - // For example, graph link. - var dataModel = el.dataModel || seriesModel; - var dataIndex = el.dataIndex; - var dataType = el.dataType; - var data = dataModel.getData(); - - var tooltipModel = buildTooltipModel([ - data.getItemModel(dataIndex), - dataModel, - seriesModel && (seriesModel.coordinateSystem || {}).model, - this._tooltipModel - ]); - - var tooltipTrigger = tooltipModel.get('trigger'); - if (tooltipTrigger != null && tooltipTrigger !== 'item') { - return; + var end = this.getNextNDay(firstDay, -1); + range = [start.formatedDate, end.formatedDate]; } - var params = dataModel.getDataParams(dataIndex, dataType); - var seriesTooltip = dataModel.formatTooltip(dataIndex, false, dataType, this._renderMode); - var defaultHtml; - var markers; - if (isObject$1(seriesTooltip)) { - defaultHtml = seriesTooltip.html; - markers = seriesTooltip.markers; - } - else { - defaultHtml = seriesTooltip; - markers = null; + if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rg)) { + range = [rg, rg]; } - var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; - - this._showOrMove(tooltipModel, function () { - this._showTooltipContent( - tooltipModel, defaultHtml, params, asyncTicket, - e.offsetX, e.offsetY, e.position, e.target, markers - ); - }); - - // FIXME - // duplicated showtip if manuallyShowTip is called from dispatchAction. - dispatchAction({ - type: 'showTip', - dataIndexInside: dataIndex, - dataIndex: data.getRawIndex(dataIndex), - seriesIndex: seriesIndex, - from: this.uid - }); - }, + var tmp = this._getRangeInfo(range); - _showComponentItemTooltip: function (e, el, dispatchAction) { - var tooltipOpt = el.tooltip; - if (typeof tooltipOpt === 'string') { - var content = tooltipOpt; - tooltipOpt = { - content: content, - // Fixed formatter - formatter: content - }; + if (tmp.start.time > tmp.end.time) { + range.reverse(); } - var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel); - var defaultHtml = subTooltipModel.get('content'); - var asyncTicket = Math.random(); - - // Do not check whether `trigger` is 'none' here, because `trigger` - // only works on cooridinate system. In fact, we have not found case - // that requires setting `trigger` nothing on component yet. - - this._showOrMove(subTooltipModel, function () { - this._showTooltipContent( - subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, - asyncTicket, e.offsetX, e.offsetY, e.position, el - ); - }); - // If not dispatch showTip, tip may be hide triggered by axis. - dispatchAction({ - type: 'showTip', - from: this.uid - }); + return range; }, - _showTooltipContent: function ( - tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markers - ) { - // Reset ticket - this._ticket = ''; + /** + * range info + * + * @private + * @param {Array} range range ['2017-01-01', '2017-07-08'] + * If range[0] > range[1], they will not be reversed. + * @return {Object} obj + */ + _getRangeInfo: function (range) { + range = [ + this.getDateInfo(range[0]), + this.getDateInfo(range[1]) + ]; - if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { - return; + var reversed; + if (range[0].time > range[1].time) { + reversed = true; + range.reverse(); } - var tooltipContent = this._tooltipContent; + var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) + - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; - var formatter = tooltipModel.get('formatter'); - positionExpr = positionExpr || tooltipModel.get('position'); - var html = defaultHtml; + // Consider case1 (#11677 #10430): + // Set the system timezone as "UK", set the range to `['2016-07-01', '2016-12-31']` - if (formatter && typeof formatter === 'string') { - html = formatTpl(formatter, params, true); - } - else if (typeof formatter === 'function') { - var callback = bind$3(function (cbTicket, html) { - if (cbTicket === this._ticket) { - tooltipContent.setContent(html, markers, tooltipModel); - this._updatePosition( - tooltipModel, positionExpr, x, y, tooltipContent, params, el - ); - } - }, this); - this._ticket = asyncTicket; - html = formatter(params, asyncTicket, callback); + // Consider case2: + // Firstly set system timezone as "Time Zone: America/Toronto", + // ``` + // var first = new Date(1478412000000 - 3600 * 1000 * 2.5); + // var second = new Date(1478412000000); + // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; + // ``` + // will get wrong result because of DST. So we should fix it. + var date = new Date(range[0].time); + var startDateNum = date.getDate(); + var endDateNum = range[1].date.getDate(); + date.setDate(startDateNum + allDay - 1); + // The bias can not over a month, so just compare date. + var dateNum = date.getDate(); + if (dateNum !== endDateNum) { + var sign = date.getTime() - range[1].time > 0 ? 1 : -1; + while ( + (dateNum = date.getDate()) !== endDateNum + && (date.getTime() - range[1].time) * sign > 0 + ) { + allDay -= sign; + date.setDate(dateNum - sign); + } } - tooltipContent.setContent(html, markers, tooltipModel); - tooltipContent.show(tooltipModel); + var weeks = Math.floor((allDay + range[0].day + 6) / 7); + var nthWeek = reversed ? -weeks + 1 : weeks - 1; - this._updatePosition( - tooltipModel, positionExpr, x, y, tooltipContent, params, el - ); + reversed && range.reverse(); + + return { + range: [range[0].formatedDate, range[1].formatedDate], + start: range[0], + end: range[1], + allDay: allDay, + weeks: weeks, + // From 0. + nthWeek: nthWeek, + fweek: range[0].day, + lweek: range[1].day + }; }, /** - * @param {string|Function|Array.|Object} positionExpr - * @param {number} x Mouse x - * @param {number} y Mouse y - * @param {boolean} confine Whether confine tooltip content in view rect. - * @param {Object|} params - * @param {module:zrender/Element} el target element - * @param {module:echarts/ExtensionAPI} api - * @return {Array.} + * get date by nthWeeks and week day in range + * + * @private + * @param {number} nthWeek the week + * @param {number} day the week day + * @param {Array} range [d1, d2] + * @return {Object} */ - _updatePosition: function (tooltipModel, positionExpr, x, y, content, params, el) { - var viewWidth = this._api.getWidth(); - var viewHeight = this._api.getHeight(); - positionExpr = positionExpr || tooltipModel.get('position'); - - var contentSize = content.getSize(); - var align = tooltipModel.get('align'); - var vAlign = tooltipModel.get('verticalAlign'); - var rect = el && el.getBoundingRect().clone(); - el && rect.applyTransform(el.transform); - - if (typeof positionExpr === 'function') { - // Callback of position can be an array or a string specify the position - positionExpr = positionExpr([x, y], params, content.el, rect, { - viewSize: [viewWidth, viewHeight], - contentSize: contentSize.slice() - }); - } - - if (isArray(positionExpr)) { - x = parsePercent$2(positionExpr[0], viewWidth); - y = parsePercent$2(positionExpr[1], viewHeight); - } - else if (isObject$1(positionExpr)) { - positionExpr.width = contentSize[0]; - positionExpr.height = contentSize[1]; - var layoutRect = getLayoutRect( - positionExpr, {width: viewWidth, height: viewHeight} - ); - x = layoutRect.x; - y = layoutRect.y; - align = null; - // When positionExpr is left/top/right/bottom, - // align and verticalAlign will not work. - vAlign = null; - } - // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element - else if (typeof positionExpr === 'string' && el) { - var pos = calcTooltipPosition( - positionExpr, rect, contentSize - ); - x = pos[0]; - y = pos[1]; - } - else { - var pos = refixTooltipPosition( - x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20 - ); - x = pos[0]; - y = pos[1]; - } - - align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); - vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); + _getDateByWeeksAndDay: function (nthWeek, day, range) { + var rangeInfo = this._getRangeInfo(range); - if (tooltipModel.get('confine')) { - var pos = confineTooltipPosition( - x, y, content, viewWidth, viewHeight - ); - x = pos[0]; - y = pos[1]; + if (nthWeek > rangeInfo.weeks + || (nthWeek === 0 && day < rangeInfo.fweek) + || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) + ) { + return false; } - content.moveTo(x, y); - }, - - // FIXME - // Should we remove this but leave this to user? - _updateContentNotChangedOnAxis: function (dataByCoordSys) { - var lastCoordSys = this._lastDataByCoordSys; - var contentNotChanged = !!lastCoordSys - && lastCoordSys.length === dataByCoordSys.length; - - contentNotChanged && each$17(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { - var lastDataByAxis = lastItemCoordSys.dataByAxis || {}; - var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; - var thisDataByAxis = thisItemCoordSys.dataByAxis || []; - contentNotChanged &= lastDataByAxis.length === thisDataByAxis.length; - - contentNotChanged && each$17(lastDataByAxis, function (lastItem, indexAxis) { - var thisItem = thisDataByAxis[indexAxis] || {}; - var lastIndices = lastItem.seriesDataIndices || []; - var newIndices = thisItem.seriesDataIndices || []; - - contentNotChanged &= - lastItem.value === thisItem.value - && lastItem.axisType === thisItem.axisType - && lastItem.axisId === thisItem.axisId - && lastIndices.length === newIndices.length; - - contentNotChanged && each$17(lastIndices, function (lastIdxItem, j) { - var newIdxItem = newIndices[j]; - contentNotChanged &= - lastIdxItem.seriesIndex === newIdxItem.seriesIndex - && lastIdxItem.dataIndex === newIdxItem.dataIndex; - }); - }); - }); - - this._lastDataByCoordSys = dataByCoordSys; - - return !!contentNotChanged; - }, - - _hide: function (dispatchAction) { - // Do not directly hideLater here, because this behavior may be prevented - // in dispatchAction when showTip is dispatched. - - // FIXME - // duplicated hideTip if manuallyHideTip is called from dispatchAction. - this._lastDataByCoordSys = null; - dispatchAction({ - type: 'hideTip', - from: this.uid - }); - }, + var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; + var date = new Date(rangeInfo.start.time); + date.setDate(rangeInfo.start.d + nthDay); - dispose: function (ecModel, api) { - if (env$1.node || env$1.wxa) { - return; - } - this._tooltipContent.hide(); - unregister('itemTooltip', api); + return this.getDateInfo(date); } -}); +}; +Calendar.dimensions = Calendar.prototype.dimensions; -/** - * @param {Array.} modelCascade - * From top to bottom. (the last one should be globalTooltipModel); - */ -function buildTooltipModel(modelCascade) { - var resultModel = modelCascade.pop(); - while (modelCascade.length) { - var tooltipOpt = modelCascade.pop(); - if (tooltipOpt) { - if (Model.isInstance(tooltipOpt)) { - tooltipOpt = tooltipOpt.get('tooltip', true); - } - // In each data item tooltip can be simply write: - // { - // value: 10, - // tooltip: 'Something you need to know' - // } - if (typeof tooltipOpt === 'string') { - tooltipOpt = {formatter: tooltipOpt}; - } - resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel); - } - } - return resultModel; -} +Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; -function makeDispatchAction$1(payload, api) { - return payload.dispatchAction || bind(api.dispatchAction, api); -} +Calendar.create = function (ecModel, api) { + var calendarList = []; -function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) { - var size = content.getOuterSize(); - var width = size.width; - var height = size.height; + ecModel.eachComponent('calendar', function (calendarModel) { + var calendar = new Calendar(calendarModel, ecModel, api); + calendarList.push(calendar); + calendarModel.coordinateSystem = calendar; + }); - if (gapH != null) { - if (x + width + gapH > viewWidth) { - x -= width + gapH; - } - else { - x += gapH; - } - } - if (gapV != null) { - if (y + height + gapV > viewHeight) { - y -= height + gapV; - } - else { - y += gapV; + ecModel.eachSeries(function (calendarSeries) { + if (calendarSeries.get('coordinateSystem') === 'calendar') { + // Inject coordinate system + calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; } - } - return [x, y]; -} - -function confineTooltipPosition(x, y, content, viewWidth, viewHeight) { - var size = content.getOuterSize(); - var width = size.width; - var height = size.height; + }); + return calendarList; +}; - x = Math.min(x + width, viewWidth) - width; - y = Math.min(y + height, viewHeight) - height; - x = Math.max(x, 0); - y = Math.max(y, 0); +function doConvert$2(methodName, ecModel, finder, value) { + var calendarModel = finder.calendarModel; + var seriesModel = finder.seriesModel; - return [x, y]; -} + var coordSys = calendarModel + ? calendarModel.coordinateSystem + : seriesModel + ? seriesModel.coordinateSystem + : null; -function calcTooltipPosition(position, rect, contentSize) { - var domWidth = contentSize[0]; - var domHeight = contentSize[1]; - var gap = 5; - var x = 0; - var y = 0; - var rectWidth = rect.width; - var rectHeight = rect.height; - switch (position) { - case 'inside': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y + rectHeight / 2 - domHeight / 2; - break; - case 'top': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y - domHeight - gap; - break; - case 'bottom': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y + rectHeight + gap; - break; - case 'left': - x = rect.x - domWidth - gap; - y = rect.y + rectHeight / 2 - domHeight / 2; - break; - case 'right': - x = rect.x + rectWidth + gap; - y = rect.y + rectHeight / 2 - domHeight / 2; - } - return [x, y]; + return coordSys === this ? coordSys[methodName](value) : null; } -function isCenterAlign(align) { - return align === 'center' || align === 'middle'; -} +CoordinateSystemManager.register('calendar', Calendar); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -74080,333 +77654,134 @@ function isCenterAlign(align) { * under the License. */ -// FIXME Better way to pack data in graphic element - -/** - * @action - * @property {string} type - * @property {number} seriesIndex - * @property {number} dataIndex - * @property {number} [x] - * @property {number} [y] - */ -registerAction( - { - type: 'showTip', - event: 'showTip', - update: 'tooltip:manuallyShowTip' - }, - // noop - function () {} -); +var CalendarModel = ComponentModel.extend({ -registerAction( - { - type: 'hideTip', - event: 'hideTip', - update: 'tooltip:manuallyHideTip' - }, - // noop - function () {} -); + type: 'calendar', -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + /** + * @type {module:echarts/coord/calendar/Calendar} + */ + coordinateSystem: null, -function getSeriesStackId$1(seriesModel) { - return seriesModel.get('stack') - || '__ec_stack_' + seriesModel.seriesIndex; -} + defaultOption: { + zlevel: 0, + z: 2, + left: 80, + top: 60, -function getAxisKey$1(axis) { - return axis.dim; -} + cellSize: 20, -/** - * @param {string} seriesType - * @param {module:echarts/model/Global} ecModel - * @param {module:echarts/ExtensionAPI} api - */ -function barLayoutPolar(seriesType, ecModel, api) { + // horizontal vertical + orient: 'horizontal', - var width = api.getWidth(); - var height = api.getHeight(); + // month separate line style + splitLine: { + show: true, + lineStyle: { + color: '#000', + width: 1, + type: 'solid' + } + }, - var lastStackCoords = {}; + // rect style temporarily unused emphasis + itemStyle: { + color: '#fff', + borderWidth: 1, + borderColor: '#ccc' + }, - var barWidthAndOffset = calRadialBar( - filter( - ecModel.getSeriesByType(seriesType), - function (seriesModel) { - return !ecModel.isSeriesFiltered(seriesModel) - && seriesModel.coordinateSystem - && seriesModel.coordinateSystem.type === 'polar'; - } - ) - ); - - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - // Check series coordinate, do layout for polar only - if (seriesModel.coordinateSystem.type !== 'polar') { - return; - } - - var data = seriesModel.getData(); - var polar = seriesModel.coordinateSystem; - var baseAxis = polar.getBaseAxis(); - - var stackId = getSeriesStackId$1(seriesModel); - var columnLayoutInfo - = barWidthAndOffset[getAxisKey$1(baseAxis)][stackId]; - var columnOffset = columnLayoutInfo.offset; - var columnWidth = columnLayoutInfo.width; - var valueAxis = polar.getOtherAxis(baseAxis); - - var center = seriesModel.get('center') || ['50%', '50%']; - var cx = parsePercent$1(center[0], width); - var cy = parsePercent$1(center[1], height); - - var barMinHeight = seriesModel.get('barMinHeight') || 0; - var barMinAngle = seriesModel.get('barMinAngle') || 0; - - lastStackCoords[stackId] = lastStackCoords[stackId] || []; - - var valueDim = data.mapDimension(valueAxis.dim); - var baseDim = data.mapDimension(baseAxis.dim); - var stacked = isDimensionStacked(data, valueDim /*, baseDim*/); - - var valueAxisStart = valueAxis.getExtent()[0]; - - for (var idx = 0, len = data.count(); idx < len; idx++) { - var value = data.get(valueDim, idx); - var baseValue = data.get(baseDim, idx); - - if (isNaN(value)) { - continue; - } - - var sign = value >= 0 ? 'p' : 'n'; - var baseCoord = valueAxisStart; - - // Because of the barMinHeight, we can not use the value in - // stackResultDimension directly. - // Only ordinal axis can be stacked. - if (stacked) { - if (!lastStackCoords[stackId][baseValue]) { - lastStackCoords[stackId][baseValue] = { - p: valueAxisStart, // Positive stack - n: valueAxisStart // Negative stack - }; - } - // Should also consider #4243 - baseCoord = lastStackCoords[stackId][baseValue][sign]; - } - - var r0; - var r; - var startAngle; - var endAngle; - - // radial sector - if (valueAxis.dim === 'radius') { - var radiusSpan = valueAxis.dataToRadius(value) - valueAxisStart; - var angle = baseAxis.dataToAngle(baseValue); + // week text style + dayLabel: { + show: true, - if (Math.abs(radiusSpan) < barMinHeight) { - radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; - } + // a week first day + firstDay: 0, - r0 = baseCoord; - r = baseCoord + radiusSpan; - startAngle = angle - columnOffset; - endAngle = startAngle - columnWidth; + // start end + position: 'start', + margin: '50%', // 50% of cellSize + nameMap: 'en', + color: '#000' + }, - stacked && (lastStackCoords[stackId][baseValue][sign] = r); - } - // tangential sector - else { - // angleAxis must be clamped. - var angleSpan = valueAxis.dataToAngle(value, true) - valueAxisStart; - var radius = baseAxis.dataToRadius(baseValue); + // month text style + monthLabel: { + show: true, - if (Math.abs(angleSpan) < barMinAngle) { - angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; - } + // start end + position: 'start', + margin: 5, - r0 = radius + columnOffset; - r = r0 + columnWidth; - startAngle = baseCoord; - endAngle = baseCoord + angleSpan; + // center or left + align: 'center', - // if the previous stack is at the end of the ring, - // add a round to differentiate it from origin - // var extent = angleAxis.getExtent(); - // var stackCoord = angle; - // if (stackCoord === extent[0] && value > 0) { - // stackCoord = extent[1]; - // } - // else if (stackCoord === extent[1] && value < 0) { - // stackCoord = extent[0]; - // } - stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); - } + // cn en [] + nameMap: 'en', + formatter: null, + color: '#000' + }, - data.setItemLayout(idx, { - cx: cx, - cy: cy, - r0: r0, - r: r, - // Consider that positive angle is anti-clockwise, - // while positive radian of sector is clockwise - startAngle: -startAngle * Math.PI / 180, - endAngle: -endAngle * Math.PI / 180 - }); + // year text style + yearLabel: { + show: true, + // top bottom left right + position: null, + margin: 30, + formatter: null, + color: '#ccc', + fontFamily: 'sans-serif', + fontWeight: 'bolder', + fontSize: 20 } + }, - }, this); - -} - -/** - * Calculate bar width and offset for radial bar charts - */ -function calRadialBar(barSeries, api) { - // Columns info on each category axis. Key is polar name - var columnsMap = {}; - - each$1(barSeries, function (seriesModel, idx) { - var data = seriesModel.getData(); - var polar = seriesModel.coordinateSystem; + /** + * @override + */ + init: function (option, parentModel, ecModel, extraOpt) { + var inputPositionParams = getLayoutParams(option); - var baseAxis = polar.getBaseAxis(); + CalendarModel.superApply(this, 'init', arguments); - var axisExtent = baseAxis.getExtent(); - var bandWidth = baseAxis.type === 'category' - ? baseAxis.getBandWidth() - : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); + mergeAndNormalizeLayoutParams(option, inputPositionParams); + }, - var columnsOnAxis = columnsMap[getAxisKey$1(baseAxis)] || { - bandWidth: bandWidth, - remainedWidth: bandWidth, - autoWidthCount: 0, - categoryGap: '20%', - gap: '30%', - stacks: {} - }; - var stacks = columnsOnAxis.stacks; - columnsMap[getAxisKey$1(baseAxis)] = columnsOnAxis; + /** + * @override + */ + mergeOption: function (option, extraOpt) { + CalendarModel.superApply(this, 'mergeOption', arguments); - var stackId = getSeriesStackId$1(seriesModel); + mergeAndNormalizeLayoutParams(this.option, option); + } +}); - if (!stacks[stackId]) { - columnsOnAxis.autoWidthCount++; - } - stacks[stackId] = stacks[stackId] || { - width: 0, - maxWidth: 0 - }; +function mergeAndNormalizeLayoutParams(target, raw) { + // Normalize cellSize + var cellSize = target.cellSize; - var barWidth = parsePercent$1( - seriesModel.get('barWidth'), - bandWidth - ); - var barMaxWidth = parsePercent$1( - seriesModel.get('barMaxWidth'), - bandWidth - ); - var barGap = seriesModel.get('barGap'); - var barCategoryGap = seriesModel.get('barCategoryGap'); + if (!isArray(cellSize)) { + cellSize = target.cellSize = [cellSize, cellSize]; + } + else if (cellSize.length === 1) { + cellSize[1] = cellSize[0]; + } - if (barWidth && !stacks[stackId].width) { - barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); - stacks[stackId].width = barWidth; - columnsOnAxis.remainedWidth -= barWidth; + var ignoreSize = map([0, 1], function (hvIdx) { + // If user have set `width` or both `left` and `right`, cellSize + // will be automatically set to 'auto', otherwise the default + // setting of cellSize will make `width` setting not work. + if (sizeCalculable(raw, hvIdx)) { + cellSize[hvIdx] = 'auto'; } - - barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); - (barGap != null) && (columnsOnAxis.gap = barGap); - (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap); + return cellSize[hvIdx] != null && cellSize[hvIdx] !== 'auto'; }); - - var result = {}; - - each$1(columnsMap, function (columnsOnAxis, coordSysName) { - - result[coordSysName] = {}; - - var stacks = columnsOnAxis.stacks; - var bandWidth = columnsOnAxis.bandWidth; - var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); - var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); - - var remainedWidth = columnsOnAxis.remainedWidth; - var autoWidthCount = columnsOnAxis.autoWidthCount; - var autoWidth = (remainedWidth - categoryGap) - / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - - // Find if any auto calculated bar exceeded maxBarWidth - each$1(stacks, function (column, stack) { - var maxWidth = column.maxWidth; - if (maxWidth && maxWidth < autoWidth) { - maxWidth = Math.min(maxWidth, remainedWidth); - if (column.width) { - maxWidth = Math.min(maxWidth, column.width); - } - remainedWidth -= maxWidth; - column.width = maxWidth; - autoWidthCount--; - } - }); - - // Recalculate width again - autoWidth = (remainedWidth - categoryGap) - / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - - var widthSum = 0; - var lastColumn; - each$1(stacks, function (column, idx) { - if (!column.width) { - column.width = autoWidth; - } - lastColumn = column; - widthSum += column.width * (1 + barGapPercent); - }); - if (lastColumn) { - widthSum -= lastColumn.width * barGapPercent; - } - - var offset = -widthSum / 2; - each$1(stacks, function (column, stackId) { - result[coordSysName][stackId] = result[coordSysName][stackId] || { - offset: offset, - width: column.width - }; - - offset += column.width * (1 + barGapPercent); - }); + mergeLayoutParam(target, raw, { + type: 'box', ignoreSize: ignoreSize }); - - return result; } /* @@ -74428,349 +77803,477 @@ function calRadialBar(barSeries, api) { * under the License. */ -function RadiusAxis(scale, radiusExtent) { +var MONTH_TEXT = { + EN: [ + 'Jan', 'Feb', 'Mar', + 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec' + ], + CN: [ + '一月', '二月', '三月', + '四月', '五月', '六月', + '七月', '八月', '九月', + '十月', '十一月', '十二月' + ] +}; - Axis.call(this, 'radius', scale, radiusExtent); +var WEEK_TEXT = { + EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], + CN: ['日', '一', '二', '三', '四', '五', '六'] +}; + +extendComponentView({ + + type: 'calendar', /** - * Axis type - * - 'category' - * - 'value' - * - 'time' - * - 'log' - * @type {string} + * top/left line points + * @private */ - this.type = 'category'; -} - -RadiusAxis.prototype = { + _tlpoints: null, - constructor: RadiusAxis, + /** + * bottom/right line points + * @private + */ + _blpoints: null, /** - * @override + * first day of month + * @private */ - pointToData: function (point, clamp) { - return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; - }, + _firstDayOfMonth: null, - dataToRadius: Axis.prototype.dataToCoord, + /** + * first day point of month + * @private + */ + _firstDayPoints: null, - radiusToData: Axis.prototype.coordToData -}; + render: function (calendarModel, ecModel, api) { -inherits(RadiusAxis, Axis); + var group = this.group; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + group.removeAll(); -function AngleAxis(scale, angleExtent) { + var coordSys = calendarModel.coordinateSystem; - angleExtent = angleExtent || [0, 360]; + // range info + var rangeData = coordSys.getRangeInfo(); + var orient = coordSys.getOrient(); - Axis.call(this, 'angle', scale, angleExtent); + this._renderDayRect(calendarModel, rangeData, group); - /** - * Axis type - * - 'category' - * - 'value' - * - 'time' - * - 'log' - * @type {string} - */ - this.type = 'category'; -} + // _renderLines must be called prior to following function + this._renderLines(calendarModel, rangeData, orient, group); -AngleAxis.prototype = { + this._renderYearText(calendarModel, rangeData, orient, group); - constructor: AngleAxis, + this._renderMonthText(calendarModel, orient, group); - /** - * @override - */ - pointToData: function (point, clamp) { - return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; + this._renderWeekText(calendarModel, rangeData, orient, group); }, - dataToAngle: Axis.prototype.dataToCoord, + // render day rect + _renderDayRect: function (calendarModel, rangeData, group) { + var coordSys = calendarModel.coordinateSystem; + var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); + var sw = coordSys.getCellWidth(); + var sh = coordSys.getCellHeight(); - angleToData: Axis.prototype.coordToData -}; + for (var i = rangeData.start.time; + i <= rangeData.end.time; + i = coordSys.getNextNDay(i, 1).time + ) { -inherits(AngleAxis, Axis); + var point = coordSys.dataToRect([i], false).tl; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + // every rect + var rect = new Rect({ + shape: { + x: point[0], + y: point[1], + width: sw, + height: sh + }, + cursor: 'default', + style: itemRectStyleModel + }); -/** - * @module echarts/coord/polar/Polar - */ + group.add(rect); + } -/** - * @alias {module:echarts/coord/polar/Polar} - * @constructor - * @param {string} name - */ -var Polar = function (name) { + }, - /** - * @type {string} - */ - this.name = name || ''; + // render separate line + _renderLines: function (calendarModel, rangeData, orient, group) { - /** - * x of polar center - * @type {number} - */ - this.cx = 0; + var self = this; - /** - * y of polar center - * @type {number} - */ - this.cy = 0; + var coordSys = calendarModel.coordinateSystem; - /** - * @type {module:echarts/coord/polar/RadiusAxis} - * @private - */ - this._radiusAxis = new RadiusAxis(); + var lineStyleModel = calendarModel.getModel('splitLine.lineStyle').getLineStyle(); + var show = calendarModel.get('splitLine.show'); - /** - * @type {module:echarts/coord/polar/AngleAxis} - * @private - */ - this._angleAxis = new AngleAxis(); + var lineWidth = lineStyleModel.lineWidth; - this._radiusAxis.polar = this._angleAxis.polar = this; -}; + this._tlpoints = []; + this._blpoints = []; + this._firstDayOfMonth = []; + this._firstDayPoints = []; -Polar.prototype = { - type: 'polar', + var firstDay = rangeData.start; - axisPointerEnabled: true, + for (var i = 0; firstDay.time <= rangeData.end.time; i++) { + addPoints(firstDay.formatedDate); - constructor: Polar, + if (i === 0) { + firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); + } - /** - * @param {Array.} - * @readOnly - */ - dimensions: ['radius', 'angle'], + var date = firstDay.date; + date.setMonth(date.getMonth() + 1); + firstDay = coordSys.getDateInfo(date); + } - /** - * @type {module:echarts/coord/PolarModel} - */ - model: null, + addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); - /** - * If contain coord - * @param {Array.} point - * @return {boolean} - */ - containPoint: function (point) { - var coord = this.pointToCoord(point); - return this._radiusAxis.contain(coord[0]) - && this._angleAxis.contain(coord[1]); - }, + function addPoints(date) { - /** - * If contain data - * @param {Array.} data - * @return {boolean} - */ - containData: function (data) { - return this._radiusAxis.containData(data[0]) - && this._angleAxis.containData(data[1]); - }, + self._firstDayOfMonth.push(coordSys.getDateInfo(date)); + self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); + + var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); + + self._tlpoints.push(points[0]); + self._blpoints.push(points[points.length - 1]); + + show && self._drawSplitline(points, lineStyleModel, group); + } + + + // render top/left line + show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); + + // render bottom/right line + show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); - /** - * @param {string} dim - * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} - */ - getAxis: function (dim) { - return this['_' + dim + 'Axis']; }, - /** - * @return {Array.} - */ - getAxes: function () { - return [this._radiusAxis, this._angleAxis]; + // get points at both ends + _getEdgesPoints: function (points, lineWidth, orient) { + var rs = [points[0].slice(), points[points.length - 1].slice()]; + var idx = orient === 'horizontal' ? 0 : 1; + + // both ends of the line are extend half lineWidth + rs[0][idx] = rs[0][idx] - lineWidth / 2; + rs[1][idx] = rs[1][idx] + lineWidth / 2; + + return rs; }, - /** - * Get axes by type of scale - * @param {string} scaleType - * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} - */ - getAxesByScale: function (scaleType) { - var axes = []; - var angleAxis = this._angleAxis; - var radiusAxis = this._radiusAxis; - angleAxis.scale.type === scaleType && axes.push(angleAxis); - radiusAxis.scale.type === scaleType && axes.push(radiusAxis); + // render split line + _drawSplitline: function (points, lineStyleModel, group) { - return axes; + var poyline = new Polyline({ + z2: 20, + shape: { + points: points + }, + style: lineStyleModel + }); + + group.add(poyline); }, - /** - * @return {module:echarts/coord/polar/AngleAxis} - */ - getAngleAxis: function () { - return this._angleAxis; + // render month line of one week points + _getLinePointsOfOneWeek: function (calendarModel, date, orient) { + + var coordSys = calendarModel.coordinateSystem; + date = coordSys.getDateInfo(date); + + var points = []; + + for (var i = 0; i < 7; i++) { + + var tmpD = coordSys.getNextNDay(date.time, i); + var point = coordSys.dataToRect([tmpD.time], false); + + points[2 * tmpD.day] = point.tl; + points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; + } + + return points; + }, - /** - * @return {module:echarts/coord/polar/RadiusAxis} - */ - getRadiusAxis: function () { - return this._radiusAxis; + _formatterLabel: function (formatter, params) { + + if (typeof formatter === 'string' && formatter) { + return formatTplSimple(formatter, params); + } + + if (typeof formatter === 'function') { + return formatter(params); + } + + return params.nameMap; + }, - /** - * @param {module:echarts/coord/polar/Axis} - * @return {module:echarts/coord/polar/Axis} - */ - getOtherAxis: function (axis) { - var angleAxis = this._angleAxis; - return axis === angleAxis ? this._radiusAxis : angleAxis; + _yearTextPositionControl: function (textEl, point, orient, position, margin) { + + point = point.slice(); + var aligns = ['center', 'bottom']; + + if (position === 'bottom') { + point[1] += margin; + aligns = ['center', 'top']; + } + else if (position === 'left') { + point[0] -= margin; + } + else if (position === 'right') { + point[0] += margin; + aligns = ['center', 'top']; + } + else { // top + point[1] -= margin; + } + + var rotate = 0; + if (position === 'left' || position === 'right') { + rotate = Math.PI / 2; + } + + return { + rotation: rotate, + position: point, + style: { + textAlign: aligns[0], + textVerticalAlign: aligns[1] + } + }; }, - /** - * Base axis will be used on stacking. - * - * @return {module:echarts/coord/polar/Axis} - */ - getBaseAxis: function () { - return this.getAxesByScale('ordinal')[0] - || this.getAxesByScale('time')[0] - || this.getAngleAxis(); + // render year + _renderYearText: function (calendarModel, rangeData, orient, group) { + var yearLabel = calendarModel.getModel('yearLabel'); + + if (!yearLabel.get('show')) { + return; + } + + var margin = yearLabel.get('margin'); + var pos = yearLabel.get('position'); + + if (!pos) { + pos = orient !== 'horizontal' ? 'top' : 'left'; + } + + var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; + var xc = (points[0][0] + points[1][0]) / 2; + var yc = (points[0][1] + points[1][1]) / 2; + + var idx = orient === 'horizontal' ? 0 : 1; + + var posPoints = { + top: [xc, points[idx][1]], + bottom: [xc, points[1 - idx][1]], + left: [points[1 - idx][0], yc], + right: [points[idx][0], yc] + }; + + var name = rangeData.start.y; + + if (+rangeData.end.y > +rangeData.start.y) { + name = name + '-' + rangeData.end.y; + } + + var formatter = yearLabel.get('formatter'); + + var params = { + start: rangeData.start.y, + end: rangeData.end.y, + nameMap: name + }; + + var content = this._formatterLabel(formatter, params); + + var yearText = new Text({z2: 30}); + setTextStyle(yearText.style, yearLabel, {text: content}), + yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); + + group.add(yearText); }, - /** - * @param {string} [dim] 'radius' or 'angle' or 'auto' or null/undefined - * @return {Object} {baseAxes: [], otherAxes: []} - */ - getTooltipAxes: function (dim) { - var baseAxis = (dim != null && dim !== 'auto') - ? this.getAxis(dim) : this.getBaseAxis(); + _monthTextPositionControl: function (point, isCenter, orient, position, margin) { + var align = 'left'; + var vAlign = 'top'; + var x = point[0]; + var y = point[1]; + + if (orient === 'horizontal') { + y = y + margin; + + if (isCenter) { + align = 'center'; + } + + if (position === 'start') { + vAlign = 'bottom'; + } + } + else { + x = x + margin; + + if (isCenter) { + vAlign = 'middle'; + } + + if (position === 'start') { + align = 'right'; + } + } + return { - baseAxes: [baseAxis], - otherAxes: [this.getOtherAxis(baseAxis)] + x: x, + y: y, + textAlign: align, + textVerticalAlign: vAlign }; }, - /** - * Convert a single data item to (x, y) point. - * Parameter data is an array which the first element is radius and the second is angle - * @param {Array.} data - * @param {boolean} [clamp=false] - * @return {Array.} - */ - dataToPoint: function (data, clamp) { - return this.coordToPoint([ - this._radiusAxis.dataToRadius(data[0], clamp), - this._angleAxis.dataToAngle(data[1], clamp) - ]); + // render month and year text + _renderMonthText: function (calendarModel, orient, group) { + var monthLabel = calendarModel.getModel('monthLabel'); + + if (!monthLabel.get('show')) { + return; + } + + var nameMap = monthLabel.get('nameMap'); + var margin = monthLabel.get('margin'); + var pos = monthLabel.get('position'); + var align = monthLabel.get('align'); + + var termPoints = [this._tlpoints, this._blpoints]; + + if (isString(nameMap)) { + nameMap = MONTH_TEXT[nameMap.toUpperCase()] || []; + } + + var idx = pos === 'start' ? 0 : 1; + var axis = orient === 'horizontal' ? 0 : 1; + margin = pos === 'start' ? -margin : margin; + var isCenter = (align === 'center'); + + for (var i = 0; i < termPoints[idx].length - 1; i++) { + + var tmp = termPoints[idx][i].slice(); + var firstDay = this._firstDayOfMonth[i]; + + if (isCenter) { + var firstDayPoints = this._firstDayPoints[i]; + tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; + } + + var formatter = monthLabel.get('formatter'); + var name = nameMap[+firstDay.m - 1]; + var params = { + yyyy: firstDay.y, + yy: (firstDay.y + '').slice(2), + MM: firstDay.m, + M: +firstDay.m, + nameMap: name + }; + + var content = this._formatterLabel(formatter, params); + + var monthText = new Text({z2: 30}); + extend( + setTextStyle(monthText.style, monthLabel, {text: content}), + this._monthTextPositionControl(tmp, isCenter, orient, pos, margin) + ); + + group.add(monthText); + } }, - /** - * Convert a (x, y) point to data - * @param {Array.} point - * @param {boolean} [clamp=false] - * @return {Array.} - */ - pointToData: function (point, clamp) { - var coord = this.pointToCoord(point); - return [ - this._radiusAxis.radiusToData(coord[0], clamp), - this._angleAxis.angleToData(coord[1], clamp) - ]; + _weekTextPositionControl: function (point, orient, position, margin, cellSize) { + var align = 'center'; + var vAlign = 'middle'; + var x = point[0]; + var y = point[1]; + var isStart = position === 'start'; + + if (orient === 'horizontal') { + x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; + align = isStart ? 'right' : 'left'; + } + else { + y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; + vAlign = isStart ? 'bottom' : 'top'; + } + + return { + x: x, + y: y, + textAlign: align, + textVerticalAlign: vAlign + }; }, - /** - * Convert a (x, y) point to (radius, angle) coord - * @param {Array.} point - * @return {Array.} - */ - pointToCoord: function (point) { - var dx = point[0] - this.cx; - var dy = point[1] - this.cy; - var angleAxis = this.getAngleAxis(); - var extent = angleAxis.getExtent(); - var minAngle = Math.min(extent[0], extent[1]); - var maxAngle = Math.max(extent[0], extent[1]); - // Fix fixed extent in polarCreator - // FIXME - angleAxis.inverse - ? (minAngle = maxAngle - 360) - : (maxAngle = minAngle + 360); + // render weeks + _renderWeekText: function (calendarModel, rangeData, orient, group) { + var dayLabel = calendarModel.getModel('dayLabel'); - var radius = Math.sqrt(dx * dx + dy * dy); - dx /= radius; - dy /= radius; + if (!dayLabel.get('show')) { + return; + } - var radian = Math.atan2(-dy, dx) / Math.PI * 180; + var coordSys = calendarModel.coordinateSystem; + var pos = dayLabel.get('position'); + var nameMap = dayLabel.get('nameMap'); + var margin = dayLabel.get('margin'); + var firstDayOfWeek = coordSys.getFirstDayOfWeek(); - // move to angleExtent - var dir = radian < minAngle ? 1 : -1; - while (radian < minAngle || radian > maxAngle) { - radian += dir * 360; + if (isString(nameMap)) { + nameMap = WEEK_TEXT[nameMap.toUpperCase()] || []; } - return [radius, radian]; - }, + var start = coordSys.getNextNDay( + rangeData.end.time, (7 - rangeData.lweek) + ).time; - /** - * Convert a (radius, angle) coord to (x, y) point - * @param {Array.} coord - * @return {Array.} - */ - coordToPoint: function (coord) { - var radius = coord[0]; - var radian = coord[1] / 180 * Math.PI; - var x = Math.cos(radian) * radius + this.cx; - // Inverse the y - var y = -Math.sin(radian) * radius + this.cy; + var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; + margin = parsePercent$1(margin, cellSize[orient === 'horizontal' ? 0 : 1]); - return [x, y]; - } + if (pos === 'start') { + start = coordSys.getNextNDay( + rangeData.start.time, -(7 + rangeData.fweek) + ).time; + margin = -margin; + } -}; + for (var i = 0; i < 7; i++) { + + var tmpD = coordSys.getNextNDay(start, i); + var point = coordSys.dataToRect([tmpD.time], false).center; + var day = i; + day = Math.abs((i + firstDayOfWeek) % 7); + var weekText = new Text({z2: 30}); + + extend( + setTextStyle(weekText.style, dayLabel, {text: nameMap[day]}), + this._weekTextPositionControl(point, orient, pos, margin, cellSize) + ); + group.add(weekText); + } + } +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -74791,61 +78294,6 @@ Polar.prototype = { * under the License. */ -var PolarAxisModel = ComponentModel.extend({ - - type: 'polarAxis', - - /** - * @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} - */ - axis: null, - - /** - * @override - */ - getCoordSysModel: function () { - return this.ecModel.queryComponents({ - mainType: 'polar', - index: this.option.polarIndex, - id: this.option.polarId - })[0]; - } - -}); - -merge(PolarAxisModel.prototype, axisModelCommonMixin); - -var polarAxisDefaultExtendedOption = { - angle: { - // polarIndex: 0, - // polarId: '', - - startAngle: 90, - - clockwise: true, - - splitNumber: 12, - - axisLabel: { - rotate: false - } - }, - radius: { - // polarIndex: 0, - // polarId: '', - - splitNumber: 5 - } -}; - -function getAxisType$3(axisDim, option) { - // Default axis with data is category axis - return option.type || (option.data ? 'category' : 'value'); -} - -axisModelCreator('angle', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.angle); -axisModelCreator('radius', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.radius); - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -74865,470 +78313,573 @@ axisModelCreator('radius', PolarAxisModel, getAxisType$3, polarAxisDefaultExtend * under the License. */ -extendComponentModel({ +var _nonShapeGraphicElements = { - type: 'polar', + // Reserved but not supported in graphic component. + path: null, + compoundPath: null, - dependencies: ['polarAxis', 'angleAxis'], + // Supported in graphic component. + group: Group, + image: ZImage, + text: Text +}; - /** - * @type {module:echarts/coord/polar/Polar} - */ - coordinateSystem: null, - - /** - * @param {string} axisType - * @return {module:echarts/coord/polar/AxisModel} - */ - findAxisModel: function (axisType) { - var foundAxisModel; - var ecModel = this.ecModel; - - ecModel.eachComponent(axisType, function (axisModel) { - if (axisModel.getCoordSysModel() === this) { - foundAxisModel = axisModel; - } - }, this); - return foundAxisModel; - }, - - defaultOption: { - - zlevel: 0, - - z: 0, +// ------------- +// Preprocessor +// ------------- - center: ['50%', '50%'], +registerPreprocessor(function (option) { + var graphicOption = option.graphic; - radius: '80%' + // Convert + // {graphic: [{left: 10, type: 'circle'}, ...]} + // or + // {graphic: {left: 10, type: 'circle'}} + // to + // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} + if (isArray(graphicOption)) { + if (!graphicOption[0] || !graphicOption[0].elements) { + option.graphic = [{elements: graphicOption}]; + } + else { + // Only one graphic instance can be instantiated. (We dont + // want that too many views are created in echarts._viewMap) + option.graphic = [option.graphic[0]]; + } + } + else if (graphicOption && !graphicOption.elements) { + option.graphic = [{elements: [graphicOption]}]; } }); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +// ------ +// Model +// ------ -// TODO Axis scale +var GraphicModel = extendComponentModel({ -/** - * Resize method bound to the polar - * @param {module:echarts/coord/polar/PolarModel} polarModel - * @param {module:echarts/ExtensionAPI} api - */ -function resizePolar(polar, polarModel, api) { - var center = polarModel.get('center'); - var width = api.getWidth(); - var height = api.getHeight(); + type: 'graphic', - polar.cx = parsePercent$1(center[0], width); - polar.cy = parsePercent$1(center[1], height); + defaultOption: { - var radiusAxis = polar.getRadiusAxis(); - var size = Math.min(width, height) / 2; - var radius = parsePercent$1(polarModel.get('radius'), size); - radiusAxis.inverse - ? radiusAxis.setExtent(radius, 0) - : radiusAxis.setExtent(0, radius); -} + // Extra properties for each elements: + // + // left/right/top/bottom: (like 12, '22%', 'center', default undefined) + // If left/rigth is set, shape.x/shape.cx/position will not be used. + // If top/bottom is set, shape.y/shape.cy/position will not be used. + // This mechanism is useful when you want to position a group/element + // against the right side or the center of this container. + // + // width/height: (can only be pixel value, default 0) + // Only be used to specify contianer(group) size, if needed. And + // can not be percentage value (like '33%'). See the reason in the + // layout algorithm below. + // + // bounding: (enum: 'all' (default) | 'raw') + // Specify how to calculate boundingRect when locating. + // 'all': Get uioned and transformed boundingRect + // from both itself and its descendants. + // This mode simplies confining a group of elements in the bounding + // of their ancester container (e.g., using 'right: 0'). + // 'raw': Only use the boundingRect of itself and before transformed. + // This mode is similar to css behavior, which is useful when you + // want an element to be able to overflow its container. (Consider + // a rotated circle needs to be located in a corner.) + // info: custom info. enables user to mount some info on elements and use them + // in event handlers. Update them only when user specified, otherwise, remain. -/** - * Update polar - */ -function updatePolarScale(ecModel, api) { - var polar = this; - var angleAxis = polar.getAngleAxis(); - var radiusAxis = polar.getRadiusAxis(); - // Reset scale - angleAxis.scale.setExtent(Infinity, -Infinity); - radiusAxis.scale.setExtent(Infinity, -Infinity); + // Note: elements is always behind its ancestors in this elements array. + elements: [], + parentId: null + }, - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.coordinateSystem === polar) { - var data = seriesModel.getData(); - each$1(data.mapDimension('radius', true), function (dim) { - radiusAxis.scale.unionExtentFromData( - data, getStackedDimension(data, dim) - ); - }); - each$1(data.mapDimension('angle', true), function (dim) { - angleAxis.scale.unionExtentFromData( - data, getStackedDimension(data, dim) - ); - }); - } - }); + /** + * Save el options for the sake of the performance (only update modified graphics). + * The order is the same as those in option. (ancesters -> descendants) + * + * @private + * @type {Array.} + */ + _elOptionsToUpdate: null, - niceScaleExtent(angleAxis.scale, angleAxis.model); - niceScaleExtent(radiusAxis.scale, radiusAxis.model); + /** + * @override + */ + mergeOption: function (option) { + // Prevent default merge to elements + var elements = this.option.elements; + this.option.elements = null; - // Fix extent of category angle axis - if (angleAxis.type === 'category' && !angleAxis.onBand) { - var extent = angleAxis.getExtent(); - var diff = 360 / angleAxis.scale.count(); - angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff); - angleAxis.setExtent(extent[0], extent[1]); - } -} + GraphicModel.superApply(this, 'mergeOption', arguments); -/** - * Set common axis properties - * @param {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} - * @param {module:echarts/coord/polar/AxisModel} - * @inner - */ -function setAxis(axis, axisModel) { - axis.type = axisModel.get('type'); - axis.scale = createScaleByModel(axisModel); - axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; - axis.inverse = axisModel.get('inverse'); + this.option.elements = elements; + }, - if (axisModel.mainType === 'angleAxis') { - axis.inverse ^= axisModel.get('clockwise'); - var startAngle = axisModel.get('startAngle'); - axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360)); - } + /** + * @override + */ + optionUpdated: function (newOption, isInit) { + var thisOption = this.option; + var newList = (isInit ? thisOption : newOption).elements; + var existList = thisOption.elements = isInit ? [] : thisOption.elements; - // Inject axis instance - axisModel.axis = axis; - axis.model = axisModel; -} + var flattenedList = []; + this._flatten(newList, flattenedList); + var mappingResult = mappingToExists(existList, flattenedList); + makeIdAndName(mappingResult); -var polarCreator = { + // Clear elOptionsToUpdate + var elOptionsToUpdate = this._elOptionsToUpdate = []; - dimensions: Polar.prototype.dimensions, + each$1(mappingResult, function (resultItem, index) { + var newElOption = resultItem.option; - create: function (ecModel, api) { - var polarList = []; - ecModel.eachComponent('polar', function (polarModel, idx) { - var polar = new Polar(idx); - // Inject resize and update method - polar.update = updatePolarScale; + if (__DEV__) { + assert$1( + isObject$1(newElOption) || resultItem.exist, + 'Empty graphic option definition' + ); + } - var radiusAxis = polar.getRadiusAxis(); - var angleAxis = polar.getAngleAxis(); + if (!newElOption) { + return; + } - var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); - var angleAxisModel = polarModel.findAxisModel('angleAxis'); + elOptionsToUpdate.push(newElOption); - setAxis(radiusAxis, radiusAxisModel); - setAxis(angleAxis, angleAxisModel); + setKeyInfoToNewElOption(resultItem, newElOption); - resizePolar(polar, polarModel, api); + mergeNewElOptionToExist(existList, index, newElOption); - polarList.push(polar); + setLayoutInfoToExist(existList[index], newElOption); - polarModel.coordinateSystem = polar; - polar.model = polarModel; - }); - // Inject coordinateSystem to series - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'polar') { - var polarModel = ecModel.queryComponents({ - mainType: 'polar', - index: seriesModel.get('polarIndex'), - id: seriesModel.get('polarId') - })[0]; + }, this); - if (__DEV__) { - if (!polarModel) { - throw new Error( - 'Polar "' + retrieve( - seriesModel.get('polarIndex'), - seriesModel.get('polarId'), - 0 - ) + '" not found' - ); - } - } - seriesModel.coordinateSystem = polarModel.coordinateSystem; + // Clean + for (var i = existList.length - 1; i >= 0; i--) { + if (existList[i] == null) { + existList.splice(i, 1); } - }); - - return polarList; - } -}; - -CoordinateSystemManager.register('polar', polarCreator); - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + else { + // $action should be volatile, otherwise option gotten from + // `getOption` will contain unexpected $action. + delete existList[i].$action; + } + } + }, -var elementList$1 = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea']; + /** + * Convert + * [{ + * type: 'group', + * id: 'xx', + * children: [{type: 'circle'}, {type: 'polygon'}] + * }] + * to + * [ + * {type: 'group', id: 'xx'}, + * {type: 'circle', parentId: 'xx'}, + * {type: 'polygon', parentId: 'xx'} + * ] + * + * @private + * @param {Array.} optionList option list + * @param {Array.} result result of flatten + * @param {Object} parentOption parent option + */ + _flatten: function (optionList, result, parentOption) { + each$1(optionList, function (option) { + if (!option) { + return; + } -function getAxisLineShape(polar, rExtent, angle) { - rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); - var start = polar.coordToPoint([rExtent[0], angle]); - var end = polar.coordToPoint([rExtent[1], angle]); + if (parentOption) { + option.parentOption = parentOption; + } - return { - x1: start[0], - y1: start[1], - x2: end[0], - y2: end[1] - }; -} + result.push(option); -function getRadiusIdx(polar) { - var radiusAxis = polar.getRadiusAxis(); - return radiusAxis.inverse ? 0 : 1; -} + var children = option.children; + if (option.type === 'group' && children) { + this._flatten(children, result, option); + } + // Deleting for JSON output, and for not affecting group creation. + delete option.children; + }, this); + }, -// Remove the last tick which will overlap the first tick -function fixAngleOverlap(list) { - var firstItem = list[0]; - var lastItem = list[list.length - 1]; - if (firstItem - && lastItem - && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4 - ) { - list.pop(); + // FIXME + // Pass to view using payload? setOption has a payload? + useElOptionsToUpdate: function () { + var els = this._elOptionsToUpdate; + // Clear to avoid render duplicately when zooming. + this._elOptionsToUpdate = null; + return els; } -} - -AxisView.extend({ - - type: 'angleAxis', - - axisPointerClass: 'PolarAxisPointer', - - render: function (angleAxisModel, ecModel) { - this.group.removeAll(); - if (!angleAxisModel.get('show')) { - return; - } - - var angleAxis = angleAxisModel.axis; - var polar = angleAxis.polar; - var radiusExtent = polar.getRadiusAxis().getExtent(); +}); - var ticksAngles = angleAxis.getTicksCoords(); - var labels = map(angleAxis.getViewLabels(), function (labelItem) { - var labelItem = clone(labelItem); - labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue); - return labelItem; - }); +// ----- +// View +// ----- - fixAngleOverlap(labels); - fixAngleOverlap(ticksAngles); +extendComponentView({ - each$1(elementList$1, function (name) { - if (angleAxisModel.get(name +'.show') - && (!angleAxis.scale.isBlank() || name === 'axisLine') - ) { - this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels); - } - }, this); - }, + type: 'graphic', /** - * @private + * @override */ - _axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) { - var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle'); + init: function (ecModel, api) { - var circle = new Circle({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: radiusExtent[getRadiusIdx(polar)] - }, - style: lineStyleModel.getLineStyle(), - z2: 1, - silent: true - }); - circle.style.fill = null; + /** + * @private + * @type {module:zrender/core/util.HashMap} + */ + this._elMap = createHashMap(); - this.group.add(circle); + /** + * @private + * @type {module:echarts/graphic/GraphicModel} + */ + this._lastGraphicModel; }, /** - * @private + * @override */ - _axisTick: function (angleAxisModel, polar, ticksAngles, radiusExtent) { - var tickModel = angleAxisModel.getModel('axisTick'); + render: function (graphicModel, ecModel, api) { - var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length'); - var radius = radiusExtent[getRadiusIdx(polar)]; + // Having leveraged between use cases and algorithm complexity, a very + // simple layout mechanism is used: + // The size(width/height) can be determined by itself or its parent (not + // implemented yet), but can not by its children. (Top-down travel) + // The location(x/y) can be determined by the bounding rect of itself + // (can including its descendants or not) and the size of its parent. + // (Bottom-up travel) - var lines = map(ticksAngles, function (tickAngleItem) { - return new Line({ - shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) - }); - }); - this.group.add(mergePath( - lines, { - style: defaults( - tickModel.getModel('lineStyle').getLineStyle(), - { - stroke: angleAxisModel.get('axisLine.lineStyle.color') - } - ) - } - )); + // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, + // view will be reused. + if (graphicModel !== this._lastGraphicModel) { + this._clear(); + } + this._lastGraphicModel = graphicModel; + + this._updateElements(graphicModel); + this._relocate(graphicModel, api); }, /** + * Update graphic elements. + * * @private + * @param {Object} graphicModel graphic model */ - _axisLabel: function (angleAxisModel, polar, ticksAngles, radiusExtent, labels) { - var rawCategoryData = angleAxisModel.getCategories(true); + _updateElements: function (graphicModel) { + var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); - var commonLabelModel = angleAxisModel.getModel('axisLabel'); + if (!elOptionsToUpdate) { + return; + } - var labelMargin = commonLabelModel.get('margin'); + var elMap = this._elMap; + var rootGroup = this.group; - // Use length of ticksAngles because it may remove the last tick to avoid overlapping - each$1(labels, function (labelItem, idx) { - var labelModel = commonLabelModel; - var tickValue = labelItem.tickValue; + // Top-down tranverse to assign graphic settings to each elements. + each$1(elOptionsToUpdate, function (elOption) { + var $action = elOption.$action; + var id = elOption.id; + var existEl = elMap.get(id); + var parentId = elOption.parentId; + var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; - var r = radiusExtent[getRadiusIdx(polar)]; - var p = polar.coordToPoint([r + labelMargin, labelItem.coord]); - var cx = polar.cx; - var cy = polar.cy; + var elOptionStyle = elOption.style; + if (elOption.type === 'text' && elOptionStyle) { + // In top/bottom mode, textVerticalAlign should not be used, which cause + // inaccurately locating. + if (elOption.hv && elOption.hv[1]) { + elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = null; + } - var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 - ? 'center' : (p[0] > cx ? 'left' : 'right'); - var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 - ? 'middle' : (p[1] > cy ? 'top' : 'bottom'); + // Compatible with previous setting: both support fill and textFill, + // stroke and textStroke. + !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && ( + elOptionStyle.textFill = elOptionStyle.fill + ); + !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && ( + elOptionStyle.textStroke = elOptionStyle.stroke + ); + } - if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { - labelModel = new Model(rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel); + // Remove unnecessary props to avoid potential problems. + var elOptionCleaned = getCleanedElOption(elOption); + + // For simple, do not support parent change, otherwise reorder is needed. + if (__DEV__) { + existEl && assert$1( + targetElParent === existEl.parent, + 'Changing parent is not supported.' + ); } - var textEl = new Text({silent: true}); - this.group.add(textEl); - setTextStyle(textEl.style, labelModel, { - x: p[0], - y: p[1], - textFill: labelModel.getTextColor() || angleAxisModel.get('axisLine.lineStyle.color'), - text: labelItem.formattedLabel, - textAlign: labelTextAlign, - textVerticalAlign: labelTextVerticalAlign - }); - }, this); + if (!$action || $action === 'merge') { + existEl + ? existEl.attr(elOptionCleaned) + : createEl$1(id, targetElParent, elOptionCleaned, elMap); + } + else if ($action === 'replace') { + removeEl(existEl, elMap); + createEl$1(id, targetElParent, elOptionCleaned, elMap); + } + else if ($action === 'remove') { + removeEl(existEl, elMap); + } + + var el = elMap.get(id); + if (el) { + el.__ecGraphicWidthOption = elOption.width; + el.__ecGraphicHeightOption = elOption.height; + setEventData(el, graphicModel, elOption); + } + }); }, /** + * Locate graphic elements. + * * @private + * @param {Object} graphicModel graphic model + * @param {module:echarts/ExtensionAPI} api extension API */ - _splitLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) { - var splitLineModel = angleAxisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - var lineCount = 0; - - lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + _relocate: function (graphicModel, api) { + var elOptions = graphicModel.option.elements; + var rootGroup = this.group; + var elMap = this._elMap; + var apiWidth = api.getWidth(); + var apiHeight = api.getHeight(); - var splitLines = []; + // Top-down to calculate percentage width/height of group + for (var i = 0; i < elOptions.length; i++) { + var elOption = elOptions[i]; + var el = elMap.get(elOption.id); - for (var i = 0; i < ticksAngles.length; i++) { - var colorIndex = (lineCount++) % lineColors.length; - splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(new Line({ - shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) - })); + if (!el || !el.isGroup) { + continue; + } + var parentEl = el.parent; + var isParentRoot = parentEl === rootGroup; + // Like 'position:absolut' in css, default 0. + el.__ecGraphicWidth = parsePercent$1( + el.__ecGraphicWidthOption, + isParentRoot ? apiWidth : parentEl.__ecGraphicWidth + ) || 0; + el.__ecGraphicHeight = parsePercent$1( + el.__ecGraphicHeightOption, + isParentRoot ? apiHeight : parentEl.__ecGraphicHeight + ) || 0; } - // Simple optimization - // Batching the lines if color are the same - for (var i = 0; i < splitLines.length; i++) { - this.group.add(mergePath(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length] - }, lineStyleModel.getLineStyle()), - silent: true, - z: angleAxisModel.get('z') - })); + // Bottom-up tranvese all elements (consider ec resize) to locate elements. + for (var i = elOptions.length - 1; i >= 0; i--) { + var elOption = elOptions[i]; + var el = elMap.get(elOption.id); + + if (!el) { + continue; + } + + var parentEl = el.parent; + var containerInfo = parentEl === rootGroup + ? { + width: apiWidth, + height: apiHeight + } + : { + width: parentEl.__ecGraphicWidth, + height: parentEl.__ecGraphicHeight + }; + + // PENDING + // Currently, when `bounding: 'all'`, the union bounding rect of the group + // does not include the rect of [0, 0, group.width, group.height], which + // is probably weird for users. Should we make a break change for it? + positionElement( + el, elOption, containerInfo, null, + {hv: elOption.hv, boundingMode: elOption.bounding} + ); } }, /** + * Clear all elements. + * * @private */ - _splitArea: function (angleAxisModel, polar, ticksAngles, radiusExtent) { - if (!ticksAngles.length) { - return; - } + _clear: function () { + var elMap = this._elMap; + elMap.each(function (el) { + removeEl(el, elMap); + }); + this._elMap = createHashMap(); + }, - var splitAreaModel = angleAxisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); - var lineCount = 0; + /** + * @override + */ + dispose: function () { + this._clear(); + } +}); - areaColors = areaColors instanceof Array ? areaColors : [areaColors]; +function createEl$1(id, targetElParent, elOption, elMap) { + var graphicType = elOption.type; - var splitAreas = []; + if (__DEV__) { + assert$1(graphicType, 'graphic type MUST be set'); + } - var RADIAN = Math.PI / 180; - var prevAngle = -ticksAngles[0].coord * RADIAN; - var r0 = Math.min(radiusExtent[0], radiusExtent[1]); - var r1 = Math.max(radiusExtent[0], radiusExtent[1]); + var Clz = _nonShapeGraphicElements.hasOwnProperty(graphicType) + // Those graphic elements are not shapes. They should not be + // overwritten by users, so do them first. + ? _nonShapeGraphicElements[graphicType] + : getShapeClass(graphicType); - var clockwise = angleAxisModel.get('clockwise'); + if (__DEV__) { + assert$1(Clz, 'graphic type can not be found'); + } - for (var i = 1; i < ticksAngles.length; i++) { - var colorIndex = (lineCount++) % areaColors.length; - splitAreas[colorIndex] = splitAreas[colorIndex] || []; - splitAreas[colorIndex].push(new Sector({ - shape: { - cx: polar.cx, - cy: polar.cy, - r0: r0, - r: r1, - startAngle: prevAngle, - endAngle: -ticksAngles[i].coord * RADIAN, - clockwise: clockwise - }, - silent: true - })); - prevAngle = -ticksAngles[i].coord * RADIAN; + var el = new Clz(elOption); + targetElParent.add(el); + elMap.set(id, el); + el.__ecGraphicId = id; +} + +function removeEl(existEl, elMap) { + var existElParent = existEl && existEl.parent; + if (existElParent) { + existEl.type === 'group' && existEl.traverse(function (el) { + removeEl(el, elMap); + }); + elMap.removeKey(existEl.__ecGraphicId); + existElParent.remove(existEl); + } +} + +// Remove unnecessary props to avoid potential problems. +function getCleanedElOption(elOption) { + elOption = extend({}, elOption); + each$1( + ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS), + function (name) { + delete elOption[name]; } + ); + return elOption; +} - // Simple optimization - // Batching the lines if color are the same - for (var i = 0; i < splitAreas.length; i++) { - this.group.add(mergePath(splitAreas[i], { - style: defaults({ - fill: areaColors[i % areaColors.length] - }, areaStyleModel.getAreaStyle()), - silent: true - })); +function isSetLoc(obj, props) { + var isSet; + each$1(props, function (prop) { + obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); + }); + return isSet; +} + +function setKeyInfoToNewElOption(resultItem, newElOption) { + var existElOption = resultItem.exist; + + // Set id and type after id assigned. + newElOption.id = resultItem.keyInfo.id; + !newElOption.type && existElOption && (newElOption.type = existElOption.type); + + // Set parent id if not specified + if (newElOption.parentId == null) { + var newElParentOption = newElOption.parentOption; + if (newElParentOption) { + newElOption.parentId = newElParentOption.id; + } + else if (existElOption) { + newElOption.parentId = existElOption.parentId; } } -}); + + // Clear + newElOption.parentOption = null; +} + +function mergeNewElOptionToExist(existList, index, newElOption) { + // Update existing options, for `getOption` feature. + var newElOptCopy = extend({}, newElOption); + var existElOption = existList[index]; + + var $action = newElOption.$action || 'merge'; + if ($action === 'merge') { + if (existElOption) { + + if (__DEV__) { + var newType = newElOption.type; + assert$1( + !newType || existElOption.type === newType, + 'Please set $action: "replace" to change `type`' + ); + } + + // We can ensure that newElOptCopy and existElOption are not + // the same object, so `merge` will not change newElOptCopy. + merge(existElOption, newElOptCopy, true); + // Rigid body, use ignoreSize. + mergeLayoutParam(existElOption, newElOptCopy, {ignoreSize: true}); + // Will be used in render. + copyLayoutParams(newElOption, existElOption); + } + else { + existList[index] = newElOptCopy; + } + } + else if ($action === 'replace') { + existList[index] = newElOptCopy; + } + else if ($action === 'remove') { + // null will be cleaned later. + existElOption && (existList[index] = null); + } +} + +function setLayoutInfoToExist(existItem, newElOption) { + if (!existItem) { + return; + } + existItem.hv = newElOption.hv = [ + // Rigid body, dont care `width`. + isSetLoc(newElOption, ['left', 'right']), + // Rigid body, dont care `height`. + isSetLoc(newElOption, ['top', 'bottom']) + ]; + // Give default group size. Otherwise layout error may occur. + if (existItem.type === 'group') { + existItem.width == null && (existItem.width = newElOption.width = 0); + existItem.height == null && (existItem.height = newElOption.height = 0); + } +} + +function setEventData(el, graphicModel, elOption) { + var eventData = el.eventData; + // Simple optimize for large amount of elements that no need event. + if (!el.silent && !el.ignore && !eventData) { + eventData = el.eventData = { + componentType: 'graphic', + componentIndex: graphicModel.componentIndex, + name: el.name + }; + } + + // `elOption.info` enables user to mount some info on + // elements and use them in event handlers. + if (eventData) { + eventData.info = el.info; + } +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -75349,6 +78900,17 @@ AxisView.extend({ * under the License. */ + +var features = {}; + +function register$1(name, ctor) { + features[name] = ctor; +} + +function get$1(name) { + return features[name]; +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -75368,146 +78930,76 @@ AxisView.extend({ * under the License. */ -var axisBuilderAttrs$3 = [ - 'axisLine', 'axisTickLabel', 'axisName' -]; -var selfBuilderAttrs$1 = [ - 'splitLine', 'splitArea' -]; +var ToolboxModel = extendComponentModel({ -AxisView.extend({ + type: 'toolbox', - type: 'radiusAxis', + layoutMode: { + type: 'box', + ignoreSize: true + }, - axisPointerClass: 'PolarAxisPointer', + optionUpdated: function () { + ToolboxModel.superApply(this, 'optionUpdated', arguments); - render: function (radiusAxisModel, ecModel) { - this.group.removeAll(); - if (!radiusAxisModel.get('show')) { - return; - } - var radiusAxis = radiusAxisModel.axis; - var polar = radiusAxis.polar; - var angleAxis = polar.getAngleAxis(); - var ticksCoords = radiusAxis.getTicksCoords(); - var axisAngle = angleAxis.getExtent()[0]; - var radiusExtent = radiusAxis.getExtent(); + each$1(this.option.feature, function (featureOpt, featureName) { + var Feature = get$1(featureName); + Feature && merge(featureOpt, Feature.defaultOption); + }); + }, - var layout = layoutAxis(polar, radiusAxisModel, axisAngle); - var axisBuilder = new AxisBuilder(radiusAxisModel, layout); - each$1(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); - this.group.add(axisBuilder.getGroup()); + defaultOption: { - each$1(selfBuilderAttrs$1, function (name) { - if (radiusAxisModel.get(name +'.show') && !radiusAxis.scale.isBlank()) { - this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords); - } - }, this); - }, + show: true, - /** - * @private - */ - _splitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { - var splitLineModel = radiusAxisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - var lineCount = 0; + z: 6, - lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + zlevel: 0, - var splitLines = []; + orient: 'horizontal', - for (var i = 0; i < ticksCoords.length; i++) { - var colorIndex = (lineCount++) % lineColors.length; - splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(new Circle({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: ticksCoords[i].coord - }, - silent: true - })); - } + left: 'right', - // Simple optimization - // Batching the lines if color are the same - for (var i = 0; i < splitLines.length; i++) { - this.group.add(mergePath(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length], - fill: null - }, lineStyleModel.getLineStyle()), - silent: true - })); - } - }, + top: 'top', - /** - * @private - */ - _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { - if (!ticksCoords.length) { - return; - } + // right + // bottom - var splitAreaModel = radiusAxisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); - var lineCount = 0; + backgroundColor: 'transparent', - areaColors = areaColors instanceof Array ? areaColors : [areaColors]; + borderColor: '#ccc', - var splitAreas = []; + borderRadius: 0, - var prevRadius = ticksCoords[0].coord; - for (var i = 1; i < ticksCoords.length; i++) { - var colorIndex = (lineCount++) % areaColors.length; - splitAreas[colorIndex] = splitAreas[colorIndex] || []; - splitAreas[colorIndex].push(new Sector({ - shape: { - cx: polar.cx, - cy: polar.cy, - r0: prevRadius, - r: ticksCoords[i].coord, - startAngle: 0, - endAngle: Math.PI * 2 - }, - silent: true - })); - prevRadius = ticksCoords[i].coord; - } + borderWidth: 0, - // Simple optimization - // Batching the lines if color are the same - for (var i = 0; i < splitAreas.length; i++) { - this.group.add(mergePath(splitAreas[i], { - style: defaults({ - fill: areaColors[i % areaColors.length] - }, areaStyleModel.getAreaStyle()), - silent: true - })); + padding: 5, + + itemSize: 15, + + itemGap: 8, + + showTitle: true, + + iconStyle: { + borderColor: '#666', + color: 'none' + }, + emphasis: { + iconStyle: { + borderColor: '#3E98C5' + } + }, + // textStyle: {}, + + // feature + + tooltip: { + show: false } } }); -/** - * @inner - */ -function layoutAxis(polar, radiusAxisModel, axisAngle) { - return { - position: [polar.cx, polar.cy], - rotation: axisAngle / 180 * Math.PI, - labelDirection: -1, - tickDirection: -1, - nameDirection: 1, - labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'), - // Over splitLine and splitArea - z2: 1 - }; -} - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -75527,6 +79019,66 @@ function layoutAxis(polar, radiusAxisModel, axisAngle) { * under the License. */ +/** + * Layout list like component. + * It will box layout each items in group of component and then position the whole group in the viewport + * @param {module:zrender/group/Group} group + * @param {module:echarts/model/Component} componentModel + * @param {module:echarts/ExtensionAPI} + */ +function layout$3(group, componentModel, api) { + var boxLayoutParams = componentModel.getBoxLayoutParams(); + var padding = componentModel.get('padding'); + var viewportSize = {width: api.getWidth(), height: api.getHeight()}; + + var rect = getLayoutRect( + boxLayoutParams, + viewportSize, + padding + ); + + box( + componentModel.get('orient'), + group, + componentModel.get('itemGap'), + rect.width, + rect.height + ); + + positionElement( + group, + boxLayoutParams, + viewportSize, + padding + ); +} + +function makeBackground(rect, componentModel) { + var padding = normalizeCssArray$1( + componentModel.get('padding') + ); + var style = componentModel.getItemStyle(['color', 'opacity']); + style.fill = componentModel.get('backgroundColor'); + var rect = new Rect({ + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[1] + padding[3], + height: rect.height + padding[0] + padding[2], + r: componentModel.get('borderRadius') + }, + style: style, + silent: true, + z2: -1 + }); + // FIXME + // `subPixelOptimizeRect` may bring some gap between edge of viewpart + // and background rect when setting like `left: 0`, `top: 0`. + // graphic.subPixelOptimizeRect(rect); + + return rect; +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -75546,164 +79098,269 @@ function layoutAxis(polar, radiusAxisModel, axisAngle) { * under the License. */ -var PolarAxisPointer = BaseAxisPointer.extend({ - - /** - * @override - */ - makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { - var axis = axisModel.axis; +extendComponentView({ - if (axis.dim === 'angle') { - this.animationThreshold = Math.PI / 18; - } + type: 'toolbox', - var polar = axis.polar; - var otherAxis = polar.getOtherAxis(axis); - var otherExtent = otherAxis.getExtent(); - - var coordValue; - coordValue = axis['dataTo' + capitalFirst(axis.dim)](value); + render: function (toolboxModel, ecModel, api, payload) { + var group = this.group; + group.removeAll(); - var axisPointerType = axisPointerModel.get('type'); - if (axisPointerType && axisPointerType !== 'none') { - var elStyle = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder$2[axisPointerType]( - axis, polar, coordValue, otherExtent, elStyle - ); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; + if (!toolboxModel.get('show')) { + return; } - var labelMargin = axisPointerModel.get('label.margin'); - var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); - buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); - } + var itemSize = +toolboxModel.get('itemSize'); + var featureOpts = toolboxModel.get('feature') || {}; + var features = this._features || (this._features = {}); - // Do not support handle, utill any user requires it. + var featureNames = []; + each$1(featureOpts, function (opt, name) { + featureNames.push(name); + }); -}); + (new DataDiffer(this._featureNames || [], featureNames)) + .add(processFeature) + .update(processFeature) + .remove(curry(processFeature, null)) + .execute(); -function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { - var axis = axisModel.axis; - var coord = axis.dataToCoord(value); - var axisAngle = polar.getAngleAxis().getExtent()[0]; - axisAngle = axisAngle / 180 * Math.PI; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var position; - var align; - var verticalAlign; + // Keep for diff. + this._featureNames = featureNames; - if (axis.dim === 'radius') { - var transform = create$1(); - rotate(transform, transform, axisAngle); - translate(transform, transform, [polar.cx, polar.cy]); - position = applyTransform$1([coord, -labelMargin], transform); + function processFeature(newIndex, oldIndex) { + var featureName = featureNames[newIndex]; + var oldName = featureNames[oldIndex]; + var featureOpt = featureOpts[featureName]; + var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel); + var feature; - var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; - var labelLayout = AxisBuilder.innerTextLayout( - axisAngle, labelRotation * Math.PI / 180, -1 - ); - align = labelLayout.textAlign; - verticalAlign = labelLayout.textVerticalAlign; - } - else { // angle axis - var r = radiusExtent[1]; - position = polar.coordToPoint([r + labelMargin, coord]); - var cx = polar.cx; - var cy = polar.cy; - align = Math.abs(position[0] - cx) / r < 0.3 - ? 'center' : (position[0] > cx ? 'left' : 'right'); - verticalAlign = Math.abs(position[1] - cy) / r < 0.3 - ? 'middle' : (position[1] > cy ? 'top' : 'bottom'); - } + // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ? + if (payload && payload.newTitle != null && payload.featureName === featureName) { + featureOpt.title = payload.newTitle; + } - return { - position: position, - align: align, - verticalAlign: verticalAlign - }; -} + if (featureName && !oldName) { // Create + if (isUserFeatureName(featureName)) { + feature = { + model: featureModel, + onclick: featureModel.option.onclick, + featureName: featureName + }; + } + else { + var Feature = get$1(featureName); + if (!Feature) { + return; + } + feature = new Feature(featureModel, ecModel, api); + } + features[featureName] = feature; + } + else { + feature = features[oldName]; + // If feature does not exsit. + if (!feature) { + return; + } + feature.model = featureModel; + feature.ecModel = ecModel; + feature.api = api; + } + if (!featureName && oldName) { + feature.dispose && feature.dispose(ecModel, api); + return; + } -var pointerShapeBuilder$2 = { + if (!featureModel.get('show') || feature.unusable) { + feature.remove && feature.remove(ecModel, api); + return; + } - line: function (axis, polar, coordValue, otherExtent, elStyle) { - return axis.dim === 'angle' - ? { - type: 'Line', - shape: makeLineShape( - polar.coordToPoint([otherExtent[0], coordValue]), - polar.coordToPoint([otherExtent[1], coordValue]) - ) + createIconPaths(featureModel, feature, featureName); + + featureModel.setIconStatus = function (iconName, status) { + var option = this.option; + var iconPaths = this.iconPaths; + option.iconStatus = option.iconStatus || {}; + option.iconStatus[iconName] = status; + // FIXME + iconPaths[iconName] && iconPaths[iconName].trigger(status); + }; + + if (feature.render) { + feature.render(featureModel, ecModel, api, payload); } - : { - type: 'Circle', - shape: { - cx: polar.cx, - cy: polar.cy, - r: coordValue + } + + function createIconPaths(featureModel, feature, featureName) { + var iconStyleModel = featureModel.getModel('iconStyle'); + var iconStyleEmphasisModel = featureModel.getModel('emphasis.iconStyle'); + + // If one feature has mutiple icon. they are orginaized as + // { + // icon: { + // foo: '', + // bar: '' + // }, + // title: { + // foo: '', + // bar: '' + // } + // } + var icons = feature.getIcons ? feature.getIcons() : featureModel.get('icon'); + var titles = featureModel.get('title') || {}; + if (typeof icons === 'string') { + var icon = icons; + var title = titles; + icons = {}; + titles = {}; + icons[featureName] = icon; + titles[featureName] = title; + } + var iconPaths = featureModel.iconPaths = {}; + each$1(icons, function (iconStr, iconName) { + var path = createIcon( + iconStr, + {}, + { + x: -itemSize / 2, + y: -itemSize / 2, + width: itemSize, + height: itemSize + } + ); + path.setStyle(iconStyleModel.getItemStyle()); + path.hoverStyle = iconStyleEmphasisModel.getItemStyle(); + + // Text position calculation + path.setStyle({ + text: titles[iconName], + textAlign: iconStyleEmphasisModel.get('textAlign'), + textBorderRadius: iconStyleEmphasisModel.get('textBorderRadius'), + textPadding: iconStyleEmphasisModel.get('textPadding'), + textFill: null + }); + + var tooltipModel = toolboxModel.getModel('tooltip'); + if (tooltipModel && tooltipModel.get('show')) { + path.attr('tooltip', extend({ + content: titles[iconName], + formatter: tooltipModel.get('formatter', true) + || function () { + return titles[iconName]; + }, + formatterParams: { + componentType: 'toolbox', + name: iconName, + title: titles[iconName], + $vars: ['name', 'title'] + }, + position: tooltipModel.get('position', true) || 'bottom' + }, tooltipModel.option)); } - }; - }, - shadow: function (axis, polar, coordValue, otherExtent, elStyle) { - var bandWidth = Math.max(1, axis.getBandWidth()); - var radian = Math.PI / 180; + setHoverStyle(path); - return axis.dim === 'angle' - ? { - type: 'Sector', - shape: makeSectorShape( - polar.cx, polar.cy, - otherExtent[0], otherExtent[1], - // In ECharts y is negative if angle is positive - (-coordValue - bandWidth / 2) * radian, - (-coordValue + bandWidth / 2) * radian - ) + if (toolboxModel.get('showTitle')) { + path.__title = titles[iconName]; + path.on('mouseover', function () { + // Should not reuse above hoverStyle, which might be modified. + var hoverStyle = iconStyleEmphasisModel.getItemStyle(); + var defaultTextPosition = toolboxModel.get('orient') === 'vertical' + ? (toolboxModel.get('right') == null ? 'right' : 'left') + : (toolboxModel.get('bottom') == null ? 'bottom' : 'top'); + path.setStyle({ + textFill: iconStyleEmphasisModel.get('textFill') + || hoverStyle.fill || hoverStyle.stroke || '#000', + textBackgroundColor: iconStyleEmphasisModel.get('textBackgroundColor'), + textPosition: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition + }); + }) + .on('mouseout', function () { + path.setStyle({ + textFill: null, + textBackgroundColor: null + }); + }); + } + path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal'); + + group.add(path); + path.on('click', bind( + feature.onclick, feature, ecModel, api, iconName + )); + + iconPaths[iconName] = path; + }); + } + + layout$3(group, toolboxModel, api); + // Render background after group is layout + // FIXME + group.add(makeBackground(group.getBoundingRect(), toolboxModel)); + + // Adjust icon title positions to avoid them out of screen + group.eachChild(function (icon) { + var titleText = icon.__title; + var hoverStyle = icon.hoverStyle; + // May be background element + if (hoverStyle && titleText) { + var rect = getBoundingRect( + titleText, makeFont(hoverStyle) + ); + var offsetX = icon.position[0] + group.position[0]; + var offsetY = icon.position[1] + group.position[1] + itemSize; + + var needPutOnTop = false; + if (offsetY + rect.height > api.getHeight()) { + hoverStyle.textPosition = 'top'; + needPutOnTop = true; + } + var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8); + if (offsetX + rect.width / 2 > api.getWidth()) { + hoverStyle.textPosition = ['100%', topOffset]; + hoverStyle.textAlign = 'right'; + } + else if (offsetX - rect.width / 2 < 0) { + hoverStyle.textPosition = [0, topOffset]; + hoverStyle.textAlign = 'left'; + } } - : { - type: 'Sector', - shape: makeSectorShape( - polar.cx, polar.cy, - coordValue - bandWidth / 2, - coordValue + bandWidth / 2, - 0, Math.PI * 2 - ) - }; - } -}; + }); + }, -AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); + updateView: function (toolboxModel, ecModel, api, payload) { + each$1(this._features, function (feature) { + feature.updateView && feature.updateView(feature.model, ecModel, api, payload); + }); + }, -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + // updateLayout: function (toolboxModel, ecModel, api, payload) { + // zrUtil.each(this._features, function (feature) { + // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); + // }); + // }, -// For reducing size of echarts.min, barLayoutPolar is required by polar. -registerLayout(curry(barLayoutPolar, 'bar')); + remove: function (ecModel, api) { + each$1(this._features, function (feature) { + feature.remove && feature.remove(ecModel, api); + }); + this.group.removeAll(); + }, -// Polar view -extendComponentView({ - type: 'polar' + dispose: function (ecModel, api) { + each$1(this._features, function (feature) { + feature.dispose && feature.dispose(ecModel, api); + }); + } }); +function isUserFeatureName(featureName) { + return featureName.indexOf('my') === 0; +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -75723,153 +79380,85 @@ extendComponentView({ * under the License. */ -var GeoModel = ComponentModel.extend({ - - type: 'geo', - - /** - * @type {module:echarts/coord/geo/Geo} - */ - coordinateSystem: null, - - layoutMode: 'box', - - init: function (option) { - ComponentModel.prototype.init.apply(this, arguments); - - // Default label emphasis `show` - defaultEmphasis(option, 'label', ['show']); - }, - - optionUpdated: function () { - var option = this.option; - var self = this; - - option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap); - - this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { - if (regionOpt.name) { - optionModelMap.set(regionOpt.name, new Model(regionOpt, self)); - } - return optionModelMap; - }, createHashMap()); - - this.updateSelectedMap(option.regions); - }, - - defaultOption: { - - zlevel: 0, - - z: 0, - - show: true, - - left: 'center', - - top: 'center', - - - // width:, - // height:, - // right - // bottom - - // Aspect is width / height. Inited to be geoJson bbox aspect - // This parameter is used for scale this aspect - // If svg used, aspectScale is 1 by default. - // aspectScale: 0.75, - aspectScale: null, - - ///// Layout with center and size - // If you wan't to put map in a fixed size box with right aspect ratio - // This two properties may more conveninet - // layoutCenter: [50%, 50%] - // layoutSize: 100 - - silent: false, - - // Map type - map: '', - - // Define left-top, right-bottom coords to control view - // For example, [ [180, 90], [-180, -90] ] - boundingCoords: null, - - // Default on center of map - center: null, +/* global Uint8Array */ - zoom: 1, +var saveAsImageLang = lang.toolbox.saveAsImage; - scaleLimit: null, +function SaveAsImage(model) { + this.model = model; +} - // selectedMode: false +SaveAsImage.defaultOption = { + show: true, + icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0', + title: saveAsImageLang.title, + type: 'png', + // Default use option.backgroundColor + // backgroundColor: '#fff', + connectedBackgroundColor: '#fff', + name: '', + excludeComponents: ['toolbox'], + pixelRatio: 1, + lang: saveAsImageLang.lang.slice() +}; - label: { - show: false, - color: '#000' - }, +SaveAsImage.prototype.unusable = !env$1.canvasSupported; - itemStyle: { - // color: 各异, - borderWidth: 0.5, - borderColor: '#444', - color: '#eee' - }, +var proto$2 = SaveAsImage.prototype; - emphasis: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' +proto$2.onclick = function (ecModel, api) { + var model = this.model; + var title = model.get('name') || ecModel.get('title.0.text') || 'echarts'; + var isSvg = api.getZr().painter.getType() === 'svg'; + var type = isSvg ? 'svg' : model.get('type', true) || 'png'; + var url = api.getConnectedDataURL({ + type: type, + backgroundColor: model.get('backgroundColor', true) + || ecModel.get('backgroundColor') || '#fff', + connectedBackgroundColor: model.get('connectedBackgroundColor'), + excludeComponents: model.get('excludeComponents'), + pixelRatio: model.get('pixelRatio') + }); + // Chrome and Firefox + if (typeof MouseEvent === 'function' && !env$1.browser.ie && !env$1.browser.edge) { + var $a = document.createElement('a'); + $a.download = title + '.' + type; + $a.target = '_blank'; + $a.href = url; + var evt = new MouseEvent('click', { + view: window, + bubbles: true, + cancelable: false + }); + $a.dispatchEvent(evt); + } + // IE + else { + if (window.navigator.msSaveOrOpenBlob) { + var bstr = atob(url.split(',')[1]); + var n = bstr.length; + var u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); } - }, - - regions: [] - }, - - /** - * Get model of region - * @param {string} name - * @return {module:echarts/model/Model} - */ - getRegionModel: function (name) { - return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); - }, - - /** - * Format label - * @param {string} name Region name - * @param {string} [status='normal'] 'normal' or 'emphasis' - * @return {string} - */ - getFormattedLabel: function (name, status) { - var regionModel = this.getRegionModel(name); - var formatter = regionModel.get('label.' + status + '.formatter'); - var params = { - name: name - }; - if (typeof formatter === 'function') { - params.status = status; - return formatter(params); + var blob = new Blob([u8arr]); + window.navigator.msSaveOrOpenBlob(blob, title + '.' + type); } - else if (typeof formatter === 'string') { - return formatter.replace('{a}', name != null ? name : ''); + else { + var lang$$1 = model.get('lang'); + var html = '' + + '' + + '' + + ''; + var tab = window.open(); + tab.document.write(html); } - }, - - setZoom: function (zoom) { - this.option.zoom = zoom; - }, - - setCenter: function (center) { - this.option.center = center; } -}); +}; -mixin(GeoModel, selectableMixin); +register$1( + 'saveAsImage', SaveAsImage +); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -75890,97 +79479,179 @@ mixin(GeoModel, selectableMixin); * under the License. */ -extendComponentView({ - - type: 'geo', +var magicTypeLang = lang.toolbox.magicType; +var INNER_STACK_KEYWORD = '__ec_magicType_stack__'; - init: function (ecModel, api) { - var mapDraw = new MapDraw(api, true); - this._mapDraw = mapDraw; +function MagicType(model) { + this.model = model; +} - this.group.add(mapDraw.group); +MagicType.defaultOption = { + show: true, + type: [], + // Icon group + icon: { + /* eslint-disable */ + line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4', + bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7', + stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line + /* eslint-enable */ }, + // `line`, `bar`, `stack`, `tiled` + title: clone(magicTypeLang.title), + option: {}, + seriesIndex: {} +}; - render: function (geoModel, ecModel, api, payload) { - // Not render if it is an toggleSelect action from self - if (payload && payload.type === 'geoToggleSelect' - && payload.from === this.uid - ) { - return; +var proto$3 = MagicType.prototype; + +proto$3.getIcons = function () { + var model = this.model; + var availableIcons = model.get('icon'); + var icons = {}; + each$1(model.get('type'), function (type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; } + }); + return icons; +}; - var mapDraw = this._mapDraw; - if (geoModel.get('show')) { - mapDraw.draw(geoModel, ecModel, api, this, payload); +var seriesOptGenreator = { + 'line': function (seriesType, seriesId, seriesModel, model) { + if (seriesType === 'bar') { + return merge({ + id: seriesId, + type: 'line', + // Preserve data related option + data: seriesModel.get('data'), + stack: seriesModel.get('stack'), + markPoint: seriesModel.get('markPoint'), + markLine: seriesModel.get('markLine') + }, model.get('option.line') || {}, true); } - else { - this._mapDraw.group.removeAll(); + }, + 'bar': function (seriesType, seriesId, seriesModel, model) { + if (seriesType === 'line') { + return merge({ + id: seriesId, + type: 'bar', + // Preserve data related option + data: seriesModel.get('data'), + stack: seriesModel.get('stack'), + markPoint: seriesModel.get('markPoint'), + markLine: seriesModel.get('markLine') + }, model.get('option.bar') || {}, true); } - - this.group.silent = geoModel.get('silent'); }, + 'stack': function (seriesType, seriesId, seriesModel, model) { + var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD; + if (seriesType === 'line' || seriesType === 'bar') { + model.setIconStatus('stack', isStack ? 'normal' : 'emphasis'); + return merge({ + id: seriesId, + stack: isStack ? '' : INNER_STACK_KEYWORD + }, model.get('option.stack') || {}, true); + } + } +}; - dispose: function () { - this._mapDraw && this._mapDraw.remove(); +var radioTypes = [ + ['line', 'bar'], + ['stack'] +]; + +proto$3.onclick = function (ecModel, api, type) { + var model = this.model; + var seriesIndex = model.get('seriesIndex.' + type); + // Not supported magicType + if (!seriesOptGenreator[type]) { + return; } + var newOption = { + series: [] + }; + var generateNewSeriesTypes = function (seriesModel) { + var seriesType = seriesModel.subType; + var seriesId = seriesModel.id; + var newSeriesOpt = seriesOptGenreator[type]( + seriesType, seriesId, seriesModel, model + ); + if (newSeriesOpt) { + // PENDING If merge original option? + defaults(newSeriesOpt, seriesModel.option); + newOption.series.push(newSeriesOpt); + } + // Modify boundaryGap + var coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { + var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; + if (categoryAxis) { + var axisDim = categoryAxis.dim; + var axisType = axisDim + 'Axis'; + var axisModel = ecModel.queryComponents({ + mainType: axisType, + index: seriesModel.get(name + 'Index'), + id: seriesModel.get(name + 'Id') + })[0]; + var axisIndex = axisModel.componentIndex; -}); + newOption[axisType] = newOption[axisType] || []; + for (var i = 0; i <= axisIndex; i++) { + newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; + } + newOption[axisType][axisIndex].boundaryGap = type === 'bar'; + } + } + }; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + each$1(radioTypes, function (radio) { + if (indexOf(radio, type) >= 0) { + each$1(radio, function (item) { + model.setIconStatus(item, 'normal'); + }); + } + }); -function makeAction(method, actionInfo) { - actionInfo.update = 'updateView'; - registerAction(actionInfo, function (payload, ecModel) { - var selected = {}; + model.setIconStatus(type, 'emphasis'); - ecModel.eachComponent( - { mainType: 'geo', query: payload}, - function (geoModel) { - geoModel[method](payload.name); - var geo = geoModel.coordinateSystem; - each$1(geo.regions, function (region) { - selected[region.name] = geoModel.isSelected(region.name) || false; - }); + ecModel.eachComponent( + { + mainType: 'series', + query: seriesIndex == null ? null : { + seriesIndex: seriesIndex } - ); + }, generateNewSeriesTypes + ); - return { - selected: selected, - name: payload.name - }; + var newTitle; + // Change title of stack + if (type === 'stack') { + var isStack = newOption.series && newOption.series[0] && newOption.series[0].stack === INNER_STACK_KEYWORD; + newTitle = isStack + ? merge({ stack: magicTypeLang.title.tiled }, magicTypeLang.title) + : clone(magicTypeLang.title); + } + + api.dispatchAction({ + type: 'changeMagicType', + currentType: type, + newOption: newOption, + newTitle: newTitle, + featureName: 'magicType' }); -} +}; -makeAction('toggleSelected', { - type: 'geoToggleSelect', - event: 'geoselectchanged' -}); -makeAction('select', { - type: 'geoSelect', - event: 'geoselected' -}); -makeAction('unSelect', { - type: 'geoUnSelect', - event: 'geounselected' +registerAction({ + type: 'changeMagicType', + event: 'magicTypeChanged', + update: 'prepareAndUpdate' +}, function (payload, ecModel) { + ecModel.mergeOption(payload.newOption); }); +register$1('magicType', MagicType); + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -76000,420 +79671,454 @@ makeAction('unSelect', { * under the License. */ -var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear']; +var dataViewLang = lang.toolbox.dataView; -var preprocessor$1 = function (option, isNew) { - var brushComponents = option && option.brush; - if (!isArray(brushComponents)) { - brushComponents = brushComponents ? [brushComponents] : []; - } +var BLOCK_SPLITER = new Array(60).join('-'); +var ITEM_SPLITER = '\t'; +/** + * Group series into two types + * 1. on category axis, like line, bar + * 2. others, like scatter, pie + * @param {module:echarts/model/Global} ecModel + * @return {Object} + * @inner + */ +function groupSeries(ecModel) { + var seriesGroupByCategoryAxis = {}; + var otherSeries = []; + var meta = []; + ecModel.eachRawSeries(function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; - if (!brushComponents.length) { - return; - } + if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) { + var baseAxis = coordSys.getBaseAxis(); + if (baseAxis.type === 'category') { + var key = baseAxis.dim + '_' + baseAxis.index; + if (!seriesGroupByCategoryAxis[key]) { + seriesGroupByCategoryAxis[key] = { + categoryAxis: baseAxis, + valueAxis: coordSys.getOtherAxis(baseAxis), + series: [] + }; + meta.push({ + axisDim: baseAxis.dim, + axisIndex: baseAxis.index + }); + } + seriesGroupByCategoryAxis[key].series.push(seriesModel); + } + else { + otherSeries.push(seriesModel); + } + } + else { + otherSeries.push(seriesModel); + } + }); - var brushComponentSpecifiedBtns = []; + return { + seriesGroupByCategoryAxis: seriesGroupByCategoryAxis, + other: otherSeries, + meta: meta + }; +} - each$1(brushComponents, function (brushOpt) { - var tbs = brushOpt.hasOwnProperty('toolbox') - ? brushOpt.toolbox : []; +/** + * Assemble content of series on cateogory axis + * @param {Array.} series + * @return {string} + * @inner + */ +function assembleSeriesWithCategoryAxis(series) { + var tables = []; + each$1(series, function (group, key) { + var categoryAxis = group.categoryAxis; + var valueAxis = group.valueAxis; + var valueAxisDim = valueAxis.dim; - if (tbs instanceof Array) { - brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); + var headers = [' '].concat(map(group.series, function (series) { + return series.name; + })); + var columns = [categoryAxis.model.getCategories()]; + each$1(group.series, function (series) { + columns.push(series.getRawData().mapArray(valueAxisDim, function (val) { + return val; + })); + }); + // Assemble table content + var lines = [headers.join(ITEM_SPLITER)]; + for (var i = 0; i < columns[0].length; i++) { + var items = []; + for (var j = 0; j < columns.length; j++) { + items.push(columns[j][i]); + } + lines.push(items.join(ITEM_SPLITER)); } + tables.push(lines.join('\n')); }); + return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); +} - var toolbox = option && option.toolbox; - - if (isArray(toolbox)) { - toolbox = toolbox[0]; - } - if (!toolbox) { - toolbox = {feature: {}}; - option.toolbox = [toolbox]; - } - - var toolboxFeature = (toolbox.feature || (toolbox.feature = {})); - var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); - var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); +/** + * Assemble content of other series + * @param {Array.} series + * @return {string} + * @inner + */ +function assembleOtherSeries(series) { + return map(series, function (series) { + var data = series.getRawData(); + var lines = [series.name]; + var vals = []; + data.each(data.dimensions, function () { + var argLen = arguments.length; + var dataIndex = arguments[argLen - 1]; + var name = data.getName(dataIndex); + for (var i = 0; i < argLen - 1; i++) { + vals[i] = arguments[i]; + } + lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER)); + }); + return lines.join('\n'); + }).join('\n\n' + BLOCK_SPLITER + '\n\n'); +} - brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); +/** + * @param {module:echarts/model/Global} + * @return {Object} + * @inner + */ +function getContentFromModel(ecModel) { - removeDuplicate(brushTypes); + var result = groupSeries(ecModel); - if (isNew && !brushTypes.length) { - brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); - } -}; + return { + value: filter([ + assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), + assembleOtherSeries(result.other) + ], function (str) { + return str.replace(/[\n\t\s]/g, ''); + }).join('\n\n' + BLOCK_SPLITER + '\n\n'), -function removeDuplicate(arr) { - var map$$1 = {}; - each$1(arr, function (val) { - map$$1[val] = 1; - }); - arr.length = 0; - each$1(map$$1, function (flag, val) { - arr.push(val); - }); + meta: result.meta + }; } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +function trim$1(str) { + return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); +} /** - * @file Visual solution, for consistent option specification. + * If a block is tsv format */ - -var each$19 = each$1; - -function hasKeys(obj) { - if (obj) { - for (var name in obj){ - if (obj.hasOwnProperty(name)) { - return true; - } - } +function isTSVFormat(block) { + // Simple method to find out if a block is tsv format + var firstLine = block.slice(0, block.indexOf('\n')); + if (firstLine.indexOf(ITEM_SPLITER) >= 0) { + return true; } } +var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g'); /** - * @param {Object} option - * @param {Array.} stateList - * @param {Function} [supplementVisualOption] - * @return {Object} visualMappings > + * @param {string} tsv + * @return {Object} */ -function createVisualMappings(option, stateList, supplementVisualOption) { - var visualMappings = {}; - - each$19(stateList, function (state) { - var mappings = visualMappings[state] = createMappings(); - - each$19(option[state], function (visualData, visualType) { - if (!VisualMapping.isValidType(visualType)) { - return; - } - var mappingOption = { - type: visualType, - visual: visualData - }; - supplementVisualOption && supplementVisualOption(mappingOption, state); - mappings[visualType] = new VisualMapping(mappingOption); +function parseTSVContents(tsv) { + var tsvLines = tsv.split(/\n+/g); + var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); - // Prepare a alpha for opacity, for some case that opacity - // is not supported, such as rendering using gradient color. - if (visualType === 'opacity') { - mappingOption = clone(mappingOption); - mappingOption.type = 'colorAlpha'; - mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); - } - }); + var categories = []; + var series = map(headers, function (header) { + return { + name: header, + data: [] + }; }); - - return visualMappings; - - function createMappings() { - var Creater = function () {}; - // Make sure hidden fields will not be visited by - // object iteration (with hasOwnProperty checking). - Creater.prototype.__hidden = Creater.prototype; - var obj = new Creater(); - return obj; + for (var i = 0; i < tsvLines.length; i++) { + var items = trim$1(tsvLines[i]).split(itemSplitRegex); + categories.push(items.shift()); + for (var j = 0; j < items.length; j++) { + series[j] && (series[j].data[i] = items[j]); + } } + return { + series: series, + categories: categories + }; } /** - * @param {Object} thisOption - * @param {Object} newOption - * @param {Array.} keys + * @param {string} str + * @return {Array.} + * @inner */ -function replaceVisualOption(thisOption, newOption, keys) { - // Visual attributes merge is not supported, otherwise it - // brings overcomplicated merge logic. See #2853. So if - // newOption has anyone of these keys, all of these keys - // will be reset. Otherwise, all keys remain. - var has; - each$1(keys, function (key) { - if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { - has = true; - } - }); - has && each$1(keys, function (key) { - if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { - thisOption[key] = clone(newOption[key]); +function parseListContents(str) { + var lines = str.split(/\n+/g); + var seriesName = trim$1(lines.shift()); + + var data = []; + for (var i = 0; i < lines.length; i++) { + var items = trim$1(lines[i]).split(itemSplitRegex); + var name = ''; + var value; + var hasName = false; + if (isNaN(items[0])) { // First item is name + hasName = true; + name = items[0]; + items = items.slice(1); + data[i] = { + name: name, + value: [] + }; + value = data[i].value; } else { - delete thisOption[key]; + value = data[i] = []; } - }); + for (var j = 0; j < items.length; j++) { + value.push(+items[j]); + } + if (value.length === 1) { + hasName ? (data[i].value = value[0]) : (data[i] = value[0]); + } + } + + return { + name: seriesName, + data: data + }; } /** - * @param {Array.} stateList - * @param {Object} visualMappings > - * @param {module:echarts/data/List} list - * @param {Function} getValueState param: valueOrIndex, return: state. - * @param {object} [scope] Scope for getValueState - * @param {string} [dimension] Concrete dimension, if used. + * @param {string} str + * @param {Array.} blockMetaList + * @return {Object} + * @inner */ -// ???! handle brush? -function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { - var visualTypesMap = {}; - each$1(stateList, function (state) { - var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); - visualTypesMap[state] = visualTypes; - }); - - var dataIndex; +function parseContents(str, blockMetaList) { + var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); + var newOption = { + series: [] + }; + each$1(blocks, function (block, idx) { + if (isTSVFormat(block)) { + var result = parseTSVContents(block); + var blockMeta = blockMetaList[idx]; + var axisKey = blockMeta.axisDim + 'Axis'; - function getVisual(key) { - return data.getItemVisual(dataIndex, key); - } + if (blockMeta) { + newOption[axisKey] = newOption[axisKey] || []; + newOption[axisKey][blockMeta.axisIndex] = { + data: result.categories + }; + newOption.series = newOption.series.concat(result.series); + } + } + else { + var result = parseListContents(block); + newOption.series.push(result); + } + }); + return newOption; +} - function setVisual(key, value) { - data.setItemVisual(dataIndex, key, value); - } +/** + * @alias {module:echarts/component/toolbox/feature/DataView} + * @constructor + * @param {module:echarts/model/Model} model + */ +function DataView(model) { - if (dimension == null) { - data.each(eachItem); - } - else { - data.each([dimension], eachItem); - } + this._dom = null; - function eachItem(valueOrIndex, index) { - dataIndex = dimension == null ? valueOrIndex : index; + this.model = model; +} - var rawDataItem = data.getRawDataItem(dataIndex); - // Consider performance - if (rawDataItem && rawDataItem.visualMap === false) { - return; - } +DataView.defaultOption = { + show: true, + readOnly: false, + optionToContent: null, + contentToOption: null, - var valueState = getValueState.call(scope, valueOrIndex); - var mappings = visualMappings[valueState]; - var visualTypes = visualTypesMap[valueState]; + icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28', + title: clone(dataViewLang.title), + lang: clone(dataViewLang.lang), + backgroundColor: '#fff', + textColor: '#000', + textareaColor: '#fff', + textareaBorderColor: '#333', + buttonColor: '#c23531', + buttonTextColor: '#fff' +}; - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - mappings[type] && mappings[type].applyVisual( - valueOrIndex, getVisual, setVisual - ); - } +DataView.prototype.onclick = function (ecModel, api) { + var container = api.getDom(); + var model = this.model; + if (this._dom) { + container.removeChild(this._dom); } -} + var root = document.createElement('div'); + root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;'; + root.style.backgroundColor = model.get('backgroundColor') || '#fff'; -/** - * @param {module:echarts/data/List} data - * @param {Array.} stateList - * @param {Object} visualMappings > - * @param {Function} getValueState param: valueOrIndex, return: state. - * @param {number} [dim] dimension or dimension index. - */ -function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { - var visualTypesMap = {}; - each$1(stateList, function (state) { - var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); - visualTypesMap[state] = visualTypes; - }); + // Create elements + var header = document.createElement('h4'); + var lang$$1 = model.get('lang') || []; + header.innerHTML = lang$$1[0] || model.get('title'); + header.style.cssText = 'margin: 10px 20px;'; + header.style.color = model.get('textColor'); - function progress(params, data) { - if (dim != null) { - dim = data.getDimension(dim); - } + var viewMain = document.createElement('div'); + var textarea = document.createElement('textarea'); + viewMain.style.cssText = 'display:block;width:100%;overflow:auto;'; - function getVisual(key) { - return data.getItemVisual(dataIndex, key); + var optionToContent = model.get('optionToContent'); + var contentToOption = model.get('contentToOption'); + var result = getContentFromModel(ecModel); + if (typeof optionToContent === 'function') { + var htmlOrDom = optionToContent(api.getOption()); + if (typeof htmlOrDom === 'string') { + viewMain.innerHTML = htmlOrDom; } - - function setVisual(key, value) { - data.setItemVisual(dataIndex, key, value); + else if (isDom(htmlOrDom)) { + viewMain.appendChild(htmlOrDom); } + } + else { + // Use default textarea + viewMain.appendChild(textarea); + textarea.readOnly = model.get('readOnly'); + textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;'; + textarea.style.color = model.get('textColor'); + textarea.style.borderColor = model.get('textareaBorderColor'); + textarea.style.backgroundColor = model.get('textareaColor'); + textarea.value = result.value; + } - var dataIndex; - while ((dataIndex = params.next()) != null) { - var rawDataItem = data.getRawDataItem(dataIndex); + var blockMetaList = result.meta; - // Consider performance - if (rawDataItem && rawDataItem.visualMap === false) { - return; - } + var buttonContainer = document.createElement('div'); + buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;'; - var value = dim != null - ? data.get(dim, dataIndex, true) - : dataIndex; + var buttonStyle = 'float:right;margin-right:20px;border:none;' + + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px'; + var closeButton = document.createElement('div'); + var refreshButton = document.createElement('div'); - var valueState = getValueState(value); - var mappings = visualMappings[valueState]; - var visualTypes = visualTypesMap[valueState]; + buttonStyle += ';background-color:' + model.get('buttonColor'); + buttonStyle += ';color:' + model.get('buttonTextColor'); - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); + var self = this; + + function close() { + container.removeChild(root); + self._dom = null; + } + addEventListener(closeButton, 'click', close); + + addEventListener(refreshButton, 'click', function () { + var newOption; + try { + if (typeof contentToOption === 'function') { + newOption = contentToOption(viewMain, api.getOption()); + } + else { + newOption = parseContents(textarea.value, blockMetaList); } } - } + catch (e) { + close(); + throw new Error('Data view format error ' + e); + } + if (newOption) { + api.dispatchAction({ + type: 'changeDataView', + newOption: newOption + }); + } - return {progress: progress}; -} + close(); + }); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + closeButton.innerHTML = lang$$1[1]; + refreshButton.innerHTML = lang$$1[2]; + refreshButton.style.cssText = buttonStyle; + closeButton.style.cssText = buttonStyle; -// Key of the first level is brushType: `line`, `rect`, `polygon`. -// Key of the second level is chart element type: `point`, `rect`. -// See moudule:echarts/component/helper/BrushController -// function param: -// {Object} itemLayout fetch from data.getItemLayout(dataIndex) -// {Object} selectors {point: selector, rect: selector, ...} -// {Object} area {range: [[], [], ..], boudingRect} -// function return: -// {boolean} Whether in the given brush. -var selector = { - lineX: getLineSelectors(0), - lineY: getLineSelectors(1), - rect: { - point: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); - }, - rect: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.intersect(itemLayout); - } - }, - polygon: { - point: function (itemLayout, selectors, area) { - return itemLayout - && area.boundingRect.contain(itemLayout[0], itemLayout[1]) - && contain$1(area.range, itemLayout[0], itemLayout[1]); - }, - rect: function (itemLayout, selectors, area) { - var points = area.range; + !model.get('readOnly') && buttonContainer.appendChild(refreshButton); + buttonContainer.appendChild(closeButton); - if (!itemLayout || points.length <= 1) { - return false; - } + root.appendChild(header); + root.appendChild(viewMain); + root.appendChild(buttonContainer); - var x = itemLayout.x; - var y = itemLayout.y; - var width = itemLayout.width; - var height = itemLayout.height; - var p = points[0]; + viewMain.style.height = (container.clientHeight - 80) + 'px'; - if (contain$1(points, x, y) - || contain$1(points, x + width, y) - || contain$1(points, x, y + height) - || contain$1(points, x + width, y + height) - || BoundingRect.create(itemLayout).contain(p[0], p[1]) - || lineIntersectPolygon(x, y, x + width, y, points) - || lineIntersectPolygon(x, y, x, y + height, points) - || lineIntersectPolygon(x + width, y, x + width, y + height, points) - || lineIntersectPolygon(x, y + height, x + width, y + height, points) - ) { - return true; - } - } - } + container.appendChild(root); + this._dom = root; }; -function getLineSelectors(xyIndex) { - var xy = ['x', 'y']; - var wh = ['width', 'height']; +DataView.prototype.remove = function (ecModel, api) { + this._dom && api.getDom().removeChild(this._dom); +}; - return { - point: function (itemLayout, selectors, area) { - if (itemLayout) { - var range = area.range; - var p = itemLayout[xyIndex]; - return inLineRange(p, range); - } - }, - rect: function (itemLayout, selectors, area) { - if (itemLayout) { - var range = area.range; - var layoutRange = [ - itemLayout[xy[xyIndex]], - itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]] - ]; - layoutRange[1] < layoutRange[0] && layoutRange.reverse(); - return inLineRange(layoutRange[0], range) - || inLineRange(layoutRange[1], range) - || inLineRange(range[0], layoutRange) - || inLineRange(range[1], layoutRange); +DataView.prototype.dispose = function (ecModel, api) { + this.remove(ecModel, api); +}; + +/** + * @inner + */ +function tryMergeDataOption(newData, originalData) { + return map(newData, function (newVal, idx) { + var original = originalData && originalData[idx]; + if (isObject$1(original) && !isArray(original)) { + if (isObject$1(newVal) && !isArray(newVal)) { + newVal = newVal.value; } + // Original data has option + return defaults({ + value: newVal + }, original); } - }; -} - -function inLineRange(p, range) { - return range[0] <= p && p <= range[1]; -} - -function lineIntersectPolygon(lx, ly, l2x, l2y, points) { - for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { - var p = points[i]; - if (lineIntersect(lx, ly, l2x, l2y, p[0], p[1], p2[0], p2[1])) { - return true; + else { + return newVal; } - p2 = p; - } + }); } -// Code from with some fix. -// See -function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { - var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y); - if (nearZero(delta)) { // parallel - return false; - } - var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta; - if (namenda < 0 || namenda > 1) { - return false; - } - var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta; - if (miu < 0 || miu > 1) { - return false; - } - return true; -} +register$1('dataView', DataView); -function nearZero(val) { - return val <= (1e-6) && val >= -(1e-6); -} +registerAction({ + type: 'changeDataView', + event: 'dataViewChanged', + update: 'prepareAndUpdate' +}, function (payload, ecModel) { + var newSeriesOptList = []; + each$1(payload.newOption.series, function (seriesOpt) { + var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; + if (!seriesModel) { + // New created series + // Geuss the series type + newSeriesOptList.push(extend({ + // Default is scatter + type: 'scatter' + }, seriesOpt)); + } + else { + var originalData = seriesModel.get('data'); + newSeriesOptList.push({ + name: seriesOpt.name, + data: tryMergeDataOption(seriesOpt.data, originalData) + }); + } + }); -function determinant(v1, v2, v3, v4) { - return v1 * v4 - v2 * v3; -} + ecModel.mergeOption(defaults({ + series: newSeriesOptList + }, payload.newOption)); +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -76434,9 +80139,9 @@ function determinant(v1, v2, v3, v4) { * under the License. */ -var each$20 = each$1; +var each$17 = each$1; var indexOf$1 = indexOf; -var curry$5 = curry; +var curry$4 = curry; var COORD_CONVERTS = ['dataToPoint', 'pointToData']; @@ -76514,16 +80219,16 @@ function BrushTargetManager(option, ecModel, opt) { var info = {}; var foundCpts = parseFinder$1(ecModel, option); - each$20(targetInfoBuilders, function (builder, type) { + each$17(targetInfoBuilders, function (builder, type) { if (!opt || !opt.include || indexOf$1(opt.include, type) >= 0) { builder(foundCpts, targetInfoList, info); } }); } -var proto$2 = BrushTargetManager.prototype; +var proto$5 = BrushTargetManager.prototype; -proto$2.setOutputRanges = function (areas, ecModel) { +proto$5.setOutputRanges = function (areas, ecModel) { this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges @@ -76543,8 +80248,8 @@ proto$2.setOutputRanges = function (areas, ecModel) { }); }; -proto$2.matchOutputRanges = function (areas, ecModel, cb) { - each$20(areas, function (area) { +proto$5.matchOutputRanges = function (areas, ecModel, cb) { + each$17(areas, function (area) { var targetInfo = this.findTargetInfo(area, ecModel); if (targetInfo && targetInfo !== true) { @@ -76559,8 +80264,8 @@ proto$2.matchOutputRanges = function (areas, ecModel, cb) { }, this); }; -proto$2.setInputRanges = function (areas, ecModel) { - each$20(areas, function (area) { +proto$5.setInputRanges = function (areas, ecModel) { + each$17(areas, function (area) { var targetInfo = this.findTargetInfo(area, ecModel); if (__DEV__) { @@ -76598,7 +80303,7 @@ proto$2.setInputRanges = function (areas, ecModel) { }, this); }; -proto$2.makePanelOpts = function (api, getDefaultBrushType) { +proto$5.makePanelOpts = function (api, getDefaultBrushType) { return map(this._targetInfoList, function (targetInfo) { var rect = targetInfo.getPanelRect(); return { @@ -76613,7 +80318,7 @@ proto$2.makePanelOpts = function (api, getDefaultBrushType) { }); }; -proto$2.controlSeries = function (area, seriesModel, ecModel) { +proto$5.controlSeries = function (area, seriesModel, ecModel) { // Check whether area is bound in coord, and series do not belong to that coord. // If do not do this check, some brush (like lineX) will controll all axes. var targetInfo = this.findTargetInfo(area, ecModel); @@ -76631,7 +80336,7 @@ proto$2.controlSeries = function (area, seriesModel, ecModel) { * @param {Array} targetInfoList * @return {Object|boolean} */ -proto$2.findTargetInfo = function (area, ecModel) { +proto$5.findTargetInfo = function (area, ecModel) { var targetInfoList = this._targetInfoList; var foundCpts = parseFinder$1(ecModel, area); @@ -76681,17 +80386,17 @@ var targetInfoBuilders = { return; } - each$20(xAxisModels, function (axisModel) { + each$17(xAxisModels, function (axisModel) { var gridModel = axisModel.axis.grid.model; gridModelMap.set(gridModel.id, gridModel); xAxesHas[gridModel.id] = true; }); - each$20(yAxisModels, function (axisModel) { + each$17(yAxisModels, function (axisModel) { var gridModel = axisModel.axis.grid.model; gridModelMap.set(gridModel.id, gridModel); yAxesHas[gridModel.id] = true; }); - each$20(gridModels, function (gridModel) { + each$17(gridModels, function (gridModel) { gridModelMap.set(gridModel.id, gridModel); xAxesHas[gridModel.id] = true; yAxesHas[gridModel.id] = true; @@ -76701,7 +80406,7 @@ var targetInfoBuilders = { var grid = gridModel.coordinateSystem; var cartesians = []; - each$20(grid.getCartesians(), function (cartesian, index) { + each$17(grid.getCartesians(), function (cartesian, index) { if (indexOf$1(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf$1(yAxisModels, cartesian.getAxis('y').model) >= 0 ) { @@ -76723,7 +80428,7 @@ var targetInfoBuilders = { }, geo: function (foundCpts, targetInfoList) { - each$20(foundCpts.geoModels, function (geoModel) { + each$17(foundCpts.geoModels, function (geoModel) { var coordSys = geoModel.coordinateSystem; targetInfoList.push({ panelId: 'geo--' + geoModel.id, @@ -76776,9 +80481,9 @@ var panelRectBuilder = { var coordConvert = { - lineX: curry$5(axisConvert, 0), + lineX: curry$4(axisConvert, 0), - lineY: curry$5(axisConvert, 1), + lineY: curry$4(axisConvert, 1), rect: function (to, coordSys, rangeOrCoordRange) { var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]); @@ -76826,9 +80531,9 @@ function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) { } var diffProcessor = { - lineX: curry$5(axisDiffProcessor, 0), + lineX: curry$4(axisDiffProcessor, 0), - lineY: curry$5(axisDiffProcessor, 1), + lineY: curry$4(axisDiffProcessor, 1), rect: function (values, refer, scales) { return [ @@ -76887,316 +80592,265 @@ function getSize(xyMinMax) { * under the License. */ -var STATE_LIST = ['inBrush', 'outOfBrush']; -var DISPATCH_METHOD = '__ecBrushSelect'; -var DISPATCH_FLAG = '__ecInBrushSelectEvent'; -var PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH; +var each$18 = each$1; + +var ATTR$1 = '\0_ec_hist_store'; /** - * Layout for visual, the priority higher than other layout, and before brush visual. + * @param {module:echarts/model/Global} ecModel + * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]} */ -registerLayout(PRIORITY_BRUSH, function (ecModel, api, payload) { - ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { - - payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption( - payload.key === 'brush' ? payload.brushOption : {brushType: false} - ); - - var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); +function push(ecModel, newSnapshot) { + var store = giveStore(ecModel); - brushTargetManager.setInputRanges(brushModel.areas, ecModel); + // If previous dataZoom can not be found, + // complete an range with current range. + each$18(newSnapshot, function (batchItem, dataZoomId) { + var i = store.length - 1; + for (; i >= 0; i--) { + var snapshot = store[i]; + if (snapshot[dataZoomId]) { + break; + } + } + if (i < 0) { + // No origin range set, create one by current range. + var dataZoomModel = ecModel.queryComponents( + {mainType: 'dataZoom', subType: 'select', id: dataZoomId} + )[0]; + if (dataZoomModel) { + var percentRange = dataZoomModel.getPercentRange(); + store[0][dataZoomId] = { + dataZoomId: dataZoomId, + start: percentRange[0], + end: percentRange[1] + }; + } + } }); -}); + + store.push(newSnapshot); +} /** - * Register the visual encoding if this modules required. + * @param {module:echarts/model/Global} ecModel + * @return {Object} snapshot */ -registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) { - - var brushSelected = []; - var throttleType; - var throttleDelay; - - ecModel.eachComponent({mainType: 'brush'}, function (brushModel, brushIndex) { - - var thisBrushSelected = { - brushId: brushModel.id, - brushIndex: brushIndex, - brushName: brushModel.name, - areas: clone(brushModel.areas), - selected: [] - }; - // Every brush component exists in event params, convenient - // for user to find by index. - brushSelected.push(thisBrushSelected); - - var brushOption = brushModel.option; - var brushLink = brushOption.brushLink; - var linkedSeriesMap = []; - var selectedDataIndexForLink = []; - var rangeInfoBySeries = []; - var hasBrushExists = 0; +function pop(ecModel) { + var store = giveStore(ecModel); + var head = store[store.length - 1]; + store.length > 1 && store.pop(); - if (!brushIndex) { // Only the first throttle setting works. - throttleType = brushOption.throttleType; - throttleDelay = brushOption.throttleDelay; + // Find top for all dataZoom. + var snapshot = {}; + each$18(head, function (batchItem, dataZoomId) { + for (var i = store.length - 1; i >= 0; i--) { + var batchItem = store[i][dataZoomId]; + if (batchItem) { + snapshot[dataZoomId] = batchItem; + break; + } } + }); - // Add boundingRect and selectors to range. - var areas = map(brushModel.areas, function (area) { - return bindSelector( - defaults( - {boundingRect: boundingRectBuilders[area.brushType](area)}, - area - ) - ); - }); + return snapshot; +} - var visualMappings = createVisualMappings( - brushModel.option, STATE_LIST, function (mappingOption) { - mappingOption.mappingMethod = 'fixed'; - } - ); +/** + * @param {module:echarts/model/Global} ecModel + */ +function clear$1(ecModel) { + ecModel[ATTR$1] = null; +} - isArray(brushLink) && each$1(brushLink, function (seriesIndex) { - linkedSeriesMap[seriesIndex] = 1; - }); +/** + * @param {module:echarts/model/Global} ecModel + * @return {number} records. always >= 1. + */ +function count(ecModel) { + return giveStore(ecModel).length; +} - function linkOthers(seriesIndex) { - return brushLink === 'all' || linkedSeriesMap[seriesIndex]; - } - - // If no supported brush or no brush on the series, - // all visuals should be in original state. - function brushed(rangeInfoList) { - return !!rangeInfoList.length; - } +/** + * [{key: dataZoomId, value: {dataZoomId, range}}, ...] + * History length of each dataZoom may be different. + * this._history[0] is used to store origin range. + * @type {Array.} + */ +function giveStore(ecModel) { + var store = ecModel[ATTR$1]; + if (!store) { + store = ecModel[ATTR$1] = [{}]; + } + return store; +} - /** - * Logic for each series: (If the logic has to be modified one day, do it carefully!) - * - * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord. - * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord. - * └!hasBrushExist┘ └nothing. - * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord. - * └!hasBrushExist┘ └nothing. - * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck. - * !brushed┘ └nothing. - * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing. - */ +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // Step A - ecModel.eachSeries(function (seriesModel, seriesIndex) { - var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; +ComponentModel.registerSubTypeDefaulter('dataZoom', function () { + // Default 'slider' when no type specified. + return 'slider'; +}); - seriesModel.subType === 'parallel' - ? stepAParallel(seriesModel, seriesIndex, rangeInfoList) - : stepAOthers(seriesModel, seriesIndex, rangeInfoList); - }); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - function stepAParallel(seriesModel, seriesIndex) { - var coordSys = seriesModel.coordinateSystem; - hasBrushExists |= coordSys.hasAxisBrushed(); +var AXIS_DIMS = ['x', 'y', 'z', 'radius', 'angle', 'single']; +// Supported coords. +var COORDS = ['cartesian2d', 'polar', 'singleAxis']; - linkOthers(seriesIndex) && coordSys.eachActiveState( - seriesModel.getData(), - function (activeState, dataIndex) { - activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); - } - ); - } +/** + * @param {string} coordType + * @return {boolean} + */ +function isCoordSupported(coordType) { + return indexOf(COORDS, coordType) >= 0; +} - function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { - var selectorsByBrushType = getSelectorsByBrushType(seriesModel); - if (!selectorsByBrushType || brushModelNotControll(brushModel, seriesIndex)) { - return; - } +/** + * Create "each" method to iterate names. + * + * @pubilc + * @param {Array.} names + * @param {Array.=} attrs + * @return {Function} + */ +function createNameEach(names, attrs) { + names = names.slice(); + var capitalNames = map(names, capitalFirst); + attrs = (attrs || []).slice(); + var capitalAttrs = map(attrs, capitalFirst); - each$1(areas, function (area) { - selectorsByBrushType[area.brushType] - && brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel) - && rangeInfoList.push(area); - hasBrushExists |= brushed(rangeInfoList); - }); + return function (callback, context) { + each$1(names, function (name, index) { + var nameObj = {name: name, capital: capitalNames[index]}; - if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { - var data = seriesModel.getData(); - data.each(function (dataIndex) { - if (checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex)) { - selectedDataIndexForLink[dataIndex] = 1; - } - }); + for (var j = 0; j < attrs.length; j++) { + nameObj[attrs[j]] = name + capitalAttrs[j]; } - } - - // Step B - ecModel.eachSeries(function (seriesModel, seriesIndex) { - var seriesBrushSelected = { - seriesId: seriesModel.id, - seriesIndex: seriesIndex, - seriesName: seriesModel.name, - dataIndex: [] - }; - // Every series exists in event params, convenient - // for user to find series by seriesIndex. - thisBrushSelected.selected.push(seriesBrushSelected); - - var selectorsByBrushType = getSelectorsByBrushType(seriesModel); - var rangeInfoList = rangeInfoBySeries[seriesIndex]; - - var data = seriesModel.getData(); - var getValueState = linkOthers(seriesIndex) - ? function (dataIndex) { - return selectedDataIndexForLink[dataIndex] - ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') - : 'outOfBrush'; - } - : function (dataIndex) { - return checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) - ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') - : 'outOfBrush'; - }; - // If no supported brush or no brush, all visuals are in original state. - (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) - && applyVisual( - STATE_LIST, visualMappings, data, getValueState - ); + callback.call(context, nameObj); }); + }; +} - }); - - dispatchAction(api, throttleType, throttleDelay, brushSelected, payload); -}); - -function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) { - // This event will not be triggered when `setOpion`, otherwise dead lock may - // triggered when do `setOption` in event listener, which we do not find - // satisfactory way to solve yet. Some considered resolutions: - // (a) Diff with prevoius selected data ant only trigger event when changed. - // But store previous data and diff precisely (i.e., not only by dataIndex, but - // also detect value changes in selected data) might bring complexity or fragility. - // (b) Use spectial param like `silent` to suppress event triggering. - // But such kind of volatile param may be weird in `setOption`. - if (!payload) { - return; - } - - var zr = api.getZr(); - if (zr[DISPATCH_FLAG]) { - return; - } - - if (!zr[DISPATCH_METHOD]) { - zr[DISPATCH_METHOD] = doDispatch; - } +/** + * Iterate each dimension name. + * + * @public + * @param {Function} callback The parameter is like: + * { + * name: 'angle', + * capital: 'Angle', + * axis: 'angleAxis', + * axisIndex: 'angleAixs', + * index: 'angleIndex' + * } + * @param {Object} context + */ +var eachAxisDim$1 = createNameEach(AXIS_DIMS, ['axisIndex', 'axis', 'index', 'id']); - var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); +/** + * If tow dataZoomModels has the same axis controlled, we say that they are 'linked'. + * dataZoomModels and 'links' make up one or more graphics. + * This function finds the graphic where the source dataZoomModel is in. + * + * @public + * @param {Function} forEachNode Node iterator. + * @param {Function} forEachEdgeType edgeType iterator + * @param {Function} edgeIdGetter Giving node and edgeType, return an array of edge id. + * @return {Function} Input: sourceNode, Output: Like {nodes: [], dims: {}} + */ +function createLinkedNodesFinder(forEachNode, forEachEdgeType, edgeIdGetter) { - fn(api, brushSelected); -} + return function (sourceNode) { + var result = { + nodes: [], + records: {} // key: edgeType.name, value: Object (key: edge id, value: boolean). + }; -function doDispatch(api, brushSelected) { - if (!api.isDisposed()) { - var zr = api.getZr(); - zr[DISPATCH_FLAG] = true; - api.dispatchAction({ - type: 'brushSelect', - batch: brushSelected + forEachEdgeType(function (edgeType) { + result.records[edgeType.name] = {}; }); - zr[DISPATCH_FLAG] = false; - } -} -function checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) { - for (var i = 0, len = rangeInfoList.length; i < len; i++) { - var area = rangeInfoList[i]; - if (selectorsByBrushType[area.brushType]( - dataIndex, data, area.selectors, area - )) { - return true; + if (!sourceNode) { + return result; } - } -} - -function getSelectorsByBrushType(seriesModel) { - var brushSelector = seriesModel.brushSelector; - if (isString(brushSelector)) { - var sels = []; - each$1(selector, function (selectorsByElementType, brushType) { - sels[brushType] = function (dataIndex, data, selectors, area) { - var itemLayout = data.getItemLayout(dataIndex); - return selectorsByElementType[brushSelector](itemLayout, selectors, area); - }; - }); - return sels; - } - else if (isFunction$1(brushSelector)) { - var bSelector = {}; - each$1(selector, function (sel, brushType) { - bSelector[brushType] = brushSelector; - }); - return bSelector; - } - return brushSelector; -} - -function brushModelNotControll(brushModel, seriesIndex) { - var seriesIndices = brushModel.option.seriesIndex; - return seriesIndices != null - && seriesIndices !== 'all' - && ( - isArray(seriesIndices) - ? indexOf(seriesIndices, seriesIndex) < 0 - : seriesIndex !== seriesIndices - ); -} - -function bindSelector(area) { - var selectors = area.selectors = {}; - each$1(selector[area.brushType], function (selFn, elType) { - // Do not use function binding or curry for performance. - selectors[elType] = function (itemLayout) { - return selFn(itemLayout, selectors, area); - }; - }); - return area; -} -var boundingRectBuilders = { - - lineX: noop, + absorb(sourceNode, result); - lineY: noop, + var existsLink; + do { + existsLink = false; + forEachNode(processSingleNode); + } + while (existsLink); - rect: function (area) { - return getBoundingRectFromMinMax(area.range); - }, + function processSingleNode(node) { + if (!isNodeAbsorded(node, result) && isLinked(node, result)) { + absorb(node, result); + existsLink = true; + } + } - polygon: function (area) { - var minMax; - var range = area.range; + return result; + }; - for (var i = 0, len = range.length; i < len; i++) { - minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; - var rg = range[i]; - rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]); - rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]); - rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]); - rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]); - } + function isNodeAbsorded(node, result) { + return indexOf(result.nodes, node) >= 0; + } - return minMax && getBoundingRectFromMinMax(minMax); + function isLinked(node, result) { + var hasLink = false; + forEachEdgeType(function (edgeType) { + each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { + result.records[edgeType.name][edgeId] && (hasLink = true); + }); + }); + return hasLink; } -}; -function getBoundingRectFromMinMax(minMax) { - return new BoundingRect( - minMax[0][0], - minMax[1][0], - minMax[0][1] - minMax[0][0], - minMax[1][1] - minMax[1][0] - ); + function absorb(node, result) { + result.nodes.push(node); + forEachEdgeType(function (edgeType) { + each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { + result.records[edgeType.name][edgeId] = true; + }); + }); + } } /* @@ -77218,353 +80872,517 @@ function getBoundingRectFromMinMax(minMax) { * under the License. */ -var DEFAULT_OUT_OF_BRUSH_COLOR = ['#ddd']; - -var BrushModel = extendComponentModel({ - - type: 'brush', +var each$20 = each$1; +var asc$1 = asc; - dependencies: ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'], +/** + * Operate single axis. + * One axis can only operated by one axis operator. + * Different dataZoomModels may be defined to operate the same axis. + * (i.e. 'inside' data zoom and 'slider' data zoom components) + * So dataZoomModels share one axisProxy in that case. + * + * @class + */ +var AxisProxy = function (dimName, axisIndex, dataZoomModel, ecModel) { /** - * @protected + * @private + * @type {string} */ - defaultOption: { - // inBrush: null, - // outOfBrush: null, - toolbox: null, // Default value see preprocessor. - brushLink: null, // Series indices array, broadcast using dataIndex. - // or 'all', which means all series. 'none' or null means no series. - seriesIndex: 'all', // seriesIndex array, specify series controlled by this brush component. - geoIndex: null, // - xAxisIndex: null, - yAxisIndex: null, - - brushType: 'rect', // Default brushType, see BrushController. - brushMode: 'single', // Default brushMode, 'single' or 'multiple' - transformable: true, // Default transformable. - brushStyle: { // Default brushStyle - borderWidth: 1, - color: 'rgba(120,140,180,0.3)', - borderColor: 'rgba(120,140,180,0.8)' - }, - - throttleType: 'fixRate',// Throttle in brushSelected event. 'fixRate' or 'debounce'. - // If null, no throttle. Valid only in the first brush component - throttleDelay: 0, // Unit: ms, 0 means every event will be triggered. + this._dimName = dimName; - // FIXME - // 试验效果 - removeOnClick: true, + /** + * @private + */ + this._axisIndex = axisIndex; - z: 10000 - }, + /** + * @private + * @type {Array.} + */ + this._valueWindow; /** - * @readOnly - * @type {Array.} + * @private + * @type {Array.} */ - areas: [], + this._percentWindow; /** - * Current activated brush type. - * If null, brush is inactived. - * see module:echarts/component/helper/BrushController - * @readOnly - * @type {string} + * @private + * @type {Array.} */ - brushType: null, + this._dataExtent; /** - * Current brush opt. - * see module:echarts/component/helper/BrushController - * @readOnly + * {minSpan, maxSpan, minValueSpan, maxValueSpan} + * @private * @type {Object} */ - brushOption: {}, + this._minMaxSpan; /** * @readOnly - * @type {Array.} + * @type {module: echarts/model/Global} */ - coordInfoList: [], + this.ecModel = ecModel; - optionUpdated: function (newOption, isInit) { - var thisOption = this.option; + /** + * @private + * @type {module: echarts/component/dataZoom/DataZoomModel} + */ + this._dataZoomModel = dataZoomModel; - !isInit && replaceVisualOption( - thisOption, newOption, ['inBrush', 'outOfBrush'] - ); + // /** + // * @readOnly + // * @private + // */ + // this.hasSeriesStacked; +}; - var inBrush = thisOption.inBrush = thisOption.inBrush || {}; - // Always give default visual, consider setOption at the second time. - thisOption.outOfBrush = thisOption.outOfBrush || {color: DEFAULT_OUT_OF_BRUSH_COLOR}; +AxisProxy.prototype = { - if (!inBrush.hasOwnProperty('liftZ')) { - // Bigger than the highlight z lift, otherwise it will - // be effected by the highlight z when brush. - inBrush.liftZ = 5; - } - }, + constructor: AxisProxy, /** - * If ranges is null/undefined, range state remain. + * Whether the axisProxy is hosted by dataZoomModel. * - * @param {Array.} [ranges] + * @public + * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel + * @return {boolean} */ - setAreas: function (areas) { - if (__DEV__) { - assert$1(isArray(areas)); - each$1(areas, function (area) { - assert$1(area.brushType, 'Illegal areas'); - }); - } - - // If ranges is null/undefined, range state remain. - // This helps user to dispatchAction({type: 'brush'}) with no areas - // set but just want to get the current brush select info from a `brush` event. - if (!areas) { - return; - } - - this.areas = map(areas, function (area) { - return generateBrushOption(this.option, area); - }, this); + hostedBy: function (dataZoomModel) { + return this._dataZoomModel === dataZoomModel; }, /** - * see module:echarts/component/helper/BrushController - * @param {Object} brushOption + * @return {Array.} Value can only be NaN or finite value. */ - setBrushOption: function (brushOption) { - this.brushOption = generateBrushOption(this.option, brushOption); - this.brushType = this.brushOption.brushType; - } + getDataValueWindow: function () { + return this._valueWindow.slice(); + }, -}); + /** + * @return {Array.} + */ + getDataPercentWindow: function () { + return this._percentWindow.slice(); + }, -function generateBrushOption(option, brushOption) { - return merge( - { - brushType: option.brushType, - brushMode: option.brushMode, - transformable: option.transformable, - brushStyle: new Model(option.brushStyle).getItemStyle(), - removeOnClick: option.removeOnClick, - z: option.z - }, - brushOption, - true - ); -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -extendComponentView({ - - type: 'brush', + /** + * @public + * @param {number} axisIndex + * @return {Array} seriesModels + */ + getTargetSeriesModels: function () { + var seriesModels = []; + var ecModel = this.ecModel; - init: function (ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + if (isCoordSupported(seriesModel.get('coordinateSystem'))) { + var dimName = this._dimName; + var axisModel = ecModel.queryComponents({ + mainType: dimName + 'Axis', + index: seriesModel.get(dimName + 'AxisIndex'), + id: seriesModel.get(dimName + 'AxisId') + })[0]; + if (this._axisIndex === (axisModel && axisModel.componentIndex)) { + seriesModels.push(seriesModel); + } + } + }, this); - /** - * @readOnly - * @type {module:echarts/model/Global} - */ - this.ecModel = ecModel; + return seriesModels; + }, - /** - * @readOnly - * @type {module:echarts/ExtensionAPI} - */ - this.api = api; + getAxisModel: function () { + return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex); + }, - /** - * @readOnly - * @type {module:echarts/component/brush/BrushModel} - */ - this.model; + getOtherAxisModel: function () { + var axisDim = this._dimName; + var ecModel = this.ecModel; + var axisModel = this.getAxisModel(); + var isCartesian = axisDim === 'x' || axisDim === 'y'; + var otherAxisDim; + var coordSysIndexName; + if (isCartesian) { + coordSysIndexName = 'gridIndex'; + otherAxisDim = axisDim === 'x' ? 'y' : 'x'; + } + else { + coordSysIndexName = 'polarIndex'; + otherAxisDim = axisDim === 'angle' ? 'radius' : 'angle'; + } + var foundOtherAxisModel; + ecModel.eachComponent(otherAxisDim + 'Axis', function (otherAxisModel) { + if ((otherAxisModel.get(coordSysIndexName) || 0) + === (axisModel.get(coordSysIndexName) || 0) + ) { + foundOtherAxisModel = otherAxisModel; + } + }); + return foundOtherAxisModel; + }, - /** - * @private - * @type {module:echarts/component/helper/BrushController} - */ - (this._brushController = new BrushController(api.getZr())) - .on('brush', bind(this._onBrush, this)) - .mount(); + getMinMaxSpan: function () { + return clone(this._minMaxSpan); }, /** - * @override + * Only calculate by given range and this._dataExtent, do not change anything. + * + * @param {Object} opt + * @param {number} [opt.start] + * @param {number} [opt.end] + * @param {number} [opt.startValue] + * @param {number} [opt.endValue] */ - render: function (brushModel) { - this.model = brushModel; - return updateController.apply(this, arguments); + calculateDataWindow: function (opt) { + var dataExtent = this._dataExtent; + var axisModel = this.getAxisModel(); + var scale = axisModel.axis.scale; + var rangePropMode = this._dataZoomModel.getRangePropMode(); + var percentExtent = [0, 100]; + var percentWindow = []; + var valueWindow = []; + var hasPropModeValue; + + each$20(['start', 'end'], function (prop, idx) { + var boundPercent = opt[prop]; + var boundValue = opt[prop + 'Value']; + + // Notice: dataZoom is based either on `percentProp` ('start', 'end') or + // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent + // but not min/max of axis, which will be calculated by data window then). + // The former one is suitable for cases that a dataZoom component controls multiple + // axes with different unit or extent, and the latter one is suitable for accurate + // zoom by pixel (e.g., in dataZoomSelect). + // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated + // only when setOption or dispatchAction, otherwise it remains its original value. + // (Why not only record `percentProp` and always map to `valueProp`? Because + // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original + // `valueProp`. consider two axes constrolled by one dataZoom. They have different + // data extent. All of values that are overflow the `dataExtent` will be calculated + // to percent '100%'). + + if (rangePropMode[idx] === 'percent') { + boundPercent == null && (boundPercent = percentExtent[idx]); + // Use scale.parse to math round for category or time axis. + boundValue = scale.parse(linearMap( + boundPercent, percentExtent, dataExtent + )); + } + else { + hasPropModeValue = true; + boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); + // Calculating `percent` from `value` may be not accurate, because + // This calculation can not be inversed, because all of values that + // are overflow the `dataExtent` will be calculated to percent '100%' + boundPercent = linearMap( + boundValue, dataExtent, percentExtent + ); + } + + // valueWindow[idx] = round(boundValue); + // percentWindow[idx] = round(boundPercent); + valueWindow[idx] = boundValue; + percentWindow[idx] = boundPercent; + }); + + asc$1(valueWindow); + asc$1(percentWindow); + + // The windows from user calling of `dispatchAction` might be out of the extent, + // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window + // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint, + // where API is able to initialize/modify the window size even though `zoomLock` + // specified. + var spans = this._minMaxSpan; + hasPropModeValue + ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) + : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true); + + function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) { + var suffix = toValue ? 'Span' : 'ValueSpan'; + sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]); + for (var i = 0; i < 2; i++) { + toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true); + toValue && (toWindow[i] = scale.parse(toWindow[i])); + } + } + + return { + valueWindow: valueWindow, + percentWindow: percentWindow + }; }, /** - * @override + * Notice: reset should not be called before series.restoreData() called, + * so it is recommanded to be called in "process stage" but not "model init + * stage". + * + * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel */ - updateTransform: updateController, + reset: function (dataZoomModel) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } - /** - * @override - */ - updateView: updateController, + var targetSeries = this.getTargetSeriesModels(); + // Culculate data window and data extent, and record them. + this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); - // /** - // * @override - // */ - // updateLayout: updateController, + // this.hasSeriesStacked = false; + // each(targetSeries, function (series) { + // var data = series.getData(); + // var dataDim = data.mapDimension(this._dimName); + // var stackedDimension = data.getCalculationInfo('stackedDimension'); + // if (stackedDimension && stackedDimension === dataDim) { + // this.hasSeriesStacked = true; + // } + // }, this); - // /** - // * @override - // */ - // updateVisual: updateController, + // `calculateDataWindow` uses min/maxSpan. + setMinMaxSpan(this); + + var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption); + + this._valueWindow = dataWindow.valueWindow; + this._percentWindow = dataWindow.percentWindow; + + // Update axis setting then. + setAxisModel(this); + }, /** - * @override + * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel */ - dispose: function () { - this._brushController.dispose(); + restore: function (dataZoomModel) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } + + this._valueWindow = this._percentWindow = null; + setAxisModel(this, true); }, /** - * @private + * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel */ - _onBrush: function (areas, opt) { - var modelId = this.model.id; + filterData: function (dataZoomModel, api) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } - this.model.brushTargetManager.setOutputRanges(areas, this.ecModel); + var axisDim = this._dimName; + var seriesModels = this.getTargetSeriesModels(); + var filterMode = dataZoomModel.get('filterMode'); + var valueWindow = this._valueWindow; - // Action is not dispatched on drag end, because the drag end - // emits the same params with the last drag move event, and - // may have some delay when using touch pad, which makes - // animation not smooth (when using debounce). - (!opt.isEnd || opt.removeOnClick) && this.api.dispatchAction({ - type: 'brush', - brushId: modelId, - areas: clone(areas), - $from: modelId + if (filterMode === 'none') { + return; + } + + // FIXME + // Toolbox may has dataZoom injected. And if there are stacked bar chart + // with NaN data, NaN will be filtered and stack will be wrong. + // So we need to force the mode to be set empty. + // In fect, it is not a big deal that do not support filterMode-'filter' + // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis + // selection" some day, which might need "adapt to data extent on the + // otherAxis", which is disabled by filterMode-'empty'. + // But currently, stack has been fixed to based on value but not index, + // so this is not an issue any more. + // var otherAxisModel = this.getOtherAxisModel(); + // if (dataZoomModel.get('$fromToolbox') + // && otherAxisModel + // && otherAxisModel.hasSeriesStacked + // ) { + // filterMode = 'empty'; + // } + + // TODO + // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. + + each$20(seriesModels, function (seriesModel) { + var seriesData = seriesModel.getData(); + var dataDims = seriesData.mapDimension(axisDim, true); + + if (!dataDims.length) { + return; + } + + if (filterMode === 'weakFilter') { + seriesData.filterSelf(function (dataIndex) { + var leftOut; + var rightOut; + var hasValue; + for (var i = 0; i < dataDims.length; i++) { + var value = seriesData.get(dataDims[i], dataIndex); + var thisHasValue = !isNaN(value); + var thisLeftOut = value < valueWindow[0]; + var thisRightOut = value > valueWindow[1]; + if (thisHasValue && !thisLeftOut && !thisRightOut) { + return true; + } + thisHasValue && (hasValue = true); + thisLeftOut && (leftOut = true); + thisRightOut && (rightOut = true); + } + // If both left out and right out, do not filter. + return hasValue && leftOut && rightOut; + }); + } + else { + each$20(dataDims, function (dim) { + if (filterMode === 'empty') { + seriesModel.setData( + seriesData = seriesData.map(dim, function (value) { + return !isInWindow(value) ? NaN : value; + }) + ); + } + else { + var range = {}; + range[dim] = valueWindow; + + // console.time('select'); + seriesData.selectRange(range); + // console.timeEnd('select'); + } + }); + } + + each$20(dataDims, function (dim) { + seriesData.setApproximateExtent(valueWindow, dim); + }); }); + + function isInWindow(value) { + return value >= valueWindow[0] && value <= valueWindow[1]; + } } +}; -}); +function calculateDataExtent(axisProxy, axisDim, seriesModels) { + var dataExtent = [Infinity, -Infinity]; -function updateController(brushModel, ecModel, api, payload) { - // Do not update controller when drawing. - (!payload || payload.$from !== brushModel.id) && this._brushController - .setPanels(brushModel.brushTargetManager.makePanelOpts(api)) - .enableBrush(brushModel.brushOption) - .updateCovers(brushModel.areas.slice()); + each$20(seriesModels, function (seriesModel) { + var seriesData = seriesModel.getData(); + if (seriesData) { + each$20(seriesData.mapDimension(axisDim, true), function (dim) { + var seriesExtent = seriesData.getApproximateExtent(dim); + seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); + seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); + }); + } + }); + + if (dataExtent[1] < dataExtent[0]) { + dataExtent = [NaN, NaN]; + } + + // It is important to get "consistent" extent when more then one axes is + // controlled by a `dataZoom`, otherwise those axes will not be synchronized + // when zooming. But it is difficult to know what is "consistent", considering + // axes have different type or even different meanings (For example, two + // time axes are used to compare data of the same date in different years). + // So basically dataZoom just obtains extent by series.data (in category axis + // extent can be obtained from axis.data). + // Nevertheless, user can set min/max/scale on axes to make extent of axes + // consistent. + fixExtentByAxis(axisProxy, dataExtent); + + return dataExtent; } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +function fixExtentByAxis(axisProxy, dataExtent) { + var axisModel = axisProxy.getAxisModel(); + var min = axisModel.getMin(true); -/** - * payload: { - * brushIndex: number, or, - * brushId: string, or, - * brushName: string, - * globalRanges: Array - * } - */ -registerAction( - {type: 'brush', event: 'brush' /*, update: 'updateView' */}, - function (payload, ecModel) { - ecModel.eachComponent({mainType: 'brush', query: payload}, function (brushModel) { - brushModel.setAreas(payload.areas); - }); + // For category axis, if min/max/scale are not set, extent is determined + // by axis.data by default. + var isCategoryAxis = axisModel.get('type') === 'category'; + var axisDataLen = isCategoryAxis && axisModel.getCategories().length; + + if (min != null && min !== 'dataMin' && typeof min !== 'function') { + dataExtent[0] = min; + } + else if (isCategoryAxis) { + dataExtent[0] = axisDataLen > 0 ? 0 : NaN; } -); -/** - * payload: { - * brushComponents: [ - * { - * brushId, - * brushIndex, - * brushName, - * series: [ - * { - * seriesId, - * seriesIndex, - * seriesName, - * rawIndices: [21, 34, ...] - * }, - * ... - * ] - * }, - * ... - * ] - * } - */ -registerAction( - {type: 'brushSelect', event: 'brushSelected', update: 'none'}, - function () {} -); + var max = axisModel.getMax(true); + if (max != null && max !== 'dataMax' && typeof max !== 'function') { + dataExtent[1] = max; + } + else if (isCategoryAxis) { + dataExtent[1] = axisDataLen > 0 ? axisDataLen - 1 : NaN; + } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + if (!axisModel.get('scale', true)) { + dataExtent[0] > 0 && (dataExtent[0] = 0); + dataExtent[1] < 0 && (dataExtent[1] = 0); + } + + // For value axis, if min/max/scale are not set, we just use the extent obtained + // by series data, which may be a little different from the extent calculated by + // `axisHelper.getScaleExtent`. But the different just affects the experience a + // little when zooming. So it will not be fixed until some users require it strongly. + return dataExtent; +} -var features = {}; +function setAxisModel(axisProxy, isRestore) { + var axisModel = axisProxy.getAxisModel(); -function register$1(name, ctor) { - features[name] = ctor; + var percentWindow = axisProxy._percentWindow; + var valueWindow = axisProxy._valueWindow; + + if (!percentWindow) { + return; + } + + // [0, 500]: arbitrary value, guess axis extent. + var precision = getPixelPrecision(valueWindow, [0, 500]); + precision = Math.min(precision, 20); + // isRestore or isFull + var useOrigin = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100); + + axisModel.setRange( + useOrigin ? null : +valueWindow[0].toFixed(precision), + useOrigin ? null : +valueWindow[1].toFixed(precision) + ); } -function get$1(name) { - return features[name]; +function setMinMaxSpan(axisProxy) { + var minMaxSpan = axisProxy._minMaxSpan = {}; + var dataZoomModel = axisProxy._dataZoomModel; + var dataExtent = axisProxy._dataExtent; + + each$20(['min', 'max'], function (minMax) { + var percentSpan = dataZoomModel.get(minMax + 'Span'); + var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); + valueSpan != null && (valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan)); + + // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan + if (valueSpan != null) { + percentSpan = linearMap( + dataExtent[0] + valueSpan, dataExtent, [0, 100], true + ); + } + else if (percentSpan != null) { + valueSpan = linearMap( + percentSpan, [0, 100], dataExtent, true + ) - dataExtent[0]; + } + + minMaxSpan[minMax + 'Span'] = percentSpan; + minMaxSpan[minMax + 'ValueSpan'] = valueSpan; + }); } /* @@ -77586,620 +81404,620 @@ function get$1(name) { * under the License. */ -var brushLang = lang.toolbox.brush; +var each$19 = each$1; +var eachAxisDim = eachAxisDim$1; -function Brush(model, ecModel, api) { - this.model = model; - this.ecModel = ecModel; - this.api = api; +var DataZoomModel = extendComponentModel({ - /** - * @private - * @type {string} - */ - this._brushType; + type: 'dataZoom', + + dependencies: [ + 'xAxis', 'yAxis', 'zAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series' + ], /** - * @private - * @type {string} + * @protected */ - this._brushMode; -} - -Brush.defaultOption = { - show: true, - type: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'], - icon: { - rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13', // jshint ignore:line - polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2', // jshint ignore:line - lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4', // jshint ignore:line - lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4', // jshint ignore:line - keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z', // jshint ignore:line - clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line - }, - // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` - title: clone(brushLang.title) -}; - -var proto$3 = Brush.prototype; - -// proto.updateLayout = function (featureModel, ecModel, api) { -proto$3.render = -proto$3.updateView = function (featureModel, ecModel, api) { - var brushType; - var brushMode; - var isBrushed; - - ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { - brushType = brushModel.brushType; - brushMode = brushModel.brushOption.brushMode || 'single'; - isBrushed |= brushModel.areas.length; - }); - this._brushType = brushType; - this._brushMode = brushMode; - - each$1(featureModel.get('type', true), function (type) { - featureModel.setIconStatus( - type, - ( - type === 'keep' - ? brushMode === 'multiple' - : type === 'clear' - ? isBrushed - : type === brushType - ) ? 'emphasis' : 'normal' - ); - }); -}; + defaultOption: { + zlevel: 0, + z: 4, // Higher than normal component (z: 2). + orient: null, // Default auto by axisIndex. Possible value: 'horizontal', 'vertical'. + xAxisIndex: null, // Default the first horizontal category axis. + yAxisIndex: null, // Default the first vertical category axis. -proto$3.getIcons = function () { - var model = this.model; - var availableIcons = model.get('icon', true); - var icons = {}; - each$1(model.get('type', true), function (type) { - if (availableIcons[type]) { - icons[type] = availableIcons[type]; - } - }); - return icons; -}; + filterMode: 'filter', // Possible values: 'filter' or 'empty' or 'weakFilter'. + // 'filter': data items which are out of window will be removed. This option is + // applicable when filtering outliers. For each data item, it will be + // filtered if one of the relevant dimensions is out of the window. + // 'weakFilter': data items which are out of window will be removed. This option + // is applicable when filtering outliers. For each data item, it will be + // filtered only if all of the relevant dimensions are out of the same + // side of the window. + // 'empty': data items which are out of window will be set to empty. + // This option is applicable when user should not neglect + // that there are some data items out of window. + // 'none': Do not filter. + // Taking line chart as an example, line will be broken in + // the filtered points when filterModel is set to 'empty', but + // be connected when set to 'filter'. -proto$3.onclick = function (ecModel, api, type) { - var brushType = this._brushType; - var brushMode = this._brushMode; + throttle: null, // Dispatch action by the fixed rate, avoid frequency. + // default 100. Do not throttle when use null/undefined. + // If animation === true and animationDurationUpdate > 0, + // default value is 100, otherwise 20. + start: 0, // Start percent. 0 ~ 100 + end: 100, // End percent. 0 ~ 100 + startValue: null, // Start value. If startValue specified, start is ignored. + endValue: null, // End value. If endValue specified, end is ignored. + minSpan: null, // 0 ~ 100 + maxSpan: null, // 0 ~ 100 + minValueSpan: null, // The range of dataZoom can not be smaller than that. + maxValueSpan: null, // The range of dataZoom can not be larger than that. + rangeMode: null // Array, can be 'value' or 'percent'. + }, - if (type === 'clear') { - // Trigger parallel action firstly - api.dispatchAction({ - type: 'axisAreaSelect', - intervals: [] - }); + /** + * @override + */ + init: function (option, parentModel, ecModel) { - api.dispatchAction({ - type: 'brush', - command: 'clear', - // Clear all areas of all brush components. - areas: [] - }); - } - else { - api.dispatchAction({ - type: 'takeGlobalCursor', - key: 'brush', - brushOption: { - brushType: type === 'keep' - ? brushType - : (brushType === type ? false : type), - brushMode: type === 'keep' - ? (brushMode === 'multiple' ? 'single' : 'multiple') - : brushMode - } - }); - } -}; + /** + * key like x_0, y_1 + * @private + * @type {Object} + */ + this._dataIntervalByAxis = {}; -register$1('brush', Brush); + /** + * @private + */ + this._dataInfo = {}; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + /** + * key like x_0, y_1 + * @private + */ + this._axisProxies = {}; -/** - * Brush component entry - */ + /** + * @readOnly + */ + this.textStyleModel; -registerPreprocessor(preprocessor$1); + /** + * @private + */ + this._autoThrottle = true; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + /** + * It is `[rangeModeForMin, rangeModeForMax]`. + * The optional values for `rangeMode`: + * + `'value'` mode: the axis extent will always be determined by + * `dataZoom.startValue` and `dataZoom.endValue`, despite + * how data like and how `axis.min` and `axis.max` are. + * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`, + * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`, + * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`. + * Axis extent will be determined by the result of the percent of `[dMin, dMax]`. + * + * For example, when users are using dynamic data (update data periodically via `setOption`), + * if in `'value`' mode, the window will be kept in a fixed value range despite how + * data are appended, while if in `'percent'` mode, whe window range will be changed alone with + * the appended data (suppose `axis.min` and `axis.max` are not specified). + * + * @private + */ + this._rangePropMode = ['percent', 'percent']; -// (24*60*60*1000) -var PROXIMATE_ONE_DAY = 86400000; + var inputRawOption = retrieveRawOption(option); -/** - * Calendar - * - * @constructor - * - * @param {Object} calendarModel calendarModel - * @param {Object} ecModel ecModel - * @param {Object} api api - */ -function Calendar(calendarModel, ecModel, api) { - this._model = calendarModel; -} + /** + * Suppose a "main process" start at the point that model prepared (that is, + * model initialized or merged or method called in `action`). + * We should keep the `main process` idempotent, that is, given a set of values + * on `option`, we get the same result. + * + * But sometimes, values on `option` will be updated for providing users + * a "final calculated value" (`dataZoomProcessor` will do that). Those value + * should not be the base/input of the `main process`. + * + * So in that case we should save and keep the input of the `main process` + * separately, called `settledOption`. + * + * For example, consider the case: + * (Step_1) brush zoom the grid by `toolbox.dataZoom`, + * where the original input `option.startValue`, `option.endValue` are earsed by + * calculated value. + * (Step)2) click the legend to hide and show a series, + * where the new range is calculated by the earsed `startValue` and `endValue`, + * which brings incorrect result. + * + * @readOnly + */ + this.settledOption = inputRawOption; -Calendar.prototype = { + this.mergeDefaultAndTheme(option, ecModel); - constructor: Calendar, + this.doInit(inputRawOption); + }, - type: 'calendar', + /** + * @override + */ + mergeOption: function (newOption) { + var inputRawOption = retrieveRawOption(newOption); - dimensions: ['time', 'value'], + //FIX #2591 + merge(this.option, newOption, true); + merge(this.settledOption, inputRawOption, true); - // Required in createListFromData - getDimensionsInfo: function () { - return [{name: 'time', type: 'time'}, 'value']; + this.doInit(inputRawOption); }, - getRangeInfo: function () { - return this._rangeInfo; - }, + /** + * @protected + */ + doInit: function (inputRawOption) { + var thisOption = this.option; - getModel: function () { - return this._model; - }, + // Disable realtime view update if canvas is not supported. + if (!env$1.canvasSupported) { + thisOption.realtime = false; + } - getRect: function () { - return this._rect; - }, + this._setDefaultThrottle(inputRawOption); - getCellWidth: function () { - return this._sw; - }, + updateRangeUse(this, inputRawOption); - getCellHeight: function () { - return this._sh; - }, + var settledOption = this.settledOption; + each$19([['start', 'startValue'], ['end', 'endValue']], function (names, index) { + // start/end has higher priority over startValue/endValue if they + // both set, but we should make chart.setOption({endValue: 1000}) + // effective, rather than chart.setOption({endValue: 1000, end: null}). + if (this._rangePropMode[index] === 'value') { + thisOption[names[0]] = settledOption[names[0]] = null; + } + // Otherwise do nothing and use the merge result. + }, this); - getOrient: function () { - return this._orient; - }, + this.textStyleModel = this.getModel('textStyle'); - /** - * getFirstDayOfWeek - * - * @example - * 0 : start at Sunday - * 1 : start at Monday - * - * @return {number} - */ - getFirstDayOfWeek: function () { - return this._firstDayOfWeek; + this._resetTarget(); + + this._giveAxisProxies(); }, /** - * get date info - * - * @param {string|number} date date - * @return {Object} - * { - * y: string, local full year, eg., '1940', - * m: string, local month, from '01' ot '12', - * d: string, local date, from '01' to '31' (if exists), - * day: It is not date.getDay(). It is the location of the cell in a week, from 0 to 6, - * time: timestamp, - * formatedDate: string, yyyy-MM-dd, - * date: original date object. - * } + * @private */ - getDateInfo: function (date) { - - date = parseDate(date); + _giveAxisProxies: function () { + var axisProxies = this._axisProxies; - var y = date.getFullYear(); + this.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel, ecModel) { + var axisModel = this.dependentModels[dimNames.axis][axisIndex]; - var m = date.getMonth() + 1; - m = m < 10 ? '0' + m : m; + // If exists, share axisProxy with other dataZoomModels. + var axisProxy = axisModel.__dzAxisProxy || ( + // Use the first dataZoomModel as the main model of axisProxy. + axisModel.__dzAxisProxy = new AxisProxy( + dimNames.name, axisIndex, this, ecModel + ) + ); + // FIXME + // dispose __dzAxisProxy - var d = date.getDate(); - d = d < 10 ? '0' + d : d; + axisProxies[dimNames.name + '_' + axisIndex] = axisProxy; + }, this); + }, - var day = date.getDay(); + /** + * @private + */ + _resetTarget: function () { + var thisOption = this.option; - day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); + var autoMode = this._judgeAutoMode(); - return { - y: y, - m: m, - d: d, - day: day, - time: date.getTime(), - formatedDate: y + '-' + m + '-' + d, - date: date - }; - }, + eachAxisDim(function (dimNames) { + var axisIndexName = dimNames.axisIndex; + thisOption[axisIndexName] = normalizeToArray( + thisOption[axisIndexName] + ); + }, this); - getNextNDay: function (date, n) { - n = n || 0; - if (n === 0) { - return this.getDateInfo(date); + if (autoMode === 'axisIndex') { + this._autoSetAxisIndex(); + } + else if (autoMode === 'orient') { + this._autoSetOrient(); } - - date = new Date(this.getDateInfo(date).time); - date.setDate(date.getDate() + n); - - return this.getDateInfo(date); }, - update: function (ecModel, api) { - - this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay'); - this._orient = this._model.get('orient'); - this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0; - - - this._rangeInfo = this._getRangeInfo(this._initRangeOption()); - var weeks = this._rangeInfo.weeks || 1; - var whNames = ['width', 'height']; - var cellSize = this._model.get('cellSize').slice(); - var layoutParams = this._model.getBoxLayoutParams(); - var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; + /** + * @private + */ + _judgeAutoMode: function () { + // Auto set only works for setOption at the first time. + // The following is user's reponsibility. So using merged + // option is OK. + var thisOption = this.option; - each$1([0, 1], function (idx) { - if (cellSizeSpecified(cellSize, idx)) { - layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; + var hasIndexSpecified = false; + eachAxisDim(function (dimNames) { + // When user set axisIndex as a empty array, we think that user specify axisIndex + // but do not want use auto mode. Because empty array may be encountered when + // some error occured. + if (thisOption[dimNames.axisIndex] != null) { + hasIndexSpecified = true; } - }); + }, this); - var whGlobal = { - width: api.getWidth(), - height: api.getHeight() - }; - var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); + var orient = thisOption.orient; - each$1([0, 1], function (idx) { - if (!cellSizeSpecified(cellSize, idx)) { - cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; + if (orient == null && hasIndexSpecified) { + return 'orient'; + } + else if (!hasIndexSpecified) { + if (orient == null) { + thisOption.orient = 'horizontal'; } - }); - - function cellSizeSpecified(cellSize, idx) { - return cellSize[idx] != null && cellSize[idx] !== 'auto'; + return 'axisIndex'; } - - this._sw = cellSize[0]; - this._sh = cellSize[1]; }, - /** - * Convert a time data(time, value) item to (x, y) point. - * - * @override - * @param {Array|number} data data - * @param {boolean} [clamp=true] out of range - * @return {Array} point + * @private */ - dataToPoint: function (data, clamp) { - isArray(data) && (data = data[0]); - clamp == null && (clamp = true); + _autoSetAxisIndex: function () { + var autoAxisIndex = true; + var orient = this.get('orient', true); + var thisOption = this.option; + var dependentModels = this.dependentModels; - var dayInfo = this.getDateInfo(data); - var range = this._rangeInfo; - var date = dayInfo.formatedDate; + if (autoAxisIndex) { + // Find axis that parallel to dataZoom as default. + var dimName = orient === 'vertical' ? 'y' : 'x'; - // if not in range return [NaN, NaN] - if (clamp && !( - dayInfo.time >= range.start.time - && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY - )) { - return [NaN, NaN]; + if (dependentModels[dimName + 'Axis'].length) { + thisOption[dimName + 'AxisIndex'] = [0]; + autoAxisIndex = false; + } + else { + each$19(dependentModels.singleAxis, function (singleAxisModel) { + if (autoAxisIndex && singleAxisModel.get('orient', true) === orient) { + thisOption.singleAxisIndex = [singleAxisModel.componentIndex]; + autoAxisIndex = false; + } + }); + } } - var week = dayInfo.day; - var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek; - - if (this._orient === 'vertical') { - return [ - this._rect.x + week * this._sw + this._sw / 2, - this._rect.y + nthWeek * this._sh + this._sh / 2 - ]; - + if (autoAxisIndex) { + // Find the first category axis as default. (consider polar) + eachAxisDim(function (dimNames) { + if (!autoAxisIndex) { + return; + } + var axisIndices = []; + var axisModels = this.dependentModels[dimNames.axis]; + if (axisModels.length && !axisIndices.length) { + for (var i = 0, len = axisModels.length; i < len; i++) { + if (axisModels[i].get('type') === 'category') { + axisIndices.push(i); + } + } + } + thisOption[dimNames.axisIndex] = axisIndices; + if (axisIndices.length) { + autoAxisIndex = false; + } + }, this); } - return [ - this._rect.x + nthWeek * this._sw + this._sw / 2, - this._rect.y + week * this._sh + this._sh / 2 - ]; - - }, + if (autoAxisIndex) { + // FIXME + // 这里是兼容ec2的写法(没指定xAxisIndex和yAxisIndex时把scatter和双数值轴折柱纳入dataZoom控制), + // 但是实际是否需要Grid.js#getScaleByOption来判断(考虑time,log等axis type)? - /** - * Convert a (x, y) point to time data - * - * @override - * @param {string} point point - * @return {string} data - */ - pointToData: function (point) { + // If both dataZoom.xAxisIndex and dataZoom.yAxisIndex is not specified, + // dataZoom component auto adopts series that reference to + // both xAxis and yAxis which type is 'value'. + this.ecModel.eachSeries(function (seriesModel) { + if (this._isSeriesHasAllAxesTypeOf(seriesModel, 'value')) { + eachAxisDim(function (dimNames) { + var axisIndices = thisOption[dimNames.axisIndex]; - var date = this.pointToDate(point); + var axisIndex = seriesModel.get(dimNames.axisIndex); + var axisId = seriesModel.get(dimNames.axisId); - return date && date.time; - }, + var axisModel = seriesModel.ecModel.queryComponents({ + mainType: dimNames.axis, + index: axisIndex, + id: axisId + })[0]; + + if (__DEV__) { + if (!axisModel) { + throw new Error( + dimNames.axis + ' "' + retrieve( + axisIndex, + axisId, + 0 + ) + '" not found' + ); + } + } + axisIndex = axisModel.componentIndex; + + if (indexOf(axisIndices, axisIndex) < 0) { + axisIndices.push(axisIndex); + } + }); + } + }, this); + } + }, /** - * Convert a time date item to (x, y) four point. - * - * @param {Array} data date[0] is date - * @param {boolean} [clamp=true] out of range - * @return {Object} point + * @private */ - dataToRect: function (data, clamp) { - var point = this.dataToPoint(data, clamp); - - return { - contentShape: { - x: point[0] - (this._sw - this._lineWidth) / 2, - y: point[1] - (this._sh - this._lineWidth) / 2, - width: this._sw - this._lineWidth, - height: this._sh - this._lineWidth - }, + _autoSetOrient: function () { + var dim; - center: point, + // Find the first axis + this.eachTargetAxis(function (dimNames) { + !dim && (dim = dimNames.name); + }, this); - tl: [ - point[0] - this._sw / 2, - point[1] - this._sh / 2 - ], + this.option.orient = dim === 'y' ? 'vertical' : 'horizontal'; + }, - tr: [ - point[0] + this._sw / 2, - point[1] - this._sh / 2 - ], + /** + * @private + */ + _isSeriesHasAllAxesTypeOf: function (seriesModel, axisType) { + // FIXME + // 需要series的xAxisIndex和yAxisIndex都首先自动设置上。 + // 例如series.type === scatter时。 - br: [ - point[0] + this._sw / 2, - point[1] + this._sh / 2 - ], + var is = true; + eachAxisDim(function (dimNames) { + var seriesAxisIndex = seriesModel.get(dimNames.axisIndex); + var axisModel = this.dependentModels[dimNames.axis][seriesAxisIndex]; - bl: [ - point[0] - this._sw / 2, - point[1] + this._sh / 2 - ] + if (!axisModel || axisModel.get('type') !== axisType) { + is = false; + } + }, this); + return is; + }, - }; + /** + * @private + */ + _setDefaultThrottle: function (inputRawOption) { + // When first time user set throttle, auto throttle ends. + if (inputRawOption.hasOwnProperty('throttle')) { + this._autoThrottle = false; + } + if (this._autoThrottle) { + var globalOption = this.ecModel.option; + this.option.throttle = ( + globalOption.animation && globalOption.animationDurationUpdate > 0 + ) ? 100 : 20; + } }, /** - * Convert a (x, y) point to time date - * - * @param {Array} point point - * @return {Object} date + * @public */ - pointToDate: function (point) { - var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; - var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; - var range = this._rangeInfo.range; + getFirstTargetAxisModel: function () { + var firstAxisModel; + eachAxisDim(function (dimNames) { + if (firstAxisModel == null) { + var indices = this.get(dimNames.axisIndex); + if (indices.length) { + firstAxisModel = this.dependentModels[dimNames.axis][indices[0]]; + } + } + }, this); - if (this._orient === 'vertical') { - return this._getDateByWeeksAndDay(nthY, nthX - 1, range); - } + return firstAxisModel; + }, - return this._getDateByWeeksAndDay(nthX, nthY - 1, range); + /** + * @public + * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel + */ + eachTargetAxis: function (callback, context) { + var ecModel = this.ecModel; + eachAxisDim(function (dimNames) { + each$19( + this.get(dimNames.axisIndex), + function (axisIndex) { + callback.call(context, dimNames, axisIndex, this, ecModel); + }, + this + ); + }, this); }, /** - * @inheritDoc + * @param {string} dimName + * @param {number} axisIndex + * @return {module:echarts/component/dataZoom/AxisProxy} If not found, return null/undefined. */ - convertToPixel: curry(doConvert$2, 'dataToPoint'), + getAxisProxy: function (dimName, axisIndex) { + return this._axisProxies[dimName + '_' + axisIndex]; + }, /** - * @inheritDoc + * @param {string} dimName + * @param {number} axisIndex + * @return {module:echarts/model/Model} If not found, return null/undefined. */ - convertFromPixel: curry(doConvert$2, 'pointToData'), + getAxisModel: function (dimName, axisIndex) { + var axisProxy = this.getAxisProxy(dimName, axisIndex); + return axisProxy && axisProxy.getAxisModel(); + }, /** - * initRange + * If not specified, set to undefined. * - * @private - * @return {Array} [start, end] + * @public + * @param {Object} opt + * @param {number} [opt.start] + * @param {number} [opt.end] + * @param {number} [opt.startValue] + * @param {number} [opt.endValue] */ - _initRangeOption: function () { - var range = this._model.get('range'); - - var rg = range; - - if (isArray(rg) && rg.length === 1) { - rg = rg[0]; - } - - if (/^\d{4}$/.test(rg)) { - range = [rg + '-01-01', rg + '-12-31']; - } + setRawRange: function (opt) { + var thisOption = this.option; + var settledOption = this.settledOption; + each$19([['start', 'startValue'], ['end', 'endValue']], function (names) { + // Consider the pair : + // If one has value and the other one is `null/undefined`, we both set them + // to `settledOption`. This strategy enables the feature to clear the original + // value in `settledOption` to `null/undefined`. + // But if both of them are `null/undefined`, we do not set them to `settledOption` + // and keep `settledOption` with the original value. This strategy enables users to + // only set but not set when calling + // `dispatchAction`. + // The pair is treated in the same way. + if (opt[names[0]] != null || opt[names[1]] != null) { + thisOption[names[0]] = settledOption[names[0]] = opt[names[0]]; + thisOption[names[1]] = settledOption[names[1]] = opt[names[1]]; + } + }, this); - if (/^\d{4}[\/|-]\d{1,2}$/.test(rg)) { + updateRangeUse(this, opt); + }, - var start = this.getDateInfo(rg); - var firstDay = start.date; - firstDay.setMonth(firstDay.getMonth() + 1); + /** + * @public + * @param {Object} opt + * @param {number} [opt.start] + * @param {number} [opt.end] + * @param {number} [opt.startValue] + * @param {number} [opt.endValue] + */ + setCalculatedRange: function (opt) { + var option = this.option; + each$19(['start', 'startValue', 'end', 'endValue'], function (name) { + option[name] = opt[name]; + }); + }, - var end = this.getNextNDay(firstDay, -1); - range = [start.formatedDate, end.formatedDate]; + /** + * @public + * @return {Array.} [startPercent, endPercent] + */ + getPercentRange: function () { + var axisProxy = this.findRepresentativeAxisProxy(); + if (axisProxy) { + return axisProxy.getDataPercentWindow(); } + }, - if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rg)) { - range = [rg, rg]; + /** + * @public + * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0); + * + * @param {string} [axisDimName] + * @param {number} [axisIndex] + * @return {Array.} [startValue, endValue] value can only be '-' or finite number. + */ + getValueRange: function (axisDimName, axisIndex) { + if (axisDimName == null && axisIndex == null) { + var axisProxy = this.findRepresentativeAxisProxy(); + if (axisProxy) { + return axisProxy.getDataValueWindow(); + } } - - var tmp = this._getRangeInfo(range); - - if (tmp.start.time > tmp.end.time) { - range.reverse(); + else { + return this.getAxisProxy(axisDimName, axisIndex).getDataValueWindow(); } - - return range; }, /** - * range info - * - * @private - * @param {Array} range range ['2017-01-01', '2017-07-08'] - * If range[0] > range[1], they will not be reversed. - * @return {Object} obj + * @public + * @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy + * corresponding to the axisModel + * @return {module:echarts/component/dataZoom/AxisProxy} */ - _getRangeInfo: function (range) { - range = [ - this.getDateInfo(range[0]), - this.getDateInfo(range[1]) - ]; - - var reversed; - if (range[0].time > range[1].time) { - reversed = true; - range.reverse(); + findRepresentativeAxisProxy: function (axisModel) { + if (axisModel) { + return axisModel.__dzAxisProxy; } - var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) - - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; - - // Consider case: - // Firstly set system timezone as "Time Zone: America/Toronto", - // ``` - // var first = new Date(1478412000000 - 3600 * 1000 * 2.5); - // var second = new Date(1478412000000); - // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; - // ``` - // will get wrong result because of DST. So we should fix it. - var date = new Date(range[0].time); - var startDateNum = date.getDate(); - var endDateNum = range[1].date.getDate(); - date.setDate(startDateNum + allDay - 1); - // The bias can not over a month, so just compare date. - if (date.getDate() !== endDateNum) { - var sign = date.getTime() - range[1].time > 0 ? 1 : -1; - while (date.getDate() !== endDateNum && (date.getTime() - range[1].time) * sign > 0) { - allDay -= sign; - date.setDate(startDateNum + allDay - 1); + // Find the first hosted axisProxy + var axisProxies = this._axisProxies; + for (var key in axisProxies) { + if (axisProxies.hasOwnProperty(key) && axisProxies[key].hostedBy(this)) { + return axisProxies[key]; } } - var weeks = Math.floor((allDay + range[0].day + 6) / 7); - var nthWeek = reversed ? -weeks + 1: weeks - 1; - - reversed && range.reverse(); - - return { - range: [range[0].formatedDate, range[1].formatedDate], - start: range[0], - end: range[1], - allDay: allDay, - weeks: weeks, - // From 0. - nthWeek: nthWeek, - fweek: range[0].day, - lweek: range[1].day - }; + // If no hosted axis find not hosted axisProxy. + // Consider this case: dataZoomModel1 and dataZoomModel2 control the same axis, + // and the option.start or option.end settings are different. The percentRange + // should follow axisProxy. + // (We encounter this problem in toolbox data zoom.) + for (var key in axisProxies) { + if (axisProxies.hasOwnProperty(key) && !axisProxies[key].hostedBy(this)) { + return axisProxies[key]; + } + } }, /** - * get date by nthWeeks and week day in range - * - * @private - * @param {number} nthWeek the week - * @param {number} day the week day - * @param {Array} range [d1, d2] - * @return {Object} + * @return {Array.} */ - _getDateByWeeksAndDay: function (nthWeek, day, range) { - var rangeInfo = this._getRangeInfo(range); - - if (nthWeek > rangeInfo.weeks - || (nthWeek === 0 && day < rangeInfo.fweek) - || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) - ) { - return false; - } - - var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; - var date = new Date(rangeInfo.start.time); - date.setDate(rangeInfo.start.d + nthDay); - - return this.getDateInfo(date); + getRangePropMode: function () { + return this._rangePropMode.slice(); } -}; -Calendar.dimensions = Calendar.prototype.dimensions; - -Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; +}); -Calendar.create = function (ecModel, api) { - var calendarList = []; +/** + * Retrieve the those raw params from option, which will be cached separately. + * becasue they will be overwritten by normalized/calculated values in the main + * process. + */ +function retrieveRawOption(option) { + var ret = {}; + each$19( + ['start', 'end', 'startValue', 'endValue', 'throttle'], + function (name) { + option.hasOwnProperty(name) && (ret[name] = option[name]); + } + ); + return ret; +} - ecModel.eachComponent('calendar', function (calendarModel) { - var calendar = new Calendar(calendarModel, ecModel, api); - calendarList.push(calendar); - calendarModel.coordinateSystem = calendar; - }); +function updateRangeUse(dataZoomModel, inputRawOption) { + var rangePropMode = dataZoomModel._rangePropMode; + var rangeModeInOption = dataZoomModel.get('rangeMode'); - ecModel.eachSeries(function (calendarSeries) { - if (calendarSeries.get('coordinateSystem') === 'calendar') { - // Inject coordinate system - calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; + each$19([['start', 'startValue'], ['end', 'endValue']], function (names, index) { + var percentSpecified = inputRawOption[names[0]] != null; + var valueSpecified = inputRawOption[names[1]] != null; + if (percentSpecified && !valueSpecified) { + rangePropMode[index] = 'percent'; + } + else if (!percentSpecified && valueSpecified) { + rangePropMode[index] = 'value'; + } + else if (rangeModeInOption) { + rangePropMode[index] = rangeModeInOption[index]; + } + else if (percentSpecified) { // percentSpecified && valueSpecified + rangePropMode[index] = 'percent'; } + // else remain its original setting. }); - return calendarList; -}; - -function doConvert$2(methodName, ecModel, finder, value) { - var calendarModel = finder.calendarModel; - var seriesModel = finder.seriesModel; - - var coordSys = calendarModel - ? calendarModel.coordinateSystem - : seriesModel - ? seriesModel.coordinateSystem - : null; - - return coordSys === this ? coordSys[methodName](value) : null; } -CoordinateSystemManager.register('calendar', Calendar); - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -78219,135 +82037,259 @@ CoordinateSystemManager.register('calendar', Calendar); * under the License. */ -var CalendarModel = ComponentModel.extend({ +var DataZoomView = Component$1.extend({ - type: 'calendar', + type: 'dataZoom', + + render: function (dataZoomModel, ecModel, api, payload) { + this.dataZoomModel = dataZoomModel; + this.ecModel = ecModel; + this.api = api; + }, /** - * @type {module:echarts/coord/calendar/Calendar} + * Find the first target coordinate system. + * + * @protected + * @return {Object} { + * grid: [ + * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1}, + * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0}, + * ... + * ], // cartesians must not be null/undefined. + * polar: [ + * {model: coord0, axisModels: [axis4], coordIndex: 0}, + * ... + * ], // polars must not be null/undefined. + * singleAxis: [ + * {model: coord0, axisModels: [], coordIndex: 0} + * ] */ - coordinateSystem: null, - - defaultOption: { - zlevel: 0, - z: 2, - left: 80, - top: 60, - - cellSize: 20, + getTargetCoordInfo: function () { + var dataZoomModel = this.dataZoomModel; + var ecModel = this.ecModel; + var coordSysLists = {}; - // horizontal vertical - orient: 'horizontal', + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { + var axisModel = ecModel.getComponent(dimNames.axis, axisIndex); + if (axisModel) { + var coordModel = axisModel.getCoordSysModel(); + coordModel && save( + coordModel, + axisModel, + coordSysLists[coordModel.mainType] || (coordSysLists[coordModel.mainType] = []), + coordModel.componentIndex + ); + } + }, this); - // month separate line style - splitLine: { - show: true, - lineStyle: { - color: '#000', - width: 1, - type: 'solid' + function save(coordModel, axisModel, store, coordIndex) { + var item; + for (var i = 0; i < store.length; i++) { + if (store[i].model === coordModel) { + item = store[i]; + break; + } } - }, + if (!item) { + store.push(item = { + model: coordModel, axisModels: [], coordIndex: coordIndex + }); + } + item.axisModels.push(axisModel); + } - // rect style temporarily unused emphasis - itemStyle: { - color: '#fff', - borderWidth: 1, - borderColor: '#ccc' - }, + return coordSysLists; + } - // week text style - dayLabel: { - show: true, +}); - // a week first day - firstDay: 0, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // start end - position: 'start', - margin: '50%', // 50% of cellSize - nameMap: 'en', - color: '#000' - }, +DataZoomModel.extend({ + type: 'dataZoom.select' +}); - // month text style - monthLabel: { - show: true, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // start end - position: 'start', - margin: 5, +DataZoomView.extend({ + type: 'dataZoom.select' +}); - // center or left - align: 'center', +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // cn en [] - nameMap: 'en', - formatter: null, - color: '#000' - }, +registerProcessor({ - // year text style - yearLabel: { - show: true, + // `dataZoomProcessor` will only be performed in needed series. Consider if + // there is a line series and a pie series, it is better not to update the + // line series if only pie series is needed to be updated. + getTargetSeries: function (ecModel) { + var seriesModelMap = createHashMap(); - // top bottom left right - position: null, - margin: 30, - formatter: null, - color: '#ccc', - fontFamily: 'sans-serif', - fontWeight: 'bolder', - fontSize: 20 - } + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { + var axisProxy = dataZoomModel.getAxisProxy(dimNames.name, axisIndex); + each$1(axisProxy.getTargetSeriesModels(), function (seriesModel) { + seriesModelMap.set(seriesModel.uid, seriesModel); + }); + }); + }); + + return seriesModelMap; }, - /** - * @override - */ - init: function (option, parentModel, ecModel, extraOpt) { - var inputPositionParams = getLayoutParams(option); + modifyOutputEnd: true, - CalendarModel.superApply(this, 'init', arguments); + // Consider appendData, where filter should be performed. Because data process is + // in block mode currently, it is not need to worry about that the overallProgress + // execute every frame. + overallReset: function (ecModel, api) { - mergeAndNormalizeLayoutParams$1(option, inputPositionParams); - }, + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + // We calculate window and reset axis here but not in model + // init stage and not after action dispatch handler, because + // reset should be called after seriesData.restoreData. + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { + dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel, api); + }); - /** - * @override - */ - mergeOption: function (option, extraOpt) { - CalendarModel.superApply(this, 'mergeOption', arguments); + // Caution: data zoom filtering is order sensitive when using + // percent range and no min/max/scale set on axis. + // For example, we have dataZoom definition: + // [ + // {xAxisIndex: 0, start: 30, end: 70}, + // {yAxisIndex: 0, start: 20, end: 80} + // ] + // In this case, [20, 80] of y-dataZoom should be based on data + // that have filtered by x-dataZoom using range of [30, 70], + // but should not be based on full raw data. Thus sliding + // x-dataZoom will change both ranges of xAxis and yAxis, + // while sliding y-dataZoom will only change the range of yAxis. + // So we should filter x-axis after reset x-axis immediately, + // and then reset y-axis and filter y-axis. + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { + dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel, api); + }); + }); + + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + // Fullfill all of the range props so that user + // is able to get them from chart.getOption(). + var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + var percentRange = axisProxy.getDataPercentWindow(); + var valueRange = axisProxy.getDataValueWindow(); - mergeAndNormalizeLayoutParams$1(this.option, option); + dataZoomModel.setCalculatedRange({ + start: percentRange[0], + end: percentRange[1], + startValue: valueRange[0], + endValue: valueRange[1] + }); + }); } }); -function mergeAndNormalizeLayoutParams$1(target, raw) { - // Normalize cellSize - var cellSize = target.cellSize; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - if (!isArray(cellSize)) { - cellSize = target.cellSize = [cellSize, cellSize]; - } - else if (cellSize.length === 1) { - cellSize[1] = cellSize[0]; - } +registerAction('dataZoom', function (payload, ecModel) { - var ignoreSize = map([0, 1], function (hvIdx) { - // If user have set `width` or both `left` and `right`, cellSize - // will be automatically set to 'auto', otherwise the default - // setting of cellSize will make `width` setting not work. - if (sizeCalculable(raw, hvIdx)) { - cellSize[hvIdx] = 'auto'; + var linkedNodesFinder = createLinkedNodesFinder( + bind(ecModel.eachComponent, ecModel, 'dataZoom'), + eachAxisDim$1, + function (model, dimNames) { + return model.get(dimNames.axisIndex); } - return cellSize[hvIdx] != null && cellSize[hvIdx] !== 'auto'; - }); + ); - mergeLayoutParam(target, raw, { - type: 'box', ignoreSize: ignoreSize + var effectedModels = []; + + ecModel.eachComponent( + {mainType: 'dataZoom', query: payload}, + function (model, index) { + effectedModels.push.apply( + effectedModels, linkedNodesFinder(model).nodes + ); + } + ); + + each$1(effectedModels, function (dataZoomModel, index) { + dataZoomModel.setRawRange({ + start: payload.start, + end: payload.end, + startValue: payload.startValue, + endValue: payload.endValue + }); }); -} + +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -78368,477 +82310,378 @@ function mergeAndNormalizeLayoutParams$1(target, raw) { * under the License. */ -var MONTH_TEXT = { - EN: [ - 'Jan', 'Feb', 'Mar', - 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec' - ], - CN: [ - '一月', '二月', '三月', - '四月', '五月', '六月', - '七月', '八月', '九月', - '十月', '十一月', '十二月' - ] -}; - -var WEEK_TEXT = { - EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], - CN: ['日', '一', '二', '三', '四', '五', '六'] -}; +/** + * Only work for toolbox dataZoom. User + * MUST NOT import this module directly. + */ -extendComponentView({ +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - type: 'calendar', +// Use dataZoomSelect +var dataZoomLang = lang.toolbox.dataZoom; +var each$16 = each$1; - /** - * top/left line points - * @private - */ - _tlpoints: null, +// Spectial component id start with \0ec\0, see echarts/model/Global.js~hasInnerId +var DATA_ZOOM_ID_BASE = '\0_ec_\0toolbox-dataZoom_'; - /** - * bottom/right line points - * @private - */ - _blpoints: null, +function DataZoom(model, ecModel, api) { /** - * first day of month - * @private + * @private + * @type {module:echarts/component/helper/BrushController} */ - _firstDayOfMonth: null, + (this._brushController = new BrushController(api.getZr())) + .on('brush', bind(this._onBrush, this)) + .mount(); /** - * first day point of month - * @private + * @private + * @type {boolean} */ - _firstDayPoints: null, + this._isZoomActive; +} - render: function (calendarModel, ecModel, api) { +DataZoom.defaultOption = { + show: true, + filterMode: 'filter', + // Icon group + icon: { + zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1', + back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26' + }, + // `zoom`, `back` + title: clone(dataZoomLang.title) +}; - var group = this.group; +var proto$4 = DataZoom.prototype; - group.removeAll(); +proto$4.render = function (featureModel, ecModel, api, payload) { + this.model = featureModel; + this.ecModel = ecModel; + this.api = api; - var coordSys = calendarModel.coordinateSystem; + updateZoomBtnStatus(featureModel, ecModel, this, payload, api); + updateBackBtnStatus(featureModel, ecModel); +}; - // range info - var rangeData = coordSys.getRangeInfo(); - var orient = coordSys.getOrient(); +proto$4.onclick = function (ecModel, api, type) { + handlers$1[type].call(this); +}; - this._renderDayRect(calendarModel, rangeData, group); +proto$4.remove = function (ecModel, api) { + this._brushController.unmount(); +}; - // _renderLines must be called prior to following function - this._renderLines(calendarModel, rangeData, orient, group); +proto$4.dispose = function (ecModel, api) { + this._brushController.dispose(); +}; - this._renderYearText(calendarModel, rangeData, orient, group); +/** + * @private + */ +var handlers$1 = { - this._renderMonthText(calendarModel, orient, group); + zoom: function () { + var nextActive = !this._isZoomActive; - this._renderWeekText(calendarModel, rangeData, orient, group); + this.api.dispatchAction({ + type: 'takeGlobalCursor', + key: 'dataZoomSelect', + dataZoomSelectActive: nextActive + }); }, - // render day rect - _renderDayRect: function (calendarModel, rangeData, group) { - var coordSys = calendarModel.coordinateSystem; - var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); - var sw = coordSys.getCellWidth(); - var sh = coordSys.getCellHeight(); - - for (var i = rangeData.start.time; - i <= rangeData.end.time; - i = coordSys.getNextNDay(i, 1).time - ) { + back: function () { + this._dispatchZoomAction(pop(this.ecModel)); + } +}; - var point = coordSys.dataToRect([i], false).tl; +/** + * @private + */ +proto$4._onBrush = function (areas, opt) { + if (!opt.isEnd || !areas.length) { + return; + } + var snapshot = {}; + var ecModel = this.ecModel; - // every rect - var rect = new Rect({ - shape: { - x: point[0], - y: point[1], - width: sw, - height: sh - }, - cursor: 'default', - style: itemRectStyleModel - }); + this._brushController.updateCovers([]); // remove cover - group.add(rect); + var brushTargetManager = new BrushTargetManager( + retrieveAxisSetting(this.model.option), ecModel, {include: ['grid']} + ); + brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { + if (coordSys.type !== 'cartesian2d') { + return; } - }, + var brushType = area.brushType; + if (brushType === 'rect') { + setBatch('x', coordSys, coordRange[0]); + setBatch('y', coordSys, coordRange[1]); + } + else { + setBatch(({lineX: 'x', lineY: 'y'})[brushType], coordSys, coordRange); + } + }); - // render separate line - _renderLines: function (calendarModel, rangeData, orient, group) { + push(ecModel, snapshot); - var self = this; + this._dispatchZoomAction(snapshot); - var coordSys = calendarModel.coordinateSystem; + function setBatch(dimName, coordSys, minMax) { + var axis = coordSys.getAxis(dimName); + var axisModel = axis.model; + var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); - var lineStyleModel = calendarModel.getModel('splitLine.lineStyle').getLineStyle(); - var show = calendarModel.get('splitLine.show'); + // Restrict range. + var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); + if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { + minMax = sliderMove( + 0, minMax.slice(), axis.scale.getExtent(), 0, + minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan + ); + } - var lineWidth = lineStyleModel.lineWidth; + dataZoomModel && (snapshot[dataZoomModel.id] = { + dataZoomId: dataZoomModel.id, + startValue: minMax[0], + endValue: minMax[1] + }); + } - this._tlpoints = []; - this._blpoints = []; - this._firstDayOfMonth = []; - this._firstDayPoints = []; + function findDataZoom(dimName, axisModel, ecModel) { + var found; + ecModel.eachComponent({mainType: 'dataZoom', subType: 'select'}, function (dzModel) { + var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); + has && (found = dzModel); + }); + return found; + } +}; +/** + * @private + */ +proto$4._dispatchZoomAction = function (snapshot) { + var batch = []; - var firstDay = rangeData.start; + // Convert from hash map to array. + each$16(snapshot, function (batchItem, dataZoomId) { + batch.push(clone(batchItem)); + }); - for (var i = 0; firstDay.time <= rangeData.end.time; i++) { - addPoints(firstDay.formatedDate); + batch.length && this.api.dispatchAction({ + type: 'dataZoom', + from: this.uid, + batch: batch + }); +}; - if (i === 0) { - firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); - } +function retrieveAxisSetting(option) { + var setting = {}; + // Compatible with previous setting: null => all axis, false => no axis. + each$1(['xAxisIndex', 'yAxisIndex'], function (name) { + setting[name] = option[name]; + setting[name] == null && (setting[name] = 'all'); + (setting[name] === false || setting[name] === 'none') && (setting[name] = []); + }); + return setting; +} - var date = firstDay.date; - date.setMonth(date.getMonth() + 1); - firstDay = coordSys.getDateInfo(date); - } +function updateBackBtnStatus(featureModel, ecModel) { + featureModel.setIconStatus( + 'back', + count(ecModel) > 1 ? 'emphasis' : 'normal' + ); +} - addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); +function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) { + var zoomActive = view._isZoomActive; - function addPoints(date) { + if (payload && payload.type === 'takeGlobalCursor') { + zoomActive = payload.key === 'dataZoomSelect' + ? payload.dataZoomSelectActive : false; + } - self._firstDayOfMonth.push(coordSys.getDateInfo(date)); - self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); + view._isZoomActive = zoomActive; - var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); + featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); - self._tlpoints.push(points[0]); - self._blpoints.push(points[points.length - 1]); + var brushTargetManager = new BrushTargetManager( + retrieveAxisSetting(featureModel.option), ecModel, {include: ['grid']} + ); - show && self._drawSplitline(points, lineStyleModel, group); - } + view._brushController + .setPanels(brushTargetManager.makePanelOpts(api, function (targetInfo) { + return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared) + ? 'lineX' + : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared) + ? 'lineY' + : 'rect'; + })) + .enableBrush( + zoomActive + ? { + brushType: 'auto', + brushStyle: { + // FIXME user customized? + lineWidth: 0, + fill: 'rgba(0,0,0,0.2)' + } + } + : false + ); +} - // render top/left line - show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); +register$1('dataZoom', DataZoom); - // render bottom/right line - show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); - }, +// Create special dataZoom option for select +// FIXME consider the case of merge option, where axes options are not exists. +registerPreprocessor(function (option) { + if (!option) { + return; + } - // get points at both ends - _getEdgesPoints: function (points, lineWidth, orient) { - var rs = [points[0].slice(), points[points.length - 1].slice()]; - var idx = orient === 'horizontal' ? 0 : 1; + var dataZoomOpts = option.dataZoom || (option.dataZoom = []); + if (!isArray(dataZoomOpts)) { + option.dataZoom = dataZoomOpts = [dataZoomOpts]; + } - // both ends of the line are extend half lineWidth - rs[0][idx] = rs[0][idx] - lineWidth / 2; - rs[1][idx] = rs[1][idx] + lineWidth / 2; + var toolboxOpt = option.toolbox; + if (toolboxOpt) { + // Assume there is only one toolbox + if (isArray(toolboxOpt)) { + toolboxOpt = toolboxOpt[0]; + } - return rs; - }, + if (toolboxOpt && toolboxOpt.feature) { + var dataZoomOpt = toolboxOpt.feature.dataZoom; + // FIXME: If add dataZoom when setOption in merge mode, + // no axis info to be added. See `test/dataZoom-extreme.html` + addForAxis('xAxis', dataZoomOpt); + addForAxis('yAxis', dataZoomOpt); + } + } - // render split line - _drawSplitline: function (points, lineStyleModel, group) { + function addForAxis(axisName, dataZoomOpt) { + if (!dataZoomOpt) { + return; + } - var poyline = new Polyline({ - z2: 20, - shape: { - points: points - }, - style: lineStyleModel - }); - - group.add(poyline); - }, - - // render month line of one week points - _getLinePointsOfOneWeek: function (calendarModel, date, orient) { - - var coordSys = calendarModel.coordinateSystem; - date = coordSys.getDateInfo(date); - - var points = []; - - for (var i = 0; i < 7; i++) { - - var tmpD = coordSys.getNextNDay(date.time, i); - var point = coordSys.dataToRect([tmpD.time], false); - - points[2 * tmpD.day] = point.tl; - points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; - } - - return points; - - }, - - _formatterLabel: function (formatter, params) { - - if (typeof formatter === 'string' && formatter) { - return formatTplSimple(formatter, params); - } - - if (typeof formatter === 'function') { - return formatter(params); - } - - return params.nameMap; - - }, - - _yearTextPositionControl: function (textEl, point, orient, position, margin) { - - point = point.slice(); - var aligns = ['center', 'bottom']; - - if (position === 'bottom') { - point[1] += margin; - aligns = ['center', 'top']; - } - else if (position === 'left') { - point[0] -= margin; - } - else if (position === 'right') { - point[0] += margin; - aligns = ['center', 'top']; - } - else { // top - point[1] -= margin; - } - - var rotate = 0; - if (position === 'left' || position === 'right') { - rotate = Math.PI / 2; - } - - return { - rotation: rotate, - position: point, - style: { - textAlign: aligns[0], - textVerticalAlign: aligns[1] - } - }; - }, - - // render year - _renderYearText: function (calendarModel, rangeData, orient, group) { - var yearLabel = calendarModel.getModel('yearLabel'); - - if (!yearLabel.get('show')) { - return; - } - - var margin = yearLabel.get('margin'); - var pos = yearLabel.get('position'); - - if (!pos) { - pos = orient !== 'horizontal' ? 'top' : 'left'; - } - - var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; - var xc = (points[0][0] + points[1][0]) / 2; - var yc = (points[0][1] + points[1][1]) / 2; - - var idx = orient === 'horizontal' ? 0 : 1; - - var posPoints = { - top: [xc, points[idx][1]], - bottom: [xc, points[1 - idx][1]], - left: [points[1 - idx][0], yc], - right: [points[idx][0], yc] - }; - - var name = rangeData.start.y; - - if (+rangeData.end.y > +rangeData.start.y) { - name = name + '-' + rangeData.end.y; - } - - var formatter = yearLabel.get('formatter'); - - var params = { - start: rangeData.start.y, - end: rangeData.end.y, - nameMap: name - }; - - var content = this._formatterLabel(formatter, params); - - var yearText = new Text({z2: 30}); - setTextStyle(yearText.style, yearLabel, {text: content}), - yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); - - group.add(yearText); - }, - - _monthTextPositionControl: function (point, isCenter, orient, position, margin) { - var align = 'left'; - var vAlign = 'top'; - var x = point[0]; - var y = point[1]; - - if (orient === 'horizontal') { - y = y + margin; - - if (isCenter) { - align = 'center'; - } - - if (position === 'start') { - vAlign = 'bottom'; - } - } - else { - x = x + margin; - - if (isCenter) { - vAlign = 'middle'; - } - - if (position === 'start') { - align = 'right'; - } - } - - return { - x: x, - y: y, - textAlign: align, - textVerticalAlign: vAlign - }; - }, - - // render month and year text - _renderMonthText: function (calendarModel, orient, group) { - var monthLabel = calendarModel.getModel('monthLabel'); - - if (!monthLabel.get('show')) { - return; - } - - var nameMap = monthLabel.get('nameMap'); - var margin = monthLabel.get('margin'); - var pos = monthLabel.get('position'); - var align = monthLabel.get('align'); - - var termPoints = [this._tlpoints, this._blpoints]; - - if (isString(nameMap)) { - nameMap = MONTH_TEXT[nameMap.toUpperCase()] || []; + // Try not to modify model, because it is not merged yet. + var axisIndicesName = axisName + 'Index'; + var givenAxisIndices = dataZoomOpt[axisIndicesName]; + if (givenAxisIndices != null + && givenAxisIndices !== 'all' + && !isArray(givenAxisIndices) + ) { + givenAxisIndices = (givenAxisIndices === false || givenAxisIndices === 'none') ? [] : [givenAxisIndices]; } - var idx = pos === 'start' ? 0 : 1; - var axis = orient === 'horizontal' ? 0 : 1; - margin = pos === 'start' ? -margin : margin; - var isCenter = (align === 'center'); - - for (var i = 0; i < termPoints[idx].length - 1; i++) { - - var tmp = termPoints[idx][i].slice(); - var firstDay = this._firstDayOfMonth[i]; - - if (isCenter) { - var firstDayPoints = this._firstDayPoints[i]; - tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; + forEachComponent(axisName, function (axisOpt, axisIndex) { + if (givenAxisIndices != null + && givenAxisIndices !== 'all' + && indexOf(givenAxisIndices, axisIndex) === -1 + ) { + return; } - - var formatter = monthLabel.get('formatter'); - var name = nameMap[+firstDay.m - 1]; - var params = { - yyyy: firstDay.y, - yy: (firstDay.y + '').slice(2), - MM: firstDay.m, - M: +firstDay.m, - nameMap: name + var newOpt = { + type: 'select', + $fromToolbox: true, + // Default to be filter + filterMode: dataZoomOpt.filterMode || 'filter', + // Id for merge mapping. + id: DATA_ZOOM_ID_BASE + axisName + axisIndex }; + // FIXME + // Only support one axis now. + newOpt[axisIndicesName] = axisIndex; + dataZoomOpts.push(newOpt); + }); + } - var content = this._formatterLabel(formatter, params); - - var monthText = new Text({z2: 30}); - extend( - setTextStyle(monthText.style, monthLabel, {text: content}), - this._monthTextPositionControl(tmp, isCenter, orient, pos, margin) - ); - - group.add(monthText); - } - }, - - _weekTextPositionControl: function (point, orient, position, margin, cellSize) { - var align = 'center'; - var vAlign = 'middle'; - var x = point[0]; - var y = point[1]; - var isStart = position === 'start'; - - if (orient === 'horizontal') { - x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; - align = isStart ? 'right' : 'left'; - } - else { - y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; - vAlign = isStart ? 'bottom' : 'top'; + function forEachComponent(mainType, cb) { + var opts = option[mainType]; + if (!isArray(opts)) { + opts = opts ? [opts] : []; } + each$16(opts, cb); + } +}); - return { - x: x, - y: y, - textAlign: align, - textVerticalAlign: vAlign - }; - }, - - // render weeks - _renderWeekText: function (calendarModel, rangeData, orient, group) { - var dayLabel = calendarModel.getModel('dayLabel'); - - if (!dayLabel.get('show')) { - return; - } +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - var coordSys = calendarModel.coordinateSystem; - var pos = dayLabel.get('position'); - var nameMap = dayLabel.get('nameMap'); - var margin = dayLabel.get('margin'); - var firstDayOfWeek = coordSys.getFirstDayOfWeek(); +var restoreLang = lang.toolbox.restore; - if (isString(nameMap)) { - nameMap = WEEK_TEXT[nameMap.toUpperCase()] || []; - } +function Restore(model) { + this.model = model; +} - var start = coordSys.getNextNDay( - rangeData.end.time, (7 - rangeData.lweek) - ).time; +Restore.defaultOption = { + show: true, + /* eslint-disable */ + icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', + /* eslint-enable */ + title: restoreLang.title +}; - var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; - margin = parsePercent$1(margin, cellSize[orient === 'horizontal' ? 0 : 1]); +var proto$6 = Restore.prototype; - if (pos === 'start') { - start = coordSys.getNextNDay( - rangeData.start.time, -(7 + rangeData.fweek) - ).time; - margin = -margin; - } +proto$6.onclick = function (ecModel, api, type) { + clear$1(ecModel); - for (var i = 0; i < 7; i++) { + api.dispatchAction({ + type: 'restore', + from: this.uid + }); +}; - var tmpD = coordSys.getNextNDay(start, i); - var point = coordSys.dataToRect([tmpD.time], false).center; - var day = i; - day = Math.abs((i + firstDayOfWeek) % 7); - var weekText = new Text({z2: 30}); +register$1('restore', Restore); - extend( - setTextStyle(weekText.style, dayLabel, {text: nameMap[day]}), - this._weekTextPositionControl(point, orient, pos, margin, cellSize) - ); - group.add(weekText); - } +registerAction( + {type: 'restore', event: 'restore', update: 'prepareAndUpdate'}, + function (payload, ecModel) { + ecModel.resetOption('recreate'); } -}); +); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -78859,11 +82702,6 @@ extendComponentView({ * under the License. */ -/** - * @file calendar.js - * @author dxh - */ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -78883,204 +82721,111 @@ extendComponentView({ * under the License. */ -// Model extendComponentModel({ - type: 'title', + type: 'tooltip', - layoutMode: {type: 'box', ignoreSize: true}, + dependencies: ['axisPointer'], defaultOption: { - // 一级层叠 zlevel: 0, - // 二级层叠 - z: 6, + + z: 60, + show: true, - text: '', - // 超链接跳转 - // link: null, - // 仅支持self | blank - target: 'blank', - subtext: '', + // tooltip主体内容 + showContent: true, - // 超链接跳转 - // sublink: null, - // 仅支持self | blank - subtarget: 'blank', + // 'trigger' only works on coordinate system. + // 'item' | 'axis' | 'none' + trigger: 'item', - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - left: 0, - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - top: 0, + // 'click' | 'mousemove' | 'none' + triggerOn: 'mousemove|click', - // 水平对齐 - // 'auto' | 'left' | 'right' | 'center' - // 默认根据 left 的位置判断是左对齐还是右对齐 - // textAlign: null - // - // 垂直对齐 - // 'auto' | 'top' | 'bottom' | 'middle' - // 默认根据 top 位置判断是上对齐还是下对齐 - // textBaseline: null + alwaysShowContent: false, - backgroundColor: 'rgba(0,0,0,0)', + displayMode: 'single', // 'single' | 'multipleByCoordSys' - // 标题边框颜色 - borderColor: '#ccc', + renderMode: 'auto', // 'auto' | 'html' | 'richText' + // 'auto': use html by default, and use non-html if `document` is not defined + // 'html': use html for tooltip + // 'richText': use canvas, svg, and etc. for tooltip - // 标题边框线宽,单位px,默认为0(无边框) - borderWidth: 0, + // 位置 {Array} | {Function} + // position: null + // Consider triggered from axisPointer handle, verticalAlign should be 'middle' + // align: null, + // verticalAlign: null, - // 标题内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - padding: 5, + // 是否约束 content 在 viewRect 中。默认 false 是为了兼容以前版本。 + confine: false, - // 主副标题纵向间隔,单位px,默认为10, - itemGap: 10, - textStyle: { - fontSize: 18, - fontWeight: 'bolder', - color: '#333' - }, - subtextStyle: { - color: '#aaa' - } - } -}); + // 内容格式器:{string}(Template) ¦ {Function} + // formatter: null -// View -extendComponentView({ + showDelay: 0, - type: 'title', + // 隐藏延迟,单位ms + hideDelay: 100, - render: function (titleModel, ecModel, api) { - this.group.removeAll(); + // 动画变换时间,单位s + transitionDuration: 0.4, - if (!titleModel.get('show')) { - return; - } + enterable: false, - var group = this.group; + // 提示背景颜色,默认为透明度为0.7的黑色 + backgroundColor: 'rgba(50,50,50,0.7)', - var textStyleModel = titleModel.getModel('textStyle'); - var subtextStyleModel = titleModel.getModel('subtextStyle'); + // 提示边框颜色 + borderColor: '#333', - var textAlign = titleModel.get('textAlign'); - var textBaseline = titleModel.get('textBaseline'); + // 提示边框圆角,单位px,默认为4 + borderRadius: 4, - var textEl = new Text({ - style: setTextStyle({}, textStyleModel, { - text: titleModel.get('text'), - textFill: textStyleModel.getTextColor() - }, {disableBox: true}), - z2: 10 - }); + // 提示边框线宽,单位px,默认为0(无边框) + borderWidth: 0, - var textRect = textEl.getBoundingRect(); + // 提示内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + padding: 5, - var subText = titleModel.get('subtext'); - var subTextEl = new Text({ - style: setTextStyle({}, subtextStyleModel, { - text: subText, - textFill: subtextStyleModel.getTextColor(), - y: textRect.height + titleModel.get('itemGap'), - textVerticalAlign: 'top' - }, {disableBox: true}), - z2: 10 - }); + // Extra css text + extraCssText: '', - var link = titleModel.get('link'); - var sublink = titleModel.get('sublink'); + // 坐标轴指示器,坐标轴触发有效 + axisPointer: { + // 默认为直线 + // 可选为:'line' | 'shadow' | 'cross' + type: 'line', - textEl.silent = !link; - subTextEl.silent = !sublink; + // type 为 line 的时候有效,指定 tooltip line 所在的轴,可选 + // 可选 'x' | 'y' | 'angle' | 'radius' | 'auto' + // 默认 'auto',会选择类型为 category 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴 + // 极坐标系会默认选择 angle 轴 + axis: 'auto', - if (link) { - textEl.on('click', function () { - window.open(link, '_' + titleModel.get('target')); - }); - } - if (sublink) { - subTextEl.on('click', function () { - window.open(sublink, '_' + titleModel.get('subtarget')); - }); - } + animation: 'auto', + animationDurationUpdate: 200, + animationEasingUpdate: 'exponentialOut', - group.add(textEl); - subText && group.add(subTextEl); - // If no subText, but add subTextEl, there will be an empty line. + crossStyle: { + color: '#999', + width: 1, + type: 'dashed', - var groupRect = group.getBoundingRect(); - var layoutOption = titleModel.getBoxLayoutParams(); - layoutOption.width = groupRect.width; - layoutOption.height = groupRect.height; - var layoutRect = getLayoutRect( - layoutOption, { - width: api.getWidth(), - height: api.getHeight() - }, titleModel.get('padding') - ); - // Adjust text align based on position - if (!textAlign) { - // Align left if title is on the left. center and right is same - textAlign = titleModel.get('left') || titleModel.get('right'); - if (textAlign === 'middle') { - textAlign = 'center'; - } - // Adjust layout by text align - if (textAlign === 'right') { - layoutRect.x += layoutRect.width; - } - else if (textAlign === 'center') { - layoutRect.x += layoutRect.width / 2; - } - } - if (!textBaseline) { - textBaseline = titleModel.get('top') || titleModel.get('bottom'); - if (textBaseline === 'center') { - textBaseline = 'middle'; - } - if (textBaseline === 'bottom') { - layoutRect.y += layoutRect.height; - } - else if (textBaseline === 'middle') { - layoutRect.y += layoutRect.height / 2; + // TODO formatter + textStyle: {} } - textBaseline = textBaseline || 'top'; + // lineStyle and shadowStyle should not be specified here, + // otherwise it will always override those styles on option.axisPointer. + }, + textStyle: { + color: '#fff', + fontSize: 14 } - - group.attr('position', [layoutRect.x, layoutRect.y]); - var alignStyle = { - textAlign: textAlign, - textVerticalAlign: textBaseline - }; - textEl.setStyle(alignStyle); - subTextEl.setStyle(alignStyle); - - // Render background - // Get groupRect again because textAlign has been changed - groupRect = group.getBoundingRect(); - var padding = layoutRect.margin; - var style = titleModel.getItemStyle(['color', 'opacity']); - style.fill = titleModel.get('backgroundColor'); - var rect = new Rect({ - shape: { - x: groupRect.x - padding[3], - y: groupRect.y - padding[0], - width: groupRect.width + padding[1] + padding[3], - height: groupRect.height + padding[0] + padding[2], - r: titleModel.get('borderRadius') - }, - style: style, - silent: true - }); - subPixelOptimizeRect(rect); - - group.add(rect); } }); @@ -79103,154 +82848,328 @@ extendComponentView({ * under the License. */ -ComponentModel.registerSubTypeDefaulter('dataZoom', function () { - // Default 'slider' when no type specified. - return 'slider'; -}); +var each$22 = each$1; +var toCamelCase$1 = toCamelCase; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +var vendors = ['', '-webkit-', '-moz-', '-o-']; -var AXIS_DIMS = ['x', 'y', 'z', 'radius', 'angle', 'single']; -// Supported coords. -var COORDS = ['cartesian2d', 'polar', 'singleAxis']; +var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;'; /** - * @param {string} coordType - * @return {boolean} + * @param {number} duration + * @return {string} + * @inner */ -function isCoordSupported(coordType) { - return indexOf(COORDS, coordType) >= 0; +function assembleTransition(duration) { + var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)'; + var transitionText = 'left ' + duration + 's ' + transitionCurve + ',' + + 'top ' + duration + 's ' + transitionCurve; + return map(vendors, function (vendorPrefix) { + return vendorPrefix + 'transition:' + transitionText; + }).join(';'); } /** - * Create "each" method to iterate names. - * - * @pubilc - * @param {Array.} names - * @param {Array.=} attrs - * @return {Function} + * @param {Object} textStyle + * @return {string} + * @inner */ -function createNameEach(names, attrs) { - names = names.slice(); - var capitalNames = map(names, capitalFirst); - attrs = (attrs || []).slice(); - var capitalAttrs = map(attrs, capitalFirst); +function assembleFont(textStyleModel) { + var cssText = []; - return function (callback, context) { - each$1(names, function (name, index) { - var nameObj = {name: name, capital: capitalNames[index]}; + var fontSize = textStyleModel.get('fontSize'); + var color = textStyleModel.getTextColor(); - for (var j = 0; j < attrs.length; j++) { - nameObj[attrs[j]] = name + capitalAttrs[j]; - } + color && cssText.push('color:' + color); - callback.call(context, nameObj); - }); - }; + cssText.push('font:' + textStyleModel.getFont()); + + fontSize + && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px'); + + each$22(['decoration', 'align'], function (name) { + var val = textStyleModel.get(name); + val && cssText.push('text-' + name + ':' + val); + }); + + return cssText.join(';'); } /** - * Iterate each dimension name. - * - * @public - * @param {Function} callback The parameter is like: - * { - * name: 'angle', - * capital: 'Angle', - * axis: 'angleAxis', - * axisIndex: 'angleAixs', - * index: 'angleIndex' - * } - * @param {Object} context + * @param {Object} tooltipModel + * @return {string} + * @inner */ -var eachAxisDim$1 = createNameEach(AXIS_DIMS, ['axisIndex', 'axis', 'index', 'id']); +function assembleCssText(tooltipModel) { + + var cssText = []; + + var transitionDuration = tooltipModel.get('transitionDuration'); + var backgroundColor = tooltipModel.get('backgroundColor'); + var textStyleModel = tooltipModel.getModel('textStyle'); + var padding = tooltipModel.get('padding'); + + // Animation transition. Do not animate when transitionDuration is 0. + transitionDuration + && cssText.push(assembleTransition(transitionDuration)); + + if (backgroundColor) { + if (env$1.canvasSupported) { + cssText.push('background-Color:' + backgroundColor); + } + else { + // for ie + cssText.push( + 'background-Color:#' + toHex(backgroundColor) + ); + cssText.push('filter:alpha(opacity=70)'); + } + } + + // Border style + each$22(['width', 'color', 'radius'], function (name) { + var borderName = 'border-' + name; + var camelCase = toCamelCase$1(borderName); + var val = tooltipModel.get(camelCase); + val != null + && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); + }); + + // Text style + cssText.push(assembleFont(textStyleModel)); + + // Padding + if (padding != null) { + cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px'); + } + + return cssText.join(';') + ';'; +} + +// If not able to make, do not modify the input `out`. +function makeStyleCoord(out, zr, appendToBody, zrX, zrY) { + var zrPainter = zr && zr.painter; + + if (appendToBody) { + var zrViewportRoot = zrPainter && zrPainter.getViewportRoot(); + if (zrViewportRoot) { + // Some APPs might use scale on body, so we support CSS transform here. + transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY); + } + } + else { + out[0] = zrX; + out[1] = zrY; + // xy should be based on canvas root. But tooltipContent is + // the sibling of canvas root. So padding of ec container + // should be considered here. + var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset(); + if (viewportRootOffset) { + out[0] += viewportRootOffset.offsetLeft; + out[1] += viewportRootOffset.offsetTop; + } + } +} /** - * If tow dataZoomModels has the same axis controlled, we say that they are 'linked'. - * dataZoomModels and 'links' make up one or more graphics. - * This function finds the graphic where the source dataZoomModel is in. - * - * @public - * @param {Function} forEachNode Node iterator. - * @param {Function} forEachEdgeType edgeType iterator - * @param {Function} edgeIdGetter Giving node and edgeType, return an array of edge id. - * @return {Function} Input: sourceNode, Output: Like {nodes: [], dims: {}} + * @alias module:echarts/component/tooltip/TooltipContent + * @param {HTMLElement} container + * @param {ExtensionAPI} api + * @param {Object} [opt] + * @param {boolean} [opt.appendToBody] + * `false`: the DOM element will be inside the container. Default value. + * `true`: the DOM element will be appended to HTML body, which avoid + * some overflow clip but intrude outside of the container. + * @constructor */ -function createLinkedNodesFinder(forEachNode, forEachEdgeType, edgeIdGetter) { +function TooltipContent(container, api, opt) { + if (env$1.wxa) { + return null; + } - return function (sourceNode) { - var result = { - nodes: [], - records: {} // key: edgeType.name, value: Object (key: edge id, value: boolean). - }; + var el = document.createElement('div'); + el.domBelongToZr = true; + this.el = el; + var zr = this._zr = api.getZr(); + var appendToBody = this._appendToBody = opt && opt.appendToBody; - forEachEdgeType(function (edgeType) { - result.records[edgeType.name] = {}; - }); + this._styleCoord = [0, 0]; - if (!sourceNode) { - return result; + makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2); + + if (appendToBody) { + document.body.appendChild(el); + } + else { + container.appendChild(el); + } + + this._container = container; + + this._show = false; + + /** + * @private + */ + this._hideTimeout; + + // FIXME + // Is it needed to trigger zr event manually if + // the browser do not support `pointer-events: none`. + + var self = this; + el.onmouseenter = function () { + // clear the timeout in hideLater and keep showing tooltip + if (self._enterable) { + clearTimeout(self._hideTimeout); + self._show = true; + } + self._inContent = true; + }; + el.onmousemove = function (e) { + e = e || window.event; + if (!self._enterable) { + // `pointer-events: none` is set to tooltip content div + // if `enterable` is set as `false`, and `el.onmousemove` + // can not be triggered. But in browser that do not + // support `pointer-events`, we need to do this: + // Try trigger zrender event to avoid mouse + // in and out shape too frequently + var handler = zr.handler; + var zrViewportRoot = zr.painter.getViewportRoot(); + normalizeEvent(zrViewportRoot, e, true); + handler.dispatch('mousemove', e); + } + }; + el.onmouseleave = function () { + if (self._enterable) { + if (self._show) { + self.hideLater(self._hideDelay); + } } + self._inContent = false; + }; +} - absorb(sourceNode, result); +TooltipContent.prototype = { - var existsLink; - do { - existsLink = false; - forEachNode(processSingleNode); + constructor: TooltipContent, + + /** + * @private + * @type {boolean} + */ + _enterable: true, + + /** + * Update when tooltip is rendered + */ + update: function () { + // FIXME + // Move this logic to ec main? + var container = this._container; + var stl = container.currentStyle + || document.defaultView.getComputedStyle(container); + var domStyle = container.style; + if (domStyle.position !== 'absolute' && stl.position !== 'absolute') { + domStyle.position = 'relative'; } - while (existsLink); + // Hide the tooltip + // PENDING + // this.hide(); + }, - function processSingleNode(node) { - if (!isNodeAbsorded(node, result) && isLinked(node, result)) { - absorb(node, result); - existsLink = true; + show: function (tooltipModel) { + clearTimeout(this._hideTimeout); + var el = this.el; + var styleCoord = this._styleCoord; + + el.style.cssText = gCssText + assembleCssText(tooltipModel) + // Because of the reason described in: + // http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore + // we should set initial value to `left` and `top`. + + ';left:' + styleCoord[0] + 'px;top:' + styleCoord[1] + 'px;' + + (tooltipModel.get('extraCssText') || ''); + + el.style.display = el.innerHTML ? 'block' : 'none'; + + // If mouse occsionally move over the tooltip, a mouseout event will be + // triggered by canvas, and cuase some unexpectable result like dragging + // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve + // it. Although it is not suppored by IE8~IE10, fortunately it is a rare + // scenario. + el.style.pointerEvents = this._enterable ? 'auto' : 'none'; + + this._show = true; + }, + + setContent: function (content) { + this.el.innerHTML = content == null ? '' : content; + }, + + setEnterable: function (enterable) { + this._enterable = enterable; + }, + + getSize: function () { + var el = this.el; + return [el.clientWidth, el.clientHeight]; + }, + + moveTo: function (zrX, zrY) { + var styleCoord = this._styleCoord; + makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY); + + var style = this.el.style; + style.left = styleCoord[0] + 'px'; + style.top = styleCoord[1] + 'px'; + }, + + hide: function () { + this.el.style.display = 'none'; + this._show = false; + }, + + hideLater: function (time) { + if (this._show && !(this._inContent && this._enterable)) { + if (time) { + this._hideDelay = time; + // Set show false to avoid invoke hideLater mutiple times + this._show = false; + this._hideTimeout = setTimeout(bind(this.hide, this), time); + } + else { + this.hide(); } } + }, - return result; - }; + isShow: function () { + return this._show; + }, - function isNodeAbsorded(node, result) { - return indexOf(result.nodes, node) >= 0; - } + dispose: function () { + this.el.parentNode.removeChild(this.el); + }, - function isLinked(node, result) { - var hasLink = false; - forEachEdgeType(function (edgeType) { - each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { - result.records[edgeType.name][edgeId] && (hasLink = true); - }); - }); - return hasLink; - } + getOuterSize: function () { + var width = this.el.clientWidth; + var height = this.el.clientHeight; - function absorb(node, result) { - result.nodes.push(node); - forEachEdgeType(function (edgeType) { - each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { - result.records[edgeType.name][edgeId] = true; - }); - }); + // Consider browser compatibility. + // IE8 does not support getComputedStyle. + if (document.defaultView && document.defaultView.getComputedStyle) { + var stl = document.defaultView.getComputedStyle(this.el); + if (stl) { + width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10); + height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10); + } + } + + return {width: width, height: height}; } -} + +}; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -79271,494 +83190,173 @@ function createLinkedNodesFinder(forEachNode, forEachEdgeType, edgeIdGetter) { * under the License. */ -var each$22 = each$1; -var asc$1 = asc; - +// import Group from 'zrender/src/container/Group'; /** - * Operate single axis. - * One axis can only operated by one axis operator. - * Different dataZoomModels may be defined to operate the same axis. - * (i.e. 'inside' data zoom and 'slider' data zoom components) - * So dataZoomModels share one axisProxy in that case. - * - * @class + * @alias module:echarts/component/tooltip/TooltipRichContent + * @constructor */ -var AxisProxy = function (dimName, axisIndex, dataZoomModel, ecModel) { - - /** - * @private - * @type {string} - */ - this._dimName = dimName; - - /** - * @private - */ - this._axisIndex = axisIndex; +function TooltipRichContent(api) { - /** - * @private - * @type {Array.} - */ - this._valueWindow; + this._zr = api.getZr(); - /** - * @private - * @type {Array.} - */ - this._percentWindow; + this._show = false; /** * @private - * @type {Array.} */ - this._dataExtent; + this._hideTimeout; +} - /** - * {minSpan, maxSpan, minValueSpan, maxValueSpan} - * @private - * @type {Object} - */ - this._minMaxSpan; +TooltipRichContent.prototype = { - /** - * @readOnly - * @type {module: echarts/model/Global} - */ - this.ecModel = ecModel; + constructor: TooltipRichContent, /** * @private - * @type {module: echarts/component/dataZoom/DataZoomModel} + * @type {boolean} */ - this._dataZoomModel = dataZoomModel; - - // /** - // * @readOnly - // * @private - // */ - // this.hasSeriesStacked; -}; - -AxisProxy.prototype = { - - constructor: AxisProxy, + _enterable: true, /** - * Whether the axisProxy is hosted by dataZoomModel. - * - * @public - * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel - * @return {boolean} + * Update when tooltip is rendered */ - hostedBy: function (dataZoomModel) { - return this._dataZoomModel === dataZoomModel; + update: function () { + // noop }, - /** - * @return {Array.} Value can only be NaN or finite value. - */ - getDataValueWindow: function () { - return this._valueWindow.slice(); - }, + show: function (tooltipModel) { + if (this._hideTimeout) { + clearTimeout(this._hideTimeout); + } - /** - * @return {Array.} - */ - getDataPercentWindow: function () { - return this._percentWindow.slice(); + this.el.attr('show', true); + this._show = true; }, /** - * @public - * @param {number} axisIndex - * @return {Array} seriesModels + * Set tooltip content + * + * @param {string} content rich text string of content + * @param {Object} markerRich rich text style + * @param {Object} tooltipModel tooltip model */ - getTargetSeriesModels: function () { - var seriesModels = []; - var ecModel = this.ecModel; - - ecModel.eachSeries(function (seriesModel) { - if (isCoordSupported(seriesModel.get('coordinateSystem'))) { - var dimName = this._dimName; - var axisModel = ecModel.queryComponents({ - mainType: dimName + 'Axis', - index: seriesModel.get(dimName + 'AxisIndex'), - id: seriesModel.get(dimName + 'AxisId') - })[0]; - if (this._axisIndex === (axisModel && axisModel.componentIndex)) { - seriesModels.push(seriesModel); - } - } - }, this); - - return seriesModels; - }, - - getAxisModel: function () { - return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex); - }, - - getOtherAxisModel: function () { - var axisDim = this._dimName; - var ecModel = this.ecModel; - var axisModel = this.getAxisModel(); - var isCartesian = axisDim === 'x' || axisDim === 'y'; - var otherAxisDim; - var coordSysIndexName; - if (isCartesian) { - coordSysIndexName = 'gridIndex'; - otherAxisDim = axisDim === 'x' ? 'y' : 'x'; - } - else { - coordSysIndexName = 'polarIndex'; - otherAxisDim = axisDim === 'angle' ? 'radius' : 'angle'; + setContent: function (content, markerRich, tooltipModel) { + if (this.el) { + this._zr.remove(this.el); } - var foundOtherAxisModel; - ecModel.eachComponent(otherAxisDim + 'Axis', function (otherAxisModel) { - if ((otherAxisModel.get(coordSysIndexName) || 0) - === (axisModel.get(coordSysIndexName) || 0) - ) { - foundOtherAxisModel = otherAxisModel; - } - }); - return foundOtherAxisModel; - }, - getMinMaxSpan: function () { - return clone(this._minMaxSpan); - }, + var markers = {}; + var text = content; + var prefix = '{marker'; + var suffix = '|}'; + var startId = text.indexOf(prefix); + while (startId >= 0) { + var endId = text.indexOf(suffix); + var name = text.substr(startId + prefix.length, endId - startId - prefix.length); + if (name.indexOf('sub') > -1) { + markers['marker' + name] = { + textWidth: 4, + textHeight: 4, + textBorderRadius: 2, + textBackgroundColor: markerRich[name], + // TODO: textOffset is not implemented for rich text + textOffset: [3, 0] + }; + } + else { + markers['marker' + name] = { + textWidth: 10, + textHeight: 10, + textBorderRadius: 5, + textBackgroundColor: markerRich[name] + }; + } - /** - * Only calculate by given range and this._dataExtent, do not change anything. - * - * @param {Object} opt - * @param {number} [opt.start] - * @param {number} [opt.end] - * @param {number} [opt.startValue] - * @param {number} [opt.endValue] - */ - calculateDataWindow: function (opt) { - var dataExtent = this._dataExtent; - var axisModel = this.getAxisModel(); - var scale = axisModel.axis.scale; - var rangePropMode = this._dataZoomModel.getRangePropMode(); - var percentExtent = [0, 100]; - var percentWindow = [ - opt.start, - opt.end - ]; - var valueWindow = []; + text = text.substr(endId + 1); + startId = text.indexOf('{marker'); + } - each$22(['startValue', 'endValue'], function (prop) { - valueWindow.push(opt[prop] != null ? scale.parse(opt[prop]) : null); + this.el = new Text({ + style: { + rich: markers, + text: content, + textLineHeight: 20, + textBackgroundColor: tooltipModel.get('backgroundColor'), + textBorderRadius: tooltipModel.get('borderRadius'), + textFill: tooltipModel.get('textStyle.color'), + textPadding: tooltipModel.get('padding') + }, + z: tooltipModel.get('z') }); + this._zr.add(this.el); - // Normalize bound. - each$22([0, 1], function (idx) { - var boundValue = valueWindow[idx]; - var boundPercent = percentWindow[idx]; - - // Notice: dataZoom is based either on `percentProp` ('start', 'end') or - // on `valueProp` ('startValue', 'endValue'). The former one is suitable - // for cases that a dataZoom component controls multiple axes with different - // unit or extent, and the latter one is suitable for accurate zoom by pixel - // (e.g., in dataZoomSelect). `valueProp` can be calculated from `percentProp`, - // but it is awkward that `percentProp` can not be obtained from `valueProp` - // accurately (because all of values that are overflow the `dataExtent` will - // be calculated to percent '100%'). So we have to use - // `dataZoom.getRangePropMode()` to mark which prop is used. - // `rangePropMode` is updated only when setOption or dispatchAction, otherwise - // it remains its original value. - - if (rangePropMode[idx] === 'percent') { - if (boundPercent == null) { - boundPercent = percentExtent[idx]; - } - // Use scale.parse to math round for category or time axis. - boundValue = scale.parse(linearMap( - boundPercent, percentExtent, dataExtent, true - )); + var self = this; + this.el.on('mouseover', function () { + // clear the timeout in hideLater and keep showing tooltip + if (self._enterable) { + clearTimeout(self._hideTimeout); + self._show = true; } - else { - // Calculating `percent` from `value` may be not accurate, because - // This calculation can not be inversed, because all of values that - // are overflow the `dataExtent` will be calculated to percent '100%' - boundPercent = linearMap( - boundValue, dataExtent, percentExtent, true - ); + self._inContent = true; + }); + this.el.on('mouseout', function () { + if (self._enterable) { + if (self._show) { + self.hideLater(self._hideDelay); + } } - - // valueWindow[idx] = round(boundValue); - // percentWindow[idx] = round(boundPercent); - valueWindow[idx] = boundValue; - percentWindow[idx] = boundPercent; + self._inContent = false; }); - - return { - valueWindow: asc$1(valueWindow), - percentWindow: asc$1(percentWindow) - }; }, - /** - * Notice: reset should not be called before series.restoreData() called, - * so it is recommanded to be called in "process stage" but not "model init - * stage". - * - * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel - */ - reset: function (dataZoomModel) { - if (dataZoomModel !== this._dataZoomModel) { - return; - } - - var targetSeries = this.getTargetSeriesModels(); - // Culculate data window and data extent, and record them. - this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); - - // this.hasSeriesStacked = false; - // each(targetSeries, function (series) { - // var data = series.getData(); - // var dataDim = data.mapDimension(this._dimName); - // var stackedDimension = data.getCalculationInfo('stackedDimension'); - // if (stackedDimension && stackedDimension === dataDim) { - // this.hasSeriesStacked = true; - // } - // }, this); - - var dataWindow = this.calculateDataWindow(dataZoomModel.option); - - this._valueWindow = dataWindow.valueWindow; - this._percentWindow = dataWindow.percentWindow; - - setMinMaxSpan(this); - - // Update axis setting then. - setAxisModel(this); + setEnterable: function (enterable) { + this._enterable = enterable; }, - /** - * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel - */ - restore: function (dataZoomModel) { - if (dataZoomModel !== this._dataZoomModel) { - return; - } - - this._valueWindow = this._percentWindow = null; - setAxisModel(this, true); + getSize: function () { + var bounding = this.el.getBoundingRect(); + return [bounding.width, bounding.height]; }, - /** - * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel - */ - filterData: function (dataZoomModel, api) { - if (dataZoomModel !== this._dataZoomModel) { - return; + moveTo: function (x, y) { + if (this.el) { + this.el.attr('position', [x, y]); } + }, - var axisDim = this._dimName; - var seriesModels = this.getTargetSeriesModels(); - var filterMode = dataZoomModel.get('filterMode'); - var valueWindow = this._valueWindow; - - if (filterMode === 'none') { - return; + hide: function () { + if (this.el) { + this.el.hide(); } + this._show = false; + }, - // FIXME - // Toolbox may has dataZoom injected. And if there are stacked bar chart - // with NaN data, NaN will be filtered and stack will be wrong. - // So we need to force the mode to be set empty. - // In fect, it is not a big deal that do not support filterMode-'filter' - // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis - // selection" some day, which might need "adapt to data extent on the - // otherAxis", which is disabled by filterMode-'empty'. - // But currently, stack has been fixed to based on value but not index, - // so this is not an issue any more. - // var otherAxisModel = this.getOtherAxisModel(); - // if (dataZoomModel.get('$fromToolbox') - // && otherAxisModel - // && otherAxisModel.hasSeriesStacked - // ) { - // filterMode = 'empty'; - // } - - // TODO - // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. - - // Process series data - each$22(seriesModels, function (seriesModel) { - var seriesData = seriesModel.getData(); - var dataDims = seriesData.mapDimension(axisDim, true); - - if (filterMode === 'weakFilter') { - seriesData.filterSelf(function (dataIndex) { - var leftOut; - var rightOut; - var hasValue; - for (var i = 0; i < dataDims.length; i++) { - var value = seriesData.get(dataDims[i], dataIndex); - var thisHasValue = !isNaN(value); - var thisLeftOut = value < valueWindow[0]; - var thisRightOut = value > valueWindow[1]; - if (thisHasValue && !thisLeftOut && !thisRightOut) { - return true; - } - thisHasValue && (hasValue = true); - thisLeftOut && (leftOut = true); - thisRightOut && (rightOut = true); - } - // If both left out and right out, do not filter. - return hasValue && leftOut && rightOut; - }); + hideLater: function (time) { + if (this._show && !(this._inContent && this._enterable)) { + if (time) { + this._hideDelay = time; + // Set show false to avoid invoke hideLater mutiple times + this._show = false; + this._hideTimeout = setTimeout(bind(this.hide, this), time); } else { - each$22(dataDims, function (dim) { - if (filterMode === 'empty') { - seriesModel.setData( - seriesData.map(dim, function (value) { - return !isInWindow(value) ? NaN : value; - }) - ); - } - else { - var range = {}; - range[dim] = valueWindow; - - // console.time('select'); - seriesData.selectRange(range); - // console.timeEnd('select'); - } - }); + this.hide(); } - - each$22(dataDims, function (dim) { - seriesData.setApproximateExtent(valueWindow, dim); - }); - }); - - function isInWindow(value) { - return value >= valueWindow[0] && value <= valueWindow[1]; - } - } -}; - -function calculateDataExtent(axisProxy, axisDim, seriesModels) { - var dataExtent = [Infinity, -Infinity]; - - each$22(seriesModels, function (seriesModel) { - var seriesData = seriesModel.getData(); - if (seriesData) { - each$22(seriesData.mapDimension(axisDim, true), function (dim) { - var seriesExtent = seriesData.getApproximateExtent(dim); - seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); - seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); - }); } - }); - - if (dataExtent[1] < dataExtent[0]) { - dataExtent = [NaN, NaN]; - } - - // It is important to get "consistent" extent when more then one axes is - // controlled by a `dataZoom`, otherwise those axes will not be synchronized - // when zooming. But it is difficult to know what is "consistent", considering - // axes have different type or even different meanings (For example, two - // time axes are used to compare data of the same date in different years). - // So basically dataZoom just obtains extent by series.data (in category axis - // extent can be obtained from axis.data). - // Nevertheless, user can set min/max/scale on axes to make extent of axes - // consistent. - fixExtentByAxis(axisProxy, dataExtent); - - return dataExtent; -} - -function fixExtentByAxis(axisProxy, dataExtent) { - var axisModel = axisProxy.getAxisModel(); - var min = axisModel.getMin(true); - - // For category axis, if min/max/scale are not set, extent is determined - // by axis.data by default. - var isCategoryAxis = axisModel.get('type') === 'category'; - var axisDataLen = isCategoryAxis && axisModel.getCategories().length; - - if (min != null && min !== 'dataMin' && typeof min !== 'function') { - dataExtent[0] = min; - } - else if (isCategoryAxis) { - dataExtent[0] = axisDataLen > 0 ? 0 : NaN; - } - - var max = axisModel.getMax(true); - if (max != null && max !== 'dataMax' && typeof max !== 'function') { - dataExtent[1] = max; - } - else if (isCategoryAxis) { - dataExtent[1] = axisDataLen > 0 ? axisDataLen - 1 : NaN; - } - - if (!axisModel.get('scale', true)) { - dataExtent[0] > 0 && (dataExtent[0] = 0); - dataExtent[1] < 0 && (dataExtent[1] = 0); - } - - // For value axis, if min/max/scale are not set, we just use the extent obtained - // by series data, which may be a little different from the extent calculated by - // `axisHelper.getScaleExtent`. But the different just affects the experience a - // little when zooming. So it will not be fixed until some users require it strongly. - - return dataExtent; -} - -function setAxisModel(axisProxy, isRestore) { - var axisModel = axisProxy.getAxisModel(); + }, - var percentWindow = axisProxy._percentWindow; - var valueWindow = axisProxy._valueWindow; + isShow: function () { + return this._show; + }, - if (!percentWindow) { - return; + getOuterSize: function () { + var size = this.getSize(); + return { + width: size[0], + height: size[1] + }; } - - // [0, 500]: arbitrary value, guess axis extent. - var precision = getPixelPrecision(valueWindow, [0, 500]); - precision = Math.min(precision, 20); - // isRestore or isFull - var useOrigin = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100); - - axisModel.setRange( - useOrigin ? null : +valueWindow[0].toFixed(precision), - useOrigin ? null : +valueWindow[1].toFixed(precision) - ); -} - -function setMinMaxSpan(axisProxy) { - var minMaxSpan = axisProxy._minMaxSpan = {}; - var dataZoomModel = axisProxy._dataZoomModel; - - each$22(['min', 'max'], function (minMax) { - minMaxSpan[minMax + 'Span'] = dataZoomModel.get(minMax + 'Span'); - - // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan - var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); - - if (valueSpan != null) { - minMaxSpan[minMax + 'ValueSpan'] = valueSpan; - valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan); - - if (valueSpan != null) { - var dataExtent = axisProxy._dataExtent; - minMaxSpan[minMax + 'Span'] = linearMap( - dataExtent[0] + valueSpan, dataExtent, [0, 100], true - ); - } - } - }); -} +}; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -79779,553 +83377,809 @@ function setMinMaxSpan(axisProxy) { * under the License. */ +var bind$3 = bind; var each$21 = each$1; -var eachAxisDim = eachAxisDim$1; +var parsePercent$2 = parsePercent$1; -var DataZoomModel = extendComponentModel({ +var proxyRect = new Rect({ + shape: {x: -1, y: -1, width: 2, height: 2} +}); - type: 'dataZoom', +extendComponentView({ - dependencies: [ - 'xAxis', 'yAxis', 'zAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series' - ], + type: 'tooltip', - /** - * @protected - */ - defaultOption: { - zlevel: 0, - z: 4, // Higher than normal component (z: 2). - orient: null, // Default auto by axisIndex. Possible value: 'horizontal', 'vertical'. - xAxisIndex: null, // Default the first horizontal category axis. - yAxisIndex: null, // Default the first vertical category axis. + init: function (ecModel, api) { + if (env$1.node) { + return; + } - filterMode: 'filter', // Possible values: 'filter' or 'empty' or 'weakFilter'. - // 'filter': data items which are out of window will be removed. This option is - // applicable when filtering outliers. For each data item, it will be - // filtered if one of the relevant dimensions is out of the window. - // 'weakFilter': data items which are out of window will be removed. This option - // is applicable when filtering outliers. For each data item, it will be - // filtered only if all of the relevant dimensions are out of the same - // side of the window. - // 'empty': data items which are out of window will be set to empty. - // This option is applicable when user should not neglect - // that there are some data items out of window. - // 'none': Do not filter. - // Taking line chart as an example, line will be broken in - // the filtered points when filterModel is set to 'empty', but - // be connected when set to 'filter'. + var tooltipModel = ecModel.getComponent('tooltip'); + var renderMode = tooltipModel.get('renderMode'); + this._renderMode = getTooltipRenderMode(renderMode); - throttle: null, // Dispatch action by the fixed rate, avoid frequency. - // default 100. Do not throttle when use null/undefined. - // If animation === true and animationDurationUpdate > 0, - // default value is 100, otherwise 20. - start: 0, // Start percent. 0 ~ 100 - end: 100, // End percent. 0 ~ 100 - startValue: null, // Start value. If startValue specified, start is ignored. - endValue: null, // End value. If endValue specified, end is ignored. - minSpan: null, // 0 ~ 100 - maxSpan: null, // 0 ~ 100 - minValueSpan: null, // The range of dataZoom can not be smaller than that. - maxValueSpan: null, // The range of dataZoom can not be larger than that. - rangeMode: null // Array, can be 'value' or 'percent'. + var tooltipContent; + if (this._renderMode === 'html') { + tooltipContent = new TooltipContent(api.getDom(), api, { + appendToBody: tooltipModel.get('appendToBody', true) + }); + this._newLine = '
'; + } + else { + tooltipContent = new TooltipRichContent(api); + this._newLine = '\n'; + } + + this._tooltipContent = tooltipContent; }, - /** - * @override - */ - init: function (option, parentModel, ecModel) { + render: function (tooltipModel, ecModel, api) { + if (env$1.node) { + return; + } - /** - * key like x_0, y_1 - * @private - * @type {Object} - */ - this._dataIntervalByAxis = {}; + // Reset + this.group.removeAll(); /** * @private + * @type {module:echarts/component/tooltip/TooltipModel} */ - this._dataInfo = {}; + this._tooltipModel = tooltipModel; /** - * key like x_0, y_1 * @private + * @type {module:echarts/model/Global} */ - this._axisProxies = {}; + this._ecModel = ecModel; /** - * @readOnly + * @private + * @type {module:echarts/ExtensionAPI} */ - this.textStyleModel; + this._api = api; /** + * Should be cleaned when render. * @private + * @type {Array.>} */ - this._autoThrottle = true; + this._lastDataByCoordSys = null; /** - * 'percent' or 'value' * @private + * @type {boolean} */ - this._rangePropMode = ['percent', 'percent']; + this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); - var rawOption = retrieveRaw(option); + var tooltipContent = this._tooltipContent; + tooltipContent.update(); + tooltipContent.setEnterable(tooltipModel.get('enterable')); - this.mergeDefaultAndTheme(option, ecModel); + this._initGlobalListener(); - this.doInit(rawOption); + this._keepShow(); }, - /** - * @override - */ - mergeOption: function (newOption) { - var rawOption = retrieveRaw(newOption); - - //FIX #2591 - merge(this.option, newOption, true); - - this.doInit(rawOption); - }, + _initGlobalListener: function () { + var tooltipModel = this._tooltipModel; + var triggerOn = tooltipModel.get('triggerOn'); - /** - * @protected - */ - doInit: function (rawOption) { - var thisOption = this.option; - - // Disable realtime view update if canvas is not supported. - if (!env$1.canvasSupported) { - thisOption.realtime = false; - } - - this._setDefaultThrottle(rawOption); - - updateRangeUse(this, rawOption); - - each$21([['start', 'startValue'], ['end', 'endValue']], function (names, index) { - // start/end has higher priority over startValue/endValue if they - // both set, but we should make chart.setOption({endValue: 1000}) - // effective, rather than chart.setOption({endValue: 1000, end: null}). - if (this._rangePropMode[index] === 'value') { - thisOption[names[0]] = null; - } - // Otherwise do nothing and use the merge result. - }, this); - - this.textStyleModel = this.getModel('textStyle'); - - this._resetTarget(); - - this._giveAxisProxies(); + register( + 'itemTooltip', + this._api, + bind$3(function (currTrigger, e, dispatchAction) { + // If 'none', it is not controlled by mouse totally. + if (triggerOn !== 'none') { + if (triggerOn.indexOf(currTrigger) >= 0) { + this._tryShow(e, dispatchAction); + } + else if (currTrigger === 'leave') { + this._hide(dispatchAction); + } + } + }, this) + ); }, - /** - * @private - */ - _giveAxisProxies: function () { - var axisProxies = this._axisProxies; - - this.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel, ecModel) { - var axisModel = this.dependentModels[dimNames.axis][axisIndex]; - - // If exists, share axisProxy with other dataZoomModels. - var axisProxy = axisModel.__dzAxisProxy || ( - // Use the first dataZoomModel as the main model of axisProxy. - axisModel.__dzAxisProxy = new AxisProxy( - dimNames.name, axisIndex, this, ecModel - ) - ); - // FIXME - // dispose __dzAxisProxy + _keepShow: function () { + var tooltipModel = this._tooltipModel; + var ecModel = this._ecModel; + var api = this._api; - axisProxies[dimNames.name + '_' + axisIndex] = axisProxy; - }, this); + // Try to keep the tooltip show when refreshing + if (this._lastX != null + && this._lastY != null + // When user is willing to control tooltip totally using API, + // self.manuallyShowTip({x, y}) might cause tooltip hide, + // which is not expected. + && tooltipModel.get('triggerOn') !== 'none' + ) { + var self = this; + clearTimeout(this._refreshUpdateTimeout); + this._refreshUpdateTimeout = setTimeout(function () { + // Show tip next tick after other charts are rendered + // In case highlight action has wrong result + // FIXME + !api.isDisposed() && self.manuallyShowTip(tooltipModel, ecModel, api, { + x: self._lastX, + y: self._lastY + }); + }); + } }, /** - * @private + * Show tip manually by + * dispatchAction({ + * type: 'showTip', + * x: 10, + * y: 10 + * }); + * Or + * dispatchAction({ + * type: 'showTip', + * seriesIndex: 0, + * dataIndex or dataIndexInside or name + * }); + * + * TODO Batch */ - _resetTarget: function () { - var thisOption = this.option; + manuallyShowTip: function (tooltipModel, ecModel, api, payload) { + if (payload.from === this.uid || env$1.node) { + return; + } - var autoMode = this._judgeAutoMode(); + var dispatchAction = makeDispatchAction$1(payload, api); - eachAxisDim(function (dimNames) { - var axisIndexName = dimNames.axisIndex; - thisOption[axisIndexName] = normalizeToArray( - thisOption[axisIndexName] - ); - }, this); + // Reset ticket + this._ticket = ''; - if (autoMode === 'axisIndex') { - this._autoSetAxisIndex(); + // When triggered from axisPointer. + var dataByCoordSys = payload.dataByCoordSys; + + if (payload.tooltip && payload.x != null && payload.y != null) { + var el = proxyRect; + el.position = [payload.x, payload.y]; + el.update(); + el.tooltip = payload.tooltip; + // Manually show tooltip while view is not using zrender elements. + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + target: el + }, dispatchAction); } - else if (autoMode === 'orient') { - this._autoSetOrient(); + else if (dataByCoordSys) { + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + dataByCoordSys: payload.dataByCoordSys, + tooltipOption: payload.tooltipOption + }, dispatchAction); } - }, - - /** - * @private - */ - _judgeAutoMode: function () { - // Auto set only works for setOption at the first time. - // The following is user's reponsibility. So using merged - // option is OK. - var thisOption = this.option; + else if (payload.seriesIndex != null) { - var hasIndexSpecified = false; - eachAxisDim(function (dimNames) { - // When user set axisIndex as a empty array, we think that user specify axisIndex - // but do not want use auto mode. Because empty array may be encountered when - // some error occured. - if (thisOption[dimNames.axisIndex] != null) { - hasIndexSpecified = true; + if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { + return; } - }, this); - - var orient = thisOption.orient; - if (orient == null && hasIndexSpecified) { - return 'orient'; - } - else if (!hasIndexSpecified) { - if (orient == null) { - thisOption.orient = 'horizontal'; + var pointInfo = findPointFromSeries(payload, ecModel); + var cx = pointInfo.point[0]; + var cy = pointInfo.point[1]; + if (cx != null && cy != null) { + this._tryShow({ + offsetX: cx, + offsetY: cy, + position: payload.position, + target: pointInfo.el + }, dispatchAction); } - return 'axisIndex'; } - }, + else if (payload.x != null && payload.y != null) { + // FIXME + // should wrap dispatchAction like `axisPointer/globalListener` ? + api.dispatchAction({ + type: 'updateAxisPointer', + x: payload.x, + y: payload.y + }); - /** - * @private - */ - _autoSetAxisIndex: function () { - var autoAxisIndex = true; - var orient = this.get('orient', true); - var thisOption = this.option; - var dependentModels = this.dependentModels; + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + target: api.getZr().findHover(payload.x, payload.y).target + }, dispatchAction); + } + }, - if (autoAxisIndex) { - // Find axis that parallel to dataZoom as default. - var dimName = orient === 'vertical' ? 'y' : 'x'; + manuallyHideTip: function (tooltipModel, ecModel, api, payload) { + var tooltipContent = this._tooltipContent; - if (dependentModels[dimName + 'Axis'].length) { - thisOption[dimName + 'AxisIndex'] = [0]; - autoAxisIndex = false; - } - else { - each$21(dependentModels.singleAxis, function (singleAxisModel) { - if (autoAxisIndex && singleAxisModel.get('orient', true) === orient) { - thisOption.singleAxisIndex = [singleAxisModel.componentIndex]; - autoAxisIndex = false; - } - }); - } + if (!this._alwaysShowContent && this._tooltipModel) { + tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); } - if (autoAxisIndex) { - // Find the first category axis as default. (consider polar) - eachAxisDim(function (dimNames) { - if (!autoAxisIndex) { - return; - } - var axisIndices = []; - var axisModels = this.dependentModels[dimNames.axis]; - if (axisModels.length && !axisIndices.length) { - for (var i = 0, len = axisModels.length; i < len; i++) { - if (axisModels[i].get('type') === 'category') { - axisIndices.push(i); - } - } - } - thisOption[dimNames.axisIndex] = axisIndices; - if (axisIndices.length) { - autoAxisIndex = false; - } - }, this); - } + this._lastX = this._lastY = null; - if (autoAxisIndex) { - // FIXME - // 这里是兼容ec2的写法(没指定xAxisIndex和yAxisIndex时把scatter和双数值轴折柱纳入dataZoom控制), - // 但是实际是否需要Grid.js#getScaleByOption来判断(考虑time,log等axis type)? + if (payload.from !== this.uid) { + this._hide(makeDispatchAction$1(payload, api)); + } + }, - // If both dataZoom.xAxisIndex and dataZoom.yAxisIndex is not specified, - // dataZoom component auto adopts series that reference to - // both xAxis and yAxis which type is 'value'. - this.ecModel.eachSeries(function (seriesModel) { - if (this._isSeriesHasAllAxesTypeOf(seriesModel, 'value')) { - eachAxisDim(function (dimNames) { - var axisIndices = thisOption[dimNames.axisIndex]; + // Be compatible with previous design, that is, when tooltip.type is 'axis' and + // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer + // and tooltip. + _manuallyAxisShowTip: function (tooltipModel, ecModel, api, payload) { + var seriesIndex = payload.seriesIndex; + var dataIndex = payload.dataIndex; + var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; - var axisIndex = seriesModel.get(dimNames.axisIndex); - var axisId = seriesModel.get(dimNames.axisId); + if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { + return; + } - var axisModel = seriesModel.ecModel.queryComponents({ - mainType: dimNames.axis, - index: axisIndex, - id: axisId - })[0]; + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + if (!seriesModel) { + return; + } - if (__DEV__) { - if (!axisModel) { - throw new Error( - dimNames.axis + ' "' + retrieve( - axisIndex, - axisId, - 0 - ) + '" not found' - ); - } - } - axisIndex = axisModel.componentIndex; + var data = seriesModel.getData(); + var tooltipModel = buildTooltipModel([ + data.getItemModel(dataIndex), + seriesModel, + (seriesModel.coordinateSystem || {}).model, + tooltipModel + ]); - if (indexOf(axisIndices, axisIndex) < 0) { - axisIndices.push(axisIndex); - } - }); - } - }, this); + if (tooltipModel.get('trigger') !== 'axis') { + return; } - }, - /** - * @private - */ - _autoSetOrient: function () { - var dim; - - // Find the first axis - this.eachTargetAxis(function (dimNames) { - !dim && (dim = dimNames.name); - }, this); + api.dispatchAction({ + type: 'updateAxisPointer', + seriesIndex: seriesIndex, + dataIndex: dataIndex, + position: payload.position + }); - this.option.orient = dim === 'y' ? 'vertical' : 'horizontal'; + return true; }, - /** - * @private - */ - _isSeriesHasAllAxesTypeOf: function (seriesModel, axisType) { - // FIXME - // 需要series的xAxisIndex和yAxisIndex都首先自动设置上。 - // 例如series.type === scatter时。 + _tryShow: function (e, dispatchAction) { + var el = e.target; + var tooltipModel = this._tooltipModel; - var is = true; - eachAxisDim(function (dimNames) { - var seriesAxisIndex = seriesModel.get(dimNames.axisIndex); - var axisModel = this.dependentModels[dimNames.axis][seriesAxisIndex]; + if (!tooltipModel) { + return; + } - if (!axisModel || axisModel.get('type') !== axisType) { - is = false; - } - }, this); - return is; - }, + // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed + this._lastX = e.offsetX; + this._lastY = e.offsetY; - /** - * @private - */ - _setDefaultThrottle: function (rawOption) { - // When first time user set throttle, auto throttle ends. - if (rawOption.hasOwnProperty('throttle')) { - this._autoThrottle = false; + var dataByCoordSys = e.dataByCoordSys; + if (dataByCoordSys && dataByCoordSys.length) { + this._showAxisTooltip(dataByCoordSys, e); } - if (this._autoThrottle) { - var globalOption = this.ecModel.option; - this.option.throttle = - (globalOption.animation && globalOption.animationDurationUpdate > 0) - ? 100 : 20; + // Always show item tooltip if mouse is on the element with dataIndex + else if (el && el.dataIndex != null) { + this._lastDataByCoordSys = null; + this._showSeriesItemTooltip(e, el, dispatchAction); + } + // Tooltip provided directly. Like legend. + else if (el && el.tooltip) { + this._lastDataByCoordSys = null; + this._showComponentItemTooltip(e, el, dispatchAction); + } + else { + this._lastDataByCoordSys = null; + this._hide(dispatchAction); } }, - /** - * @public - */ - getFirstTargetAxisModel: function () { - var firstAxisModel; - eachAxisDim(function (dimNames) { - if (firstAxisModel == null) { - var indices = this.get(dimNames.axisIndex); - if (indices.length) { - firstAxisModel = this.dependentModels[dimNames.axis][indices[0]]; - } - } - }, this); - - return firstAxisModel; + _showOrMove: function (tooltipModel, cb) { + // showDelay is used in this case: tooltip.enterable is set + // as true. User intent to move mouse into tooltip and click + // something. `showDelay` makes it easyer to enter the content + // but tooltip do not move immediately. + var delay = tooltipModel.get('showDelay'); + cb = bind(cb, this); + clearTimeout(this._showTimout); + delay > 0 + ? (this._showTimout = setTimeout(cb, delay)) + : cb(); }, - /** - * @public - * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel - */ - eachTargetAxis: function (callback, context) { - var ecModel = this.ecModel; - eachAxisDim(function (dimNames) { - each$21( - this.get(dimNames.axisIndex), - function (axisIndex) { - callback.call(context, dimNames, axisIndex, this, ecModel); - }, - this - ); - }, this); - }, + _showAxisTooltip: function (dataByCoordSys, e) { + var ecModel = this._ecModel; + var globalTooltipModel = this._tooltipModel; - /** - * @param {string} dimName - * @param {number} axisIndex - * @return {module:echarts/component/dataZoom/AxisProxy} If not found, return null/undefined. - */ - getAxisProxy: function (dimName, axisIndex) { - return this._axisProxies[dimName + '_' + axisIndex]; - }, + var point = [e.offsetX, e.offsetY]; - /** - * @param {string} dimName - * @param {number} axisIndex - * @return {module:echarts/model/Model} If not found, return null/undefined. - */ - getAxisModel: function (dimName, axisIndex) { - var axisProxy = this.getAxisProxy(dimName, axisIndex); - return axisProxy && axisProxy.getAxisModel(); - }, + var singleDefaultHTML = []; + var singleParamsList = []; + var singleTooltipModel = buildTooltipModel([ + e.tooltipOption, + globalTooltipModel + ]); - /** - * If not specified, set to undefined. - * - * @public - * @param {Object} opt - * @param {number} [opt.start] - * @param {number} [opt.end] - * @param {number} [opt.startValue] - * @param {number} [opt.endValue] - * @param {boolean} [ignoreUpdateRangeUsg=false] - */ - setRawRange: function (opt, ignoreUpdateRangeUsg) { - var option = this.option; - each$21([['start', 'startValue'], ['end', 'endValue']], function (names) { - // If only one of 'start' and 'startValue' is not null/undefined, the other - // should be cleared, which enable clear the option. - // If both of them are not set, keep option with the original value, which - // enable use only set start but not set end when calling `dispatchAction`. - // The same as 'end' and 'endValue'. - if (opt[names[0]] != null || opt[names[1]] != null) { - option[names[0]] = opt[names[0]]; - option[names[1]] = opt[names[1]]; - } - }, this); + var renderMode = this._renderMode; + var newLine = this._newLine; - !ignoreUpdateRangeUsg && updateRangeUse(this, opt); - }, + var markers = {}; - /** - * @public - * @return {Array.} [startPercent, endPercent] - */ - getPercentRange: function () { - var axisProxy = this.findRepresentativeAxisProxy(); - if (axisProxy) { - return axisProxy.getDataPercentWindow(); - } - }, + each$21(dataByCoordSys, function (itemCoordSys) { + // var coordParamList = []; + // var coordDefaultHTML = []; + // var coordTooltipModel = buildTooltipModel([ + // e.tooltipOption, + // itemCoordSys.tooltipOption, + // ecModel.getComponent(itemCoordSys.coordSysMainType, itemCoordSys.coordSysIndex), + // globalTooltipModel + // ]); + // var displayMode = coordTooltipModel.get('displayMode'); + // var paramsList = displayMode === 'single' ? singleParamsList : []; - /** - * @public - * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0); - * - * @param {string} [axisDimName] - * @param {number} [axisIndex] - * @return {Array.} [startValue, endValue] value can only be '-' or finite number. - */ - getValueRange: function (axisDimName, axisIndex) { - if (axisDimName == null && axisIndex == null) { - var axisProxy = this.findRepresentativeAxisProxy(); - if (axisProxy) { - return axisProxy.getDataValueWindow(); - } - } - else { - return this.getAxisProxy(axisDimName, axisIndex).getDataValueWindow(); - } - }, + each$21(itemCoordSys.dataByAxis, function (item) { + var axisModel = ecModel.getComponent(item.axisDim + 'Axis', item.axisIndex); + var axisValue = item.value; + var seriesDefaultHTML = []; - /** - * @public - * @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy - * corresponding to the axisModel - * @return {module:echarts/component/dataZoom/AxisProxy} - */ - findRepresentativeAxisProxy: function (axisModel) { - if (axisModel) { - return axisModel.__dzAxisProxy; - } + if (!axisModel || axisValue == null) { + return; + } - // Find the first hosted axisProxy - var axisProxies = this._axisProxies; - for (var key in axisProxies) { - if (axisProxies.hasOwnProperty(key) && axisProxies[key].hostedBy(this)) { - return axisProxies[key]; + var valueLabel = getValueLabel( + axisValue, axisModel.axis, ecModel, + item.seriesDataIndices, + item.valueLabelOpt + ); + + each$1(item.seriesDataIndices, function (idxItem) { + var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + var dataIndex = idxItem.dataIndexInside; + var dataParams = series && series.getDataParams(dataIndex); + dataParams.axisDim = item.axisDim; + dataParams.axisIndex = item.axisIndex; + dataParams.axisType = item.axisType; + dataParams.axisId = item.axisId; + dataParams.axisValue = getAxisRawValue(axisModel.axis, axisValue); + dataParams.axisValueLabel = valueLabel; + + if (dataParams) { + singleParamsList.push(dataParams); + var seriesTooltip = series.formatTooltip(dataIndex, true, null, renderMode); + + var html; + if (isObject$1(seriesTooltip)) { + html = seriesTooltip.html; + var newMarkers = seriesTooltip.markers; + merge(markers, newMarkers); + } + else { + html = seriesTooltip; + } + seriesDefaultHTML.push(html); + } + }); + + // Default tooltip content + // FIXME + // (1) shold be the first data which has name? + // (2) themeRiver, firstDataIndex is array, and first line is unnecessary. + var firstLine = valueLabel; + if (renderMode !== 'html') { + singleDefaultHTML.push(seriesDefaultHTML.join(newLine)); + } + else { + singleDefaultHTML.push( + (firstLine ? encodeHTML(firstLine) + newLine : '') + + seriesDefaultHTML.join(newLine) + ); + } + }); + }, this); + + // In most case, the second axis is shown upper than the first one. + singleDefaultHTML.reverse(); + singleDefaultHTML = singleDefaultHTML.join(this._newLine + this._newLine); + + var positionExpr = e.position; + this._showOrMove(singleTooltipModel, function () { + if (this._updateContentNotChangedOnAxis(dataByCoordSys)) { + this._updatePosition( + singleTooltipModel, + positionExpr, + point[0], point[1], + this._tooltipContent, + singleParamsList + ); + } + else { + this._showTooltipContent( + singleTooltipModel, singleDefaultHTML, singleParamsList, Math.random(), + point[0], point[1], positionExpr, undefined, markers + ); } + }); + + // Do not trigger events here, because this branch only be entered + // from dispatchAction. + }, + + _showSeriesItemTooltip: function (e, el, dispatchAction) { + var ecModel = this._ecModel; + // Use dataModel in element if possible + // Used when mouseover on a element like markPoint or edge + // In which case, the data is not main data in series. + var seriesIndex = el.seriesIndex; + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + + // For example, graph link. + var dataModel = el.dataModel || seriesModel; + var dataIndex = el.dataIndex; + var dataType = el.dataType; + var data = dataModel.getData(dataType); + + var tooltipModel = buildTooltipModel([ + data.getItemModel(dataIndex), + dataModel, + seriesModel && (seriesModel.coordinateSystem || {}).model, + this._tooltipModel + ]); + + var tooltipTrigger = tooltipModel.get('trigger'); + if (tooltipTrigger != null && tooltipTrigger !== 'item') { + return; } - // If no hosted axis find not hosted axisProxy. - // Consider this case: dataZoomModel1 and dataZoomModel2 control the same axis, - // and the option.start or option.end settings are different. The percentRange - // should follow axisProxy. - // (We encounter this problem in toolbox data zoom.) - for (var key in axisProxies) { - if (axisProxies.hasOwnProperty(key) && !axisProxies[key].hostedBy(this)) { - return axisProxies[key]; - } + var params = dataModel.getDataParams(dataIndex, dataType); + var seriesTooltip = dataModel.formatTooltip(dataIndex, false, dataType, this._renderMode); + var defaultHtml; + var markers; + if (isObject$1(seriesTooltip)) { + defaultHtml = seriesTooltip.html; + markers = seriesTooltip.markers; + } + else { + defaultHtml = seriesTooltip; + markers = null; + } + + var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; + + this._showOrMove(tooltipModel, function () { + this._showTooltipContent( + tooltipModel, defaultHtml, params, asyncTicket, + e.offsetX, e.offsetY, e.position, e.target, markers + ); + }); + + // FIXME + // duplicated showtip if manuallyShowTip is called from dispatchAction. + dispatchAction({ + type: 'showTip', + dataIndexInside: dataIndex, + dataIndex: data.getRawIndex(dataIndex), + seriesIndex: seriesIndex, + from: this.uid + }); + }, + + _showComponentItemTooltip: function (e, el, dispatchAction) { + var tooltipOpt = el.tooltip; + if (typeof tooltipOpt === 'string') { + var content = tooltipOpt; + tooltipOpt = { + content: content, + // Fixed formatter + formatter: content + }; + } + var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel); + var defaultHtml = subTooltipModel.get('content'); + var asyncTicket = Math.random(); + + // Do not check whether `trigger` is 'none' here, because `trigger` + // only works on cooridinate system. In fact, we have not found case + // that requires setting `trigger` nothing on component yet. + + this._showOrMove(subTooltipModel, function () { + this._showTooltipContent( + subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, + asyncTicket, e.offsetX, e.offsetY, e.position, el + ); + }); + + // If not dispatch showTip, tip may be hide triggered by axis. + dispatchAction({ + type: 'showTip', + from: this.uid + }); + }, + + _showTooltipContent: function ( + tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markers + ) { + // Reset ticket + this._ticket = ''; + + if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { + return; + } + + var tooltipContent = this._tooltipContent; + + var formatter = tooltipModel.get('formatter'); + positionExpr = positionExpr || tooltipModel.get('position'); + var html = defaultHtml; + + if (formatter && typeof formatter === 'string') { + html = formatTpl(formatter, params, true); + } + else if (typeof formatter === 'function') { + var callback = bind$3(function (cbTicket, html) { + if (cbTicket === this._ticket) { + tooltipContent.setContent(html, markers, tooltipModel); + this._updatePosition( + tooltipModel, positionExpr, x, y, tooltipContent, params, el + ); + } + }, this); + this._ticket = asyncTicket; + html = formatter(params, asyncTicket, callback); } + + tooltipContent.setContent(html, markers, tooltipModel); + tooltipContent.show(tooltipModel); + + this._updatePosition( + tooltipModel, positionExpr, x, y, tooltipContent, params, el + ); }, /** - * @return {Array.} + * @param {string|Function|Array.|Object} positionExpr + * @param {number} x Mouse x + * @param {number} y Mouse y + * @param {boolean} confine Whether confine tooltip content in view rect. + * @param {Object|} params + * @param {module:zrender/Element} el target element + * @param {module:echarts/ExtensionAPI} api + * @return {Array.} */ - getRangePropMode: function () { - return this._rangePropMode.slice(); - } + _updatePosition: function (tooltipModel, positionExpr, x, y, content, params, el) { + var viewWidth = this._api.getWidth(); + var viewHeight = this._api.getHeight(); + + positionExpr = positionExpr || tooltipModel.get('position'); + + var contentSize = content.getSize(); + var align = tooltipModel.get('align'); + var vAlign = tooltipModel.get('verticalAlign'); + var rect = el && el.getBoundingRect().clone(); + el && rect.applyTransform(el.transform); + + if (typeof positionExpr === 'function') { + // Callback of position can be an array or a string specify the position + positionExpr = positionExpr([x, y], params, content.el, rect, { + viewSize: [viewWidth, viewHeight], + contentSize: contentSize.slice() + }); + } + + if (isArray(positionExpr)) { + x = parsePercent$2(positionExpr[0], viewWidth); + y = parsePercent$2(positionExpr[1], viewHeight); + } + else if (isObject$1(positionExpr)) { + positionExpr.width = contentSize[0]; + positionExpr.height = contentSize[1]; + var layoutRect = getLayoutRect( + positionExpr, {width: viewWidth, height: viewHeight} + ); + x = layoutRect.x; + y = layoutRect.y; + align = null; + // When positionExpr is left/top/right/bottom, + // align and verticalAlign will not work. + vAlign = null; + } + // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element + else if (typeof positionExpr === 'string' && el) { + var pos = calcTooltipPosition( + positionExpr, rect, contentSize + ); + x = pos[0]; + y = pos[1]; + } + else { + var pos = refixTooltipPosition( + x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20 + ); + x = pos[0]; + y = pos[1]; + } + + align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); + vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); + + if (tooltipModel.get('confine')) { + var pos = confineTooltipPosition( + x, y, content, viewWidth, viewHeight + ); + x = pos[0]; + y = pos[1]; + } + + content.moveTo(x, y); + }, + + // FIXME + // Should we remove this but leave this to user? + _updateContentNotChangedOnAxis: function (dataByCoordSys) { + var lastCoordSys = this._lastDataByCoordSys; + var contentNotChanged = !!lastCoordSys + && lastCoordSys.length === dataByCoordSys.length; + + contentNotChanged && each$21(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { + var lastDataByAxis = lastItemCoordSys.dataByAxis || {}; + var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; + var thisDataByAxis = thisItemCoordSys.dataByAxis || []; + contentNotChanged &= lastDataByAxis.length === thisDataByAxis.length; + + contentNotChanged && each$21(lastDataByAxis, function (lastItem, indexAxis) { + var thisItem = thisDataByAxis[indexAxis] || {}; + var lastIndices = lastItem.seriesDataIndices || []; + var newIndices = thisItem.seriesDataIndices || []; + + contentNotChanged + &= lastItem.value === thisItem.value + && lastItem.axisType === thisItem.axisType + && lastItem.axisId === thisItem.axisId + && lastIndices.length === newIndices.length; + + contentNotChanged && each$21(lastIndices, function (lastIdxItem, j) { + var newIdxItem = newIndices[j]; + contentNotChanged + &= lastIdxItem.seriesIndex === newIdxItem.seriesIndex + && lastIdxItem.dataIndex === newIdxItem.dataIndex; + }); + }); + }); + this._lastDataByCoordSys = dataByCoordSys; + + return !!contentNotChanged; + }, + + _hide: function (dispatchAction) { + // Do not directly hideLater here, because this behavior may be prevented + // in dispatchAction when showTip is dispatched. + + // FIXME + // duplicated hideTip if manuallyHideTip is called from dispatchAction. + this._lastDataByCoordSys = null; + dispatchAction({ + type: 'hideTip', + from: this.uid + }); + }, + + dispose: function (ecModel, api) { + if (env$1.node) { + return; + } + this._tooltipContent.dispose(); + unregister('itemTooltip', api); + } }); -function retrieveRaw(option) { - var ret = {}; - each$21( - ['start', 'end', 'startValue', 'endValue', 'throttle'], - function (name) { - option.hasOwnProperty(name) && (ret[name] = option[name]); + +/** + * @param {Array.} modelCascade + * From top to bottom. (the last one should be globalTooltipModel); + */ +function buildTooltipModel(modelCascade) { + var resultModel = modelCascade.pop(); + while (modelCascade.length) { + var tooltipOpt = modelCascade.pop(); + if (tooltipOpt) { + if (Model.isInstance(tooltipOpt)) { + tooltipOpt = tooltipOpt.get('tooltip', true); + } + // In each data item tooltip can be simply write: + // { + // value: 10, + // tooltip: 'Something you need to know' + // } + if (typeof tooltipOpt === 'string') { + tooltipOpt = {formatter: tooltipOpt}; + } + resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel); } - ); - return ret; + } + return resultModel; } -function updateRangeUse(dataZoomModel, rawOption) { - var rangePropMode = dataZoomModel._rangePropMode; - var rangeModeInOption = dataZoomModel.get('rangeMode'); +function makeDispatchAction$1(payload, api) { + return payload.dispatchAction || bind(api.dispatchAction, api); +} - each$21([['start', 'startValue'], ['end', 'endValue']], function (names, index) { - var percentSpecified = rawOption[names[0]] != null; - var valueSpecified = rawOption[names[1]] != null; - if (percentSpecified && !valueSpecified) { - rangePropMode[index] = 'percent'; +function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) { + var size = content.getOuterSize(); + var width = size.width; + var height = size.height; + + if (gapH != null) { + if (x + width + gapH > viewWidth) { + x -= width + gapH; } - else if (!percentSpecified && valueSpecified) { - rangePropMode[index] = 'value'; + else { + x += gapH; } - else if (rangeModeInOption) { - rangePropMode[index] = rangeModeInOption[index]; + } + if (gapV != null) { + if (y + height + gapV > viewHeight) { + y -= height + gapV; } - else if (percentSpecified) { // percentSpecified && valueSpecified - rangePropMode[index] = 'percent'; + else { + y += gapV; } - // else remain its original setting. - }); + } + return [x, y]; +} + +function confineTooltipPosition(x, y, content, viewWidth, viewHeight) { + var size = content.getOuterSize(); + var width = size.width; + var height = size.height; + + x = Math.min(x + width, viewWidth) - width; + y = Math.min(y + height, viewHeight) - height; + x = Math.max(x, 0); + y = Math.max(y, 0); + + return [x, y]; +} + +function calcTooltipPosition(position, rect, contentSize) { + var domWidth = contentSize[0]; + var domHeight = contentSize[1]; + var gap = 5; + var x = 0; + var y = 0; + var rectWidth = rect.width; + var rectHeight = rect.height; + switch (position) { + case 'inside': + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y + rectHeight / 2 - domHeight / 2; + break; + case 'top': + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y - domHeight - gap; + break; + case 'bottom': + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y + rectHeight + gap; + break; + case 'left': + x = rect.x - domWidth - gap; + y = rect.y + rectHeight / 2 - domHeight / 2; + break; + case 'right': + x = rect.x + rectWidth + gap; + y = rect.y + rectHeight / 2 - domHeight / 2; + } + return [x, y]; +} + +function isCenterAlign(align) { + return align === 'center' || align === 'middle'; } /* @@ -80347,72 +84201,35 @@ function updateRangeUse(dataZoomModel, rawOption) { * under the License. */ -var DataZoomView = Component.extend({ - - type: 'dataZoom', +// FIXME Better way to pack data in graphic element - render: function (dataZoomModel, ecModel, api, payload) { - this.dataZoomModel = dataZoomModel; - this.ecModel = ecModel; - this.api = api; +/** + * @action + * @property {string} type + * @property {number} seriesIndex + * @property {number} dataIndex + * @property {number} [x] + * @property {number} [y] + */ +registerAction( + { + type: 'showTip', + event: 'showTip', + update: 'tooltip:manuallyShowTip' }, + // noop + function () {} +); - /** - * Find the first target coordinate system. - * - * @protected - * @return {Object} { - * grid: [ - * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1}, - * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0}, - * ... - * ], // cartesians must not be null/undefined. - * polar: [ - * {model: coord0, axisModels: [axis4], coordIndex: 0}, - * ... - * ], // polars must not be null/undefined. - * singleAxis: [ - * {model: coord0, axisModels: [], coordIndex: 0} - * ] - */ - getTargetCoordInfo: function () { - var dataZoomModel = this.dataZoomModel; - var ecModel = this.ecModel; - var coordSysLists = {}; - - dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { - var axisModel = ecModel.getComponent(dimNames.axis, axisIndex); - if (axisModel) { - var coordModel = axisModel.getCoordSysModel(); - coordModel && save( - coordModel, - axisModel, - coordSysLists[coordModel.mainType] || (coordSysLists[coordModel.mainType] = []), - coordModel.componentIndex - ); - } - }, this); - - function save(coordModel, axisModel, store, coordIndex) { - var item; - for (var i = 0; i < store.length; i++) { - if (store[i].model === coordModel) { - item = store[i]; - break; - } - } - if (!item) { - store.push(item = { - model: coordModel, axisModels: [], coordIndex: coordIndex - }); - } - item.axisModels.push(axisModel); - } - - return coordSysLists; - } - -}); +registerAction( + { + type: 'hideTip', + event: 'hideTip', + update: 'tooltip:manuallyHideTip' + }, + // noop + function () {} +); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -80433,69 +84250,62 @@ var DataZoomView = Component.extend({ * under the License. */ -var SliderZoomModel = DataZoomModel.extend({ +var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear']; - type: 'dataZoom.slider', +var preprocessor$1 = function (option, isNew) { + var brushComponents = option && option.brush; + if (!isArray(brushComponents)) { + brushComponents = brushComponents ? [brushComponents] : []; + } - layoutMode: 'box', + if (!brushComponents.length) { + return; + } - /** - * @protected - */ - defaultOption: { - show: true, + var brushComponentSpecifiedBtns = []; - // ph => placeholder. Using placehoder here because - // deault value can only be drived in view stage. - right: 'ph', // Default align to grid rect. - top: 'ph', // Default align to grid rect. - width: 'ph', // Default align to grid rect. - height: 'ph', // Default align to grid rect. - left: null, // Default align to grid rect. - bottom: null, // Default align to grid rect. + each$1(brushComponents, function (brushOpt) { + var tbs = brushOpt.hasOwnProperty('toolbox') + ? brushOpt.toolbox : []; - backgroundColor: 'rgba(47,69,84,0)', // Background of slider zoom component. - // dataBackgroundColor: '#ddd', // Background coor of data shadow and border of box, - // highest priority, remain for compatibility of - // previous version, but not recommended any more. - dataBackground: { - lineStyle: { - color: '#2f4554', - width: 0.5, - opacity: 0.3 - }, - areaStyle: { - color: 'rgba(47,69,84,0.3)', - opacity: 0.3 - } - }, - borderColor: '#ddd', // border color of the box. For compatibility, - // if dataBackgroundColor is set, borderColor - // is ignored. + if (tbs instanceof Array) { + brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); + } + }); - fillerColor: 'rgba(167,183,204,0.4)', // Color of selected area. - // handleColor: 'rgba(89,170,216,0.95)', // Color of handle. - // handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z', - handleIcon: 'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z', - // Percent of the slider height - handleSize: '100%', + var toolbox = option && option.toolbox; - handleStyle: { - color: '#a7b7cc' - }, + if (isArray(toolbox)) { + toolbox = toolbox[0]; + } + if (!toolbox) { + toolbox = {feature: {}}; + option.toolbox = [toolbox]; + } - labelPrecision: null, - labelFormatter: null, - showDetail: true, - showDataShadow: 'auto', // Default auto decision. - realtime: true, - zoomLock: false, // Whether disable zoom. - textStyle: { - color: '#333' - } + var toolboxFeature = (toolbox.feature || (toolbox.feature = {})); + var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); + var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); + + brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); + + removeDuplicate(brushTypes); + + if (isNew && !brushTypes.length) { + brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); } +}; -}); +function removeDuplicate(arr) { + var map$$1 = {}; + each$1(arr, function (val) { + map$$1[val] = 1; + }); + arr.length = 0; + each$1(map$$1, function (flag, val) { + arr.push(val); + }); +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -80516,792 +84326,800 @@ var SliderZoomModel = DataZoomModel.extend({ * under the License. */ -var Rect$2 = Rect; -var linearMap$1 = linearMap; -var asc$2 = asc; -var bind$4 = bind; -var each$23 = each$1; - -// Constants -var DEFAULT_LOCATION_EDGE_GAP = 7; -var DEFAULT_FRAME_BORDER_WIDTH = 1; -var DEFAULT_FILLER_SIZE = 30; -var HORIZONTAL = 'horizontal'; -var VERTICAL = 'vertical'; -var LABEL_GAP = 5; -var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter']; - -var SliderZoomView = DataZoomView.extend({ - - type: 'dataZoom.slider', +/** + * @file Visual solution, for consistent option specification. + */ - init: function (ecModel, api) { +var each$23 = each$1; - /** - * @private - * @type {Object} - */ - this._displayables = {}; +function hasKeys(obj) { + if (obj) { + for (var name in obj) { + if (obj.hasOwnProperty(name)) { + return true; + } + } + } +} - /** - * @private - * @type {string} - */ - this._orient; +/** + * @param {Object} option + * @param {Array.} stateList + * @param {Function} [supplementVisualOption] + * @return {Object} visualMappings > + */ +function createVisualMappings(option, stateList, supplementVisualOption) { + var visualMappings = {}; - /** - * [0, 100] - * @private - */ - this._range; + each$23(stateList, function (state) { + var mappings = visualMappings[state] = createMappings(); - /** - * [coord of the first handle, coord of the second handle] - * @private - */ - this._handleEnds; + each$23(option[state], function (visualData, visualType) { + if (!VisualMapping.isValidType(visualType)) { + return; + } + var mappingOption = { + type: visualType, + visual: visualData + }; + supplementVisualOption && supplementVisualOption(mappingOption, state); + mappings[visualType] = new VisualMapping(mappingOption); - /** - * [length, thick] - * @private - * @type {Array.} - */ - this._size; + // Prepare a alpha for opacity, for some case that opacity + // is not supported, such as rendering using gradient color. + if (visualType === 'opacity') { + mappingOption = clone(mappingOption); + mappingOption.type = 'colorAlpha'; + mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); + } + }); + }); - /** - * @private - * @type {number} - */ - this._handleWidth; + return visualMappings; - /** - * @private - * @type {number} - */ - this._handleHeight; + function createMappings() { + var Creater = function () {}; + // Make sure hidden fields will not be visited by + // object iteration (with hasOwnProperty checking). + Creater.prototype.__hidden = Creater.prototype; + var obj = new Creater(); + return obj; + } +} - /** - * @private - */ - this._location; +/** + * @param {Object} thisOption + * @param {Object} newOption + * @param {Array.} keys + */ +function replaceVisualOption(thisOption, newOption, keys) { + // Visual attributes merge is not supported, otherwise it + // brings overcomplicated merge logic. See #2853. So if + // newOption has anyone of these keys, all of these keys + // will be reset. Otherwise, all keys remain. + var has; + each$1(keys, function (key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + has = true; + } + }); + has && each$1(keys, function (key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + thisOption[key] = clone(newOption[key]); + } + else { + delete thisOption[key]; + } + }); +} - /** - * @private - */ - this._dragging; +/** + * @param {Array.} stateList + * @param {Object} visualMappings > + * @param {module:echarts/data/List} list + * @param {Function} getValueState param: valueOrIndex, return: state. + * @param {object} [scope] Scope for getValueState + * @param {string} [dimension] Concrete dimension, if used. + */ +// ???! handle brush? +function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { + var visualTypesMap = {}; + each$1(stateList, function (state) { + var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); - /** - * @private - */ - this._dataShadowInfo; + var dataIndex; - this.api = api; - }, + function getVisual(key) { + return data.getItemVisual(dataIndex, key); + } - /** - * @override - */ - render: function (dataZoomModel, ecModel, api, payload) { - SliderZoomView.superApply(this, 'render', arguments); + function setVisual(key, value) { + data.setItemVisual(dataIndex, key, value); + } - createOrUpdate( - this, - '_dispatchZoomAction', - this.dataZoomModel.get('throttle'), - 'fixRate' - ); + if (dimension == null) { + data.each(eachItem); + } + else { + data.each([dimension], eachItem); + } - this._orient = dataZoomModel.get('orient'); + function eachItem(valueOrIndex, index) { + dataIndex = dimension == null ? valueOrIndex : index; - if (this.dataZoomModel.get('show') === false) { - this.group.removeAll(); + var rawDataItem = data.getRawDataItem(dataIndex); + // Consider performance + if (rawDataItem && rawDataItem.visualMap === false) { return; } - // Notice: this._resetInterval() should not be executed when payload.type - // is 'dataZoom', origin this._range should be maintained, otherwise 'pan' - // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction, - if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) { - this._buildView(); + var valueState = getValueState.call(scope, valueOrIndex); + var mappings = visualMappings[valueState]; + var visualTypes = visualTypesMap[valueState]; + + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + mappings[type] && mappings[type].applyVisual( + valueOrIndex, getVisual, setVisual + ); } + } +} - this._updateView(); - }, +/** + * @param {module:echarts/data/List} data + * @param {Array.} stateList + * @param {Object} visualMappings > + * @param {Function} getValueState param: valueOrIndex, return: state. + * @param {number} [dim] dimension or dimension index. + */ +function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { + var visualTypesMap = {}; + each$1(stateList, function (state) { + var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); - /** - * @override - */ - remove: function () { - SliderZoomView.superApply(this, 'remove', arguments); - clear(this, '_dispatchZoomAction'); - }, + function progress(params, data) { + if (dim != null) { + dim = data.getDimension(dim); + } - /** - * @override - */ - dispose: function () { - SliderZoomView.superApply(this, 'dispose', arguments); - clear(this, '_dispatchZoomAction'); - }, + function getVisual(key) { + return data.getItemVisual(dataIndex, key); + } - _buildView: function () { - var thisGroup = this.group; + function setVisual(key, value) { + data.setItemVisual(dataIndex, key, value); + } - thisGroup.removeAll(); + var dataIndex; + while ((dataIndex = params.next()) != null) { + var rawDataItem = data.getRawDataItem(dataIndex); - this._resetLocation(); - this._resetInterval(); + // Consider performance + if (rawDataItem && rawDataItem.visualMap === false) { + continue; + } - var barGroup = this._displayables.barGroup = new Group(); + var value = dim != null + ? data.get(dim, dataIndex, true) + : dataIndex; - this._renderBackground(); + var valueState = getValueState(value); + var mappings = visualMappings[valueState]; + var visualTypes = visualTypesMap[valueState]; - this._renderHandle(); + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); + } + } + } - this._renderDataShadow(); + return {progress: progress}; +} - thisGroup.add(barGroup); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - this._positionGroup(); +// Key of the first level is brushType: `line`, `rect`, `polygon`. +// Key of the second level is chart element type: `point`, `rect`. +// See moudule:echarts/component/helper/BrushController +// function param: +// {Object} itemLayout fetch from data.getItemLayout(dataIndex) +// {Object} selectors {point: selector, rect: selector, ...} +// {Object} area {range: [[], [], ..], boudingRect} +// function return: +// {boolean} Whether in the given brush. +var selector = { + lineX: getLineSelectors(0), + lineY: getLineSelectors(1), + rect: { + point: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); + }, + rect: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.intersect(itemLayout); + } }, + polygon: { + point: function (itemLayout, selectors, area) { + return itemLayout + && area.boundingRect.contain(itemLayout[0], itemLayout[1]) + && contain$1(area.range, itemLayout[0], itemLayout[1]); + }, + rect: function (itemLayout, selectors, area) { + var points = area.range; - /** - * @private - */ - _resetLocation: function () { - var dataZoomModel = this.dataZoomModel; - var api = this.api; - - // If some of x/y/width/height are not specified, - // auto-adapt according to target grid. - var coordRect = this._findCoordRect(); - var ecSize = {width: api.getWidth(), height: api.getHeight()}; - // Default align by coordinate system rect. - var positionInfo = this._orient === HORIZONTAL - ? { - // Why using 'right', because right should be used in vertical, - // and it is better to be consistent for dealing with position param merge. - right: ecSize.width - coordRect.x - coordRect.width, - top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP), - width: coordRect.width, - height: DEFAULT_FILLER_SIZE + if (!itemLayout || points.length <= 1) { + return false; } - : { // vertical - right: DEFAULT_LOCATION_EDGE_GAP, - top: coordRect.y, - width: DEFAULT_FILLER_SIZE, - height: coordRect.height - }; - // Do not write back to option and replace value 'ph', because - // the 'ph' value should be recalculated when resize. - var layoutParams = getLayoutParams(dataZoomModel.option); + var x = itemLayout.x; + var y = itemLayout.y; + var width = itemLayout.width; + var height = itemLayout.height; + var p = points[0]; - // Replace the placeholder value. - each$1(['right', 'top', 'width', 'height'], function (name) { - if (layoutParams[name] === 'ph') { - layoutParams[name] = positionInfo[name]; + if (contain$1(points, x, y) + || contain$1(points, x + width, y) + || contain$1(points, x, y + height) + || contain$1(points, x + width, y + height) + || BoundingRect.create(itemLayout).contain(p[0], p[1]) + || linePolygonIntersect(x, y, x + width, y, points) + || linePolygonIntersect(x, y, x, y + height, points) + || linePolygonIntersect(x + width, y, x + width, y + height, points) + || linePolygonIntersect(x, y + height, x + width, y + height, points) + ) { + return true; } - }); + } + } +}; - var layoutRect = getLayoutRect( - layoutParams, - ecSize, - dataZoomModel.padding - ); +function getLineSelectors(xyIndex) { + var xy = ['x', 'y']; + var wh = ['width', 'height']; - this._location = {x: layoutRect.x, y: layoutRect.y}; - this._size = [layoutRect.width, layoutRect.height]; - this._orient === VERTICAL && this._size.reverse(); - }, + return { + point: function (itemLayout, selectors, area) { + if (itemLayout) { + var range = area.range; + var p = itemLayout[xyIndex]; + return inLineRange(p, range); + } + }, + rect: function (itemLayout, selectors, area) { + if (itemLayout) { + var range = area.range; + var layoutRange = [ + itemLayout[xy[xyIndex]], + itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]] + ]; + layoutRange[1] < layoutRange[0] && layoutRange.reverse(); + return inLineRange(layoutRange[0], range) + || inLineRange(layoutRange[1], range) + || inLineRange(range[0], layoutRange) + || inLineRange(range[1], layoutRange); + } + } + }; +} - /** - * @private - */ - _positionGroup: function () { - var thisGroup = this.group; - var location = this._location; - var orient = this._orient; +function inLineRange(p, range) { + return range[0] <= p && p <= range[1]; +} - // Just use the first axis to determine mapping. - var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); - var inverse = targetAxisModel && targetAxisModel.get('inverse'); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - var barGroup = this._displayables.barGroup; - var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; +var STATE_LIST = ['inBrush', 'outOfBrush']; +var DISPATCH_METHOD = '__ecBrushSelect'; +var DISPATCH_FLAG = '__ecInBrushSelectEvent'; +var PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH; - // Transform barGroup. - barGroup.attr( - (orient === HORIZONTAL && !inverse) - ? {scale: otherAxisInverse ? [1, 1] : [1, -1]} - : (orient === HORIZONTAL && inverse) - ? {scale: otherAxisInverse ? [-1, 1] : [-1, -1]} - : (orient === VERTICAL && !inverse) - ? {scale: otherAxisInverse ? [1, -1] : [1, 1], rotation: Math.PI / 2} - // Dont use Math.PI, considering shadow direction. - : {scale: otherAxisInverse ? [-1, -1] : [-1, 1], rotation: Math.PI / 2} +/** + * Layout for visual, the priority higher than other layout, and before brush visual. + */ +registerLayout(PRIORITY_BRUSH, function (ecModel, api, payload) { + ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { + payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption( + payload.key === 'brush' ? payload.brushOption : {brushType: false} ); + }); + layoutCovers(ecModel); +}); - // Position barGroup - var rect = thisGroup.getBoundingRect([barGroup]); - thisGroup.attr('position', [location.x - rect.x, location.y - rect.y]); - }, +function layoutCovers(ecModel) { + ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { + var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); + brushTargetManager.setInputRanges(brushModel.areas, ecModel); + }); +} - /** - * @private - */ - _getViewExtent: function () { - return [0, this._size[0]]; - }, +/** + * Register the visual encoding if this modules required. + */ +registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) { - _renderBackground: function () { - var dataZoomModel = this.dataZoomModel; - var size = this._size; - var barGroup = this._displayables.barGroup; + var brushSelected = []; + var throttleType; + var throttleDelay; - barGroup.add(new Rect$2({ - silent: true, - shape: { - x: 0, y: 0, width: size[0], height: size[1] - }, - style: { - fill: dataZoomModel.get('backgroundColor') - }, - z2: -40 - })); + ecModel.eachComponent({mainType: 'brush'}, function (brushModel, brushIndex) { - // Click panel, over shadow, below handles. - barGroup.add(new Rect$2({ - shape: { - x: 0, y: 0, width: size[0], height: size[1] - }, - style: { - fill: 'transparent' - }, - z2: 0, - onclick: bind(this._onClickPanelClick, this) - })); - }, + var thisBrushSelected = { + brushId: brushModel.id, + brushIndex: brushIndex, + brushName: brushModel.name, + areas: clone(brushModel.areas), + selected: [] + }; + // Every brush component exists in event params, convenient + // for user to find by index. + brushSelected.push(thisBrushSelected); - _renderDataShadow: function () { - var info = this._dataShadowInfo = this._prepareDataShadowInfo(); + var brushOption = brushModel.option; + var brushLink = brushOption.brushLink; + var linkedSeriesMap = []; + var selectedDataIndexForLink = []; + var rangeInfoBySeries = []; + var hasBrushExists = 0; - if (!info) { - return; + if (!brushIndex) { // Only the first throttle setting works. + throttleType = brushOption.throttleType; + throttleDelay = brushOption.throttleDelay; } - var size = this._size; - var seriesModel = info.series; - var data = seriesModel.getRawData(); + // Add boundingRect and selectors to range. + var areas = map(brushModel.areas, function (area) { + return bindSelector( + defaults( + {boundingRect: boundingRectBuilders[area.brushType](area)}, + area + ) + ); + }); - var otherDim = seriesModel.getShadowDim - ? seriesModel.getShadowDim() // @see candlestick - : info.otherDim; + var visualMappings = createVisualMappings( + brushModel.option, STATE_LIST, function (mappingOption) { + mappingOption.mappingMethod = 'fixed'; + } + ); - if (otherDim == null) { - return; + isArray(brushLink) && each$1(brushLink, function (seriesIndex) { + linkedSeriesMap[seriesIndex] = 1; + }); + + function linkOthers(seriesIndex) { + return brushLink === 'all' || linkedSeriesMap[seriesIndex]; } - var otherDataExtent = data.getDataExtent(otherDim); - // Nice extent. - var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3; - otherDataExtent = [ - otherDataExtent[0] - otherOffset, - otherDataExtent[1] + otherOffset - ]; - var otherShadowExtent = [0, size[1]]; + // If no supported brush or no brush on the series, + // all visuals should be in original state. + function brushed(rangeInfoList) { + return !!rangeInfoList.length; + } - var thisShadowExtent = [0, size[0]]; + /** + * Logic for each series: (If the logic has to be modified one day, do it carefully!) + * + * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord. + * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord. + * └!hasBrushExist┘ └nothing. + * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord. + * └!hasBrushExist┘ └nothing. + * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck. + * !brushed┘ └nothing. + * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing. + */ - var areaPoints = [[size[0], 0], [0, 0]]; - var linePoints = []; - var step = thisShadowExtent[1] / (data.count() - 1); - var thisCoord = 0; + // Step A + ecModel.eachSeries(function (seriesModel, seriesIndex) { + var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; - // Optimize for large data shadow - var stride = Math.round(data.count() / size[0]); - var lastIsEmpty; - data.each([otherDim], function (value, index) { - if (stride > 0 && (index % stride)) { - thisCoord += step; - return; - } + seriesModel.subType === 'parallel' + ? stepAParallel(seriesModel, seriesIndex, rangeInfoList) + : stepAOthers(seriesModel, seriesIndex, rangeInfoList); + }); - // FIXME - // Should consider axis.min/axis.max when drawing dataShadow. + function stepAParallel(seriesModel, seriesIndex) { + var coordSys = seriesModel.coordinateSystem; + hasBrushExists |= coordSys.hasAxisBrushed(); - // FIXME - // 应该使用统一的空判断?还是在list里进行空判断? - var isEmpty = value == null || isNaN(value) || value === ''; - // See #4235. - var otherCoord = isEmpty - ? 0 : linearMap$1(value, otherDataExtent, otherShadowExtent, true); + linkOthers(seriesIndex) && coordSys.eachActiveState( + seriesModel.getData(), + function (activeState, dataIndex) { + activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); + } + ); + } - // Attempt to draw data shadow precisely when there are empty value. - if (isEmpty && !lastIsEmpty && index) { - areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]); - linePoints.push([linePoints[linePoints.length - 1][0], 0]); - } - else if (!isEmpty && lastIsEmpty) { - areaPoints.push([thisCoord, 0]); - linePoints.push([thisCoord, 0]); + function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { + var selectorsByBrushType = getSelectorsByBrushType(seriesModel); + if (!selectorsByBrushType || brushModelNotControll(brushModel, seriesIndex)) { + return; } - areaPoints.push([thisCoord, otherCoord]); - linePoints.push([thisCoord, otherCoord]); - - thisCoord += step; - lastIsEmpty = isEmpty; - }); - - var dataZoomModel = this.dataZoomModel; - // var dataBackgroundModel = dataZoomModel.getModel('dataBackground'); - this._displayables.barGroup.add(new Polygon({ - shape: {points: areaPoints}, - style: defaults( - {fill: dataZoomModel.get('dataBackgroundColor')}, - dataZoomModel.getModel('dataBackground.areaStyle').getAreaStyle() - ), - silent: true, - z2: -20 - })); - this._displayables.barGroup.add(new Polyline({ - shape: {points: linePoints}, - style: dataZoomModel.getModel('dataBackground.lineStyle').getLineStyle(), - silent: true, - z2: -19 - })); - }, - - _prepareDataShadowInfo: function () { - var dataZoomModel = this.dataZoomModel; - var showDataShadow = dataZoomModel.get('showDataShadow'); + each$1(areas, function (area) { + selectorsByBrushType[area.brushType] + && brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel) + && rangeInfoList.push(area); + hasBrushExists |= brushed(rangeInfoList); + }); - if (showDataShadow === false) { - return; + if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { + var data = seriesModel.getData(); + data.each(function (dataIndex) { + if (checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex)) { + selectedDataIndexForLink[dataIndex] = 1; + } + }); + } } - // Find a representative series. - var result; - var ecModel = this.ecModel; + // Step B + ecModel.eachSeries(function (seriesModel, seriesIndex) { + var seriesBrushSelected = { + seriesId: seriesModel.id, + seriesIndex: seriesIndex, + seriesName: seriesModel.name, + dataIndex: [] + }; + // Every series exists in event params, convenient + // for user to find series by seriesIndex. + thisBrushSelected.selected.push(seriesBrushSelected); - dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { - var seriesModels = dataZoomModel - .getAxisProxy(dimNames.name, axisIndex) - .getTargetSeriesModels(); + var selectorsByBrushType = getSelectorsByBrushType(seriesModel); + var rangeInfoList = rangeInfoBySeries[seriesIndex]; - each$1(seriesModels, function (seriesModel) { - if (result) { - return; + var data = seriesModel.getData(); + var getValueState = linkOthers(seriesIndex) + ? function (dataIndex) { + return selectedDataIndexForLink[dataIndex] + ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') + : 'outOfBrush'; } + : function (dataIndex) { + return checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) + ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') + : 'outOfBrush'; + }; - if (showDataShadow !== true && indexOf( - SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type') - ) < 0 - ) { - return; - } + // If no supported brush or no brush, all visuals are in original state. + (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) + && applyVisual( + STATE_LIST, visualMappings, data, getValueState + ); + }); - var thisAxis = ecModel.getComponent(dimNames.axis, axisIndex).axis; - var otherDim = getOtherDim(dimNames.name); - var otherAxisInverse; - var coordSys = seriesModel.coordinateSystem; + }); - if (otherDim != null && coordSys.getOtherAxis) { - otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; - } + dispatchAction(api, throttleType, throttleDelay, brushSelected, payload); +}); - otherDim = seriesModel.getData().mapDimension(otherDim); +function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) { + // This event will not be triggered when `setOpion`, otherwise dead lock may + // triggered when do `setOption` in event listener, which we do not find + // satisfactory way to solve yet. Some considered resolutions: + // (a) Diff with prevoius selected data ant only trigger event when changed. + // But store previous data and diff precisely (i.e., not only by dataIndex, but + // also detect value changes in selected data) might bring complexity or fragility. + // (b) Use spectial param like `silent` to suppress event triggering. + // But such kind of volatile param may be weird in `setOption`. + if (!payload) { + return; + } - result = { - thisAxis: thisAxis, - series: seriesModel, - thisDim: dimNames.name, - otherDim: otherDim, - otherAxisInverse: otherAxisInverse - }; + var zr = api.getZr(); + if (zr[DISPATCH_FLAG]) { + return; + } - }, this); + if (!zr[DISPATCH_METHOD]) { + zr[DISPATCH_METHOD] = doDispatch; + } - }, this); + var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); - return result; - }, + fn(api, brushSelected); +} - _renderHandle: function () { - var displaybles = this._displayables; - var handles = displaybles.handles = []; - var handleLabels = displaybles.handleLabels = []; - var barGroup = this._displayables.barGroup; - var size = this._size; - var dataZoomModel = this.dataZoomModel; +function doDispatch(api, brushSelected) { + if (!api.isDisposed()) { + var zr = api.getZr(); + zr[DISPATCH_FLAG] = true; + api.dispatchAction({ + type: 'brushSelect', + batch: brushSelected + }); + zr[DISPATCH_FLAG] = false; + } +} - barGroup.add(displaybles.filler = new Rect$2({ - draggable: true, - cursor: getCursor(this._orient), - drift: bind$4(this._onDragMove, this, 'all'), - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - ondragstart: bind$4(this._showDataInfo, this, true), - ondragend: bind$4(this._onDragEnd, this), - onmouseover: bind$4(this._showDataInfo, this, true), - onmouseout: bind$4(this._showDataInfo, this, false), - style: { - fill: dataZoomModel.get('fillerColor'), - textPosition : 'inside' - } - })); +function checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) { + for (var i = 0, len = rangeInfoList.length; i < len; i++) { + var area = rangeInfoList[i]; + if (selectorsByBrushType[area.brushType]( + dataIndex, data, area.selectors, area + )) { + return true; + } + } +} - // Frame border. - barGroup.add(new Rect$2(subPixelOptimizeRect({ - silent: true, - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1] - }, - style: { - stroke: dataZoomModel.get('dataBackgroundColor') - || dataZoomModel.get('borderColor'), - lineWidth: DEFAULT_FRAME_BORDER_WIDTH, - fill: 'rgba(0,0,0,0)' - } - }))); +function getSelectorsByBrushType(seriesModel) { + var brushSelector = seriesModel.brushSelector; + if (isString(brushSelector)) { + var sels = []; + each$1(selector, function (selectorsByElementType, brushType) { + sels[brushType] = function (dataIndex, data, selectors, area) { + var itemLayout = data.getItemLayout(dataIndex); + return selectorsByElementType[brushSelector](itemLayout, selectors, area); + }; + }); + return sels; + } + else if (isFunction$1(brushSelector)) { + var bSelector = {}; + each$1(selector, function (sel, brushType) { + bSelector[brushType] = brushSelector; + }); + return bSelector; + } + return brushSelector; +} - each$23([0, 1], function (handleIndex) { - var path = createIcon( - dataZoomModel.get('handleIcon'), - { - cursor: getCursor(this._orient), - draggable: true, - drift: bind$4(this._onDragMove, this, handleIndex), - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - ondragend: bind$4(this._onDragEnd, this), - onmouseover: bind$4(this._showDataInfo, this, true), - onmouseout: bind$4(this._showDataInfo, this, false) - }, - {x: -1, y: 0, width: 2, height: 2} - ); +function brushModelNotControll(brushModel, seriesIndex) { + var seriesIndices = brushModel.option.seriesIndex; + return seriesIndices != null + && seriesIndices !== 'all' + && ( + isArray(seriesIndices) + ? indexOf(seriesIndices, seriesIndex) < 0 + : seriesIndex !== seriesIndices + ); +} - var bRect = path.getBoundingRect(); - this._handleHeight = parsePercent$1(dataZoomModel.get('handleSize'), this._size[1]); - this._handleWidth = bRect.width / bRect.height * this._handleHeight; +function bindSelector(area) { + var selectors = area.selectors = {}; + each$1(selector[area.brushType], function (selFn, elType) { + // Do not use function binding or curry for performance. + selectors[elType] = function (itemLayout) { + return selFn(itemLayout, selectors, area); + }; + }); + return area; +} - path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); - var handleColor = dataZoomModel.get('handleColor'); - // Compatitable with previous version - if (handleColor != null) { - path.style.fill = handleColor; - } +var boundingRectBuilders = { - barGroup.add(handles[handleIndex] = path); + lineX: noop, - var textStyleModel = dataZoomModel.textStyleModel; - - this.group.add( - handleLabels[handleIndex] = new Text({ - silent: true, - invisible: true, - style: { - x: 0, y: 0, text: '', - textVerticalAlign: 'middle', - textAlign: 'center', - textFill: textStyleModel.getTextColor(), - textFont: textStyleModel.getFont() - }, - z2: 10 - })); + lineY: noop, - }, this); + rect: function (area) { + return getBoundingRectFromMinMax(area.range); }, - /** - * @private - */ - _resetInterval: function () { - var range = this._range = this.dataZoomModel.getPercentRange(); - var viewExtent = this._getViewExtent(); - - this._handleEnds = [ - linearMap$1(range[0], [0, 100], viewExtent, true), - linearMap$1(range[1], [0, 100], viewExtent, true) - ]; - }, + polygon: function (area) { + var minMax; + var range = area.range; - /** - * @private - * @param {(number|string)} handleIndex 0 or 1 or 'all' - * @param {number} delta - * @return {boolean} changed - */ - _updateInterval: function (handleIndex, delta) { - var dataZoomModel = this.dataZoomModel; - var handleEnds = this._handleEnds; - var viewExtend = this._getViewExtent(); - var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); - var percentExtent = [0, 100]; + for (var i = 0, len = range.length; i < len; i++) { + minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; + var rg = range[i]; + rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]); + rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]); + rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]); + rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]); + } - sliderMove( - delta, - handleEnds, - viewExtend, - dataZoomModel.get('zoomLock') ? 'all' : handleIndex, - minMaxSpan.minSpan != null - ? linearMap$1(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, - minMaxSpan.maxSpan != null - ? linearMap$1(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null - ); + return minMax && getBoundingRectFromMinMax(minMax); + } +}; - var lastRange = this._range; - var range = this._range = asc$2([ - linearMap$1(handleEnds[0], viewExtend, percentExtent, true), - linearMap$1(handleEnds[1], viewExtend, percentExtent, true) - ]); +function getBoundingRectFromMinMax(minMax) { + return new BoundingRect( + minMax[0][0], + minMax[1][0], + minMax[0][1] - minMax[0][0], + minMax[1][1] - minMax[1][0] + ); +} - return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; - }, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - /** - * @private - */ - _updateView: function (nonRealtime) { - var displaybles = this._displayables; - var handleEnds = this._handleEnds; - var handleInterval = asc$2(handleEnds.slice()); - var size = this._size; +var DEFAULT_OUT_OF_BRUSH_COLOR = ['#ddd']; - each$23([0, 1], function (handleIndex) { - // Handles - var handle = displaybles.handles[handleIndex]; - var handleHeight = this._handleHeight; - handle.attr({ - scale: [handleHeight / 2, handleHeight / 2], - position: [handleEnds[handleIndex], size[1] / 2 - handleHeight / 2] - }); - }, this); +var BrushModel = extendComponentModel({ - // Filler - displaybles.filler.setShape({ - x: handleInterval[0], - y: 0, - width: handleInterval[1] - handleInterval[0], - height: size[1] - }); + type: 'brush', - this._updateDataInfo(nonRealtime); - }, + dependencies: ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'], /** - * @private + * @protected */ - _updateDataInfo: function (nonRealtime) { - var dataZoomModel = this.dataZoomModel; - var displaybles = this._displayables; - var handleLabels = displaybles.handleLabels; - var orient = this._orient; - var labelTexts = ['', '']; - - // FIXME - // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter) - if (dataZoomModel.get('showDetail')) { - var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); - - if (axisProxy) { - var axis = axisProxy.getAxisModel().axis; - var range = this._range; - - var dataInterval = nonRealtime - // See #4434, data and axis are not processed and reset yet in non-realtime mode. - ? axisProxy.calculateDataWindow({ - start: range[0], end: range[1] - }).valueWindow - : axisProxy.getDataValueWindow(); + defaultOption: { + // inBrush: null, + // outOfBrush: null, + toolbox: null, // Default value see preprocessor. + brushLink: null, // Series indices array, broadcast using dataIndex. + // or 'all', which means all series. 'none' or null means no series. + seriesIndex: 'all', // seriesIndex array, specify series controlled by this brush component. + geoIndex: null, // + xAxisIndex: null, + yAxisIndex: null, - labelTexts = [ - this._formatLabel(dataInterval[0], axis), - this._formatLabel(dataInterval[1], axis) - ]; - } - } + brushType: 'rect', // Default brushType, see BrushController. + brushMode: 'single', // Default brushMode, 'single' or 'multiple' + transformable: true, // Default transformable. + brushStyle: { // Default brushStyle + borderWidth: 1, + color: 'rgba(120,140,180,0.3)', + borderColor: 'rgba(120,140,180,0.8)' + }, - var orderedHandleEnds = asc$2(this._handleEnds.slice()); + throttleType: 'fixRate', // Throttle in brushSelected event. 'fixRate' or 'debounce'. + // If null, no throttle. Valid only in the first brush component + throttleDelay: 0, // Unit: ms, 0 means every event will be triggered. - setLabel.call(this, 0); - setLabel.call(this, 1); + // FIXME + // 试验效果 + removeOnClick: true, - function setLabel(handleIndex) { - // Label - // Text should not transform by barGroup. - // Ignore handlers transform - var barTransform = getTransform( - displaybles.handles[handleIndex].parent, this.group - ); - var direction = transformDirection( - handleIndex === 0 ? 'right' : 'left', barTransform - ); - var offset = this._handleWidth / 2 + LABEL_GAP; - var textPoint = applyTransform$1( - [ - orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), - this._size[1] / 2 - ], - barTransform - ); - handleLabels[handleIndex].setStyle({ - x: textPoint[0], - y: textPoint[1], - textVerticalAlign: orient === HORIZONTAL ? 'middle' : direction, - textAlign: orient === HORIZONTAL ? direction : 'center', - text: labelTexts[handleIndex] - }); - } + z: 10000 }, /** - * @private + * @readOnly + * @type {Array.} */ - _formatLabel: function (value, axis) { - var dataZoomModel = this.dataZoomModel; - var labelFormatter = dataZoomModel.get('labelFormatter'); - - var labelPrecision = dataZoomModel.get('labelPrecision'); - if (labelPrecision == null || labelPrecision === 'auto') { - labelPrecision = axis.getPixelPrecision(); - } - - var valueStr = (value == null || isNaN(value)) - ? '' - // FIXME Glue code - : (axis.type === 'category' || axis.type === 'time') - ? axis.scale.getLabel(Math.round(value)) - // param of toFixed should less then 20. - : value.toFixed(Math.min(labelPrecision, 20)); - - return isFunction$1(labelFormatter) - ? labelFormatter(value, valueStr) - : isString(labelFormatter) - ? labelFormatter.replace('{value}', valueStr) - : valueStr; - }, + areas: [], /** - * @private - * @param {boolean} showOrHide true: show, false: hide + * Current activated brush type. + * If null, brush is inactived. + * see module:echarts/component/helper/BrushController + * @readOnly + * @type {string} */ - _showDataInfo: function (showOrHide) { - // Always show when drgging. - showOrHide = this._dragging || showOrHide; - - var handleLabels = this._displayables.handleLabels; - handleLabels[0].attr('invisible', !showOrHide); - handleLabels[1].attr('invisible', !showOrHide); - }, - - _onDragMove: function (handleIndex, dx, dy) { - this._dragging = true; - - // Transform dx, dy to bar coordination. - var barTransform = this._displayables.barGroup.getLocalTransform(); - var vertex = applyTransform$1([dx, dy], barTransform, true); - - var changed = this._updateInterval(handleIndex, vertex[0]); - - var realtime = this.dataZoomModel.get('realtime'); + brushType: null, - this._updateView(!realtime); + /** + * Current brush opt. + * see module:echarts/component/helper/BrushController + * @readOnly + * @type {Object} + */ + brushOption: {}, - // Avoid dispatch dataZoom repeatly but range not changed, - // which cause bad visual effect when progressive enabled. - changed && realtime && this._dispatchZoomAction(); - }, + /** + * @readOnly + * @type {Array.} + */ + coordInfoList: [], - _onDragEnd: function () { - this._dragging = false; - this._showDataInfo(false); + optionUpdated: function (newOption, isInit) { + var thisOption = this.option; - // While in realtime mode and stream mode, dispatch action when - // drag end will cause the whole view rerender, which is unnecessary. - var realtime = this.dataZoomModel.get('realtime'); - !realtime && this._dispatchZoomAction(); - }, + !isInit && replaceVisualOption( + thisOption, newOption, ['inBrush', 'outOfBrush'] + ); - _onClickPanelClick: function (e) { - var size = this._size; - var localPoint = this._displayables.barGroup.transformCoordToLocal(e.offsetX, e.offsetY); + var inBrush = thisOption.inBrush = thisOption.inBrush || {}; + // Always give default visual, consider setOption at the second time. + thisOption.outOfBrush = thisOption.outOfBrush || {color: DEFAULT_OUT_OF_BRUSH_COLOR}; - if (localPoint[0] < 0 || localPoint[0] > size[0] - || localPoint[1] < 0 || localPoint[1] > size[1] - ) { - return; + if (!inBrush.hasOwnProperty('liftZ')) { + // Bigger than the highlight z lift, otherwise it will + // be effected by the highlight z when brush. + inBrush.liftZ = 5; } - - var handleEnds = this._handleEnds; - var center = (handleEnds[0] + handleEnds[1]) / 2; - - var changed = this._updateInterval('all', localPoint[0] - center); - this._updateView(); - changed && this._dispatchZoomAction(); }, /** - * This action will be throttled. - * @private + * If ranges is null/undefined, range state remain. + * + * @param {Array.} [ranges] */ - _dispatchZoomAction: function () { - var range = this._range; + setAreas: function (areas) { + if (__DEV__) { + assert$1(isArray(areas)); + each$1(areas, function (area) { + assert$1(area.brushType, 'Illegal areas'); + }); + } - this.api.dispatchAction({ - type: 'dataZoom', - from: this.uid, - dataZoomId: this.dataZoomModel.id, - start: range[0], - end: range[1] - }); + // If ranges is null/undefined, range state remain. + // This helps user to dispatchAction({type: 'brush'}) with no areas + // set but just want to get the current brush select info from a `brush` event. + if (!areas) { + return; + } + + this.areas = map(areas, function (area) { + return generateBrushOption(this.option, area); + }, this); }, /** - * @private + * see module:echarts/component/helper/BrushController + * @param {Object} brushOption */ - _findCoordRect: function () { - // Find the grid coresponding to the first axis referred by dataZoom. - var rect; - each$23(this.getTargetCoordInfo(), function (coordInfoList) { - if (!rect && coordInfoList.length) { - var coordSys = coordInfoList[0].model.coordinateSystem; - rect = coordSys.getRect && coordSys.getRect(); - } - }); - if (!rect) { - var width = this.api.getWidth(); - var height = this.api.getHeight(); - rect = { - x: width * 0.2, - y: height * 0.2, - width: width * 0.6, - height: height * 0.6 - }; - } - - return rect; + setBrushOption: function (brushOption) { + this.brushOption = generateBrushOption(this.option, brushOption); + this.brushType = this.brushOption.brushType; } }); -function getOtherDim(thisDim) { - // FIXME - // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好 - var map$$1 = {x: 'y', y: 'x', radius: 'angle', angle: 'radius'}; - return map$$1[thisDim]; -} - -function getCursor(orient) { - return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; +function generateBrushOption(option, brushOption) { + return merge( + { + brushType: option.brushType, + brushMode: option.brushMode, + transformable: option.transformable, + brushStyle: new Model(option.brushStyle).getItemStyle(), + removeOnClick: option.removeOnClick, + z: option.z + }, + brushOption, + true + ); } /* @@ -81323,23 +85141,116 @@ function getCursor(orient) { * under the License. */ -DataZoomModel.extend({ +extendComponentView({ - type: 'dataZoom.inside', + type: 'brush', + + init: function (ecModel, api) { + + /** + * @readOnly + * @type {module:echarts/model/Global} + */ + this.ecModel = ecModel; + + /** + * @readOnly + * @type {module:echarts/ExtensionAPI} + */ + this.api = api; + + /** + * @readOnly + * @type {module:echarts/component/brush/BrushModel} + */ + this.model; + + /** + * @private + * @type {module:echarts/component/helper/BrushController} + */ + (this._brushController = new BrushController(api.getZr())) + .on('brush', bind(this._onBrush, this)) + .mount(); + }, /** - * @protected + * @override */ - defaultOption: { - disabled: false, // Whether disable this inside zoom. - zoomLock: false, // Whether disable zoom but only pan. - zoomOnMouseWheel: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. - moveOnMouseMove: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. - moveOnMouseWheel: false, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. - preventDefaultMouseMove: true + render: function (brushModel) { + this.model = brushModel; + return updateController.apply(this, arguments); + }, + + /** + * @override + */ + updateTransform: function (brushModel, ecModel) { + // PENDING: `updateTransform` is a little tricky, whose layout need + // to be calculate mandatorily and other stages will not be performed. + // Take care the correctness of the logic. See #11754 . + layoutCovers(ecModel); + return updateController.apply(this, arguments); + }, + + /** + * @override + */ + updateView: updateController, + + // /** + // * @override + // */ + // updateLayout: updateController, + + // /** + // * @override + // */ + // updateVisual: updateController, + + /** + * @override + */ + dispose: function () { + this._brushController.dispose(); + }, + + /** + * @private + */ + _onBrush: function (areas, opt) { + var modelId = this.model.id; + + this.model.brushTargetManager.setOutputRanges(areas, this.ecModel); + + // Action is not dispatched on drag end, because the drag end + // emits the same params with the last drag move event, and + // may have some delay when using touch pad, which makes + // animation not smooth (when using debounce). + (!opt.isEnd || opt.removeOnClick) && this.api.dispatchAction({ + type: 'brush', + brushId: modelId, + areas: clone(areas), + $from: modelId + }); + opt.isEnd && this.api.dispatchAction({ + type: 'brushEnd', + brushId: modelId, + areas: clone(areas), + $from: modelId + }); } + }); +function updateController(brushModel, ecModel, api, payload) { + // Do not update controller when drawing. + (!payload || payload.$from !== brushModel.id) && this._brushController + .setPanels(brushModel.brushTargetManager.makePanelOpts(api)) + .enableBrush(brushModel.brushOption) + .updateCovers(brushModel.areas.slice()); +} + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -81359,206 +85270,215 @@ DataZoomModel.extend({ * under the License. */ -// Only create one roam controller for each coordinate system. -// one roam controller might be refered by two inside data zoom -// components (for example, one for x and one for y). When user -// pan or zoom, only dispatch one action for those data zoom -// components. - -var ATTR$1 = '\0_ec_dataZoom_roams'; - - /** - * @public - * @param {module:echarts/ExtensionAPI} api - * @param {Object} dataZoomInfo - * @param {string} dataZoomInfo.coordId - * @param {Function} dataZoomInfo.containsPoint - * @param {Array.} dataZoomInfo.allCoordIds - * @param {string} dataZoomInfo.dataZoomId - * @param {Object} dataZoomInfo.getRange - * @param {Function} dataZoomInfo.getRange.pan - * @param {Function} dataZoomInfo.getRange.zoom - * @param {Function} dataZoomInfo.getRange.scrollMove - * @param {boolean} dataZoomInfo.dataZoomModel + * payload: { + * brushIndex: number, or, + * brushId: string, or, + * brushName: string, + * globalRanges: Array + * } */ -function register$2(api, dataZoomInfo) { - var store = giveStore(api); - var theDataZoomId = dataZoomInfo.dataZoomId; - var theCoordId = dataZoomInfo.coordId; - - // Do clean when a dataZoom changes its target coordnate system. - // Avoid memory leak, dispose all not-used-registered. - each$1(store, function (record, coordId) { - var dataZoomInfos = record.dataZoomInfos; - if (dataZoomInfos[theDataZoomId] - && indexOf(dataZoomInfo.allCoordIds, theCoordId) < 0 - ) { - delete dataZoomInfos[theDataZoomId]; - record.count--; - } - }); - - cleanStore(store); - - var record = store[theCoordId]; - // Create if needed. - if (!record) { - record = store[theCoordId] = { - coordId: theCoordId, - dataZoomInfos: {}, - count: 0 - }; - record.controller = createController(api, record); - record.dispatchAction = curry(dispatchAction$1, api); +registerAction( + {type: 'brush', event: 'brush' /*, update: 'updateView' */}, + function (payload, ecModel) { + ecModel.eachComponent({mainType: 'brush', query: payload}, function (brushModel) { + brushModel.setAreas(payload.areas); + }); } +); - // Update reference of dataZoom. - !(record.dataZoomInfos[theDataZoomId]) && record.count++; - record.dataZoomInfos[theDataZoomId] = dataZoomInfo; +/** + * payload: { + * brushComponents: [ + * { + * brushId, + * brushIndex, + * brushName, + * series: [ + * { + * seriesId, + * seriesIndex, + * seriesName, + * rawIndices: [21, 34, ...] + * }, + * ... + * ] + * }, + * ... + * ] + * } + */ +registerAction( + {type: 'brushSelect', event: 'brushSelected', update: 'none'}, + function () {} +); - var controllerParams = mergeControllerParams(record.dataZoomInfos); - record.controller.enable(controllerParams.controlType, controllerParams.opt); +registerAction( + {type: 'brushEnd', event: 'brushEnd', update: 'none'}, + function () {} +); - // Consider resize, area should be always updated. - record.controller.setPointerChecker(dataZoomInfo.containsPoint); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - // Update throttle. - createOrUpdate( - record, - 'dispatchAction', - dataZoomInfo.dataZoomModel.get('throttle', true), - 'fixRate' - ); -} +var brushLang = lang.toolbox.brush; -/** - * @public - * @param {module:echarts/ExtensionAPI} api - * @param {string} dataZoomId - */ -function unregister$1(api, dataZoomId) { - var store = giveStore(api); +function Brush(model, ecModel, api) { + this.model = model; + this.ecModel = ecModel; + this.api = api; - each$1(store, function (record) { - record.controller.dispose(); - var dataZoomInfos = record.dataZoomInfos; - if (dataZoomInfos[dataZoomId]) { - delete dataZoomInfos[dataZoomId]; - record.count--; - } - }); + /** + * @private + * @type {string} + */ + this._brushType; - cleanStore(store); + /** + * @private + * @type {string} + */ + this._brushMode; } -/** - * @public - */ -function generateCoordId(coordModel) { - return coordModel.type + '\0_' + coordModel.id; -} +Brush.defaultOption = { + show: true, + type: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'], + icon: { + /* eslint-disable */ + rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13', // jshint ignore:line + polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2', // jshint ignore:line + lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4', // jshint ignore:line + lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4', // jshint ignore:line + keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z', // jshint ignore:line + clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line + /* eslint-enable */ + }, + // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` + title: clone(brushLang.title) +}; -/** - * Key: coordId, value: {dataZoomInfos: [], count, controller} - * @type {Array.} - */ -function giveStore(api) { - // Mount store on zrender instance, so that we do not - // need to worry about dispose. - var zr = api.getZr(); - return zr[ATTR$1] || (zr[ATTR$1] = {}); -} +var proto$7 = Brush.prototype; -function createController(api, newRecord) { - var controller = new RoamController(api.getZr()); +// proto.updateLayout = function (featureModel, ecModel, api) { +/* eslint-disable */ +proto$7.render = +/* eslint-enable */ +proto$7.updateView = function (featureModel, ecModel, api) { + var brushType; + var brushMode; + var isBrushed; - each$1(['pan', 'zoom', 'scrollMove'], function (eventName) { - controller.on(eventName, function (event) { - var batch = []; + ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { + brushType = brushModel.brushType; + brushMode = brushModel.brushOption.brushMode || 'single'; + isBrushed |= brushModel.areas.length; + }); + this._brushType = brushType; + this._brushMode = brushMode; - each$1(newRecord.dataZoomInfos, function (info) { - if (!event.isAvailableBehavior(info.dataZoomModel.option)) { - return; - } + each$1(featureModel.get('type', true), function (type) { + featureModel.setIconStatus( + type, + ( + type === 'keep' + ? brushMode === 'multiple' + : type === 'clear' + ? isBrushed + : type === brushType + ) ? 'emphasis' : 'normal' + ); + }); +}; - var method = (info.getRange || {})[eventName]; - var range = method && method(newRecord.controller, event); +proto$7.getIcons = function () { + var model = this.model; + var availableIcons = model.get('icon', true); + var icons = {}; + each$1(model.get('type', true), function (type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; + } + }); + return icons; +}; - !info.dataZoomModel.get('disabled', true) && range && batch.push({ - dataZoomId: info.dataZoomId, - start: range[0], - end: range[1] - }); - }); +proto$7.onclick = function (ecModel, api, type) { + var brushType = this._brushType; + var brushMode = this._brushMode; - batch.length && newRecord.dispatchAction(batch); + if (type === 'clear') { + // Trigger parallel action firstly + api.dispatchAction({ + type: 'axisAreaSelect', + intervals: [] }); - }); - return controller; -} + api.dispatchAction({ + type: 'brush', + command: 'clear', + // Clear all areas of all brush components. + areas: [] + }); + } + else { + api.dispatchAction({ + type: 'takeGlobalCursor', + key: 'brush', + brushOption: { + brushType: type === 'keep' + ? brushType + : (brushType === type ? false : type), + brushMode: type === 'keep' + ? (brushMode === 'multiple' ? 'single' : 'multiple') + : brushMode + } + }); + } +}; -function cleanStore(store) { - each$1(store, function (record, coordId) { - if (!record.count) { - record.controller.dispose(); - delete store[coordId]; - } - }); -} +register$1('brush', Brush); -/** - * This action will be throttled. - */ -function dispatchAction$1(api, batch) { - api.dispatchAction({ - type: 'dataZoom', - batch: batch - }); -} +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ /** - * Merge roamController settings when multiple dataZooms share one roamController. + * Brush component entry */ -function mergeControllerParams(dataZoomInfos) { - var controlType; - // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated - // as string, it is probably revert to reserved word by compress tool. See #7411. - var prefix = 'type_'; - var typePriority = { - 'type_true': 2, - 'type_move': 1, - 'type_false': 0, - 'type_undefined': -1 - }; - var preventDefaultMouseMove = true; - - each$1(dataZoomInfos, function (dataZoomInfo) { - var dataZoomModel = dataZoomInfo.dataZoomModel; - var oneType = dataZoomModel.get('disabled', true) - ? false - : dataZoomModel.get('zoomLock', true) - ? 'move' - : true; - if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { - controlType = oneType; - } - // Prevent default move event by default. If one false, do not prevent. Otherwise - // users may be confused why it does not work when multiple insideZooms exist. - preventDefaultMouseMove &= dataZoomModel.get('preventDefaultMouseMove', true); - }); - return { - controlType: controlType, - opt: { - zoomOnMouseWheel: true, - moveOnMouseMove: true, - moveOnMouseWheel: true, - preventDefaultMouseMove: !!preventDefaultMouseMove - } - }; -} +registerPreprocessor(preprocessor$1); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -81579,331 +85499,215 @@ function mergeControllerParams(dataZoomInfos) { * under the License. */ -var bind$5 = bind; +// Model +extendComponentModel({ -var InsideZoomView = DataZoomView.extend({ + type: 'title', - type: 'dataZoom.inside', + layoutMode: {type: 'box', ignoreSize: true}, - /** - * @override - */ - init: function (ecModel, api) { - /** - * 'throttle' is used in this.dispatchAction, so we save range - * to avoid missing some 'pan' info. - * @private - * @type {Array.} - */ - this._range; - }, + defaultOption: { + // 一级层叠 + zlevel: 0, + // 二级层叠 + z: 6, + show: true, - /** - * @override - */ - render: function (dataZoomModel, ecModel, api, payload) { - InsideZoomView.superApply(this, 'render', arguments); + text: '', + // 超链接跳转 + // link: null, + // 仅支持self | blank + target: 'blank', + subtext: '', - // Hance the `throttle` util ensures to preserve command order, - // here simply updating range all the time will not cause missing - // any of the the roam change. - this._range = dataZoomModel.getPercentRange(); + // 超链接跳转 + // sublink: null, + // 仅支持self | blank + subtarget: 'blank', - // Reset controllers. - each$1(this.getTargetCoordInfo(), function (coordInfoList, coordSysName) { + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + left: 0, + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + top: 0, - var allCoordIds = map(coordInfoList, function (coordInfo) { - return generateCoordId(coordInfo.model); - }); + // 水平对齐 + // 'auto' | 'left' | 'right' | 'center' + // 默认根据 left 的位置判断是左对齐还是右对齐 + // textAlign: null + // + // 垂直对齐 + // 'auto' | 'top' | 'bottom' | 'middle' + // 默认根据 top 位置判断是上对齐还是下对齐 + // textVerticalAlign: null + // textBaseline: null // The same as textVerticalAlign. - each$1(coordInfoList, function (coordInfo) { - var coordModel = coordInfo.model; + backgroundColor: 'rgba(0,0,0,0)', - var getRange = {}; - each$1(['pan', 'zoom', 'scrollMove'], function (eventName) { - getRange[eventName] = bind$5(roamHandlers[eventName], this, coordInfo, coordSysName); - }, this); + // 标题边框颜色 + borderColor: '#ccc', - register$2( - api, - { - coordId: generateCoordId(coordModel), - allCoordIds: allCoordIds, - containsPoint: function (e, x, y) { - return coordModel.coordinateSystem.containPoint([x, y]); - }, - dataZoomId: dataZoomModel.id, - dataZoomModel: dataZoomModel, - getRange: getRange - } - ); - }, this); + // 标题边框线宽,单位px,默认为0(无边框) + borderWidth: 0, - }, this); - }, + // 标题内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + padding: 5, - /** - * @override - */ - dispose: function () { - unregister$1(this.api, this.dataZoomModel.id); - InsideZoomView.superApply(this, 'dispose', arguments); - this._range = null; + // 主副标题纵向间隔,单位px,默认为10, + itemGap: 10, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' + }, + subtextStyle: { + color: '#aaa' + } } - }); -var roamHandlers = { +// View +extendComponentView({ - /** - * @this {module:echarts/component/dataZoom/InsideZoomView} - */ - zoom: function (coordInfo, coordSysName, controller, e) { - var lastRange = this._range; - var range = lastRange.slice(); + type: 'title', - // Calculate transform by the first axis. - var axisModel = coordInfo.axisModels[0]; - if (!axisModel) { + render: function (titleModel, ecModel, api) { + this.group.removeAll(); + + if (!titleModel.get('show')) { return; } - var directionInfo = getDirectionInfo[coordSysName]( - null, [e.originX, e.originY], axisModel, controller, coordInfo - ); - var percentPoint = ( - directionInfo.signal > 0 - ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel) - : (directionInfo.pixel - directionInfo.pixelStart) - ) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; + var group = this.group; - var scale = Math.max(1 / e.scale, 0); - range[0] = (range[0] - percentPoint) * scale + percentPoint; - range[1] = (range[1] - percentPoint) * scale + percentPoint; + var textStyleModel = titleModel.getModel('textStyle'); + var subtextStyleModel = titleModel.getModel('subtextStyle'); - // Restrict range. - var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + var textAlign = titleModel.get('textAlign'); + var textVerticalAlign = retrieve2( + titleModel.get('textBaseline'), titleModel.get('textVerticalAlign') + ); - sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); + var textEl = new Text({ + style: setTextStyle({}, textStyleModel, { + text: titleModel.get('text'), + textFill: textStyleModel.getTextColor() + }, {disableBox: true}), + z2: 10 + }); - this._range = range; + var textRect = textEl.getBoundingRect(); - if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { - return range; - } - }, + var subText = titleModel.get('subtext'); + var subTextEl = new Text({ + style: setTextStyle({}, subtextStyleModel, { + text: subText, + textFill: subtextStyleModel.getTextColor(), + y: textRect.height + titleModel.get('itemGap'), + textVerticalAlign: 'top' + }, {disableBox: true}), + z2: 10 + }); - /** - * @this {module:echarts/component/dataZoom/InsideZoomView} - */ - pan: makeMover(function (range, axisModel, coordInfo, coordSysName, controller, e) { - var directionInfo = getDirectionInfo[coordSysName]( - [e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordInfo - ); + var link = titleModel.get('link'); + var sublink = titleModel.get('sublink'); + var triggerEvent = titleModel.get('triggerEvent', true); - return directionInfo.signal - * (range[1] - range[0]) - * directionInfo.pixel / directionInfo.pixelLength; - }), + textEl.silent = !link && !triggerEvent; + subTextEl.silent = !sublink && !triggerEvent; - /** - * @this {module:echarts/component/dataZoom/InsideZoomView} - */ - scrollMove: makeMover(function (range, axisModel, coordInfo, coordSysName, controller, e) { - return (range[1] - range[0]) * e.scrollDelta; - }) -}; - -function makeMover(getPercentDelta) { - return function (coordInfo, coordSysName, controller, e) { - var lastRange = this._range; - var range = lastRange.slice(); - - // Calculate transform by the first axis. - var axisModel = coordInfo.axisModels[0]; - if (!axisModel) { - return; - } - - var percentDelta = getPercentDelta( - range, axisModel, coordInfo, coordSysName, controller, e - ); - - sliderMove(percentDelta, range, [0, 100], 'all'); - - this._range = range; - - if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { - return range; - } - }; -} - -var getDirectionInfo = { - - grid: function (oldPoint, newPoint, axisModel, controller, coordInfo) { - var axis = axisModel.axis; - var ret = {}; - var rect = coordInfo.model.coordinateSystem.getRect(); - oldPoint = oldPoint || [0, 0]; - - if (axis.dim === 'x') { - ret.pixel = newPoint[0] - oldPoint[0]; - ret.pixelLength = rect.width; - ret.pixelStart = rect.x; - ret.signal = axis.inverse ? 1 : -1; + if (link) { + textEl.on('click', function () { + windowOpen(link, '_' + titleModel.get('target')); + }); } - else { // axis.dim === 'y' - ret.pixel = newPoint[1] - oldPoint[1]; - ret.pixelLength = rect.height; - ret.pixelStart = rect.y; - ret.signal = axis.inverse ? -1 : 1; + if (sublink) { + subTextEl.on('click', function () { + windowOpen(link, '_' + titleModel.get('subtarget')); + }); } - return ret; - }, - - polar: function (oldPoint, newPoint, axisModel, controller, coordInfo) { - var axis = axisModel.axis; - var ret = {}; - var polar = coordInfo.model.coordinateSystem; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var angleExtent = polar.getAngleAxis().getExtent(); + textEl.eventData = subTextEl.eventData = triggerEvent + ? { + componentType: 'title', + componentIndex: titleModel.componentIndex + } + : null; - oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; - newPoint = polar.pointToCoord(newPoint); + group.add(textEl); + subText && group.add(subTextEl); + // If no subText, but add subTextEl, there will be an empty line. - if (axisModel.mainType === 'radiusAxis') { - ret.pixel = newPoint[0] - oldPoint[0]; - // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); - // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); - ret.pixelLength = radiusExtent[1] - radiusExtent[0]; - ret.pixelStart = radiusExtent[0]; - ret.signal = axis.inverse ? 1 : -1; - } - else { // 'angleAxis' - ret.pixel = newPoint[1] - oldPoint[1]; - // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); - // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); - ret.pixelLength = angleExtent[1] - angleExtent[0]; - ret.pixelStart = angleExtent[0]; - ret.signal = axis.inverse ? -1 : 1; + var groupRect = group.getBoundingRect(); + var layoutOption = titleModel.getBoxLayoutParams(); + layoutOption.width = groupRect.width; + layoutOption.height = groupRect.height; + var layoutRect = getLayoutRect( + layoutOption, { + width: api.getWidth(), + height: api.getHeight() + }, titleModel.get('padding') + ); + // Adjust text align based on position + if (!textAlign) { + // Align left if title is on the left. center and right is same + textAlign = titleModel.get('left') || titleModel.get('right'); + if (textAlign === 'middle') { + textAlign = 'center'; + } + // Adjust layout by text align + if (textAlign === 'right') { + layoutRect.x += layoutRect.width; + } + else if (textAlign === 'center') { + layoutRect.x += layoutRect.width / 2; + } } + if (!textVerticalAlign) { + textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); + if (textVerticalAlign === 'center') { + textVerticalAlign = 'middle'; + } + if (textVerticalAlign === 'bottom') { + layoutRect.y += layoutRect.height; + } + else if (textVerticalAlign === 'middle') { + layoutRect.y += layoutRect.height / 2; + } - return ret; - }, - - singleAxis: function (oldPoint, newPoint, axisModel, controller, coordInfo) { - var axis = axisModel.axis; - var rect = coordInfo.model.coordinateSystem.getRect(); - var ret = {}; - - oldPoint = oldPoint || [0, 0]; - - if (axis.orient === 'horizontal') { - ret.pixel = newPoint[0] - oldPoint[0]; - ret.pixelLength = rect.width; - ret.pixelStart = rect.x; - ret.signal = axis.inverse ? 1 : -1; - } - else { // 'vertical' - ret.pixel = newPoint[1] - oldPoint[1]; - ret.pixelLength = rect.height; - ret.pixelStart = rect.y; - ret.signal = axis.inverse ? -1 : 1; + textVerticalAlign = textVerticalAlign || 'top'; } - return ret; - } -}; - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -registerProcessor({ - - // `dataZoomProcessor` will only be performed in needed series. Consider if - // there is a line series and a pie series, it is better not to update the - // line series if only pie series is needed to be updated. - getTargetSeries: function (ecModel) { - var seriesModelMap = createHashMap(); - - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { - var axisProxy = dataZoomModel.getAxisProxy(dimNames.name, axisIndex); - each$1(axisProxy.getTargetSeriesModels(), function (seriesModel) { - seriesModelMap.set(seriesModel.uid, seriesModel); - }); - }); - }); - - return seriesModelMap; - }, - - modifyOutputEnd: true, - - // Consider appendData, where filter should be performed. Because data process is - // in block mode currently, it is not need to worry about that the overallProgress - // execute every frame. - overallReset: function (ecModel, api) { - - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - // We calculate window and reset axis here but not in model - // init stage and not after action dispatch handler, because - // reset should be called after seriesData.restoreData. - dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { - dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel, api); - }); + group.attr('position', [layoutRect.x, layoutRect.y]); + var alignStyle = { + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; + textEl.setStyle(alignStyle); + subTextEl.setStyle(alignStyle); - // Caution: data zoom filtering is order sensitive when using - // percent range and no min/max/scale set on axis. - // For example, we have dataZoom definition: - // [ - // {xAxisIndex: 0, start: 30, end: 70}, - // {yAxisIndex: 0, start: 20, end: 80} - // ] - // In this case, [20, 80] of y-dataZoom should be based on data - // that have filtered by x-dataZoom using range of [30, 70], - // but should not be based on full raw data. Thus sliding - // x-dataZoom will change both ranges of xAxis and yAxis, - // while sliding y-dataZoom will only change the range of yAxis. - // So we should filter x-axis after reset x-axis immediately, - // and then reset y-axis and filter y-axis. - dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { - dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel, api); - }); + // Render background + // Get groupRect again because textAlign has been changed + groupRect = group.getBoundingRect(); + var padding = layoutRect.margin; + var style = titleModel.getItemStyle(['color', 'opacity']); + style.fill = titleModel.get('backgroundColor'); + var rect = new Rect({ + shape: { + x: groupRect.x - padding[3], + y: groupRect.y - padding[0], + width: groupRect.width + padding[1] + padding[3], + height: groupRect.height + padding[0] + padding[2], + r: titleModel.get('borderRadius') + }, + style: style, + subPixelOptimize: true, + silent: true }); - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - // Fullfill all of the range props so that user - // is able to get them from chart.getOption(). - var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); - var percentRange = axisProxy.getDataPercentWindow(); - var valueRange = axisProxy.getDataValueWindow(); - - dataZoomModel.setRawRange({ - start: percentRange[0], - end: percentRange[1], - startValue: valueRange[0], - endValue: valueRange[1] - }, true); - }); + group.add(rect); } }); @@ -81926,118 +85730,82 @@ registerProcessor({ * under the License. */ -registerAction('dataZoom', function (payload, ecModel) { - - var linkedNodesFinder = createLinkedNodesFinder( - bind(ecModel.eachComponent, ecModel, 'dataZoom'), - eachAxisDim$1, - function (model, dimNames) { - return model.get(dimNames.axisIndex); - } - ); +var preprocessor$2 = function (option) { + var timelineOpt = option && option.timeline; - var effectedModels = []; + if (!isArray(timelineOpt)) { + timelineOpt = timelineOpt ? [timelineOpt] : []; + } - ecModel.eachComponent( - {mainType: 'dataZoom', query: payload}, - function (model, index) { - effectedModels.push.apply( - effectedModels, linkedNodesFinder(model).nodes - ); + each$1(timelineOpt, function (opt) { + if (!opt) { + return; } - ); - each$1(effectedModels, function (dataZoomModel, index) { - dataZoomModel.setRawRange({ - start: payload.start, - end: payload.end, - startValue: payload.startValue, - endValue: payload.endValue - }); + compatibleEC2(opt); }); +}; -}); - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -/** - * DataZoom component entry - */ +function compatibleEC2(opt) { + var type = opt.type; -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + var ec2Types = {'number': 'value', 'time': 'time'}; -var each$24 = each$1; + // Compatible with ec2 + if (ec2Types[type]) { + opt.axisType = ec2Types[type]; + delete opt.type; + } -var preprocessor$2 = function (option) { - var visualMap = option && option.visualMap; + transferItem(opt); - if (!isArray(visualMap)) { - visualMap = visualMap ? [visualMap] : []; + if (has$1(opt, 'controlPosition')) { + var controlStyle = opt.controlStyle || (opt.controlStyle = {}); + if (!has$1(controlStyle, 'position')) { + controlStyle.position = opt.controlPosition; + } + if (controlStyle.position === 'none' && !has$1(controlStyle, 'show')) { + controlStyle.show = false; + delete controlStyle.position; + } + delete opt.controlPosition; } - each$24(visualMap, function (opt) { - if (!opt) { - return; + each$1(opt.data || [], function (dataItem) { + if (isObject$1(dataItem) && !isArray(dataItem)) { + if (!has$1(dataItem, 'value') && has$1(dataItem, 'name')) { + // In ec2, using name as value. + dataItem.value = dataItem.name; + } + transferItem(dataItem); } + }); +} - // rename splitList to pieces - if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) { - opt.pieces = opt.splitList; - delete opt.splitList; - } +function transferItem(opt) { + var itemStyle = opt.itemStyle || (opt.itemStyle = {}); - var pieces = opt.pieces; - if (pieces && isArray(pieces)) { - each$24(pieces, function (piece) { - if (isObject$1(piece)) { - if (has$1(piece, 'start') && !has$1(piece, 'min')) { - piece.min = piece.start; - } - if (has$1(piece, 'end') && !has$1(piece, 'max')) { - piece.max = piece.end; - } - } - }); + var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); + + // Transfer label out + var label = opt.label || (opt.label || {}); + var labelNormal = label.normal || (label.normal = {}); + var excludeLabelAttr = {normal: 1, emphasis: 1}; + + each$1(label, function (value, name) { + if (!excludeLabelAttr[name] && !has$1(labelNormal, name)) { + labelNormal[name] = value; } }); -}; -function has$1(obj, name) { - return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); + if (itemStyleEmphasis.label && !has$1(label, 'emphasis')) { + label.emphasis = itemStyleEmphasis.label; + delete itemStyleEmphasis.label; + } +} + +function has$1(obj, attr) { + return obj.hasOwnProperty(attr); } /* @@ -82059,20 +85827,9 @@ function has$1(obj, name) { * under the License. */ -ComponentModel.registerSubTypeDefaulter('visualMap', function (option) { - // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used. - return ( - !option.categories - && ( - !( - option.pieces - ? option.pieces.length > 0 - : option.splitNumber > 0 - ) - || option.calculable - ) - ) - ? 'continuous' : 'piecewise'; +ComponentModel.registerSubTypeDefaulter('timeline', function () { + // Only slider now. + return 'slider'; }); /* @@ -82094,88 +85851,41 @@ ComponentModel.registerSubTypeDefaulter('visualMap', function (option) { * under the License. */ -var VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT; - -registerVisual(VISUAL_PRIORITY, { - createOnAllSeries: true, - reset: function (seriesModel, ecModel) { - var resetDefines = []; - ecModel.eachComponent('visualMap', function (visualMapModel) { - var pipelineContext = seriesModel.pipelineContext; - if (!visualMapModel.isTargetSeries(seriesModel) - || (pipelineContext && pipelineContext.large) - ) { - return; - } - - resetDefines.push(incrementalApplyVisual( - visualMapModel.stateList, - visualMapModel.targetVisuals, - bind(visualMapModel.getValueState, visualMapModel), - visualMapModel.getDataDimension(seriesModel.getData()) - )); - }); +registerAction( - return resetDefines; - } -}); + {type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'}, -// Only support color. -registerVisual(VISUAL_PRIORITY, { - createOnAllSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - var visualMetaList = []; + function (payload, ecModel) { - ecModel.eachComponent('visualMap', function (visualMapModel) { - if (visualMapModel.isTargetSeries(seriesModel)) { - var visualMeta = visualMapModel.getVisualMeta( - bind(getColorVisual, null, seriesModel, visualMapModel) - ) || {stops: [], outerColors: []}; + var timelineModel = ecModel.getComponent('timeline'); + if (timelineModel && payload.currentIndex != null) { + timelineModel.setCurrentIndex(payload.currentIndex); - var concreteDim = visualMapModel.getDataDimension(data); - var dimInfo = data.getDimensionInfo(concreteDim); - if (dimInfo != null) { - // visualMeta.dimension should be dimension index, but not concrete dimension. - visualMeta.dimension = dimInfo.index; - visualMetaList.push(visualMeta); - } + if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) { + timelineModel.setPlayState(false); } - }); - - // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); - seriesModel.getData().setVisual('visualMeta', visualMetaList); - } -}); + } -// FIXME -// performance and export for heatmap? -// value can be Infinity or -Infinity -function getColorVisual(seriesModel, visualMapModel, value, valueState) { - var mappings = visualMapModel.targetVisuals[valueState]; - var visualTypes = VisualMapping.prepareVisualTypes(mappings); - var resultVisual = { - color: seriesModel.getData().getVisual('color') // default color. - }; + // Set normalized currentIndex to payload. + ecModel.resetOption('timeline'); - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - var mapping = mappings[ - type === 'opacity' ? '__alphaForOpacity' : type - ]; - mapping && mapping.applyVisual(value, getVisual, setVisual); + return defaults({ + currentIndex: timelineModel.option.currentIndex + }, payload); } +); - return resultVisual.color; +registerAction( - function getVisual(key) { - return resultVisual[key]; - } + {type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update'}, - function setVisual(key, value) { - resultVisual[key] = value; + function (payload, ecModel) { + var timelineModel = ecModel.getComponent('timeline'); + if (timelineModel && payload.playState != null) { + timelineModel.setPlayState(payload.playState); + } } -} +); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -82196,69 +85906,182 @@ function getColorVisual(seriesModel, visualMapModel, value, valueState) { * under the License. */ -/** - * @file Visual mapping. - */ +var TimelineModel = ComponentModel.extend({ -var visualDefault = { + type: 'timeline', + + layoutMode: 'box', /** - * @public + * @protected */ - get: function (visualType, key, isCategory) { - var value = clone( - (defaultOption$3[visualType] || {})[key] - ); + defaultOption: { - return isCategory - ? (isArray(value) ? value[value.length - 1] : value) - : value; - } + zlevel: 0, // 一级层叠 + z: 4, // 二级层叠 + show: true, -}; + axisType: 'time', // 模式是时间类型,支持 value, category -var defaultOption$3 = { + realtime: true, - color: { - active: ['#006edd', '#e0ffff'], - inactive: ['rgba(0,0,0,0)'] + left: '20%', + top: null, + right: '20%', + bottom: 0, + width: null, + height: 40, + padding: 5, + + controlPosition: 'left', // 'left' 'right' 'top' 'bottom' 'none' + autoPlay: false, + rewind: false, // 反向播放 + loop: true, + playInterval: 2000, // 播放时间间隔,单位ms + + currentIndex: 0, + + itemStyle: {}, + label: { + color: '#000' + }, + + data: [] }, - colorHue: { - active: [0, 360], - inactive: [0, 0] + /** + * @override + */ + init: function (option, parentModel, ecModel) { + + /** + * @private + * @type {module:echarts/data/List} + */ + this._data; + + /** + * @private + * @type {Array.} + */ + this._names; + + this.mergeDefaultAndTheme(option, ecModel); + this._initData(); }, - colorSaturation: { - active: [0.3, 1], - inactive: [0, 0] + /** + * @override + */ + mergeOption: function (option) { + TimelineModel.superApply(this, 'mergeOption', arguments); + this._initData(); }, - colorLightness: { - active: [0.9, 0.5], - inactive: [0, 0] + /** + * @param {number} [currentIndex] + */ + setCurrentIndex: function (currentIndex) { + if (currentIndex == null) { + currentIndex = this.option.currentIndex; + } + var count = this._data.count(); + + if (this.option.loop) { + currentIndex = (currentIndex % count + count) % count; + } + else { + currentIndex >= count && (currentIndex = count - 1); + currentIndex < 0 && (currentIndex = 0); + } + + this.option.currentIndex = currentIndex; }, - colorAlpha: { - active: [0.3, 1], - inactive: [0, 0] + /** + * @return {number} currentIndex + */ + getCurrentIndex: function () { + return this.option.currentIndex; }, - opacity: { - active: [0.3, 1], - inactive: [0, 0] + /** + * @return {boolean} + */ + isIndexMax: function () { + return this.getCurrentIndex() >= this._data.count() - 1; }, - symbol: { - active: ['circle', 'roundRect', 'diamond'], - inactive: ['none'] + /** + * @param {boolean} state true: play, false: stop + */ + setPlayState: function (state) { + this.option.autoPlay = !!state; }, - symbolSize: { - active: [10, 50], - inactive: [0, 0] + /** + * @return {boolean} true: play, false: stop + */ + getPlayState: function () { + return !!this.option.autoPlay; + }, + + /** + * @private + */ + _initData: function () { + var thisOption = this.option; + var dataArr = thisOption.data || []; + var axisType = thisOption.axisType; + var names = this._names = []; + + if (axisType === 'category') { + var idxArr = []; + each$1(dataArr, function (item, index) { + var value = getDataItemValue(item); + var newItem; + + if (isObject$1(item)) { + newItem = clone(item); + newItem.value = index; + } + else { + newItem = index; + } + + idxArr.push(newItem); + + if (!isString(value) && (value == null || isNaN(value))) { + value = ''; + } + + names.push(value + ''); + }); + dataArr = idxArr; + } + + var dimType = ({category: 'ordinal', time: 'time'})[axisType] || 'number'; + + var data = this._data = new List([{name: 'value', type: dimType}], this); + + data.initData(dataArr, names); + }, + + getData: function () { + return this._data; + }, + + /** + * @public + * @return {Array.} categoreis + */ + getCategories: function () { + if (this.get('axisType') === 'category') { + return this._names.slice(); + } } -}; + +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -82279,786 +86102,897 @@ var defaultOption$3 = { * under the License. */ -var mapVisual$2 = VisualMapping.mapVisual; -var eachVisual = VisualMapping.eachVisual; -var isArray$3 = isArray; -var each$25 = each$1; -var asc$3 = asc; -var linearMap$2 = linearMap; -var noop$2 = noop; - -var VisualMapModel = extendComponentModel({ - - type: 'visualMap', +var SliderTimelineModel = TimelineModel.extend({ - dependencies: ['series'], + type: 'timeline.slider', /** - * @readOnly - * @type {Array.} + * @protected */ - stateList: ['inRange', 'outOfRange'], + defaultOption: { + + backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 + borderColor: '#ccc', // 时间轴边框颜色 + borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) + + orient: 'horizontal', // 'vertical' + inverse: false, + + tooltip: { // boolean or Object + trigger: 'item' // data item may also have tootip attr. + }, + + symbol: 'emptyCircle', + symbolSize: 10, + + lineStyle: { + show: true, + width: 2, + color: '#304654' + }, + label: { // 文本标签 + position: 'auto', // auto left right top bottom + // When using number, label position is not + // restricted by viewRect. + // positive: right/bottom, negative: left/top + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#304654' + }, + itemStyle: { + color: '#304654', + borderWidth: 1 + }, + + checkpointStyle: { + symbol: 'circle', + symbolSize: 13, + color: '#c23531', + borderWidth: 5, + borderColor: 'rgba(194,53,49, 0.5)', + animation: true, + animationDuration: 300, + animationEasing: 'quinticInOut' + }, + + controlStyle: { + show: true, + showPlayBtn: true, + showPrevBtn: true, + showNextBtn: true, + itemSize: 22, + itemGap: 12, + position: 'left', // 'left' 'right' 'top' 'bottom' + playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line + stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line + nextIcon: 'path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z', // jshint ignore:line + prevIcon: 'path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z', // jshint ignore:line + + color: '#304654', + borderColor: '#304654', + borderWidth: 1 + }, + + emphasis: { + label: { + show: true, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#c23531' + }, + + itemStyle: { + color: '#c23531' + }, + + controlStyle: { + color: '#c23531', + borderColor: '#c23531', + borderWidth: 2 + } + }, + data: [] + } + +}); + +mixin(SliderTimelineModel, dataFormatMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var TimelineView = Component$1.extend({ + type: 'timeline' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/** + * Extend axis 2d + * @constructor module:echarts/coord/cartesian/Axis2D + * @extends {module:echarts/coord/cartesian/Axis} + * @param {string} dim + * @param {*} scale + * @param {Array.} coordExtent + * @param {string} axisType + * @param {string} position + */ +var TimelineAxis = function (dim, scale, coordExtent, axisType) { + + Axis.call(this, dim, scale, coordExtent); /** - * @readOnly - * @type {Array.} + * Axis type + * - 'category' + * - 'value' + * - 'time' + * - 'log' + * @type {string} */ - replacableOptionKeys: [ - 'inRange', 'outOfRange', 'target', 'controller', 'color' - ], + this.type = axisType || 'value'; /** - * [lowerBound, upperBound] - * - * @readOnly - * @type {Array.} + * Axis model + * @param {module:echarts/component/TimelineModel} */ - dataBound: [-Infinity, Infinity], + this.model = null; +}; + +TimelineAxis.prototype = { + + constructor: TimelineAxis, /** - * @readOnly - * @type {string|Object} + * @override */ - layoutMode: {type: 'box', ignoreSize: true}, + getLabelModel: function () { + return this.model.getModel('label'); + }, /** - * @protected + * @override */ - defaultOption: { - show: true, + isHorizontal: function () { + return this.model.get('orient') === 'horizontal'; + } - zlevel: 0, - z: 4, +}; - seriesIndex: 'all', // 'all' or null/undefined: all series. - // A number or an array of number: the specified series. +inherits(TimelineAxis, Axis); - // set min: 0, max: 200, only for campatible with ec2. - // In fact min max should not have default value. - min: 0, // min value, must specified if pieces is not specified. - max: 200, // max value, must specified if pieces is not specified. +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - dimension: null, - inRange: null, // 'color', 'colorHue', 'colorSaturation', 'colorLightness', 'colorAlpha', - // 'symbol', 'symbolSize' - outOfRange: null, // 'color', 'colorHue', 'colorSaturation', - // 'colorLightness', 'colorAlpha', - // 'symbol', 'symbolSize' +var bind$4 = bind; +var each$24 = each$1; - left: 0, // 'center' ¦ 'left' ¦ 'right' ¦ {number} (px) - right: null, // The same as left. - top: null, // 'top' ¦ 'bottom' ¦ 'center' ¦ {number} (px) - bottom: 0, // The same as top. +var PI$5 = Math.PI; - itemWidth: null, - itemHeight: null, - inverse: false, - orient: 'vertical', // 'horizontal' ¦ 'vertical' +TimelineView.extend({ - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 值域边框颜色 - contentColor: '#5793f3', - inactiveColor: '#aaa', - borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) - padding: 5, // 值域内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - textGap: 10, // - precision: 0, // 小数精度,默认为0,无小数点 - color: null, //颜色(deprecated,兼容ec2,顺序同pieces,不同于inRange/outOfRange) + type: 'timeline.slider', - formatter: null, - text: null, // 文本,如['高', '低'],兼容ec2,text[0]对应高值,text[1]对应低值 - textStyle: { - color: '#333' // 值域文字颜色 - } - }, + init: function (ecModel, api) { - /** - * @protected - */ - init: function (option, parentModel, ecModel) { + this.api = api; /** * @private - * @type {Array.} + * @type {module:echarts/component/timeline/TimelineAxis} */ - this._dataExtent; + this._axis; /** - * @readOnly + * @private + * @type {module:zrender/core/BoundingRect} */ - this.targetVisuals = {}; + this._viewRect; /** - * @readOnly + * @type {number} */ - this.controllerVisuals = {}; + this._timer; /** - * @readOnly + * @type {module:zrender/Element} */ - this.textStyleModel; + this._currentPointer; /** - * [width, height] - * @readOnly - * @type {Array.} + * @type {module:zrender/container/Group} */ - this.itemSize; + this._mainGroup; - this.mergeDefaultAndTheme(option, ecModel); + /** + * @type {module:zrender/container/Group} + */ + this._labelGroup; }, /** - * @protected + * @override */ - optionUpdated: function (newOption, isInit) { - var thisOption = this.option; + render: function (timelineModel, ecModel, api, payload) { + this.model = timelineModel; + this.api = api; + this.ecModel = ecModel; - // FIXME - // necessary? - // Disable realtime view update if canvas is not supported. - if (!env$1.canvasSupported) { - thisOption.realtime = false; - } + this.group.removeAll(); - !isInit && replaceVisualOption( - thisOption, newOption, this.replacableOptionKeys - ); + if (timelineModel.get('show', true)) { - this.textStyleModel = this.getModel('textStyle'); + var layoutInfo = this._layout(timelineModel, api); + var mainGroup = this._createGroup('mainGroup'); + var labelGroup = this._createGroup('labelGroup'); - this.resetItemSize(); + /** + * @private + * @type {module:echarts/component/timeline/TimelineAxis} + */ + var axis = this._axis = this._createAxis(layoutInfo, timelineModel); - this.completeVisualOption(); - }, + timelineModel.formatTooltip = function (dataIndex) { + return encodeHTML(axis.scale.getLabel(dataIndex)); + }; - /** - * @protected - */ - resetVisual: function (supplementVisualOption) { - var stateList = this.stateList; - supplementVisualOption = bind(supplementVisualOption, this); - - this.controllerVisuals = createVisualMappings( - this.option.controller, stateList, supplementVisualOption - ); - this.targetVisuals = createVisualMappings( - this.option.target, stateList, supplementVisualOption - ); - }, - - /** - * @protected - * @return {Array.} An array of series indices. - */ - getTargetSeriesIndices: function () { - var optionSeriesIndex = this.option.seriesIndex; - var seriesIndices = []; + each$24( + ['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], + function (name) { + this['_render' + name](layoutInfo, mainGroup, axis, timelineModel); + }, + this + ); - if (optionSeriesIndex == null || optionSeriesIndex === 'all') { - this.ecModel.eachSeries(function (seriesModel, index) { - seriesIndices.push(index); - }); - } - else { - seriesIndices = normalizeToArray(optionSeriesIndex); + this._renderAxisLabel(layoutInfo, labelGroup, axis, timelineModel); + this._position(layoutInfo, timelineModel); } - return seriesIndices; + this._doPlayStop(); }, /** - * @public + * @override */ - eachTargetSeries: function (callback, context) { - each$1(this.getTargetSeriesIndices(), function (seriesIndex) { - callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex)); - }, this); + remove: function () { + this._clearTimer(); + this.group.removeAll(); }, /** - * @pubilc + * @override */ - isTargetSeries: function (seriesModel) { - var is = false; - this.eachTargetSeries(function (model) { - model === seriesModel && (is = true); - }); - return is; + dispose: function () { + this._clearTimer(); }, - /** - * @example - * this.formatValueText(someVal); // format single numeric value to text. - * this.formatValueText(someVal, true); // format single category value to text. - * this.formatValueText([min, max]); // format numeric min-max to text. - * this.formatValueText([this.dataBound[0], max]); // using data lower bound. - * this.formatValueText([min, this.dataBound[1]]); // using data upper bound. - * - * @param {number|Array.} value Real value, or this.dataBound[0 or 1]. - * @param {boolean} [isCategory=false] Only available when value is number. - * @param {Array.} edgeSymbols Open-close symbol when value is interval. - * @return {string} - * @protected - */ - formatValueText: function(value, isCategory, edgeSymbols) { - var option = this.option; - var precision = option.precision; - var dataBound = this.dataBound; - var formatter = option.formatter; - var isMinMax; - var textValue; - edgeSymbols = edgeSymbols || ['<', '>']; - - if (isArray(value)) { - value = value.slice(); - isMinMax = true; - } - - textValue = isCategory - ? value - : (isMinMax - ? [toFixed(value[0]), toFixed(value[1])] - : toFixed(value) - ); - - if (isString(formatter)) { - return formatter - .replace('{value}', isMinMax ? textValue[0] : textValue) - .replace('{value2}', isMinMax ? textValue[1] : textValue); + _layout: function (timelineModel, api) { + var labelPosOpt = timelineModel.get('label.position'); + var orient = timelineModel.get('orient'); + var viewRect = getViewRect$5(timelineModel, api); + // Auto label offset. + if (labelPosOpt == null || labelPosOpt === 'auto') { + labelPosOpt = orient === 'horizontal' + ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+') + : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-'); } - else if (isFunction$1(formatter)) { - return isMinMax - ? formatter(value[0], value[1]) - : formatter(value); + else if (isNaN(labelPosOpt)) { + labelPosOpt = ({ + horizontal: {top: '-', bottom: '+'}, + vertical: {left: '-', right: '+'} + })[orient][labelPosOpt]; } - if (isMinMax) { - if (value[0] === dataBound[0]) { - return edgeSymbols[0] + ' ' + textValue[1]; - } - else if (value[1] === dataBound[1]) { - return edgeSymbols[1] + ' ' + textValue[0]; - } - else { - return textValue[0] + ' - ' + textValue[1]; - } - } - else { // Format single value (includes category case). - return textValue; - } + var labelAlignMap = { + horizontal: 'center', + vertical: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'left' : 'right' + }; - function toFixed(val) { - return val === dataBound[0] - ? 'min' - : val === dataBound[1] - ? 'max' - : (+val).toFixed(Math.min(precision, 20)); - } - }, + var labelBaselineMap = { + horizontal: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'top' : 'bottom', + vertical: 'middle' + }; + var rotationMap = { + horizontal: 0, + vertical: PI$5 / 2 + }; - /** - * @protected - */ - resetExtent: function () { - var thisOption = this.option; + // Position + var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; - // Can not calculate data extent by data here. - // Because series and data may be modified in processing stage. - // So we do not support the feature "auto min/max". + var controlModel = timelineModel.getModel('controlStyle'); + var showControl = controlModel.get('show', true); + var controlSize = showControl ? controlModel.get('itemSize') : 0; + var controlGap = showControl ? controlModel.get('itemGap') : 0; + var sizePlusGap = controlSize + controlGap; - var extent = asc$3([thisOption.min, thisOption.max]); + // Special label rotate. + var labelRotation = timelineModel.get('label.rotate') || 0; + labelRotation = labelRotation * PI$5 / 180; // To radian. - this._dataExtent = extent; - }, + var playPosition; + var prevBtnPosition; + var nextBtnPosition; + var axisExtent; + var controlPosition = controlModel.get('position', true); + var showPlayBtn = showControl && controlModel.get('showPlayBtn', true); + var showPrevBtn = showControl && controlModel.get('showPrevBtn', true); + var showNextBtn = showControl && controlModel.get('showNextBtn', true); + var xLeft = 0; + var xRight = mainLength; - /** - * @public - * @param {module:echarts/data/List} list - * @return {string} Concrete dimention. If return null/undefined, - * no dimension used. - */ - getDataDimension: function (list) { - var optDim = this.option.dimension; - var listDimensions = list.dimensions; - if (optDim == null && !listDimensions.length) { - return; + // position[0] means left, position[1] means middle. + if (controlPosition === 'left' || controlPosition === 'bottom') { + showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap); + showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap); + showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); } - - if (optDim != null) { - return list.getDimension(optDim); + else { // 'top' 'right' + showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); + showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); + showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); } + axisExtent = [xLeft, xRight]; - var dimNames = list.dimensions; - for (var i = dimNames.length - 1; i >= 0; i--) { - var dimName = dimNames[i]; - var dimInfo = list.getDimensionInfo(dimName); - if (!dimInfo.isCalculationCoord) { - return dimName; - } + if (timelineModel.get('inverse')) { + axisExtent.reverse(); } - }, - /** - * @public - * @override - */ - getExtent: function () { - return this._dataExtent.slice(); + return { + viewRect: viewRect, + mainLength: mainLength, + orient: orient, + + rotation: rotationMap[orient], + labelRotation: labelRotation, + labelPosOpt: labelPosOpt, + labelAlign: timelineModel.get('label.align') || labelAlignMap[orient], + labelBaseline: timelineModel.get('label.verticalAlign') + || timelineModel.get('label.baseline') + || labelBaselineMap[orient], + + // Based on mainGroup. + playPosition: playPosition, + prevBtnPosition: prevBtnPosition, + nextBtnPosition: nextBtnPosition, + axisExtent: axisExtent, + + controlSize: controlSize, + controlGap: controlGap + }; }, - /** - * @protected - */ - completeVisualOption: function () { - var ecModel = this.ecModel; - var thisOption = this.option; - var base = {inRange: thisOption.inRange, outOfRange: thisOption.outOfRange}; + _position: function (layoutInfo, timelineModel) { + // Position is be called finally, because bounding rect is needed for + // adapt content to fill viewRect (auto adapt offset). - var target = thisOption.target || (thisOption.target = {}); - var controller = thisOption.controller || (thisOption.controller = {}); + // Timeline may be not all in the viewRect when 'offset' is specified + // as a number, because it is more appropriate that label aligns at + // 'offset' but not the other edge defined by viewRect. - merge(target, base); // Do not override - merge(controller, base); // Do not override + var mainGroup = this._mainGroup; + var labelGroup = this._labelGroup; - var isCategory = this.isCategory(); + var viewRect = layoutInfo.viewRect; + if (layoutInfo.orient === 'vertical') { + // transform to horizontal, inverse rotate by left-top point. + var m = create$1(); + var rotateOriginX = viewRect.x; + var rotateOriginY = viewRect.y + viewRect.height; + translate(m, m, [-rotateOriginX, -rotateOriginY]); + rotate(m, m, -PI$5 / 2); + translate(m, m, [rotateOriginX, rotateOriginY]); + viewRect = viewRect.clone(); + viewRect.applyTransform(m); + } - completeSingle.call(this, target); - completeSingle.call(this, controller); - completeInactive.call(this, target, 'inRange', 'outOfRange'); - // completeInactive.call(this, target, 'outOfRange', 'inRange'); - completeController.call(this, controller); + var viewBound = getBound(viewRect); + var mainBound = getBound(mainGroup.getBoundingRect()); + var labelBound = getBound(labelGroup.getBoundingRect()); - function completeSingle(base) { - // Compatible with ec2 dataRange.color. - // The mapping order of dataRange.color is: [high value, ..., low value] - // whereas inRange.color and outOfRange.color is [low value, ..., high value] - // Notice: ec2 has no inverse. - if (isArray$3(thisOption.color) - // If there has been inRange: {symbol: ...}, adding color is a mistake. - // So adding color only when no inRange defined. - && !base.inRange - ) { - base.inRange = {color: thisOption.color.slice().reverse()}; - } + var mainPosition = mainGroup.position; + var labelsPosition = labelGroup.position; - // Compatible with previous logic, always give a defautl color, otherwise - // simple config with no inRange and outOfRange will not work. - // Originally we use visualMap.color as the default color, but setOption at - // the second time the default color will be erased. So we change to use - // constant DEFAULT_COLOR. - // If user do not want the defualt color, set inRange: {color: null}. - base.inRange = base.inRange || {color: ecModel.get('gradientColor')}; + labelsPosition[0] = mainPosition[0] = viewBound[0][0]; - // If using shortcut like: {inRange: 'symbol'}, complete default value. - each$25(this.stateList, function (state) { - var visualType = base[state]; + var labelPosOpt = layoutInfo.labelPosOpt; - if (isString(visualType)) { - var defa = visualDefault.get(visualType, 'active', isCategory); - if (defa) { - base[state] = {}; - base[state][visualType] = defa; - } - else { - // Mark as not specified. - delete base[state]; - } - } - }, this); + if (isNaN(labelPosOpt)) { // '+' or '-' + var mainBoundIdx = labelPosOpt === '+' ? 0 : 1; + toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); + toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); + } + else { + var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; + toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); + labelsPosition[1] = mainPosition[1] + labelPosOpt; } - function completeInactive(base, stateExist, stateAbsent) { - var optExist = base[stateExist]; - var optAbsent = base[stateAbsent]; + mainGroup.attr('position', mainPosition); + labelGroup.attr('position', labelsPosition); + mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; - if (optExist && !optAbsent) { - optAbsent = base[stateAbsent] = {}; - each$25(optExist, function (visualData, visualType) { - if (!VisualMapping.isValidType(visualType)) { - return; - } + setOrigin(mainGroup); + setOrigin(labelGroup); - var defa = visualDefault.get(visualType, 'inactive', isCategory); + function setOrigin(targetGroup) { + var pos = targetGroup.position; + targetGroup.origin = [ + viewBound[0][0] - pos[0], + viewBound[1][0] - pos[1] + ]; + } - if (defa != null) { - optAbsent[visualType] = defa; + function getBound(rect) { + // [[xmin, xmax], [ymin, ymax]] + return [ + [rect.x, rect.x + rect.width], + [rect.y, rect.y + rect.height] + ]; + } - // Compatibable with ec2: - // Only inactive color to rgba(0,0,0,0) can not - // make label transparent, so use opacity also. - if (visualType === 'color' - && !optAbsent.hasOwnProperty('opacity') - && !optAbsent.hasOwnProperty('colorAlpha') - ) { - optAbsent.opacity = [0, 0]; - } - } - }); - } + function toBound(fromPos, from, to, dimIdx, boundIdx) { + fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; } + }, - function completeController(controller) { - var symbolExists = (controller.inRange || {}).symbol - || (controller.outOfRange || {}).symbol; - var symbolSizeExists = (controller.inRange || {}).symbolSize - || (controller.outOfRange || {}).symbolSize; - var inactiveColor = this.get('inactiveColor'); + _createAxis: function (layoutInfo, timelineModel) { + var data = timelineModel.getData(); + var axisType = timelineModel.get('axisType'); - each$25(this.stateList, function (state) { + var scale = createScaleByModel(timelineModel, axisType); - var itemSize = this.itemSize; - var visuals = controller[state]; + // Customize scale. The `tickValue` is `dataIndex`. + scale.getTicks = function () { + return data.mapArray(['value'], function (value) { + return value; + }); + }; - // Set inactive color for controller if no other color - // attr (like colorAlpha) specified. - if (!visuals) { - visuals = controller[state] = { - color: isCategory ? inactiveColor : [inactiveColor] - }; - } + var dataExtent = data.getDataExtent('value'); + scale.setExtent(dataExtent[0], dataExtent[1]); + scale.niceTicks(); - // Consistent symbol and symbolSize if not specified. - if (visuals.symbol == null) { - visuals.symbol = symbolExists - && clone(symbolExists) - || (isCategory ? 'roundRect' : ['roundRect']); - } - if (visuals.symbolSize == null) { - visuals.symbolSize = symbolSizeExists - && clone(symbolSizeExists) - || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); - } + var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); + axis.model = timelineModel; - // Filter square and none. - visuals.symbol = mapVisual$2(visuals.symbol, function (symbol) { - return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol; - }); + return axis; + }, - // Normalize symbolSize - var symbolSize = visuals.symbolSize; + _createGroup: function (name) { + var newGroup = this['_' + name] = new Group(); + this.group.add(newGroup); + return newGroup; + }, - if (symbolSize != null) { - var max = -Infinity; - // symbolSize can be object when categories defined. - eachVisual(symbolSize, function (value) { - value > max && (max = value); - }); - visuals.symbolSize = mapVisual$2(symbolSize, function (value) { - return linearMap$2(value, [0, max], [0, itemSize[0]], true); - }); - } + _renderAxisLine: function (layoutInfo, group, axis, timelineModel) { + var axisExtent = axis.getExtent(); - }, this); + if (!timelineModel.get('lineStyle.show')) { + return; } - }, - /** - * @protected - */ - resetItemSize: function () { - this.itemSize = [ - parseFloat(this.get('itemWidth')), - parseFloat(this.get('itemHeight')) - ]; + group.add(new Line({ + shape: { + x1: axisExtent[0], y1: 0, + x2: axisExtent[1], y2: 0 + }, + style: extend( + {lineCap: 'round'}, + timelineModel.getModel('lineStyle').getLineStyle() + ), + silent: true, + z2: 1 + })); }, /** - * @public + * @private */ - isCategory: function () { - return !!this.option.categories; - }, + _renderAxisTick: function (layoutInfo, group, axis, timelineModel) { + var data = timelineModel.getData(); + // Show all ticks, despite ignoring strategy. + var ticks = axis.scale.getTicks(); - /** - * @public - * @abstract - */ - setSelected: noop$2, + // The value is dataIndex, see the costomized scale. + each$24(ticks, function (value) { + var tickCoord = axis.dataToCoord(value); + var itemModel = data.getItemModel(value); + var itemStyleModel = itemModel.getModel('itemStyle'); + var hoverStyleModel = itemModel.getModel('emphasis.itemStyle'); + var symbolOpt = { + position: [tickCoord, 0], + onclick: bind$4(this._changeTimeline, this, value) + }; + var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); + setHoverStyle(el, hoverStyleModel.getItemStyle()); - /** - * @public - * @abstract - * @param {*|module:echarts/data/List} valueOrData - * @param {number} dataIndex - * @return {string} state See this.stateList - */ - getValueState: noop$2, + if (itemModel.get('tooltip')) { + el.dataIndex = value; + el.dataModel = timelineModel; + } + else { + el.dataIndex = el.dataModel = null; + } + + }, this); + }, /** - * FIXME - * Do not publish to thirt-part-dev temporarily - * util the interface is stable. (Should it return - * a function but not visual meta?) - * - * @pubilc - * @abstract - * @param {Function} getColorVisual - * params: value, valueState - * return: color - * @return {Object} visualMeta - * should includes {stops, outerColors} - * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] + * @private */ - getVisualMeta: noop$2 + _renderAxisLabel: function (layoutInfo, group, axis, timelineModel) { + var labelModel = axis.getLabelModel(); -}); + if (!labelModel.get('show')) { + return; + } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + var data = timelineModel.getData(); + var labels = axis.getViewLabels(); -// Constant -var DEFAULT_BAR_BOUND = [20, 140]; + each$24(labels, function (labelItem) { + // The tickValue is dataIndex, see the costomized scale. + var dataIndex = labelItem.tickValue; -var ContinuousModel = VisualMapModel.extend({ + var itemModel = data.getItemModel(dataIndex); + var normalLabelModel = itemModel.getModel('label'); + var hoverLabelModel = itemModel.getModel('emphasis.label'); + var tickCoord = axis.dataToCoord(labelItem.tickValue); + var textEl = new Text({ + position: [tickCoord, 0], + rotation: layoutInfo.labelRotation - layoutInfo.rotation, + onclick: bind$4(this._changeTimeline, this, dataIndex), + silent: false + }); + setTextStyle(textEl.style, normalLabelModel, { + text: labelItem.formattedLabel, + textAlign: layoutInfo.labelAlign, + textVerticalAlign: layoutInfo.labelBaseline + }); - type: 'visualMap.continuous', + group.add(textEl); + setHoverStyle( + textEl, setTextStyle({}, hoverLabelModel) + ); - /** - * @protected - */ - defaultOption: { - align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom' - calculable: false, // This prop effect default component type determine, - // See echarts/component/visualMap/typeDefaulter. - range: null, // selected range. In default case `range` is [min, max] - // and can auto change along with modification of min max, - // util use specifid a range. - realtime: true, // Whether realtime update. - itemHeight: null, // The length of the range control edge. - itemWidth: null, // The length of the other side. - hoverLink: true, // Enable hover highlight. - hoverLinkDataSize: null,// The size of hovered data. - hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle. - // If not specified, follow the value of `realtime`. + }, this); }, /** - * @override + * @private */ - optionUpdated: function (newOption, isInit) { - ContinuousModel.superApply(this, 'optionUpdated', arguments); + _renderControl: function (layoutInfo, group, axis, timelineModel) { + var controlSize = layoutInfo.controlSize; + var rotation = layoutInfo.rotation; - this.resetExtent(); + var itemStyle = timelineModel.getModel('controlStyle').getItemStyle(); + var hoverStyle = timelineModel.getModel('emphasis.controlStyle').getItemStyle(); + var rect = [0, -controlSize / 2, controlSize, controlSize]; + var playState = timelineModel.getPlayState(); + var inverse = timelineModel.get('inverse', true); - this.resetVisual(function (mappingOption) { - mappingOption.mappingMethod = 'linear'; - mappingOption.dataExtent = this.getExtent(); - }); + makeBtn( + layoutInfo.nextBtnPosition, + 'controlStyle.nextIcon', + bind$4(this._changeTimeline, this, inverse ? '-' : '+') + ); + makeBtn( + layoutInfo.prevBtnPosition, + 'controlStyle.prevIcon', + bind$4(this._changeTimeline, this, inverse ? '+' : '-') + ); + makeBtn( + layoutInfo.playPosition, + 'controlStyle.' + (playState ? 'stopIcon' : 'playIcon'), + bind$4(this._handlePlayClick, this, !playState), + true + ); - this._resetRange(); + function makeBtn(position, iconPath, onclick, willRotate) { + if (!position) { + return; + } + var opt = { + position: position, + origin: [controlSize / 2, 0], + rotation: willRotate ? -rotation : 0, + rectHover: true, + style: itemStyle, + onclick: onclick + }; + var btn = makeIcon(timelineModel, iconPath, rect, opt); + group.add(btn); + setHoverStyle(btn, hoverStyle); + } }, - /** - * @protected - * @override - */ - resetItemSize: function () { - ContinuousModel.superApply(this, 'resetItemSize', arguments); - - var itemSize = this.itemSize; + _renderCurrentPointer: function (layoutInfo, group, axis, timelineModel) { + var data = timelineModel.getData(); + var currentIndex = timelineModel.getCurrentIndex(); + var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle'); + var me = this; - this._orient === 'horizontal' && itemSize.reverse(); + var callback = { + onCreate: function (pointer) { + pointer.draggable = true; + pointer.drift = bind$4(me._handlePointerDrag, me); + pointer.ondragend = bind$4(me._handlePointerDragend, me); + pointerMoveTo(pointer, currentIndex, axis, timelineModel, true); + }, + onUpdate: function (pointer) { + pointerMoveTo(pointer, currentIndex, axis, timelineModel); + } + }; - (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); - (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); + // Reuse when exists, for animation and drag. + this._currentPointer = giveSymbol( + pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback + ); }, - /** - * @private - */ - _resetRange: function () { - var dataExtent = this.getExtent(); - var range = this.option.range; - - if (!range || range.auto) { - // `range` should always be array (so we dont use other - // value like 'auto') for user-friend. (consider getOption). - dataExtent.auto = 1; - this.option.range = dataExtent; - } - else if (isArray(range)) { - if (range[0] > range[1]) { - range.reverse(); - } - range[0] = Math.max(range[0], dataExtent[0]); - range[1] = Math.min(range[1], dataExtent[1]); - } + _handlePlayClick: function (nextState) { + this._clearTimer(); + this.api.dispatchAction({ + type: 'timelinePlayChange', + playState: nextState, + from: this.uid + }); }, - /** - * @protected - * @override - */ - completeVisualOption: function () { - VisualMapModel.prototype.completeVisualOption.apply(this, arguments); - - each$1(this.stateList, function (state) { - var symbolSize = this.option.controller[state].symbolSize; - if (symbolSize && symbolSize[0] !== symbolSize[1]) { - symbolSize[0] = 0; // For good looking. - } - }, this); + _handlePointerDrag: function (dx, dy, e) { + this._clearTimer(); + this._pointerChangeTimeline([e.offsetX, e.offsetY]); }, - /** - * @override - */ - setSelected: function (selected) { - this.option.range = selected.slice(); - this._resetRange(); + _handlePointerDragend: function (e) { + this._pointerChangeTimeline([e.offsetX, e.offsetY], true); }, - /** - * @public - */ - getSelected: function () { - var dataExtent = this.getExtent(); + _pointerChangeTimeline: function (mousePos, trigger) { + var toCoord = this._toAxisCoord(mousePos)[0]; - var dataInterval = asc( - (this.get('range') || []).slice() - ); + var axis = this._axis; + var axisExtent = asc(axis.getExtent().slice()); - // Clamp - dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); - dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); - dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); - dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); + toCoord > axisExtent[1] && (toCoord = axisExtent[1]); + toCoord < axisExtent[0] && (toCoord = axisExtent[0]); - return dataInterval; - }, + this._currentPointer.position[0] = toCoord; + this._currentPointer.dirty(); - /** - * @override - */ - getValueState: function (value) { - var range = this.option.range; - var dataExtent = this.getExtent(); + var targetDataIndex = this._findNearestTick(toCoord); + var timelineModel = this.model; - // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'. - // range[1] is processed likewise. - return ( - (range[0] <= dataExtent[0] || range[0] <= value) - && (range[1] >= dataExtent[1] || value <= range[1]) - ) ? 'inRange' : 'outOfRange'; + if (trigger || ( + targetDataIndex !== timelineModel.getCurrentIndex() + && timelineModel.get('realtime') + )) { + this._changeTimeline(targetDataIndex); + } }, - /** - * @params {Array.} range target value: range[0] <= value && value <= range[1] - * @return {Array.} [{seriesId, dataIndices: >}, ...] - */ - findTargetDataIndices: function (range) { - var result = []; - - this.eachTargetSeries(function (seriesModel) { - var dataIndices = []; - var data = seriesModel.getData(); + _doPlayStop: function () { + this._clearTimer(); - data.each(this.getDataDimension(data), function (value, dataIndex) { - range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); - }, this); + if (this.model.getPlayState()) { + this._timer = setTimeout( + bind$4(handleFrame, this), + this.model.get('playInterval') + ); + } - result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); - }, this); + function handleFrame() { + // Do not cache + var timelineModel = this.model; + this._changeTimeline( + timelineModel.getCurrentIndex() + + (timelineModel.get('rewind', true) ? -1 : 1) + ); + } + }, - return result; + _toAxisCoord: function (vertex) { + var trans = this._mainGroup.getLocalTransform(); + return applyTransform$1(vertex, trans, true); }, - /** - * @implement - */ - getVisualMeta: function (getColorVisual) { - var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); - var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); - var stops = []; + _findNearestTick: function (axisCoord) { + var data = this.model.getData(); + var dist = Infinity; + var targetDataIndex; + var axis = this._axis; - function setStop(value, valueState) { - stops.push({ - value: value, - color: getColorVisual(value, valueState) - }); - } + data.each(['value'], function (value, dataIndex) { + var coord = axis.dataToCoord(value); + var d = Math.abs(coord - axisCoord); + if (d < dist) { + dist = d; + targetDataIndex = dataIndex; + } + }); - // Format to: outOfRange -- inRange -- outOfRange. - var iIdx = 0; - var oIdx = 0; - var iLen = iVals.length; - var oLen = oVals.length; + return targetDataIndex; + }, - for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { - // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. - if (oVals[oIdx] < iVals[iIdx]) { - setStop(oVals[oIdx], 'outOfRange'); - } + _clearTimer: function () { + if (this._timer) { + clearTimeout(this._timer); + this._timer = null; } - for (var first = 1; iIdx < iLen; iIdx++, first = 0) { - // If range is full, value beyond min, max will be clamped. - // make a singularity - first && stops.length && setStop(iVals[iIdx], 'outOfRange'); - setStop(iVals[iIdx], 'inRange'); + }, + + _changeTimeline: function (nextIndex) { + var currentIndex = this.model.getCurrentIndex(); + + if (nextIndex === '+') { + nextIndex = currentIndex + 1; } - for (var first = 1; oIdx < oLen; oIdx++) { - if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { - // make a singularity - if (first) { - stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); - first = 0; - } - setStop(oVals[oIdx], 'outOfRange'); - } + else if (nextIndex === '-') { + nextIndex = currentIndex - 1; } - var stopsLen = stops.length; - - return { - stops: stops, - outerColors: [ - stopsLen ? stops[0].color : 'transparent', - stopsLen ? stops[stopsLen - 1].color : 'transparent' - ] - }; + this.api.dispatchAction({ + type: 'timelineChange', + currentIndex: nextIndex, + from: this.uid + }); } }); -function getColorStopValues(visualMapModel, valueState, dataExtent) { - if (dataExtent[0] === dataExtent[1]) { - return dataExtent.slice(); +function getViewRect$5(model, api) { + return getLayoutRect( + model.getBoxLayoutParams(), + { + width: api.getWidth(), + height: api.getHeight() + }, + model.get('padding') + ); +} + +function makeIcon(timelineModel, objPath, rect, opts) { + var icon = makePath( + timelineModel.get(objPath).replace(/^path:\/\//, ''), + clone(opts || {}), + new BoundingRect(rect[0], rect[1], rect[2], rect[3]), + 'center' + ); + + return icon; +} + +/** + * Create symbol or update symbol + * opt: basic position and event handlers + */ +function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { + var color = itemStyleModel.get('color'); + + if (!symbol) { + var symbolType = hostModel.get('symbol'); + symbol = createSymbol(symbolType, -1, -1, 2, 2, color); + symbol.setStyle('strokeNoScale', true); + group.add(symbol); + callback && callback.onCreate(symbol); + } + else { + symbol.setColor(color); + group.add(symbol); // Group may be new, also need to add. + callback && callback.onUpdate(symbol); } - // When using colorHue mapping, it is not linear color any more. - // Moreover, canvas gradient seems not to be accurate linear. + // Style + var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']); + symbol.setStyle(itemStyle); + + // Transform and events. + opt = merge({ + rectHover: true, + z2: 100 + }, opt, true); + + var symbolSize = hostModel.get('symbolSize'); + symbolSize = symbolSize instanceof Array + ? symbolSize.slice() + : [+symbolSize, +symbolSize]; + symbolSize[0] /= 2; + symbolSize[1] /= 2; + opt.scale = symbolSize; + + var symbolOffset = hostModel.get('symbolOffset'); + if (symbolOffset) { + var pos = opt.position = opt.position || [0, 0]; + pos[0] += parsePercent$1(symbolOffset[0], symbolSize[0]); + pos[1] += parsePercent$1(symbolOffset[1], symbolSize[1]); + } + + var symbolRotate = hostModel.get('symbolRotate'); + opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + + symbol.attr(opt); + // FIXME - // Should be arbitrary value 100? or based on pixel size? - var count = 200; - var step = (dataExtent[1] - dataExtent[0]) / count; + // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, + // getBoundingRect will return wrong result. + // (This is supposed to be resolved in zrender, but it is a little difficult to + // leverage performance and auto updateTransform) + // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. + symbol.updateTransform(); - var value = dataExtent[0]; - var stopValues = []; - for (var i = 0; i <= count && value < dataExtent[1]; i++) { - stopValues.push(value); - value += step; + return symbol; +} + +function pointerMoveTo(pointer, dataIndex, axis, timelineModel, noAnimation) { + if (pointer.dragging) { + return; } - stopValues.push(dataExtent[1]); - return stopValues; + var pointerModel = timelineModel.getModel('checkpointStyle'); + var toCoord = axis.dataToCoord(timelineModel.getData().get(['value'], dataIndex)); + + if (noAnimation || !pointerModel.get('animation', true)) { + pointer.attr({position: [toCoord, 0]}); + } + else { + pointer.stopAnimation(true); + pointer.animateTo( + {position: [toCoord, 0]}, + pointerModel.get('animationDuration', true), + pointerModel.get('animationEasing', true) + ); + } } /* @@ -83080,151 +87014,160 @@ function getColorStopValues(visualMapModel, valueState, dataExtent) { * under the License. */ -var VisualMapView = extendComponentView({ +/** + * DataZoom component entry + */ - type: 'visualMap', +registerPreprocessor(preprocessor$2); - /** - * @readOnly - * @type {Object} - */ - autoPositionValues: {left: 1, right: 1, top: 1, bottom: 1}, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - init: function (ecModel, api) { - /** - * @readOnly - * @type {module:echarts/model/Global} - */ - this.ecModel = ecModel; +var addCommas$1 = addCommas; +var encodeHTML$1 = encodeHTML; - /** - * @readOnly - * @type {module:echarts/ExtensionAPI} - */ - this.api = api; +function fillLabel(opt) { + defaultEmphasis(opt, 'label', ['show']); +} +var MarkerModel = extendComponentModel({ - /** - * @readOnly - * @type {module:echarts/component/visualMap/visualMapModel} - */ - this.visualMapModel; - }, + type: 'marker', + + dependencies: ['series', 'grid', 'polar', 'geo'], /** - * @protected + * @overrite */ - render: function (visualMapModel, ecModel, api, payload) { - this.visualMapModel = visualMapModel; - - if (visualMapModel.get('show') === false) { - this.group.removeAll(); - return; - } + init: function (option, parentModel, ecModel) { - this.doRender.apply(this, arguments); + if (__DEV__) { + if (this.type === 'marker') { + throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); + } + } + this.mergeDefaultAndTheme(option, ecModel); + this._mergeOption(option, ecModel, false, true); }, /** - * @protected + * @return {boolean} */ - renderBackground: function (group) { - var visualMapModel = this.visualMapModel; - var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0); - var rect = group.getBoundingRect(); + isAnimationEnabled: function () { + if (env$1.node) { + return false; + } - group.add(new Rect({ - z2: -1, // Lay background rect on the lowest layer. - silent: true, - shape: { - x: rect.x - padding[3], - y: rect.y - padding[0], - width: rect.width + padding[3] + padding[1], - height: rect.height + padding[0] + padding[2] - }, - style: { - fill: visualMapModel.get('backgroundColor'), - stroke: visualMapModel.get('borderColor'), - lineWidth: visualMapModel.get('borderWidth') - } - })); + var hostSeries = this.__hostSeries; + return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); }, /** - * @protected - * @param {number} targetValue can be Infinity or -Infinity - * @param {string=} visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' - * @param {Object} [opts] - * @param {string=} [opts.forceState] Specify state, instead of using getValueState method. - * @param {string=} [opts.convertOpacityToAlpha=false] For color gradient in controller widget. - * @return {*} Visual value. + * @overrite */ - getControllerVisual: function (targetValue, visualCluster, opts) { - opts = opts || {}; - - var forceState = opts.forceState; - var visualMapModel = this.visualMapModel; - var visualObj = {}; + mergeOption: function (newOpt, ecModel) { + this._mergeOption(newOpt, ecModel, false, false); + }, - // Default values. - if (visualCluster === 'symbol') { - visualObj.symbol = visualMapModel.get('itemSymbol'); - } - if (visualCluster === 'color') { - var defaultColor = visualMapModel.get('contentColor'); - visualObj.color = defaultColor; - } + _mergeOption: function (newOpt, ecModel, createdBySelf, isInit) { + var MarkerModel = this.constructor; + var modelPropName = this.mainType + 'Model'; + if (!createdBySelf) { + ecModel.eachSeries(function (seriesModel) { - function getter(key) { - return visualObj[key]; - } + var markerOpt = seriesModel.get(this.mainType, true); - function setter(key, value) { - visualObj[key] = value; - } + var markerModel = seriesModel[modelPropName]; + if (!markerOpt || !markerOpt.data) { + seriesModel[modelPropName] = null; + return; + } + if (!markerModel) { + if (isInit) { + // Default label emphasis `position` and `show` + fillLabel(markerOpt); + } + each$1(markerOpt.data, function (item) { + // FIXME Overwrite fillLabel method ? + if (item instanceof Array) { + fillLabel(item[0]); + fillLabel(item[1]); + } + else { + fillLabel(item); + } + }); - var mappings = visualMapModel.controllerVisuals[ - forceState || visualMapModel.getValueState(targetValue) - ]; - var visualTypes = VisualMapping.prepareVisualTypes(mappings); + markerModel = new MarkerModel( + markerOpt, this, ecModel + ); - each$1(visualTypes, function (type) { - var visualMapping = mappings[type]; - if (opts.convertOpacityToAlpha && type === 'opacity') { - type = 'colorAlpha'; - visualMapping = mappings.__alphaForOpacity; - } - if (VisualMapping.dependsOn(type, visualCluster)) { - visualMapping && visualMapping.applyVisual( - targetValue, getter, setter - ); - } - }); + extend(markerModel, { + mainType: this.mainType, + // Use the same series index and name + seriesIndex: seriesModel.seriesIndex, + name: seriesModel.name, + createdBySelf: true + }); - return visualObj[visualCluster]; + markerModel.__hostSeries = seriesModel; + } + else { + markerModel._mergeOption(markerOpt, ecModel, true); + } + seriesModel[modelPropName] = markerModel; + }, this); + } }, - /** - * @protected - */ - positionGroup: function (group) { - var model = this.visualMapModel; - var api = this.api; - - positionElement( - group, - model.getBoxLayoutParams(), - {width: api.getWidth(), height: api.getHeight()} - ); + formatTooltip: function (dataIndex) { + var data = this.getData(); + var value = this.getRawValue(dataIndex); + var formattedValue = isArray(value) + ? map(value, addCommas$1).join(', ') : addCommas$1(value); + var name = data.getName(dataIndex); + var html = encodeHTML$1(this.name); + if (value != null || name) { + html += '
'; + } + if (name) { + html += encodeHTML$1(name); + if (value != null) { + html += ' : '; + } + } + if (value != null) { + html += encodeHTML$1(formattedValue); + } + return html; }, - /** - * @protected - * @abstract - */ - doRender: noop + getData: function () { + return this._data; + }, + setData: function (data) { + this._data = data; + } }); +mixin(MarkerModel, dataFormatMixin); + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -83244,59 +87187,34 @@ var VisualMapView = extendComponentView({ * under the License. */ -/** - * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\ - * @param {module:echarts/ExtensionAPI} api - * @param {Array.} itemSize always [short, long] - * @return {string} 'left' or 'right' or 'top' or 'bottom' - */ -function getItemAlign(visualMapModel, api, itemSize) { - var modelOption = visualMapModel.option; - var itemAlign = modelOption.align; - - if (itemAlign != null && itemAlign !== 'auto') { - return itemAlign; - } - - // Auto decision align. - var ecSize = {width: api.getWidth(), height: api.getHeight()}; - var realIndex = modelOption.orient === 'horizontal' ? 1 : 0; - - var paramsSet = [ - ['left', 'right', 'width'], - ['top', 'bottom', 'height'] - ]; - var reals = paramsSet[realIndex]; - var fakeValue = [0, null, 10]; - - var layoutInput = {}; - for (var i = 0; i < 3; i++) { - layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; - layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; - } - - var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex]; - var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); +MarkerModel.extend({ - return reals[ - (rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 - < ecSize[rParam[1]] * 0.5 ? 0 : 1 - ]; -} + type: 'markPoint', -/** - * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and - * dataIndexInside means filtered index. - */ -function convertDataIndex(batch) { - each$1(batch || [], function (batchItem) { - if (batch.dataIndex != null) { - batch.dataIndexInside = batch.dataIndex; - batch.dataIndex = null; + defaultOption: { + zlevel: 0, + z: 5, + symbol: 'pin', + symbolSize: 50, + //symbolRotate: 0, + //symbolOffset: [0, 0] + tooltip: { + trigger: 'item' + }, + label: { + show: true, + position: 'inside' + }, + itemStyle: { + borderWidth: 2 + }, + emphasis: { + label: { + show: true + } } - }); - return batch; -} + } +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -83317,838 +87235,462 @@ function convertDataIndex(batch) { * under the License. */ -var linearMap$3 = linearMap; -var each$26 = each$1; -var mathMin$7 = Math.min; -var mathMax$7 = Math.max; - -// Arbitrary value -var HOVER_LINK_SIZE = 12; -var HOVER_LINK_OUT = 6; - -// Notice: -// Any "interval" should be by the order of [low, high]. -// "handle0" (handleIndex === 0) maps to -// low data value: this._dataInterval[0] and has low coord. -// "handle1" (handleIndex === 1) maps to -// high data value: this._dataInterval[1] and has high coord. -// The logic of transform is implemented in this._createBarGroup. - -var ContinuousView = VisualMapView.extend({ - - type: 'visualMap.continuous', - - /** - * @override - */ - init: function () { +var indexOf$2 = indexOf; - ContinuousView.superApply(this, 'init', arguments); +function hasXOrY(item) { + return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); +} - /** - * @private - */ - this._shapes = {}; +function hasXAndY(item) { + return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); +} - /** - * @private - */ - this._dataInterval = []; +// Make it simple, do not visit all stacked value to count precision. +// function getPrecision(data, valueAxisDim, dataIndex) { +// var precision = -1; +// var stackedDim = data.mapDimension(valueAxisDim); +// do { +// precision = Math.max( +// numberUtil.getPrecision(data.get(stackedDim, dataIndex)), +// precision +// ); +// var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); +// if (stackedOnSeries) { +// var byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex); +// data = stackedOnSeries.getData(); +// dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue); +// stackedDim = data.getCalculationInfo('stackedDimension'); +// } +// else { +// data = null; +// } +// } while (data); - /** - * @private - */ - this._handleEnds = []; +// return precision; +// } - /** - * @private - */ - this._orient; +function markerTypeCalculatorWithExtent( + mlType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex +) { + var coordArr = []; - /** - * @private - */ - this._useHandle; + var stacked = isDimensionStacked(data, targetDataDim /*, otherDataDim*/); + var calcDataDim = stacked + ? data.getCalculationInfo('stackResultDimension') + : targetDataDim; - /** - * @private - */ - this._hoverLinkDataIndices = []; + var value = numCalculate(data, calcDataDim, mlType); - /** - * @private - */ - this._dragging; + var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; + coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); + coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex); + var coordArrValue = data.get(targetDataDim, dataIndex); + // Make it simple, do not visit all stacked value to count precision. + var precision = getPrecision(data.get(targetDataDim, dataIndex)); + precision = Math.min(precision, 20); + if (precision >= 0) { + coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); + } - /** - * @private - */ - this._hovering; - }, + return [coordArr, coordArrValue]; +} +var curry$5 = curry; +// TODO Specified percent +var markerTypeCalculator = { /** - * @protected - * @override + * @method + * @param {module:echarts/data/List} data + * @param {string} baseAxisDim + * @param {string} valueAxisDim */ - doRender: function (visualMapModel, ecModel, api, payload) { - if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { - this._buildView(); - } - }, + min: curry$5(markerTypeCalculatorWithExtent, 'min'), + /** + * @method + * @param {module:echarts/data/List} data + * @param {string} baseAxisDim + * @param {string} valueAxisDim + */ + max: curry$5(markerTypeCalculatorWithExtent, 'max'), /** - * @private + * @method + * @param {module:echarts/data/List} data + * @param {string} baseAxisDim + * @param {string} valueAxisDim */ - _buildView: function () { - this.group.removeAll(); + average: curry$5(markerTypeCalculatorWithExtent, 'average') +}; - var visualMapModel = this.visualMapModel; - var thisGroup = this.group; +/** + * Transform markPoint data item to format used in List by do the following + * 1. Calculate statistic like `max`, `min`, `average` + * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/coord/*} [coordSys] + * @param {Object} item + * @return {Object} + */ +function dataTransform(seriesModel, item) { + var data = seriesModel.getData(); + var coordSys = seriesModel.coordinateSystem; - this._orient = visualMapModel.get('orient'); - this._useHandle = visualMapModel.get('calculable'); + // 1. If not specify the position with pixel directly + // 2. If `coord` is not a data array. Which uses `xAxis`, + // `yAxis` to specify the coord on each dimension - this._resetInterval(); + // parseFloat first because item.x and item.y can be percent string like '20%' + if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) { + var dims = coordSys.dimensions; + var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); - this._renderBar(thisGroup); + // Clone the option + // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value + item = clone(item); - var dataRangeText = visualMapModel.get('text'); - this._renderEndsText(thisGroup, dataRangeText, 0); - this._renderEndsText(thisGroup, dataRangeText, 1); + if (item.type + && markerTypeCalculator[item.type] + && axisInfo.baseAxis && axisInfo.valueAxis + ) { + var otherCoordIndex = indexOf$2(dims, axisInfo.baseAxis.dim); + var targetCoordIndex = indexOf$2(dims, axisInfo.valueAxis.dim); - // Do this for background size calculation. - this._updateView(true); + var coordInfo = markerTypeCalculator[item.type]( + data, axisInfo.baseDataDim, axisInfo.valueDataDim, + otherCoordIndex, targetCoordIndex + ); + item.coord = coordInfo[0]; + // Force to use the value of calculated value. + // let item use the value without stack. + item.value = coordInfo[1]; - // After updating view, inner shapes is built completely, - // and then background can be rendered. - this.renderBackground(thisGroup); + } + else { + // FIXME Only has one of xAxis and yAxis. + var coord = [ + item.xAxis != null ? item.xAxis : item.radiusAxis, + item.yAxis != null ? item.yAxis : item.angleAxis + ]; + // Each coord support max, min, average + for (var i = 0; i < 2; i++) { + if (markerTypeCalculator[coord[i]]) { + coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); + } + } + item.coord = coord; + } + } + return item; +} - // Real update view - this._updateView(); +function getAxisInfo$1(item, data, coordSys, seriesModel) { + var ret = {}; - this._enableHoverLinkToSeries(); - this._enableHoverLinkFromSeries(); + if (item.valueIndex != null || item.valueDim != null) { + ret.valueDataDim = item.valueIndex != null + ? data.getDimension(item.valueIndex) : item.valueDim; + ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); + ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + } + else { + ret.baseAxis = seriesModel.getBaseAxis(); + ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); + } - this.positionGroup(thisGroup); - }, + return ret; +} - /** - * @private - */ - _renderEndsText: function (group, dataRangeText, endsIndex) { - if (!dataRangeText) { - return; +function dataDimToCoordDim(seriesModel, dataDim) { + var data = seriesModel.getData(); + var dimensions = data.dimensions; + dataDim = data.getDimension(dataDim); + for (var i = 0; i < dimensions.length; i++) { + var dimItem = data.getDimensionInfo(dimensions[i]); + if (dimItem.name === dataDim) { + return dimItem.coordDim; } + } +} - // Compatible with ec2, text[0] map to high value, text[1] map low value. - var text = dataRangeText[1 - endsIndex]; - text = text != null ? text + '' : ''; +/** + * Filter data which is out of coordinateSystem range + * [dataFilter description] + * @param {module:echarts/coord/*} [coordSys] + * @param {Object} item + * @return {boolean} + */ +function dataFilter$1(coordSys, item) { + // Alwalys return true if there is no coordSys + return (coordSys && coordSys.containData && item.coord && !hasXOrY(item)) + ? coordSys.containData(item.coord) : true; +} - var visualMapModel = this.visualMapModel; - var textGap = visualMapModel.get('textGap'); - var itemSize = visualMapModel.itemSize; +function dimValueGetter(item, dimName, dataIndex, dimIndex) { + // x, y, radius, angle + if (dimIndex < 2) { + return item.coord && item.coord[dimIndex]; + } + return item.value; +} - var barGroup = this._shapes.barGroup; - var position = this._applyTransform( - [ - itemSize[0] / 2, - endsIndex === 0 ? -textGap : itemSize[1] + textGap - ], - barGroup - ); - var align = this._applyTransform( - endsIndex === 0 ? 'bottom' : 'top', - barGroup - ); - var orient = this._orient; - var textStyleModel = this.visualMapModel.textStyleModel; - - this.group.add(new Text({ - style: { - x: position[0], - y: position[1], - textVerticalAlign: orient === 'horizontal' ? 'middle' : align, - textAlign: orient === 'horizontal' ? align : 'center', - text: text, - textFont: textStyleModel.getFont(), - textFill: textStyleModel.getTextColor() +function numCalculate(data, valueDataDim, type) { + if (type === 'average') { + var sum = 0; + var count = 0; + data.each(valueDataDim, function (val, idx) { + if (!isNaN(val)) { + sum += val; + count++; } - })); - }, - - /** - * @private - */ - _renderBar: function (targetGroup) { - var visualMapModel = this.visualMapModel; - var shapes = this._shapes; - var itemSize = visualMapModel.itemSize; - var orient = this._orient; - var useHandle = this._useHandle; - var itemAlign = getItemAlign(visualMapModel, this.api, itemSize); - var barGroup = shapes.barGroup = this._createBarGroup(itemAlign); - - // Bar - barGroup.add(shapes.outOfRange = createPolygon()); - barGroup.add(shapes.inRange = createPolygon( - null, - useHandle ? getCursor$1(this._orient) : null, - bind(this._dragHandle, this, 'all', false), - bind(this._dragHandle, this, 'all', true) - )); - - var textRect = visualMapModel.textStyleModel.getTextRect('国'); - var textSize = mathMax$7(textRect.width, textRect.height); + }); + return sum / count; + } + else if (type === 'median') { + return data.getMedian(valueDataDim); + } + else { + // max & min + return data.getDataExtent(valueDataDim, true)[type === 'max' ? 1 : 0]; + } +} - // Handle - if (useHandle) { - shapes.handleThumbs = []; - shapes.handleLabels = []; - shapes.handleLabelPoints = []; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - this._createHandle(barGroup, 0, itemSize, textSize, orient, itemAlign); - this._createHandle(barGroup, 1, itemSize, textSize, orient, itemAlign); - } +var MarkerView = extendComponentView({ - this._createIndicator(barGroup, itemSize, textSize, orient); + type: 'marker', - targetGroup.add(barGroup); + init: function () { + /** + * Markline grouped by series + * @private + * @type {module:zrender/core/util.HashMap} + */ + this.markerGroupMap = createHashMap(); }, - /** - * @private - */ - _createHandle: function (barGroup, handleIndex, itemSize, textSize, orient) { - var onDrift = bind(this._dragHandle, this, handleIndex, false); - var onDragEnd = bind(this._dragHandle, this, handleIndex, true); - var handleThumb = createPolygon( - createHandlePoints(handleIndex, textSize), - getCursor$1(this._orient), - onDrift, - onDragEnd - ); - handleThumb.position[0] = itemSize[0]; - barGroup.add(handleThumb); - - // Text is always horizontal layout but should not be effected by - // transform (orient/inverse). So label is built separately but not - // use zrender/graphic/helper/RectText, and is located based on view - // group (according to handleLabelPoint) but not barGroup. - var textStyleModel = this.visualMapModel.textStyleModel; - var handleLabel = new Text({ - draggable: true, - drift: onDrift, - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - ondragend: onDragEnd, - style: { - x: 0, y: 0, text: '', - textFont: textStyleModel.getFont(), - textFill: textStyleModel.getTextColor() - } + render: function (markerModel, ecModel, api) { + var markerGroupMap = this.markerGroupMap; + markerGroupMap.each(function (item) { + item.__keep = false; }); - this.group.add(handleLabel); - var handleLabelPoint = [ - orient === 'horizontal' - ? textSize / 2 - : textSize * 1.5, - orient === 'horizontal' - ? (handleIndex === 0 ? -(textSize * 1.5) : (textSize * 1.5)) - : (handleIndex === 0 ? -textSize / 2 : textSize / 2) - ]; + var markerModelKey = this.type + 'Model'; + ecModel.eachSeries(function (seriesModel) { + var markerModel = seriesModel[markerModelKey]; + markerModel && this.renderSeries(seriesModel, markerModel, ecModel, api); + }, this); - var shapes = this._shapes; - shapes.handleThumbs[handleIndex] = handleThumb; - shapes.handleLabelPoints[handleIndex] = handleLabelPoint; - shapes.handleLabels[handleIndex] = handleLabel; + markerGroupMap.each(function (item) { + !item.__keep && this.group.remove(item.group); + }, this); }, - /** - * @private - */ - _createIndicator: function (barGroup, itemSize, textSize, orient) { - var indicator = createPolygon([[0, 0]], 'move'); - indicator.position[0] = itemSize[0]; - indicator.attr({invisible: true, silent: true}); - barGroup.add(indicator); - - var textStyleModel = this.visualMapModel.textStyleModel; - var indicatorLabel = new Text({ - silent: true, - invisible: true, - style: { - x: 0, y: 0, text: '', - textFont: textStyleModel.getFont(), - textFill: textStyleModel.getTextColor() - } - }); - this.group.add(indicatorLabel); - - var indicatorLabelPoint = [ - orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT + 3, - 0 - ]; + renderSeries: function () {} +}); - var shapes = this._shapes; - shapes.indicator = indicator; - shapes.indicatorLabel = indicatorLabel; - shapes.indicatorLabelPoint = indicatorLabelPoint; - }, +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - /** - * @private - */ - _dragHandle: function (handleIndex, isEnd, dx, dy) { - if (!this._useHandle) { - return; +function updateMarkerLayout(mpData, seriesModel, api) { + var coordSys = seriesModel.coordinateSystem; + mpData.each(function (idx) { + var itemModel = mpData.getItemModel(idx); + var point; + var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); + var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; } - - this._dragging = !isEnd; - - if (!isEnd) { - // Transform dx, dy to bar coordination. - var vertex = this._applyTransform([dx, dy], this._shapes.barGroup, true); - this._updateInterval(handleIndex, vertex[1]); - - // Considering realtime, update view should be executed - // before dispatch action. - this._updateView(); + // Chart like bar may have there own marker positioning logic + else if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition( + mpData.getValues(mpData.dimensions, idx) + ); } + else if (coordSys) { + var x = mpData.get(coordSys.dimensions[0], idx); + var y = mpData.get(coordSys.dimensions[1], idx); + point = coordSys.dataToPoint([x, y]); - // dragEnd do not dispatch action when realtime. - if (isEnd === !this.visualMapModel.get('realtime')) { // jshint ignore:line - this.api.dispatchAction({ - type: 'selectDataRange', - from: this.uid, - visualMapId: this.visualMapModel.id, - selected: this._dataInterval.slice() - }); } - if (isEnd) { - !this._hovering && this._clearHoverLinkToSeries(); + // Use x, y if has any + if (!isNaN(xPx)) { + point[0] = xPx; } - else if (useHoverLinkOnHandle(this.visualMapModel)) { - this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); + if (!isNaN(yPx)) { + point[1] = yPx; } - }, - - /** - * @private - */ - _resetInterval: function () { - var visualMapModel = this.visualMapModel; - var dataInterval = this._dataInterval = visualMapModel.getSelected(); - var dataExtent = visualMapModel.getExtent(); - var sizeExtent = [0, visualMapModel.itemSize[1]]; + mpData.setItemLayout(idx, point); + }); +} - this._handleEnds = [ - linearMap$3(dataInterval[0], dataExtent, sizeExtent, true), - linearMap$3(dataInterval[1], dataExtent, sizeExtent, true) - ]; - }, +MarkerView.extend({ - /** - * @private - * @param {(number|string)} handleIndex 0 or 1 or 'all' - * @param {number} dx - * @param {number} dy - */ - _updateInterval: function (handleIndex, delta) { - delta = delta || 0; - var visualMapModel = this.visualMapModel; - var handleEnds = this._handleEnds; - var sizeExtent = [0, visualMapModel.itemSize[1]]; + type: 'markPoint', - sliderMove( - delta, - handleEnds, - sizeExtent, - handleIndex, - // cross is forbiden - 0 - ); + // updateLayout: function (markPointModel, ecModel, api) { + // ecModel.eachSeries(function (seriesModel) { + // var mpModel = seriesModel.markPointModel; + // if (mpModel) { + // updateMarkerLayout(mpModel.getData(), seriesModel, api); + // this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); + // } + // }, this); + // }, - var dataExtent = visualMapModel.getExtent(); - // Update data interval. - this._dataInterval = [ - linearMap$3(handleEnds[0], sizeExtent, dataExtent, true), - linearMap$3(handleEnds[1], sizeExtent, dataExtent, true) - ]; + updateTransform: function (markPointModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var mpModel = seriesModel.markPointModel; + if (mpModel) { + updateMarkerLayout(mpModel.getData(), seriesModel, api); + this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); + } + }, this); }, - /** - * @private - */ - _updateView: function (forSketch) { - var visualMapModel = this.visualMapModel; - var dataExtent = visualMapModel.getExtent(); - var shapes = this._shapes; - - var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; - var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; - - var visualInRange = this._createBarVisual( - this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange' - ); - var visualOutOfRange = this._createBarVisual( - dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange' - ); - - shapes.inRange - .setStyle({ - fill: visualInRange.barColor, - opacity: visualInRange.opacity - }) - .setShape('points', visualInRange.barPoints); - shapes.outOfRange - .setStyle({ - fill: visualOutOfRange.barColor, - opacity: visualOutOfRange.opacity - }) - .setShape('points', visualOutOfRange.barPoints); + renderSeries: function (seriesModel, mpModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); - this._updateHandle(inRangeHandleEnds, visualInRange); - }, + var symbolDrawMap = this.markerGroupMap; + var symbolDraw = symbolDrawMap.get(seriesId) + || symbolDrawMap.set(seriesId, new SymbolDraw()); - /** - * @private - */ - _createBarVisual: function (dataInterval, dataExtent, handleEnds, forceState) { - var opts = { - forceState: forceState, - convertOpacityToAlpha: true - }; - var colorStops = this._makeColorGradient(dataInterval, opts); + var mpData = createList$1(coordSys, seriesModel, mpModel); - var symbolSizes = [ - this.getControllerVisual(dataInterval[0], 'symbolSize', opts), - this.getControllerVisual(dataInterval[1], 'symbolSize', opts) - ]; - var barPoints = this._createBarPoints(handleEnds, symbolSizes); + // FIXME + mpModel.setData(mpData); - return { - barColor: new LinearGradient(0, 0, 0, 1, colorStops), - barPoints: barPoints, - handlesColor: [ - colorStops[0].color, - colorStops[colorStops.length - 1].color - ] - }; - }, + updateMarkerLayout(mpModel.getData(), seriesModel, api); - /** - * @private - */ - _makeColorGradient: function (dataInterval, opts) { - // Considering colorHue, which is not linear, so we have to sample - // to calculate gradient color stops, but not only caculate head - // and tail. - var sampleNumber = 100; // Arbitrary value. - var colorStops = []; - var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; + mpData.each(function (idx) { + var itemModel = mpData.getItemModel(idx); + var symbol = itemModel.getShallow('symbol'); + var symbolSize = itemModel.getShallow('symbolSize'); + var isFnSymbol = isFunction$1(symbol); + var isFnSymbolSize = isFunction$1(symbolSize); + + if (isFnSymbol || isFnSymbolSize) { + var rawIdx = mpModel.getRawValue(idx); + var dataParams = mpModel.getDataParams(idx); + if (isFnSymbol) { + symbol = symbol(rawIdx, dataParams); + } + if (isFnSymbolSize) { + // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据? + symbolSize = symbolSize(rawIdx, dataParams); + } + } - colorStops.push({ - color: this.getControllerVisual(dataInterval[0], 'color', opts), - offset: 0 + mpData.setItemVisual(idx, { + symbol: symbol, + symbolSize: symbolSize, + color: itemModel.get('itemStyle.color') + || seriesData.getVisual('color') + }); }); - for (var i = 1; i < sampleNumber; i++) { - var currValue = dataInterval[0] + step * i; - if (currValue > dataInterval[1]) { - break; - } - colorStops.push({ - color: this.getControllerVisual(currValue, 'color', opts), - offset: i / sampleNumber - }); - } + // TODO Text are wrong + symbolDraw.updateData(mpData); + this.group.add(symbolDraw.group); - colorStops.push({ - color: this.getControllerVisual(dataInterval[1], 'color', opts), - offset: 1 + // Set host model for tooltip + // FIXME + mpData.eachItemGraphicEl(function (el) { + el.traverse(function (child) { + child.dataModel = mpModel; + }); }); - return colorStops; - }, - - /** - * @private - */ - _createBarPoints: function (handleEnds, symbolSizes) { - var itemSize = this.visualMapModel.itemSize; + symbolDraw.__keep = true; - return [ - [itemSize[0] - symbolSizes[0], handleEnds[0]], - [itemSize[0], handleEnds[0]], - [itemSize[0], handleEnds[1]], - [itemSize[0] - symbolSizes[1], handleEnds[1]] - ]; - }, + symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); + } +}); - /** - * @private - */ - _createBarGroup: function (itemAlign) { - var orient = this._orient; - var inverse = this.visualMapModel.get('inverse'); +/** + * @inner + * @param {module:echarts/coord/*} [coordSys] + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Model} mpModel + */ +function createList$1(coordSys, seriesModel, mpModel) { + var coordDimsInfos; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var info = seriesModel.getData().getDimensionInfo( + seriesModel.getData().mapDimension(coordDim) + ) || {}; + // In map series data don't have lng and lat dimension. Fallback to same with coordSys + return defaults({name: coordDim}, info); + }); + } + else { + coordDimsInfos = [{ + name: 'value', + type: 'float' + }]; + } - return new Group( - (orient === 'horizontal' && !inverse) - ? {scale: itemAlign === 'bottom' ? [1, 1] : [-1, 1], rotation: Math.PI / 2} - : (orient === 'horizontal' && inverse) - ? {scale: itemAlign === 'bottom' ? [-1, 1] : [1, 1], rotation: -Math.PI / 2} - : (orient === 'vertical' && !inverse) - ? {scale: itemAlign === 'left' ? [1, -1] : [-1, -1]} - : {scale: itemAlign === 'left' ? [1, 1] : [-1, 1]} + var mpData = new List(coordDimsInfos, mpModel); + var dataOpt = map(mpModel.get('data'), curry( + dataTransform, seriesModel + )); + if (coordSys) { + dataOpt = filter( + dataOpt, curry(dataFilter$1, coordSys) ); - }, + } - /** - * @private - */ - _updateHandle: function (handleEnds, visualInRange) { - if (!this._useHandle) { - return; + mpData.initData(dataOpt, null, + coordSys ? dimValueGetter : function (item) { + return item.value; } + ); - var shapes = this._shapes; - var visualMapModel = this.visualMapModel; - var handleThumbs = shapes.handleThumbs; - var handleLabels = shapes.handleLabels; - - each$26([0, 1], function (handleIndex) { - var handleThumb = handleThumbs[handleIndex]; - handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); - handleThumb.position[1] = handleEnds[handleIndex]; - - // Update handle label position. - var textPoint = applyTransform$1( - shapes.handleLabelPoints[handleIndex], - getTransform(handleThumb, this.group) - ); - handleLabels[handleIndex].setStyle({ - x: textPoint[0], - y: textPoint[1], - text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), - textVerticalAlign: 'middle', - textAlign: this._applyTransform( - this._orient === 'horizontal' - ? (handleIndex === 0 ? 'bottom' : 'top') - : 'left', - shapes.barGroup - ) - }); - }, this); - }, - - /** - * @private - * @param {number} cursorValue - * @param {number} textValue - * @param {string} [rangeSymbol] - * @param {number} [halfHoverLinkSize] - */ - _showIndicator: function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { - var visualMapModel = this.visualMapModel; - var dataExtent = visualMapModel.getExtent(); - var itemSize = visualMapModel.itemSize; - var sizeExtent = [0, itemSize[1]]; - var pos = linearMap$3(cursorValue, dataExtent, sizeExtent, true); - - var shapes = this._shapes; - var indicator = shapes.indicator; - if (!indicator) { - return; - } - - indicator.position[1] = pos; - indicator.attr('invisible', false); - indicator.setShape('points', createIndicatorPoints( - !!rangeSymbol, halfHoverLinkSize, pos, itemSize[1] - )); - - var opts = {convertOpacityToAlpha: true}; - var color = this.getControllerVisual(cursorValue, 'color', opts); - indicator.setStyle('fill', color); - - // Update handle label position. - var textPoint = applyTransform$1( - shapes.indicatorLabelPoint, - getTransform(indicator, this.group) - ); - - var indicatorLabel = shapes.indicatorLabel; - indicatorLabel.attr('invisible', false); - var align = this._applyTransform('left', shapes.barGroup); - var orient = this._orient; - indicatorLabel.setStyle({ - text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), - textVerticalAlign: orient === 'horizontal' ? align : 'middle', - textAlign: orient === 'horizontal' ? 'center' : align, - x: textPoint[0], - y: textPoint[1] - }); - }, - - /** - * @private - */ - _enableHoverLinkToSeries: function () { - var self = this; - this._shapes.barGroup - - .on('mousemove', function (e) { - self._hovering = true; - - if (!self._dragging) { - var itemSize = self.visualMapModel.itemSize; - var pos = self._applyTransform( - [e.offsetX, e.offsetY], self._shapes.barGroup, true, true - ); - // For hover link show when hover handle, which might be - // below or upper than sizeExtent. - pos[1] = mathMin$7(mathMax$7(0, pos[1]), itemSize[1]); - self._doHoverLinkToSeries( - pos[1], - 0 <= pos[0] && pos[0] <= itemSize[0] - ); - } - }) - - .on('mouseout', function () { - // When mouse is out of handle, hoverLink still need - // to be displayed when realtime is set as false. - self._hovering = false; - !self._dragging && self._clearHoverLinkToSeries(); - }); - }, - - /** - * @private - */ - _enableHoverLinkFromSeries: function () { - var zr = this.api.getZr(); - - if (this.visualMapModel.option.hoverLink) { - zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); - zr.on('mouseout', this._hideIndicator, this); - } - else { - this._clearHoverLinkFromSeries(); - } - }, - - /** - * @private - */ - _doHoverLinkToSeries: function (cursorPos, hoverOnBar) { - var visualMapModel = this.visualMapModel; - var itemSize = visualMapModel.itemSize; - - if (!visualMapModel.option.hoverLink) { - return; - } - - var sizeExtent = [0, itemSize[1]]; - var dataExtent = visualMapModel.getExtent(); - - // For hover link show when hover handle, which might be below or upper than sizeExtent. - cursorPos = mathMin$7(mathMax$7(sizeExtent[0], cursorPos), sizeExtent[1]); - - var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); - var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; - var cursorValue = linearMap$3(cursorPos, sizeExtent, dataExtent, true); - var valueRange = [ - linearMap$3(hoverRange[0], sizeExtent, dataExtent, true), - linearMap$3(hoverRange[1], sizeExtent, dataExtent, true) - ]; - // Consider data range is out of visualMap range, see test/visualMap-continuous.html, - // where china and india has very large population. - hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); - hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); - - // Do not show indicator when mouse is over handle, - // otherwise labels overlap, especially when dragging. - if (hoverOnBar) { - if (valueRange[0] === -Infinity) { - this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); - } - else if (valueRange[1] === Infinity) { - this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); - } - else { - this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); - } - } - - // When realtime is set as false, handles, which are in barGroup, - // also trigger hoverLink, which help user to realize where they - // focus on when dragging. (see test/heatmap-large.html) - // When realtime is set as true, highlight will not show when hover - // handle, because the label on handle, which displays a exact value - // but not range, might mislead users. - var oldBatch = this._hoverLinkDataIndices; - var newBatch = []; - if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { - newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); - } - - var resultBatches = compressBatches(oldBatch, newBatch); - - this._dispatchHighDown('downplay', convertDataIndex(resultBatches[0])); - this._dispatchHighDown('highlight', convertDataIndex(resultBatches[1])); - }, - - /** - * @private - */ - _hoverLinkFromSeriesMouseOver: function (e) { - var el = e.target; - var visualMapModel = this.visualMapModel; - - if (!el || el.dataIndex == null) { - return; - } - - var dataModel = this.ecModel.getSeriesByIndex(el.seriesIndex); - - if (!visualMapModel.isTargetSeries(dataModel)) { - return; - } - - var data = dataModel.getData(el.dataType); - var value = data.get(visualMapModel.getDataDimension(data), el.dataIndex, true); - - if (!isNaN(value)) { - this._showIndicator(value, value); - } - }, - - /** - * @private - */ - _hideIndicator: function () { - var shapes = this._shapes; - shapes.indicator && shapes.indicator.attr('invisible', true); - shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); - }, - - /** - * @private - */ - _clearHoverLinkToSeries: function () { - this._hideIndicator(); - - var indices = this._hoverLinkDataIndices; - this._dispatchHighDown('downplay', convertDataIndex(indices)); - - indices.length = 0; - }, - - /** - * @private - */ - _clearHoverLinkFromSeries: function () { - this._hideIndicator(); - - var zr = this.api.getZr(); - zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); - zr.off('mouseout', this._hideIndicator); - }, - - /** - * @private - */ - _applyTransform: function (vertex, element, inverse, global) { - var transform = getTransform(element, global ? null : this.group); - - return graphic[ - isArray(vertex) ? 'applyTransform' : 'transformDirection' - ](vertex, transform, inverse); - }, - - /** - * @private - */ - _dispatchHighDown: function (type, batch) { - batch && batch.length && this.api.dispatchAction({ - type: type, - batch: batch - }); - }, - - /** - * @override - */ - dispose: function () { - this._clearHoverLinkFromSeries(); - this._clearHoverLinkToSeries(); - }, - - /** - * @override - */ - remove: function () { - this._clearHoverLinkFromSeries(); - this._clearHoverLinkToSeries(); - } - -}); - -function createPolygon(points, cursor, onDrift, onDragEnd) { - return new Polygon({ - shape: {points: points}, - draggable: !!onDrift, - cursor: cursor, - drift: onDrift, - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - ondragend: onDragEnd - }); -} - -function createHandlePoints(handleIndex, textSize) { - return handleIndex === 0 - ? [[0, 0], [textSize, 0], [textSize, -textSize]] - : [[0, 0], [textSize, 0], [textSize, textSize]]; -} - -function createIndicatorPoints(isRange, halfHoverLinkSize, pos, extentMax) { - return isRange - ? [ // indicate range - [0, -mathMin$7(halfHoverLinkSize, mathMax$7(pos, 0))], - [HOVER_LINK_OUT, 0], - [0, mathMin$7(halfHoverLinkSize, mathMax$7(extentMax - pos, 0))] - ] - : [ // indicate single value - [0, 0], [5, -5], [5, 5] - ]; -} - -function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { - var halfHoverLinkSize = HOVER_LINK_SIZE / 2; - var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); - if (hoverLinkDataSize) { - halfHoverLinkSize = linearMap$3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; - } - return halfHoverLinkSize; -} - -function useHoverLinkOnHandle(visualMapModel) { - var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); - return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); -} - -function getCursor$1(orient) { - return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; -} + return mpData; +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -84169,19 +87711,10 @@ function getCursor$1(orient) { * under the License. */ -var actionInfo$2 = { - type: 'selectDataRange', - event: 'dataRangeSelected', - // FIXME use updateView appears wrong - update: 'update' -}; - -registerAction(actionInfo$2, function (payload, ecModel) { - - ecModel.eachComponent({mainType: 'visualMap', query: payload}, function (model) { - model.setSelected(payload.selected); - }); - +// HINT Markpoint can't be used too much +registerPreprocessor(function (opt) { + // Make sure markPoint component is enabled + opt.markPoint = opt.markPoint || {}; }); /* @@ -84203,11 +87736,42 @@ registerAction(actionInfo$2, function (payload, ecModel) { * under the License. */ -/** - * DataZoom component entry - */ +MarkerModel.extend({ -registerPreprocessor(preprocessor$2); + type: 'markLine', + + defaultOption: { + zlevel: 0, + z: 5, + + symbol: ['circle', 'arrow'], + symbolSize: [8, 16], + + //symbolRotate: 0, + + precision: 2, + tooltip: { + trigger: 'item' + }, + label: { + show: true, + position: 'end', + distance: 5 + }, + lineStyle: { + type: 'dashed' + }, + emphasis: { + label: { + show: true + }, + lineStyle: { + width: 3 + } + }, + animationEasing: 'linear' + } +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -84228,800 +87792,380 @@ registerPreprocessor(preprocessor$2); * under the License. */ -var PiecewiseModel = VisualMapModel.extend({ +var markLineTransform = function (seriesModel, coordSys, mlModel, item) { + var data = seriesModel.getData(); + // Special type markLine like 'min', 'max', 'average', 'median' + var mlType = item.type; - type: 'visualMap.piecewise', + if (!isArray(item) + && ( + mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' + // In case + // data: [{ + // yAxis: 10 + // }] + || (item.xAxis != null || item.yAxis != null) + ) + ) { + var valueAxis; + var value; - /** - * Order Rule: - * - * option.categories / option.pieces / option.text / option.selected: - * If !option.inverse, - * Order when vertical: ['top', ..., 'bottom']. - * Order when horizontal: ['left', ..., 'right']. - * If option.inverse, the meaning of - * the order should be reversed. - * - * this._pieceList: - * The order is always [low, ..., high]. - * - * Mapping from location to low-high: - * If !option.inverse - * When vertical, top is high. - * When horizontal, right is high. - * If option.inverse, reverse. - */ + if (item.yAxis != null || item.xAxis != null) { + valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x'); + value = retrieve(item.yAxis, item.xAxis); + } + else { + var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); + valueAxis = axisInfo.valueAxis; + var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim); + value = numCalculate(data, valueDataDim, mlType); + } + var valueIndex = valueAxis.dim === 'x' ? 0 : 1; + var baseIndex = 1 - valueIndex; - /** - * @protected - */ - defaultOption: { - selected: null, // Object. If not specified, means selected. - // When pieces and splitNumber: {'0': true, '5': true} - // When categories: {'cate1': false, 'cate3': true} - // When selected === false, means all unselected. + var mlFrom = clone(item); + var mlTo = {}; - minOpen: false, // Whether include values that smaller than `min`. - maxOpen: false, // Whether include values that bigger than `max`. + mlFrom.type = null; - align: 'auto', // 'auto', 'left', 'right' - itemWidth: 20, // When put the controller vertically, it is the length of - // horizontal side of each item. Otherwise, vertical side. - itemHeight: 14, // When put the controller vertically, it is the length of - // vertical side of each item. Otherwise, horizontal side. - itemSymbol: 'roundRect', - pieceList: null, // Each item is Object, with some of those attrs: - // {min, max, lt, gt, lte, gte, value, - // color, colorSaturation, colorAlpha, opacity, - // symbol, symbolSize}, which customize the range or visual - // coding of the certain piece. Besides, see "Order Rule". - categories: null, // category names, like: ['some1', 'some2', 'some3']. - // Attr min/max are ignored when categories set. See "Order Rule" - splitNumber: 5, // If set to 5, auto split five pieces equally. - // If set to 0 and component type not set, component type will be - // determined as "continuous". (It is less reasonable but for ec2 - // compatibility, see echarts/component/visualMap/typeDefaulter) - selectedMode: 'multiple', // Can be 'multiple' or 'single'. - itemGap: 10, // The gap between two items, in px. - hoverLink: true, // Enable hover highlight. + mlFrom.coord = []; + mlTo.coord = []; + mlFrom.coord[baseIndex] = -Infinity; + mlTo.coord[baseIndex] = Infinity; - showLabel: null // By default, when text is used, label will hide (the logic - // is remained for compatibility reason) - }, + var precision = mlModel.get('precision'); + if (precision >= 0 && typeof value === 'number') { + value = +value.toFixed(Math.min(precision, 20)); + } - /** - * @override - */ - optionUpdated: function (newOption, isInit) { - PiecewiseModel.superApply(this, 'optionUpdated', arguments); + mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; - /** - * The order is always [low, ..., high]. - * [{text: string, interval: Array.}, ...] - * @private - * @type {Array.} - */ - this._pieceList = []; + item = [mlFrom, mlTo, { // Extra option for tooltip and label + type: mlType, + valueIndex: item.valueIndex, + // Force to use the value of calculated value. + value: value + }]; + } - this.resetExtent(); + item = [ + dataTransform(seriesModel, item[0]), + dataTransform(seriesModel, item[1]), + extend({}, item[2]) + ]; - /** - * 'pieces', 'categories', 'splitNumber' - * @type {string} - */ - var mode = this._mode = this._determineMode(); + // Avoid line data type is extended by from(to) data type + item[2].type = item[2].type || ''; - resetMethods[this._mode].call(this); + // Merge from option and to option into line option + merge(item[2], item[0]); + merge(item[2], item[1]); - this._resetSelected(newOption, isInit); + return item; +}; - var categories = this.option.categories; +function isInifinity(val) { + return !isNaN(val) && !isFinite(val); +} - this.resetVisual(function (mappingOption, state) { - if (mode === 'categories') { - mappingOption.mappingMethod = 'category'; - mappingOption.categories = clone(categories); - } - else { - mappingOption.dataExtent = this.getExtent(); - mappingOption.mappingMethod = 'piecewise'; - mappingOption.pieceList = map(this._pieceList, function (piece) { - var piece = clone(piece); - if (state !== 'inRange') { - // FIXME - // outOfRange do not support special visual in pieces. - piece.visual = null; - } - return piece; - }); - } - }); - }, +// If a markLine has one dim +function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { + var otherDimIndex = 1 - dimIndex; + var dimName = coordSys.dimensions[dimIndex]; + return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) + && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); +} - /** - * @protected - * @override - */ - completeVisualOption: function () { - // Consider this case: - // visualMap: { - // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] +function markLineFilter(coordSys, item) { + if (coordSys.type === 'cartesian2d') { + var fromCoord = item[0].coord; + var toCoord = item[1].coord; + // In case + // { + // markLine: { + // data: [{ yAxis: 2 }] + // } // } - // where no inRange/outOfRange set but only pieces. So we should make - // default inRange/outOfRange for this case, otherwise visuals that only - // appear in `pieces` will not be taken into account in visual encoding. - - var option = this.option; - var visualTypesInPieces = {}; - var visualTypes = VisualMapping.listVisualTypes(); - var isCategory = this.isCategory(); - - each$1(option.pieces, function (piece) { - each$1(visualTypes, function (visualType) { - if (piece.hasOwnProperty(visualType)) { - visualTypesInPieces[visualType] = 1; - } - }); - }); - - each$1(visualTypesInPieces, function (v, visualType) { - var exists = 0; - each$1(this.stateList, function (state) { - exists |= has(option, state, visualType) - || has(option.target, state, visualType); - }, this); + if ( + fromCoord && toCoord + && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) + || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys)) + ) { + return true; + } + } + return dataFilter$1(coordSys, item[0]) + && dataFilter$1(coordSys, item[1]); +} - !exists && each$1(this.stateList, function (state) { - (option[state] || (option[state] = {}))[visualType] = visualDefault.get( - visualType, state === 'inRange' ? 'active' : 'inactive', isCategory - ); - }); - }, this); +function updateSingleMarkerEndLayout( + data, idx, isFrom, seriesModel, api +) { + var coordSys = seriesModel.coordinateSystem; + var itemModel = data.getItemModel(idx); - function has(obj, state, visualType) { - return obj && obj[state] && ( - isObject$1(obj[state]) - ? obj[state].hasOwnProperty(visualType) - : obj[state] === visualType // e.g., inRange: 'symbol' + var point; + var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); + var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } + else { + // Chart like bar may have there own marker positioning logic + if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition( + data.getValues(data.dimensions, idx) ); } - - VisualMapModel.prototype.completeVisualOption.apply(this, arguments); - }, - - _resetSelected: function (newOption, isInit) { - var thisOption = this.option; - var pieceList = this._pieceList; - - // Selected do not merge but all override. - var selected = (isInit ? thisOption : newOption).selected || {}; - thisOption.selected = selected; - - // Consider 'not specified' means true. - each$1(pieceList, function (piece, index) { - var key = this.getSelectedMapKey(piece); - if (!selected.hasOwnProperty(key)) { - selected[key] = true; + else { + var dims = coordSys.dimensions; + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + point = coordSys.dataToPoint([x, y]); + } + // Expand line to the edge of grid if value on one axis is Inifnity + // In case + // markLine: { + // data: [{ + // yAxis: 2 + // // or + // type: 'average' + // }] + // } + if (coordSys.type === 'cartesian2d') { + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + var dims = coordSys.dimensions; + if (isInifinity(data.get(dims[0], idx))) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); + } + else if (isInifinity(data.get(dims[1], idx))) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); } - }, this); - - if (thisOption.selectedMode === 'single') { - // Ensure there is only one selected. - var hasSel = false; - - each$1(pieceList, function (piece, index) { - var key = this.getSelectedMapKey(piece); - if (selected[key]) { - hasSel - ? (selected[key] = false) - : (hasSel = true); - } - }, this); } - // thisOption.selectedMode === 'multiple', default: all selected. - }, - - /** - * @public - */ - getSelectedMapKey: function (piece) { - return this._mode === 'categories' - ? piece.value + '' : piece.index + ''; - }, - - /** - * @public - */ - getPieceList: function () { - return this._pieceList; - }, - - /** - * @private - * @return {string} - */ - _determineMode: function () { - var option = this.option; - return option.pieces && option.pieces.length > 0 - ? 'pieces' - : this.option.categories - ? 'categories' - : 'splitNumber'; - }, + // Use x, y if has any + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + } - /** - * @public - * @override - */ - setSelected: function (selected) { - this.option.selected = clone(selected); - }, + data.setItemLayout(idx, point); +} - /** - * @public - * @override - */ - getValueState: function (value) { - var index = VisualMapping.findPieceIndex(value, this._pieceList); +MarkerView.extend({ - return index != null - ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])] - ? 'inRange' : 'outOfRange' - ) - : 'outOfRange'; - }, + type: 'markLine', - /** - * @public - * @params {number} pieceIndex piece index in visualMapModel.getPieceList() - * @return {Array.} [{seriesId, dataIndices: >}, ...] - */ - findTargetDataIndices: function (pieceIndex) { - var result = []; + // updateLayout: function (markLineModel, ecModel, api) { + // ecModel.eachSeries(function (seriesModel) { + // var mlModel = seriesModel.markLineModel; + // if (mlModel) { + // var mlData = mlModel.getData(); + // var fromData = mlModel.__from; + // var toData = mlModel.__to; + // // Update visual and layout of from symbol and to symbol + // fromData.each(function (idx) { + // updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); + // updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); + // }); + // // Update layout of line + // mlData.each(function (idx) { + // mlData.setItemLayout(idx, [ + // fromData.getItemLayout(idx), + // toData.getItemLayout(idx) + // ]); + // }); - this.eachTargetSeries(function (seriesModel) { - var dataIndices = []; - var data = seriesModel.getData(); + // this.markerGroupMap.get(seriesModel.id).updateLayout(); - data.each(this.getDataDimension(data), function (value, dataIndex) { - // Should always base on model pieceList, because it is order sensitive. - var pIdx = VisualMapping.findPieceIndex(value, this._pieceList); - pIdx === pieceIndex && dataIndices.push(dataIndex); - }, this); + // } + // }, this); + // }, - result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); - }, this); + updateTransform: function (markLineModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var mlModel = seriesModel.markLineModel; + if (mlModel) { + var mlData = mlModel.getData(); + var fromData = mlModel.__from; + var toData = mlModel.__to; + // Update visual and layout of from symbol and to symbol + fromData.each(function (idx) { + updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); + updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); + }); + // Update layout of line + mlData.each(function (idx) { + mlData.setItemLayout(idx, [ + fromData.getItemLayout(idx), + toData.getItemLayout(idx) + ]); + }); - return result; - }, + this.markerGroupMap.get(seriesModel.id).updateLayout(); - /** - * @private - * @param {Object} piece piece.value or piece.interval is required. - * @return {number} Can be Infinity or -Infinity - */ - getRepresentValue: function (piece) { - var representValue; - if (this.isCategory()) { - representValue = piece.value; - } - else { - if (piece.value != null) { - representValue = piece.value; } - else { - var pieceInterval = piece.interval || []; - representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity) - ? 0 - : (pieceInterval[0] + pieceInterval[1]) / 2; - } - } - return representValue; + }, this); }, - getVisualMeta: function (getColorVisual) { - // Do not support category. (category axis is ordinal, numerical) - if (this.isCategory()) { - return; - } - - var stops = []; - var outerColors = []; - var visualMapModel = this; - - function setStop(interval, valueState) { - var representValue = visualMapModel.getRepresentValue({interval: interval}); - if (!valueState) { - valueState = visualMapModel.getValueState(representValue); - } - var color = getColorVisual(representValue, valueState); - if (interval[0] === -Infinity) { - outerColors[0] = color; - } - else if (interval[1] === Infinity) { - outerColors[1] = color; - } - else { - stops.push( - {value: interval[0], color: color}, - {value: interval[1], color: color} - ); - } - } - - // Suplement - var pieceList = this._pieceList.slice(); - if (!pieceList.length) { - pieceList.push({interval: [-Infinity, Infinity]}); - } - else { - var edge = pieceList[0].interval[0]; - edge !== -Infinity && pieceList.unshift({interval: [-Infinity, edge]}); - edge = pieceList[pieceList.length - 1].interval[1]; - edge !== Infinity && pieceList.push({interval: [edge, Infinity]}); - } - - var curr = -Infinity; - each$1(pieceList, function (piece) { - var interval = piece.interval; - if (interval) { - // Fulfill gap. - interval[0] > curr && setStop([curr, interval[0]], 'outOfRange'); - setStop(interval.slice()); - curr = interval[1]; - } - }, this); + renderSeries: function (seriesModel, mlModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); - return {stops: stops, outerColors: outerColors}; - } + var lineDrawMap = this.markerGroupMap; + var lineDraw = lineDrawMap.get(seriesId) + || lineDrawMap.set(seriesId, new LineDraw()); + this.group.add(lineDraw.group); -}); + var mlData = createList$2(coordSys, seriesModel, mlModel); -/** - * Key is this._mode - * @type {Object} - * @this {module:echarts/component/viusalMap/PiecewiseMode} - */ -var resetMethods = { + var fromData = mlData.from; + var toData = mlData.to; + var lineData = mlData.line; - splitNumber: function () { - var thisOption = this.option; - var pieceList = this._pieceList; - var precision = Math.min(thisOption.precision, 20); - var dataExtent = this.getExtent(); - var splitNumber = thisOption.splitNumber; - splitNumber = Math.max(parseInt(splitNumber, 10), 1); - thisOption.splitNumber = splitNumber; + mlModel.__from = fromData; + mlModel.__to = toData; + // Line data for tooltip and formatter + mlModel.setData(lineData); - var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; - // Precision auto-adaption - while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { - precision++; + var symbolType = mlModel.get('symbol'); + var symbolSize = mlModel.get('symbolSize'); + if (!isArray(symbolType)) { + symbolType = [symbolType, symbolType]; + } + if (typeof symbolSize === 'number') { + symbolSize = [symbolSize, symbolSize]; } - thisOption.precision = precision; - splitStep = +splitStep.toFixed(precision); - var index = 0; + // Update visual and layout of from symbol and to symbol + mlData.from.each(function (idx) { + updateDataVisualAndLayout(fromData, idx, true); + updateDataVisualAndLayout(toData, idx, false); + }); - if (thisOption.minOpen) { - pieceList.push({ - index: index++, - interval: [-Infinity, dataExtent[0]], - close: [0, 0] + // Update visual and layout of line + lineData.each(function (idx) { + var lineColor = lineData.getItemModel(idx).get('lineStyle.color'); + lineData.setItemVisual(idx, { + color: lineColor || fromData.getItemVisual(idx, 'color') }); - } - - for ( - var curr = dataExtent[0], len = index + splitNumber; - index < len; - curr += splitStep - ) { - var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep); + lineData.setItemLayout(idx, [ + fromData.getItemLayout(idx), + toData.getItemLayout(idx) + ]); - pieceList.push({ - index: index++, - interval: [curr, max], - close: [1, 1] + lineData.setItemVisual(idx, { + 'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'), + 'fromSymbol': fromData.getItemVisual(idx, 'symbol'), + 'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'), + 'toSymbol': toData.getItemVisual(idx, 'symbol') }); - } + }); - if (thisOption.maxOpen) { - pieceList.push({ - index: index++, - interval: [dataExtent[1], Infinity], - close: [0, 0] + lineDraw.updateData(lineData); + + // Set host model for tooltip + // FIXME + mlData.line.eachItemGraphicEl(function (el, idx) { + el.traverse(function (child) { + child.dataModel = mlModel; }); - } + }); - reformIntervals(pieceList); + function updateDataVisualAndLayout(data, idx, isFrom) { + var itemModel = data.getItemModel(idx); - each$1(pieceList, function (piece) { - piece.text = this.formatValueText(piece.interval); - }, this); - }, + updateSingleMarkerEndLayout( + data, idx, isFrom, seriesModel, api + ); - categories: function () { - var thisOption = this.option; - each$1(thisOption.categories, function (cate) { - // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 - // 是否改一致。 - this._pieceList.push({ - text: this.formatValueText(cate, true), - value: cate + data.setItemVisual(idx, { + symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1], + symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1], + color: itemModel.get('itemStyle.color') || seriesData.getVisual('color') }); - }, this); - - // See "Order Rule". - normalizeReverse(thisOption, this._pieceList); - }, + } - pieces: function () { - var thisOption = this.option; - var pieceList = this._pieceList; + lineDraw.__keep = true; - each$1(thisOption.pieces, function (pieceListItem, index) { + lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); + } +}); - if (!isObject$1(pieceListItem)) { - pieceListItem = {value: pieceListItem}; - } +/** + * @inner + * @param {module:echarts/coord/*} coordSys + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Model} mpModel + */ +function createList$2(coordSys, seriesModel, mlModel) { - var item = {text: '', index: index}; + var coordDimsInfos; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var info = seriesModel.getData().getDimensionInfo( + seriesModel.getData().mapDimension(coordDim) + ) || {}; + // In map series data don't have lng and lat dimension. Fallback to same with coordSys + return defaults({name: coordDim}, info); + }); + } + else { + coordDimsInfos = [{ + name: 'value', + type: 'float' + }]; + } - if (pieceListItem.label != null) { - item.text = pieceListItem.label; - } + var fromData = new List(coordDimsInfos, mlModel); + var toData = new List(coordDimsInfos, mlModel); + // No dimensions + var lineData = new List([], mlModel); - if (pieceListItem.hasOwnProperty('value')) { - var value = item.value = pieceListItem.value; - item.interval = [value, value]; - item.close = [1, 1]; - } - else { - // `min` `max` is legacy option. - // `lt` `gt` `lte` `gte` is recommanded. - var interval = item.interval = []; - var close = item.close = [0, 0]; - - var closeList = [1, 0, 1]; - var infinityList = [-Infinity, Infinity]; - - var useMinMax = []; - for (var lg = 0; lg < 2; lg++) { - var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg]; - for (var i = 0; i < 3 && interval[lg] == null; i++) { - interval[lg] = pieceListItem[names[i]]; - close[lg] = closeList[i]; - useMinMax[lg] = i === 2; - } - interval[lg] == null && (interval[lg] = infinityList[lg]); - } - useMinMax[0] && interval[1] === Infinity && (close[0] = 0); - useMinMax[1] && interval[0] === -Infinity && (close[1] = 0); - - if (__DEV__) { - if (interval[0] > interval[1]) { - console.warn( - 'Piece ' + index + 'is illegal: ' + interval - + ' lower bound should not greater then uppper bound.' - ); - } - } - - if (interval[0] === interval[1] && close[0] && close[1]) { - // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}], - // we use value to lift the priority when min === max - item.value = interval[0]; - } - } - - item.visual = VisualMapping.retrieveVisuals(pieceListItem); - - pieceList.push(item); - - }, this); - - // See "Order Rule". - normalizeReverse(thisOption, pieceList); - // Only pieces - reformIntervals(pieceList); - - each$1(pieceList, function (piece) { - var close = piece.close; - var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]]; - piece.text = piece.text || this.formatValueText( - piece.value != null ? piece.value : piece.interval, - false, - edgeSymbols - ); - }, this); - } -}; - -function normalizeReverse(thisOption, pieceList) { - var inverse = thisOption.inverse; - if (thisOption.orient === 'vertical' ? !inverse : inverse) { - pieceList.reverse(); - } -} - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -var PiecewiseVisualMapView = VisualMapView.extend({ - - type: 'visualMap.piecewise', - - /** - * @protected - * @override - */ - doRender: function () { - var thisGroup = this.group; - - thisGroup.removeAll(); - - var visualMapModel = this.visualMapModel; - var textGap = visualMapModel.get('textGap'); - var textStyleModel = visualMapModel.textStyleModel; - var textFont = textStyleModel.getFont(); - var textFill = textStyleModel.getTextColor(); - var itemAlign = this._getItemAlign(); - var itemSize = visualMapModel.itemSize; - var viewData = this._getViewData(); - var endsText = viewData.endsText; - var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); - - endsText && this._renderEndsText( - thisGroup, endsText[0], itemSize, showLabel, itemAlign - ); - - each$1(viewData.viewPieceList, renderItem, this); - - endsText && this._renderEndsText( - thisGroup, endsText[1], itemSize, showLabel, itemAlign - ); - - box( - visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap') + var optData = map(mlModel.get('data'), curry( + markLineTransform, seriesModel, coordSys, mlModel + )); + if (coordSys) { + optData = filter( + optData, curry(markLineFilter, coordSys) ); - - this.renderBackground(thisGroup); - - this.positionGroup(thisGroup); - - function renderItem(item) { - var piece = item.piece; - - var itemGroup = new Group(); - itemGroup.onclick = bind(this._onItemClick, this, piece); - - this._enableHoverLink(itemGroup, item.indexInModelPieceList); - - var representValue = visualMapModel.getRepresentValue(piece); - - this._createItemSymbol( - itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]] - ); - - if (showLabel) { - var visualState = this.visualMapModel.getValueState(representValue); - - itemGroup.add(new Text({ - style: { - x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, - y: itemSize[1] / 2, - text: piece.text, - textVerticalAlign: 'middle', - textAlign: itemAlign, - textFont: textFont, - textFill: textFill, - opacity: visualState === 'outOfRange' ? 0.5 : 1 - } - })); - } - - thisGroup.add(itemGroup); - } - }, - - /** - * @private - */ - _enableHoverLink: function (itemGroup, pieceIndex) { - itemGroup - .on('mouseover', bind(onHoverLink, this, 'highlight')) - .on('mouseout', bind(onHoverLink, this, 'downplay')); - - function onHoverLink(method) { - var visualMapModel = this.visualMapModel; - - visualMapModel.option.hoverLink && this.api.dispatchAction({ - type: method, - batch: convertDataIndex( - visualMapModel.findTargetDataIndices(pieceIndex) - ) - }); - } - }, - - /** - * @private - */ - _getItemAlign: function () { - var visualMapModel = this.visualMapModel; - var modelOption = visualMapModel.option; - - if (modelOption.orient === 'vertical') { - return getItemAlign( - visualMapModel, this.api, visualMapModel.itemSize - ); - } - else { // horizontal, most case left unless specifying right. - var align = modelOption.align; - if (!align || align === 'auto') { - align = 'left'; - } - return align; - } - }, - - /** - * @private - */ - _renderEndsText: function (group, text, itemSize, showLabel, itemAlign) { - if (!text) { - return; - } - - var itemGroup = new Group(); - var textStyleModel = this.visualMapModel.textStyleModel; - - itemGroup.add(new Text({ - style: { - x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2, - y: itemSize[1] / 2, - textVerticalAlign: 'middle', - textAlign: showLabel ? itemAlign : 'center', - text: text, - textFont: textStyleModel.getFont(), - textFill: textStyleModel.getTextColor() - } - })); - - group.add(itemGroup); - }, - - /** - * @private - * @return {Object} {peiceList, endsText} The order is the same as screen pixel order. - */ - _getViewData: function () { - var visualMapModel = this.visualMapModel; - - var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { - return {piece: piece, indexInModelPieceList: index}; - }); - var endsText = visualMapModel.get('text'); - - // Consider orient and inverse. - var orient = visualMapModel.get('orient'); - var inverse = visualMapModel.get('inverse'); - - // Order of model pieceList is always [low, ..., high] - if (orient === 'horizontal' ? inverse : !inverse) { - viewPieceList.reverse(); - } - // Origin order of endsText is [high, low] - else if (endsText) { - endsText = endsText.slice().reverse(); - } - - return {viewPieceList: viewPieceList, endsText: endsText}; - }, - - /** - * @private - */ - _createItemSymbol: function (group, representValue, shapeParam) { - group.add(createSymbol( - this.getControllerVisual(representValue, 'symbol'), - shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], - this.getControllerVisual(representValue, 'color') - )); - }, - - /** - * @private - */ - _onItemClick: function (piece) { - var visualMapModel = this.visualMapModel; - var option = visualMapModel.option; - var selected = clone(option.selected); - var newKey = visualMapModel.getSelectedMapKey(piece); - - if (option.selectedMode === 'single') { - selected[newKey] = true; - each$1(selected, function (o, key) { - selected[key] = key === newKey; - }); - } - else { - selected[newKey] = !selected[newKey]; - } - - this.api.dispatchAction({ - type: 'selectDataRange', - from: this.uid, - visualMapId: this.visualMapModel.id, - selected: selected - }); } -}); - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -/** - * DataZoom component entry - */ - -registerPreprocessor(preprocessor$2); - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + var dimValueGetter$$1 = coordSys ? dimValueGetter : function (item) { + return item.value; + }; + fromData.initData( + map(optData, function (item) { + return item[0]; + }), + null, + dimValueGetter$$1 + ); + toData.initData( + map(optData, function (item) { + return item[1]; + }), + null, + dimValueGetter$$1 + ); + lineData.initData( + map(optData, function (item) { + return item[2]; + }) + ); + lineData.hasItemOption = true; -/** - * visualMap component entry - */ + return { + from: fromData, + to: toData, + line: lineData + }; +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -85042,128 +88186,11 @@ registerPreprocessor(preprocessor$2); * under the License. */ -var addCommas$1 = addCommas; -var encodeHTML$1 = encodeHTML; - -function fillLabel(opt) { - defaultEmphasis(opt, 'label', ['show']); -} -var MarkerModel = extendComponentModel({ - - type: 'marker', - - dependencies: ['series', 'grid', 'polar', 'geo'], - - /** - * @overrite - */ - init: function (option, parentModel, ecModel, extraOpt) { - - if (__DEV__) { - if (this.type === 'marker') { - throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); - } - } - this.mergeDefaultAndTheme(option, ecModel); - this.mergeOption(option, ecModel, extraOpt.createdBySelf, true); - }, - - /** - * @return {boolean} - */ - isAnimationEnabled: function () { - if (env$1.node) { - return false; - } - - var hostSeries = this.__hostSeries; - return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); - }, - - mergeOption: function (newOpt, ecModel, createdBySelf, isInit) { - var MarkerModel = this.constructor; - var modelPropName = this.mainType + 'Model'; - if (!createdBySelf) { - ecModel.eachSeries(function (seriesModel) { - - var markerOpt = seriesModel.get(this.mainType, true); - - var markerModel = seriesModel[modelPropName]; - if (!markerOpt || !markerOpt.data) { - seriesModel[modelPropName] = null; - return; - } - if (!markerModel) { - if (isInit) { - // Default label emphasis `position` and `show` - fillLabel(markerOpt); - } - each$1(markerOpt.data, function (item) { - // FIXME Overwrite fillLabel method ? - if (item instanceof Array) { - fillLabel(item[0]); - fillLabel(item[1]); - } - else { - fillLabel(item); - } - }); - - markerModel = new MarkerModel( - markerOpt, this, ecModel - ); - - extend(markerModel, { - mainType: this.mainType, - // Use the same series index and name - seriesIndex: seriesModel.seriesIndex, - name: seriesModel.name, - createdBySelf: true - }); - - markerModel.__hostSeries = seriesModel; - } - else { - markerModel.mergeOption(markerOpt, ecModel, true); - } - seriesModel[modelPropName] = markerModel; - }, this); - } - }, - - formatTooltip: function (dataIndex) { - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var formattedValue = isArray(value) - ? map(value, addCommas$1).join(', ') : addCommas$1(value); - var name = data.getName(dataIndex); - var html = encodeHTML$1(this.name); - if (value != null || name) { - html += '
'; - } - if (name) { - html += encodeHTML$1(name); - if (value != null) { - html += ' : '; - } - } - if (value != null) { - html += encodeHTML$1(formattedValue); - } - return html; - }, - - getData: function () { - return this._data; - }, - - setData: function (data) { - this._data = data; - } +registerPreprocessor(function (opt) { + // Make sure markLine component is enabled + opt.markLine = opt.markLine || {}; }); -mixin(MarkerModel, dataFormatMixin); - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -85185,28 +88212,32 @@ mixin(MarkerModel, dataFormatMixin); MarkerModel.extend({ - type: 'markPoint', + type: 'markArea', defaultOption: { zlevel: 0, - z: 5, - symbol: 'pin', - symbolSize: 50, - //symbolRotate: 0, - //symbolOffset: [0, 0] + // PENDING + z: 1, tooltip: { trigger: 'item' }, + // markArea should fixed on the coordinate system + animation: false, label: { show: true, - position: 'inside' + position: 'top' }, itemStyle: { - borderWidth: 2 + // color and borderColor default to use color from series + // color: 'auto' + // borderColor: 'auto' + borderWidth: 0 }, + emphasis: { label: { - show: true + show: true, + position: 'top' } } } @@ -85231,223 +88262,316 @@ MarkerModel.extend({ * under the License. */ -var indexOf$2 = indexOf; +// TODO Better on polar -function hasXOrY(item) { - return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); -} +var markAreaTransform = function (seriesModel, coordSys, maModel, item) { + var lt = dataTransform(seriesModel, item[0]); + var rb = dataTransform(seriesModel, item[1]); + var retrieve$$1 = retrieve; -function hasXAndY(item) { - return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); -} + // FIXME make sure lt is less than rb + var ltCoord = lt.coord; + var rbCoord = rb.coord; + ltCoord[0] = retrieve$$1(ltCoord[0], -Infinity); + ltCoord[1] = retrieve$$1(ltCoord[1], -Infinity); -// Make it simple, do not visit all stacked value to count precision. -// function getPrecision(data, valueAxisDim, dataIndex) { -// var precision = -1; -// var stackedDim = data.mapDimension(valueAxisDim); -// do { -// precision = Math.max( -// numberUtil.getPrecision(data.get(stackedDim, dataIndex)), -// precision -// ); -// var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); -// if (stackedOnSeries) { -// var byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex); -// data = stackedOnSeries.getData(); -// dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue); -// stackedDim = data.getCalculationInfo('stackedDimension'); -// } -// else { -// data = null; -// } -// } while (data); + rbCoord[0] = retrieve$$1(rbCoord[0], Infinity); + rbCoord[1] = retrieve$$1(rbCoord[1], Infinity); -// return precision; -// } + // Merge option into one + var result = mergeAll([{}, lt, rb]); -function markerTypeCalculatorWithExtent( - mlType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex -) { - var coordArr = []; + result.coord = [ + lt.coord, rb.coord + ]; + result.x0 = lt.x; + result.y0 = lt.y; + result.x1 = rb.x; + result.y1 = rb.y; + return result; +}; - var stacked = isDimensionStacked(data, targetDataDim /*, otherDataDim*/); - var calcDataDim = stacked - ? data.getCalculationInfo('stackResultDimension') - : targetDataDim; +function isInifinity$1(val) { + return !isNaN(val) && !isFinite(val); +} - var value = numCalculate(data, calcDataDim, mlType); +// If a markArea has one dim +function ifMarkLineHasOnlyDim$1(dimIndex, fromCoord, toCoord, coordSys) { + var otherDimIndex = 1 - dimIndex; + return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]); +} - var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; - coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); - coordArr[targetCoordIndex] = data.get(targetDataDim, dataIndex); +function markAreaFilter(coordSys, item) { + var fromCoord = item.coord[0]; + var toCoord = item.coord[1]; + if (coordSys.type === 'cartesian2d') { + // In case + // { + // markArea: { + // data: [{ yAxis: 2 }] + // } + // } + if ( + fromCoord && toCoord + && (ifMarkLineHasOnlyDim$1(1, fromCoord, toCoord, coordSys) + || ifMarkLineHasOnlyDim$1(0, fromCoord, toCoord, coordSys)) + ) { + return true; + } + } + return dataFilter$1(coordSys, { + coord: fromCoord, + x: item.x0, + y: item.y0 + }) + || dataFilter$1(coordSys, { + coord: toCoord, + x: item.x1, + y: item.y1 + }); +} - // Make it simple, do not visit all stacked value to count precision. - var precision = getPrecision(data.get(targetDataDim, dataIndex)); - precision = Math.min(precision, 20); - if (precision >= 0) { - coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); +// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0'] +function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) { + var coordSys = seriesModel.coordinateSystem; + var itemModel = data.getItemModel(idx); + + var point; + var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); + var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } + else { + // Chart like bar may have there own marker positioning logic + if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition( + data.getValues(dims, idx) + ); + } + else { + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + var pt = [x, y]; + coordSys.clampData && coordSys.clampData(pt, pt); + point = coordSys.dataToPoint(pt, true); + } + if (coordSys.type === 'cartesian2d') { + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + if (isInifinity$1(x)) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); + } + else if (isInifinity$1(y)) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); + } + } + + // Use x, y if has any + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } } - return coordArr; + return point; } -var curry$6 = curry; -// TODO Specified percent -var markerTypeCalculator = { - /** - * @method - * @param {module:echarts/data/List} data - * @param {string} baseAxisDim - * @param {string} valueAxisDim - */ - min: curry$6(markerTypeCalculatorWithExtent, 'min'), - /** - * @method - * @param {module:echarts/data/List} data - * @param {string} baseAxisDim - * @param {string} valueAxisDim - */ - max: curry$6(markerTypeCalculatorWithExtent, 'max'), +var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']]; - /** - * @method - * @param {module:echarts/data/List} data - * @param {string} baseAxisDim - * @param {string} valueAxisDim - */ - average: curry$6(markerTypeCalculatorWithExtent, 'average') -}; +MarkerView.extend({ -/** - * Transform markPoint data item to format used in List by do the following - * 1. Calculate statistic like `max`, `min`, `average` - * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array - * @param {module:echarts/model/Series} seriesModel - * @param {module:echarts/coord/*} [coordSys] - * @param {Object} item - * @return {Object} - */ -function dataTransform(seriesModel, item) { - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; + type: 'markArea', - // 1. If not specify the position with pixel directly - // 2. If `coord` is not a data array. Which uses `xAxis`, - // `yAxis` to specify the coord on each dimension + // updateLayout: function (markAreaModel, ecModel, api) { + // ecModel.eachSeries(function (seriesModel) { + // var maModel = seriesModel.markAreaModel; + // if (maModel) { + // var areaData = maModel.getData(); + // areaData.each(function (idx) { + // var points = zrUtil.map(dimPermutations, function (dim) { + // return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + // }); + // // Layout + // areaData.setItemLayout(idx, points); + // var el = areaData.getItemGraphicEl(idx); + // el.setShape('points', points); + // }); + // } + // }, this); + // }, - // parseFloat first because item.x and item.y can be percent string like '20%' - if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) { - var dims = coordSys.dimensions; - var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); + updateTransform: function (markAreaModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var maModel = seriesModel.markAreaModel; + if (maModel) { + var areaData = maModel.getData(); + areaData.each(function (idx) { + var points = map(dimPermutations, function (dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + }); + // Layout + areaData.setItemLayout(idx, points); + var el = areaData.getItemGraphicEl(idx); + el.setShape('points', points); + }); + } + }, this); + }, - // Clone the option - // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value - item = clone(item); + renderSeries: function (seriesModel, maModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); - if (item.type - && markerTypeCalculator[item.type] - && axisInfo.baseAxis && axisInfo.valueAxis - ) { - var otherCoordIndex = indexOf$2(dims, axisInfo.baseAxis.dim); - var targetCoordIndex = indexOf$2(dims, axisInfo.valueAxis.dim); + var areaGroupMap = this.markerGroupMap; + var polygonGroup = areaGroupMap.get(seriesId) + || areaGroupMap.set(seriesId, {group: new Group()}); - item.coord = markerTypeCalculator[item.type]( - data, axisInfo.baseDataDim, axisInfo.valueDataDim, - otherCoordIndex, targetCoordIndex + this.group.add(polygonGroup.group); + polygonGroup.__keep = true; + + var areaData = createList$3(coordSys, seriesModel, maModel); + + // Line data for tooltip and formatter + maModel.setData(areaData); + + // Update visual and layout of line + areaData.each(function (idx) { + // Layout + areaData.setItemLayout(idx, map(dimPermutations, function (dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + })); + + // Visual + areaData.setItemVisual(idx, { + color: seriesData.getVisual('color') + }); + }); + + + areaData.diff(polygonGroup.__data) + .add(function (idx) { + var polygon = new Polygon({ + shape: { + points: areaData.getItemLayout(idx) + } + }); + areaData.setItemGraphicEl(idx, polygon); + polygonGroup.group.add(polygon); + }) + .update(function (newIdx, oldIdx) { + var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx); + updateProps(polygon, { + shape: { + points: areaData.getItemLayout(newIdx) + } + }, maModel, newIdx); + polygonGroup.group.add(polygon); + areaData.setItemGraphicEl(newIdx, polygon); + }) + .remove(function (idx) { + var polygon = polygonGroup.__data.getItemGraphicEl(idx); + polygonGroup.group.remove(polygon); + }) + .execute(); + + areaData.eachItemGraphicEl(function (polygon, idx) { + var itemModel = areaData.getItemModel(idx); + var labelModel = itemModel.getModel('label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + var color = areaData.getItemVisual(idx, 'color'); + polygon.useStyle( + defaults( + itemModel.getModel('itemStyle').getItemStyle(), + { + fill: modifyAlpha(color, 0.4), + stroke: color + } + ) ); - // Force to use the value of calculated value. - item.value = item.coord[targetCoordIndex]; - } - else { - // FIXME Only has one of xAxis and yAxis. - var coord = [ - item.xAxis != null ? item.xAxis : item.radiusAxis, - item.yAxis != null ? item.yAxis : item.angleAxis - ]; - // Each coord support max, min, average - for (var i = 0; i < 2; i++) { - if (markerTypeCalculator[coord[i]]) { - coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); + + polygon.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + + setLabelStyle( + polygon.style, polygon.hoverStyle, labelModel, labelHoverModel, + { + labelFetcher: maModel, + labelDataIndex: idx, + defaultText: areaData.getName(idx) || '', + isRectText: true, + autoColor: color } - } - item.coord = coord; - } - } - return item; -} + ); -function getAxisInfo$1(item, data, coordSys, seriesModel) { - var ret = {}; + setHoverStyle(polygon, {}); - if (item.valueIndex != null || item.valueDim != null) { - ret.valueDataDim = item.valueIndex != null - ? data.getDimension(item.valueIndex) : item.valueDim; - ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); - ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); - ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); - } - else { - ret.baseAxis = seriesModel.getBaseAxis(); - ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); - ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); - ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); - } + polygon.dataModel = maModel; + }); - return ret; -} + polygonGroup.__data = areaData; -function dataDimToCoordDim(seriesModel, dataDim) { - var data = seriesModel.getData(); - var dimensions = data.dimensions; - dataDim = data.getDimension(dataDim); - for (var i = 0; i < dimensions.length; i++) { - var dimItem = data.getDimensionInfo(dimensions[i]); - if (dimItem.name === dataDim) { - return dimItem.coordDim; - } + polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); } -} +}); /** - * Filter data which is out of coordinateSystem range - * [dataFilter description] - * @param {module:echarts/coord/*} [coordSys] - * @param {Object} item - * @return {boolean} + * @inner + * @param {module:echarts/coord/*} coordSys + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Model} mpModel */ -function dataFilter$1(coordSys, item) { - // Alwalys return true if there is no coordSys - return (coordSys && coordSys.containData && item.coord && !hasXOrY(item)) - ? coordSys.containData(item.coord) : true; -} - -function dimValueGetter(item, dimName, dataIndex, dimIndex) { - // x, y, radius, angle - if (dimIndex < 2) { - return item.coord && item.coord[dimIndex]; - } - return item.value; -} +function createList$3(coordSys, seriesModel, maModel) { -function numCalculate(data, valueDataDim, type) { - if (type === 'average') { - var sum = 0; - var count = 0; - data.each(valueDataDim, function (val, idx) { - if (!isNaN(val)) { - sum += val; - count++; - } + var coordDimsInfos; + var areaData; + var dims = ['x0', 'y0', 'x1', 'y1']; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var data = seriesModel.getData(); + var info = data.getDimensionInfo( + data.mapDimension(coordDim) + ) || {}; + // In map series data don't have lng and lat dimension. Fallback to same with coordSys + return defaults({name: coordDim}, info); }); - return sum / count; - } - else if (type === 'median') { - return data.getMedian(valueDataDim); + areaData = new List(map(dims, function (dim, idx) { + return { + name: dim, + type: coordDimsInfos[idx % 2].type + }; + }), maModel); } else { - // max & min - return data.getDataExtent(valueDataDim, true)[type === 'max' ? 1 : 0]; + coordDimsInfos = [{ + name: 'value', + type: 'float' + }]; + areaData = new List(coordDimsInfos, maModel); + } + + var optData = map(maModel.get('data'), curry( + markAreaTransform, seriesModel, coordSys, maModel + )); + if (coordSys) { + optData = filter( + optData, curry(markAreaFilter, coordSys) + ); } + + var dimValueGetter$$1 = coordSys ? function (item, dimName, dataIndex, dimIndex) { + return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; + } : function (item) { + return item.value; + }; + areaData.initData(optData, null, dimValueGetter$$1); + areaData.hasItemOption = true; + return areaData; } /* @@ -85469,37 +88593,9 @@ function numCalculate(data, valueDataDim, type) { * under the License. */ -var MarkerView = extendComponentView({ - - type: 'marker', - - init: function () { - /** - * Markline grouped by series - * @private - * @type {module:zrender/core/util.HashMap} - */ - this.markerGroupMap = createHashMap(); - }, - - render: function (markerModel, ecModel, api) { - var markerGroupMap = this.markerGroupMap; - markerGroupMap.each(function (item) { - item.__keep = false; - }); - - var markerModelKey = this.type + 'Model'; - ecModel.eachSeries(function (seriesModel) { - var markerModel = seriesModel[markerModelKey]; - markerModel && this.renderSeries(seriesModel, markerModel, ecModel, api); - }, this); - - markerGroupMap.each(function (item) { - !item.__keep && this.group.remove(item.group); - }, this); - }, - - renderSeries: function () {} +registerPreprocessor(function (opt) { + // Make sure markArea component is enabled + opt.markArea = opt.markArea || {}; }); /* @@ -85521,183 +88617,325 @@ var MarkerView = extendComponentView({ * under the License. */ -function updateMarkerLayout(mpData, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - mpData.each(function (idx) { - var itemModel = mpData.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); - var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } - // Chart like bar may have there own marker positioning logic - else if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition - point = seriesModel.getMarkerPosition( - mpData.getValues(mpData.dimensions, idx) - ); - } - else if (coordSys) { - var x = mpData.get(coordSys.dimensions[0], idx); - var y = mpData.get(coordSys.dimensions[1], idx); - point = coordSys.dataToPoint([x, y]); +var langSelector = lang.legend.selector; - } +var defaultSelectorOption = { + all: { + type: 'all', + title: clone(langSelector.all) + }, + inverse: { + type: 'inverse', + title: clone(langSelector.inverse) + } +}; - // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } - if (!isNaN(yPx)) { - point[1] = yPx; - } +var LegendModel = extendComponentModel({ - mpData.setItemLayout(idx, point); - }); -} + type: 'legend.plain', -MarkerView.extend({ + dependencies: ['series'], - type: 'markPoint', + layoutMode: { + type: 'box', + // legend.width/height are maxWidth/maxHeight actually, + // whereas realy width/height is calculated by its content. + // (Setting {left: 10, right: 10} does not make sense). + // So consider the case: + // `setOption({legend: {left: 10});` + // then `setOption({legend: {right: 10});` + // The previous `left` should be cleared by setting `ignoreSize`. + ignoreSize: true + }, - // updateLayout: function (markPointModel, ecModel, api) { - // ecModel.eachSeries(function (seriesModel) { - // var mpModel = seriesModel.markPointModel; - // if (mpModel) { - // updateMarkerLayout(mpModel.getData(), seriesModel, api); - // this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); - // } - // }, this); - // }, + init: function (option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); - updateTransform: function (markPointModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var mpModel = seriesModel.markPointModel; - if (mpModel) { - updateMarkerLayout(mpModel.getData(), seriesModel, api); - this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); + option.selected = option.selected || {}; + this._updateSelector(option); + }, + + mergeOption: function (option) { + LegendModel.superCall(this, 'mergeOption', option); + this._updateSelector(option); + }, + + _updateSelector: function (option) { + var selector = option.selector; + if (selector === true) { + selector = option.selector = ['all', 'inverse']; + } + if (isArray(selector)) { + each$1(selector, function (item, index) { + isString(item) && (item = {type: item}); + selector[index] = merge(item, defaultSelectorOption[item.type]); + }); + } + }, + + optionUpdated: function () { + this._updateData(this.ecModel); + + var legendData = this._data; + + // If selectedMode is single, try to select one + if (legendData[0] && this.get('selectedMode') === 'single') { + var hasSelected = false; + // If has any selected in option.selected + for (var i = 0; i < legendData.length; i++) { + var name = legendData[i].get('name'); + if (this.isSelected(name)) { + // Force to unselect others + this.select(name); + hasSelected = true; + break; + } } - }, this); + // Try select the first if selectedMode is single + !hasSelected && this.select(legendData[0].get('name')); + } }, - renderSeries: function (seriesModel, mpModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); + _updateData: function (ecModel) { + var potentialData = []; + var availableNames = []; - var symbolDrawMap = this.markerGroupMap; - var symbolDraw = symbolDrawMap.get(seriesId) - || symbolDrawMap.set(seriesId, new SymbolDraw()); + ecModel.eachRawSeries(function (seriesModel) { + var seriesName = seriesModel.name; + availableNames.push(seriesName); + var isPotential; - var mpData = createList$1(coordSys, seriesModel, mpModel); + if (seriesModel.legendVisualProvider) { + var provider = seriesModel.legendVisualProvider; + var names = provider.getAllNames(); - // FIXME - mpModel.setData(mpData); + if (!ecModel.isSeriesFiltered(seriesModel)) { + availableNames = availableNames.concat(names); + } - updateMarkerLayout(mpModel.getData(), seriesModel, api); + if (names.length) { + potentialData = potentialData.concat(names); + } + else { + isPotential = true; + } + } + else { + isPotential = true; + } - mpData.each(function (idx) { - var itemModel = mpData.getItemModel(idx); - var symbolSize = itemModel.getShallow('symbolSize'); - if (typeof symbolSize === 'function') { - // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据? - symbolSize = symbolSize( - mpModel.getRawValue(idx), mpModel.getDataParams(idx) - ); + if (isPotential && isNameSpecified(seriesModel)) { + potentialData.push(seriesModel.name); } - mpData.setItemVisual(idx, { - symbolSize: symbolSize, - color: itemModel.get('itemStyle.color') - || seriesData.getVisual('color'), - symbol: itemModel.getShallow('symbol') - }); }); - // TODO Text are wrong - symbolDraw.updateData(mpData); - this.group.add(symbolDraw.group); + /** + * @type {Array.} + * @private + */ + this._availableNames = availableNames; - // Set host model for tooltip - // FIXME - mpData.eachItemGraphicEl(function (el) { - el.traverse(function (child) { - child.dataModel = mpModel; + // If legend.data not specified in option, use availableNames as data, + // which is convinient for user preparing option. + var rawData = this.get('data') || potentialData; + + var legendData = map(rawData, function (dataItem) { + // Can be string or number + if (typeof dataItem === 'string' || typeof dataItem === 'number') { + dataItem = { + name: dataItem + }; + } + return new Model(dataItem, this, this.ecModel); + }, this); + + /** + * @type {Array.} + * @private + */ + this._data = legendData; + }, + + /** + * @return {Array.} + */ + getData: function () { + return this._data; + }, + + /** + * @param {string} name + */ + select: function (name) { + var selected = this.option.selected; + var selectedMode = this.get('selectedMode'); + if (selectedMode === 'single') { + var data = this._data; + each$1(data, function (dataItem) { + selected[dataItem.get('name')] = false; }); - }); + } + selected[name] = true; + }, - symbolDraw.__keep = true; + /** + * @param {string} name + */ + unSelect: function (name) { + if (this.get('selectedMode') !== 'single') { + this.option.selected[name] = false; + } + }, - symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); - } -}); + /** + * @param {string} name + */ + toggleSelected: function (name) { + var selected = this.option.selected; + // Default is true + if (!selected.hasOwnProperty(name)) { + selected[name] = true; + } + this[selected[name] ? 'unSelect' : 'select'](name); + }, -/** - * @inner - * @param {module:echarts/coord/*} [coordSys] - * @param {module:echarts/model/Series} seriesModel - * @param {module:echarts/model/Model} mpModel - */ -function createList$1(coordSys, seriesModel, mpModel) { - var coordDimsInfos; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var info = seriesModel.getData().getDimensionInfo( - seriesModel.getData().mapDimension(coordDim) - ) || {}; - // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return defaults({name: coordDim}, info); + allSelect: function () { + var data = this._data; + var selected = this.option.selected; + each$1(data, function (dataItem) { + selected[dataItem.get('name', true)] = true; }); - } - else { - coordDimsInfos =[{ - name: 'value', - type: 'float' - }]; - } + }, - var mpData = new List(coordDimsInfos, mpModel); - var dataOpt = map(mpModel.get('data'), curry( - dataTransform, seriesModel - )); - if (coordSys) { - dataOpt = filter( - dataOpt, curry(dataFilter$1, coordSys) - ); - } + inverseSelect: function () { + var data = this._data; + var selected = this.option.selected; + each$1(data, function (dataItem) { + var name = dataItem.get('name', true); + // Initially, default value is true + if (!selected.hasOwnProperty(name)) { + selected[name] = true; + } + selected[name] = !selected[name]; + }); + }, - mpData.initData(dataOpt, null, - coordSys ? dimValueGetter : function (item) { - return item.value; - } - ); + /** + * @param {string} name + */ + isSelected: function (name) { + var selected = this.option.selected; + return !(selected.hasOwnProperty(name) && !selected[name]) + && indexOf(this._availableNames, name) >= 0; + }, - return mpData; -} + getOrient: function () { + return this.get('orient') === 'vertical' + ? {index: 1, name: 'vertical'} + : {index: 0, name: 'horizontal'}; + }, -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + defaultOption: { + // 一级层叠 + zlevel: 0, + // 二级层叠 + z: 4, + show: true, -// HINT Markpoint can't be used too much -registerPreprocessor(function (opt) { - // Make sure markPoint component is enabled - opt.markPoint = opt.markPoint || {}; + // 布局方式,默认为水平布局,可选为: + // 'horizontal' | 'vertical' + orient: 'horizontal', + + left: 'center', + // right: 'center', + + top: 0, + // bottom: null, + + // 水平对齐 + // 'auto' | 'left' | 'right' + // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐 + align: 'auto', + + backgroundColor: 'rgba(0,0,0,0)', + // 图例边框颜色 + borderColor: '#ccc', + borderRadius: 0, + // 图例边框线宽,单位px,默认为0(无边框) + borderWidth: 0, + // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + padding: 5, + // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemGap: 10, + // the width of legend symbol + itemWidth: 25, + // the height of legend symbol + itemHeight: 14, + + // the color of unselected legend symbol + inactiveColor: '#ccc', + + // the borderColor of unselected legend symbol + inactiveBorderColor: '#ccc', + + itemStyle: { + // the default borderWidth of legend symbol + borderWidth: 0 + }, + + textStyle: { + // 图例文字颜色 + color: '#333' + }, + // formatter: '', + // 选择模式,默认开启图例开关 + selectedMode: true, + // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 + // selected: null, + // 图例内容(详见legend.data,数组中每一项代表一个item + // data: [], + + // Usage: + // selector: [{type: 'all or inverse', title: xxx}] + // or + // selector: true + // or + // selector: ['all', 'inverse'] + selector: false, + + selectorLabel: { + show: true, + borderRadius: 10, + padding: [3, 5, 3, 5], + fontSize: 12, + fontFamily: ' sans-serif', + color: '#666', + borderWidth: 1, + borderColor: '#666' + }, + + emphasis: { + selectorLabel: { + show: true, + color: '#eee', + backgroundColor: '#666' + } + }, + + // Value can be 'start' or 'end' + selectorPosition: 'auto', + + selectorItemGap: 7, + + selectorButtonGap: 10, + + // Tooltip 相关配置 + tooltip: { + show: false + } + } }); /* @@ -85719,41 +88957,96 @@ registerPreprocessor(function (opt) { * under the License. */ -MarkerModel.extend({ - - type: 'markLine', +function legendSelectActionHandler(methodName, payload, ecModel) { + var selectedMap = {}; + var isToggleSelect = methodName === 'toggleSelected'; + var isSelected; + // Update all legend components + ecModel.eachComponent('legend', function (legendModel) { + if (isToggleSelect && isSelected != null) { + // Force other legend has same selected status + // Or the first is toggled to true and other are toggled to false + // In the case one legend has some item unSelected in option. And if other legend + // doesn't has the item, they will assume it is selected. + legendModel[isSelected ? 'select' : 'unSelect'](payload.name); + } + else if (methodName === 'allSelect' || methodName === 'inverseSelect') { + legendModel[methodName](); + } + else { + legendModel[methodName](payload.name); + isSelected = legendModel.isSelected(payload.name); + } + var legendData = legendModel.getData(); + each$1(legendData, function (model) { + var name = model.get('name'); + // Wrap element + if (name === '\n' || name === '') { + return; + } + var isItemSelected = legendModel.isSelected(name); + if (selectedMap.hasOwnProperty(name)) { + // Unselected if any legend is unselected + selectedMap[name] = selectedMap[name] && isItemSelected; + } + else { + selectedMap[name] = isItemSelected; + } + }); + }); + // Return the event explicitly + return (methodName === 'allSelect' || methodName === 'inverseSelect') + ? { + selected: selectedMap + } + : { + name: payload.name, + selected: selectedMap + }; +} +/** + * @event legendToggleSelect + * @type {Object} + * @property {string} type 'legendToggleSelect' + * @property {string} [from] + * @property {string} name Series name or data item name + */ +registerAction( + 'legendToggleSelect', 'legendselectchanged', + curry(legendSelectActionHandler, 'toggleSelected') +); - defaultOption: { - zlevel: 0, - z: 5, +registerAction( + 'legendAllSelect', 'legendselectall', + curry(legendSelectActionHandler, 'allSelect') +); - symbol: ['circle', 'arrow'], - symbolSize: [8, 16], +registerAction( + 'legendInverseSelect', 'legendinverseselect', + curry(legendSelectActionHandler, 'inverseSelect') +); - //symbolRotate: 0, +/** + * @event legendSelect + * @type {Object} + * @property {string} type 'legendSelect' + * @property {string} name Series name or data item name + */ +registerAction( + 'legendSelect', 'legendselected', + curry(legendSelectActionHandler, 'select') +); - precision: 2, - tooltip: { - trigger: 'item' - }, - label: { - show: true, - position: 'end' - }, - lineStyle: { - type: 'dashed' - }, - emphasis: { - label: { - show: true - }, - lineStyle: { - width: 3 - } - }, - animationEasing: 'linear' - } -}); +/** + * @event legendUnSelect + * @type {Object} + * @property {string} type 'legendUnSelect' + * @property {string} name Series name or data item name + */ +registerAction( + 'legendUnSelect', 'legendunselected', + curry(legendSelectActionHandler, 'unSelect') +); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -85774,806 +89067,537 @@ MarkerModel.extend({ * under the License. */ -var markLineTransform = function (seriesModel, coordSys, mlModel, item) { - var data = seriesModel.getData(); - // Special type markLine like 'min', 'max', 'average', 'median' - var mlType = item.type; +var curry$6 = curry; +var each$25 = each$1; +var Group$3 = Group; - if (!isArray(item) - && ( - mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' - // In case - // data: [{ - // yAxis: 10 - // }] - || (item.xAxis != null || item.yAxis != null) - ) - ) { - var valueAxis; - var valueDataDim; - var value; +var LegendView = extendComponentView({ - if (item.yAxis != null || item.xAxis != null) { - valueDataDim = item.yAxis != null ? 'y' : 'x'; - valueAxis = coordSys.getAxis(valueDataDim); + type: 'legend.plain', - value = retrieve(item.yAxis, item.xAxis); - } - else { - var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); - valueDataDim = axisInfo.valueDataDim; - valueAxis = axisInfo.valueAxis; - value = numCalculate(data, valueDataDim, mlType); - } - var valueIndex = valueDataDim === 'x' ? 0 : 1; - var baseIndex = 1 - valueIndex; + newlineDisabled: false, - var mlFrom = clone(item); - var mlTo = {}; + /** + * @override + */ + init: function () { - mlFrom.type = null; + /** + * @private + * @type {module:zrender/container/Group} + */ + this.group.add(this._contentGroup = new Group$3()); - mlFrom.coord = []; - mlTo.coord = []; - mlFrom.coord[baseIndex] = -Infinity; - mlTo.coord[baseIndex] = Infinity; + /** + * @private + * @type {module:zrender/Element} + */ + this._backgroundEl; - var precision = mlModel.get('precision'); - if (precision >= 0 && typeof value === 'number') { - value = +value.toFixed(Math.min(precision, 20)); - } + /** + * @private + * @type {module:zrender/container/Group} + */ + this.group.add(this._selectorGroup = new Group$3()); - mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; + /** + * If first rendering, `contentGroup.position` is [0, 0], which + * does not make sense and may cause unexepcted animation if adopted. + * @private + * @type {boolean} + */ + this._isFirstRender = true; + }, - item = [mlFrom, mlTo, { // Extra option for tooltip and label - type: mlType, - valueIndex: item.valueIndex, - // Force to use the value of calculated value. - value: value - }]; - } - - item = [ - dataTransform(seriesModel, item[0]), - dataTransform(seriesModel, item[1]), - extend({}, item[2]) - ]; - - // Avoid line data type is extended by from(to) data type - item[2].type = item[2].type || ''; - - // Merge from option and to option into line option - merge(item[2], item[0]); - merge(item[2], item[1]); + /** + * @protected + */ + getContentGroup: function () { + return this._contentGroup; + }, - return item; -}; + /** + * @protected + */ + getSelectorGroup: function () { + return this._selectorGroup; + }, -function isInifinity(val) { - return !isNaN(val) && !isFinite(val); -} + /** + * @override + */ + render: function (legendModel, ecModel, api) { + var isFirstRender = this._isFirstRender; + this._isFirstRender = false; -// If a markLine has one dim -function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - var dimName = coordSys.dimensions[dimIndex]; - return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) - && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); -} + this.resetInner(); -function markLineFilter(coordSys, item) { - if (coordSys.type === 'cartesian2d') { - var fromCoord = item[0].coord; - var toCoord = item[1].coord; - // In case - // { - // markLine: { - // data: [{ yAxis: 2 }] - // } - // } - if ( - fromCoord && toCoord && - (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) - || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys)) - ) { - return true; + if (!legendModel.get('show', true)) { + return; } - } - return dataFilter$1(coordSys, item[0]) - && dataFilter$1(coordSys, item[1]); -} - -function updateSingleMarkerEndLayout( - data, idx, isFrom, seriesModel, api -) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); - var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } - else { - // Chart like bar may have there own marker positioning logic - if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition - point = seriesModel.getMarkerPosition( - data.getValues(data.dimensions, idx) - ); - } - else { - var dims = coordSys.dimensions; - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - point = coordSys.dataToPoint([x, y]); - } - // Expand line to the edge of grid if value on one axis is Inifnity - // In case - // markLine: { - // data: [{ - // yAxis: 2 - // // or - // type: 'average' - // }] - // } - if (coordSys.type === 'cartesian2d') { - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - var dims = coordSys.dimensions; - if (isInifinity(data.get(dims[0], idx))) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); - } - else if (isInifinity(data.get(dims[1], idx))) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); - } + var itemAlign = legendModel.get('align'); + var orient = legendModel.get('orient'); + if (!itemAlign || itemAlign === 'auto') { + itemAlign = ( + legendModel.get('left') === 'right' + && orient === 'vertical' + ) ? 'right' : 'left'; } - // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } - if (!isNaN(yPx)) { - point[1] = yPx; + var selector = legendModel.get('selector', true); + var selectorPosition = legendModel.get('selectorPosition', true); + if (selector && (!selectorPosition || selectorPosition === 'auto')) { + selectorPosition = orient === 'horizontal' ? 'end' : 'start'; } - } - data.setItemLayout(idx, point); -} + this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); -MarkerView.extend({ + // Perform layout. + var positionInfo = legendModel.getBoxLayoutParams(); + var viewportSize = {width: api.getWidth(), height: api.getHeight()}; + var padding = legendModel.get('padding'); - type: 'markLine', + var maxSize = getLayoutRect(positionInfo, viewportSize, padding); - // updateLayout: function (markLineModel, ecModel, api) { - // ecModel.eachSeries(function (seriesModel) { - // var mlModel = seriesModel.markLineModel; - // if (mlModel) { - // var mlData = mlModel.getData(); - // var fromData = mlModel.__from; - // var toData = mlModel.__to; - // // Update visual and layout of from symbol and to symbol - // fromData.each(function (idx) { - // updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); - // updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); - // }); - // // Update layout of line - // mlData.each(function (idx) { - // mlData.setItemLayout(idx, [ - // fromData.getItemLayout(idx), - // toData.getItemLayout(idx) - // ]); - // }); + var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); - // this.markerGroupMap.get(seriesModel.id).updateLayout(); + // Place mainGroup, based on the calculated `mainRect`. + var layoutRect = getLayoutRect( + defaults({width: mainRect.width, height: mainRect.height}, positionInfo), + viewportSize, + padding + ); + this.group.attr('position', [layoutRect.x - mainRect.x, layoutRect.y - mainRect.y]); - // } - // }, this); - // }, + // Render background after group is layout. + this.group.add( + this._backgroundEl = makeBackground(mainRect, legendModel) + ); + }, - updateTransform: function (markLineModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var mlModel = seriesModel.markLineModel; - if (mlModel) { - var mlData = mlModel.getData(); - var fromData = mlModel.__from; - var toData = mlModel.__to; - // Update visual and layout of from symbol and to symbol - fromData.each(function (idx) { - updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); - updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); - }); - // Update layout of line - mlData.each(function (idx) { - mlData.setItemLayout(idx, [ - fromData.getItemLayout(idx), - toData.getItemLayout(idx) - ]); - }); + /** + * @protected + */ + resetInner: function () { + this.getContentGroup().removeAll(); + this._backgroundEl && this.group.remove(this._backgroundEl); + this.getSelectorGroup().removeAll(); + }, - this.markerGroupMap.get(seriesModel.id).updateLayout(); + /** + * @protected + */ + renderInner: function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { + var contentGroup = this.getContentGroup(); + var legendDrawnMap = createHashMap(); + var selectMode = legendModel.get('selectedMode'); - } - }, this); - }, + var excludeSeriesId = []; + ecModel.eachRawSeries(function (seriesModel) { + !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); + }); - renderSeries: function (seriesModel, mlModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); + each$25(legendModel.getData(), function (itemModel, dataIndex) { + var name = itemModel.get('name'); - var lineDrawMap = this.markerGroupMap; - var lineDraw = lineDrawMap.get(seriesId) - || lineDrawMap.set(seriesId, new LineDraw()); - this.group.add(lineDraw.group); + // Use empty string or \n as a newline string + if (!this.newlineDisabled && (name === '' || name === '\n')) { + contentGroup.add(new Group$3({ + newline: true + })); + return; + } - var mlData = createList$2(coordSys, seriesModel, mlModel); + // Representitive series. + var seriesModel = ecModel.getSeriesByName(name)[0]; - var fromData = mlData.from; - var toData = mlData.to; - var lineData = mlData.line; + if (legendDrawnMap.get(name)) { + // Have been drawed + return; + } - mlModel.__from = fromData; - mlModel.__to = toData; - // Line data for tooltip and formatter - mlModel.setData(lineData); + // Legend to control series. + if (seriesModel) { + var data = seriesModel.getData(); + var color = data.getVisual('color'); + var borderColor = data.getVisual('borderColor'); - var symbolType = mlModel.get('symbol'); - var symbolSize = mlModel.get('symbolSize'); - if (!isArray(symbolType)) { - symbolType = [symbolType, symbolType]; - } - if (typeof symbolSize === 'number') { - symbolSize = [symbolSize, symbolSize]; - } + // If color is a callback function + if (typeof color === 'function') { + // Use the first data + color = color(seriesModel.getDataParams(0)); + } - // Update visual and layout of from symbol and to symbol - mlData.from.each(function (idx) { - updateDataVisualAndLayout(fromData, idx, true); - updateDataVisualAndLayout(toData, idx, false); - }); + // If borderColor is a callback function + if (typeof borderColor === 'function') { + // Use the first data + borderColor = borderColor(seriesModel.getDataParams(0)); + } - // Update visual and layout of line - lineData.each(function (idx) { - var lineColor = lineData.getItemModel(idx).get('lineStyle.color'); - lineData.setItemVisual(idx, { - color: lineColor || fromData.getItemVisual(idx, 'color') - }); - lineData.setItemLayout(idx, [ - fromData.getItemLayout(idx), - toData.getItemLayout(idx) - ]); + // Using rect symbol defaultly + var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect'; + var symbolType = data.getVisual('symbol'); - lineData.setItemVisual(idx, { - 'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'), - 'fromSymbol': fromData.getItemVisual(idx, 'symbol'), - 'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'), - 'toSymbol': toData.getItemVisual(idx, 'symbol') - }); - }); + var itemGroup = this._createItem( + name, dataIndex, itemModel, legendModel, + legendSymbolType, symbolType, + itemAlign, color, borderColor, + selectMode + ); - lineDraw.updateData(lineData); + itemGroup.on('click', curry$6(dispatchSelectAction, name, null, api, excludeSeriesId)) + .on('mouseover', curry$6(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)) + .on('mouseout', curry$6(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId)); - // Set host model for tooltip - // FIXME - mlData.line.eachItemGraphicEl(function (el, idx) { - el.traverse(function (child) { - child.dataModel = mlModel; - }); - }); + legendDrawnMap.set(name, true); + } + else { + // Legend to control data. In pie and funnel. + ecModel.eachRawSeries(function (seriesModel) { - function updateDataVisualAndLayout(data, idx, isFrom) { - var itemModel = data.getItemModel(idx); + // In case multiple series has same data name + if (legendDrawnMap.get(name)) { + return; + } - updateSingleMarkerEndLayout( - data, idx, isFrom, seriesModel, api - ); + if (seriesModel.legendVisualProvider) { + var provider = seriesModel.legendVisualProvider; + if (!provider.containName(name)) { + return; + } - data.setItemVisual(idx, { - symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1], - symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1], - color: itemModel.get('itemStyle.color') || seriesData.getVisual('color') - }); - } + var idx = provider.indexOfName(name); - lineDraw.__keep = true; + var color = provider.getItemVisual(idx, 'color'); + var borderColor = provider.getItemVisual(idx, 'borderColor'); - lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); - } -}); + var legendSymbolType = 'roundRect'; -/** - * @inner - * @param {module:echarts/coord/*} coordSys - * @param {module:echarts/model/Series} seriesModel - * @param {module:echarts/model/Model} mpModel - */ -function createList$2(coordSys, seriesModel, mlModel) { + var itemGroup = this._createItem( + name, dataIndex, itemModel, legendModel, + legendSymbolType, null, + itemAlign, color, borderColor, + selectMode + ); - var coordDimsInfos; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var info = seriesModel.getData().getDimensionInfo( - seriesModel.getData().mapDimension(coordDim) - ) || {}; - // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return defaults({name: coordDim}, info); - }); - } - else { - coordDimsInfos =[{ - name: 'value', - type: 'float' - }]; - } + // FIXME: consider different series has items with the same name. + itemGroup.on('click', curry$6(dispatchSelectAction, null, name, api, excludeSeriesId)) + // Should not specify the series name, consider legend controls + // more than one pie series. + .on('mouseover', curry$6(dispatchHighlightAction, null, name, api, excludeSeriesId)) + .on('mouseout', curry$6(dispatchDownplayAction, null, name, api, excludeSeriesId)); - var fromData = new List(coordDimsInfos, mlModel); - var toData = new List(coordDimsInfos, mlModel); - // No dimensions - var lineData = new List([], mlModel); + legendDrawnMap.set(name, true); + } - var optData = map(mlModel.get('data'), curry( - markLineTransform, seriesModel, coordSys, mlModel - )); - if (coordSys) { - optData = filter( - optData, curry(markLineFilter, coordSys) - ); - } - var dimValueGetter$$1 = coordSys ? dimValueGetter : function (item) { - return item.value; - }; - fromData.initData( - map(optData, function (item) { return item[0]; }), - null, dimValueGetter$$1 - ); - toData.initData( - map(optData, function (item) { return item[1]; }), - null, dimValueGetter$$1 - ); - lineData.initData( - map(optData, function (item) { return item[2]; }) - ); - lineData.hasItemOption = true; + }, this); + } - return { - from: fromData, - to: toData, - line: lineData - }; -} + if (__DEV__) { + if (!legendDrawnMap.get(name)) { + console.warn( + name + ' series not exists. Legend data should be same with series name or data name.' + ); + } + } + }, this); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + if (selector) { + this._createSelector(selector, legendModel, api, orient, selectorPosition); + } + }, -registerPreprocessor(function (opt) { - // Make sure markLine component is enabled - opt.markLine = opt.markLine || {}; -}); + _createSelector: function (selector, legendModel, api, orient, selectorPosition) { + var selectorGroup = this.getSelectorGroup(); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + each$25(selector, function (selectorItem) { + createSelectorButton(selectorItem); + }); -MarkerModel.extend({ + function createSelectorButton(selectorItem) { + var type = selectorItem.type; - type: 'markArea', + var labelText = new Text({ + style: { + x: 0, + y: 0, + align: 'center', + verticalAlign: 'middle' + }, + onclick: function () { + api.dispatchAction({ + type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect' + }); + } + }); - defaultOption: { - zlevel: 0, - // PENDING - z: 1, - tooltip: { - trigger: 'item' - }, - // markArea should fixed on the coordinate system - animation: false, - label: { - show: true, - position: 'top' - }, - itemStyle: { - // color and borderColor default to use color from series - // color: 'auto' - // borderColor: 'auto' - borderWidth: 0 - }, + selectorGroup.add(labelText); - emphasis: { - label: { - show: true, - position: 'top' - } + var labelModel = legendModel.getModel('selectorLabel'); + var emphasisLabelModel = legendModel.getModel('emphasis.selectorLabel'); + + setLabelStyle( + labelText.style, labelText.hoverStyle = {}, labelModel, emphasisLabelModel, + { + defaultText: selectorItem.title, + isRectText: false + } + ); + setHoverStyle(labelText); } - } -}); + }, -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + _createItem: function ( + name, dataIndex, itemModel, legendModel, + legendSymbolType, symbolType, + itemAlign, color, borderColor, selectMode + ) { + var itemWidth = legendModel.get('itemWidth'); + var itemHeight = legendModel.get('itemHeight'); + var inactiveColor = legendModel.get('inactiveColor'); + var inactiveBorderColor = legendModel.get('inactiveBorderColor'); + var symbolKeepAspect = legendModel.get('symbolKeepAspect'); + var legendModelItemStyle = legendModel.getModel('itemStyle'); -// TODO Better on polar + var isSelected = legendModel.isSelected(name); + var itemGroup = new Group$3(); -var markAreaTransform = function (seriesModel, coordSys, maModel, item) { - var lt = dataTransform(seriesModel, item[0]); - var rb = dataTransform(seriesModel, item[1]); - var retrieve$$1 = retrieve; + var textStyleModel = itemModel.getModel('textStyle'); - // FIXME make sure lt is less than rb - var ltCoord = lt.coord; - var rbCoord = rb.coord; - ltCoord[0] = retrieve$$1(ltCoord[0], -Infinity); - ltCoord[1] = retrieve$$1(ltCoord[1], -Infinity); + var itemIcon = itemModel.get('icon'); - rbCoord[0] = retrieve$$1(rbCoord[0], Infinity); - rbCoord[1] = retrieve$$1(rbCoord[1], Infinity); - - // Merge option into one - var result = mergeAll([{}, lt, rb]); - - result.coord = [ - lt.coord, rb.coord - ]; - result.x0 = lt.x; - result.y0 = lt.y; - result.x1 = rb.x; - result.y1 = rb.y; - return result; -}; - -function isInifinity$1(val) { - return !isNaN(val) && !isFinite(val); -} + var tooltipModel = itemModel.getModel('tooltip'); + var legendGlobalTooltipModel = tooltipModel.parentModel; -// If a markArea has one dim -function ifMarkLineHasOnlyDim$1(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]); -} + // Use user given icon first + legendSymbolType = itemIcon || legendSymbolType; + var legendSymbol = createSymbol( + legendSymbolType, + 0, + 0, + itemWidth, + itemHeight, + isSelected ? color : inactiveColor, + // symbolKeepAspect default true for legend + symbolKeepAspect == null ? true : symbolKeepAspect + ); + itemGroup.add( + setSymbolStyle( + legendSymbol, legendSymbolType, legendModelItemStyle, + borderColor, inactiveBorderColor, isSelected + ) + ); -function markAreaFilter(coordSys, item) { - var fromCoord = item.coord[0]; - var toCoord = item.coord[1]; - if (coordSys.type === 'cartesian2d') { - // In case - // { - // markArea: { - // data: [{ yAxis: 2 }] - // } - // } - if ( - fromCoord && toCoord && - (ifMarkLineHasOnlyDim$1(1, fromCoord, toCoord, coordSys) - || ifMarkLineHasOnlyDim$1(0, fromCoord, toCoord, coordSys)) + // Compose symbols + // PENDING + if (!itemIcon && symbolType + // At least show one symbol, can't be all none + && ((symbolType !== legendSymbolType) || symbolType === 'none') ) { - return true; - } - } - return dataFilter$1(coordSys, { - coord: fromCoord, - x: item.x0, - y: item.y0 - }) - || dataFilter$1(coordSys, { - coord: toCoord, - x: item.x1, - y: item.y1 - }); -} - -// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0'] -function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - - var point; - var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); - var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } - else { - // Chart like bar may have there own marker positioning logic - if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition - point = seriesModel.getMarkerPosition( - data.getValues(dims, idx) - ); - } - else { - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - var pt = [x, y]; - coordSys.clampData && coordSys.clampData(pt, pt); - point = coordSys.dataToPoint(pt, true); - } - if (coordSys.type === 'cartesian2d') { - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - if (isInifinity$1(x)) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); - } - else if (isInifinity$1(y)) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); + var size = itemHeight * 0.8; + if (symbolType === 'none') { + symbolType = 'circle'; } + var legendSymbolCenter = createSymbol( + symbolType, + (itemWidth - size) / 2, + (itemHeight - size) / 2, + size, + size, + isSelected ? color : inactiveColor, + // symbolKeepAspect default true for legend + symbolKeepAspect == null ? true : symbolKeepAspect + ); + // Put symbol in the center + itemGroup.add( + setSymbolStyle( + legendSymbolCenter, symbolType, legendModelItemStyle, + borderColor, inactiveBorderColor, isSelected + ) + ); } - // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; + var textX = itemAlign === 'left' ? itemWidth + 5 : -5; + var textAlign = itemAlign; + + var formatter = legendModel.get('formatter'); + var content = name; + if (typeof formatter === 'string' && formatter) { + content = formatter.replace('{name}', name != null ? name : ''); } - if (!isNaN(yPx)) { - point[1] = yPx; + else if (typeof formatter === 'function') { + content = formatter(name); } - } - - return point; -} - -var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']]; - -MarkerView.extend({ - - type: 'markArea', - // updateLayout: function (markAreaModel, ecModel, api) { - // ecModel.eachSeries(function (seriesModel) { - // var maModel = seriesModel.markAreaModel; - // if (maModel) { - // var areaData = maModel.getData(); - // areaData.each(function (idx) { - // var points = zrUtil.map(dimPermutations, function (dim) { - // return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); - // }); - // // Layout - // areaData.setItemLayout(idx, points); - // var el = areaData.getItemGraphicEl(idx); - // el.setShape('points', points); - // }); - // } - // }, this); - // }, + itemGroup.add(new Text({ + style: setTextStyle({}, textStyleModel, { + text: content, + x: textX, + y: itemHeight / 2, + textFill: isSelected ? textStyleModel.getTextColor() : inactiveColor, + textAlign: textAlign, + textVerticalAlign: 'middle' + }) + })); - updateTransform: function (markAreaModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var maModel = seriesModel.markAreaModel; - if (maModel) { - var areaData = maModel.getData(); - areaData.each(function (idx) { - var points = map(dimPermutations, function (dim) { - return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); - }); - // Layout - areaData.setItemLayout(idx, points); - var el = areaData.getItemGraphicEl(idx); - el.setShape('points', points); - }); - } - }, this); - }, + // Add a invisible rect to increase the area of mouse hover + var hitRect = new Rect({ + shape: itemGroup.getBoundingRect(), + invisible: true, + tooltip: tooltipModel.get('show') ? extend({ + content: name, + // Defaul formatter + formatter: legendGlobalTooltipModel.get('formatter', true) || function () { + return name; + }, + formatterParams: { + componentType: 'legend', + legendIndex: legendModel.componentIndex, + name: name, + $vars: ['name'] + } + }, tooltipModel.option) : null + }); + itemGroup.add(hitRect); - renderSeries: function (seriesModel, maModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); + itemGroup.eachChild(function (child) { + child.silent = true; + }); - var areaGroupMap = this.markerGroupMap; - var polygonGroup = areaGroupMap.get(seriesId) - || areaGroupMap.set(seriesId, {group: new Group()}); + hitRect.silent = !selectMode; - this.group.add(polygonGroup.group); - polygonGroup.__keep = true; + this.getContentGroup().add(itemGroup); - var areaData = createList$3(coordSys, seriesModel, maModel); + setHoverStyle(itemGroup); - // Line data for tooltip and formatter - maModel.setData(areaData); + itemGroup.__legendDataIndex = dataIndex; - // Update visual and layout of line - areaData.each(function (idx) { - // Layout - areaData.setItemLayout(idx, map(dimPermutations, function (dim) { - return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); - })); + return itemGroup; + }, - // Visual - areaData.setItemVisual(idx, { - color: seriesData.getVisual('color') - }); - }); + /** + * @protected + */ + layoutInner: function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { + var contentGroup = this.getContentGroup(); + var selectorGroup = this.getSelectorGroup(); + // Place items in contentGroup. + box( + legendModel.get('orient'), + contentGroup, + legendModel.get('itemGap'), + maxSize.width, + maxSize.height + ); - areaData.diff(polygonGroup.__data) - .add(function (idx) { - var polygon = new Polygon({ - shape: { - points: areaData.getItemLayout(idx) - } - }); - areaData.setItemGraphicEl(idx, polygon); - polygonGroup.group.add(polygon); - }) - .update(function (newIdx, oldIdx) { - var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx); - updateProps(polygon, { - shape: { - points: areaData.getItemLayout(newIdx) - } - }, maModel, newIdx); - polygonGroup.group.add(polygon); - areaData.setItemGraphicEl(newIdx, polygon); - }) - .remove(function (idx) { - var polygon = polygonGroup.__data.getItemGraphicEl(idx); - polygonGroup.group.remove(polygon); - }) - .execute(); + var contentRect = contentGroup.getBoundingRect(); + var contentPos = [-contentRect.x, -contentRect.y]; - areaData.eachItemGraphicEl(function (polygon, idx) { - var itemModel = areaData.getItemModel(idx); - var labelModel = itemModel.getModel('label'); - var labelHoverModel = itemModel.getModel('emphasis.label'); - var color = areaData.getItemVisual(idx, 'color'); - polygon.useStyle( - defaults( - itemModel.getModel('itemStyle').getItemStyle(), - { - fill: modifyAlpha(color, 0.4), - stroke: color - } - ) + if (selector) { + // Place buttons in selectorGroup + box( + // Buttons in selectorGroup always layout horizontally + 'horizontal', + selectorGroup, + legendModel.get('selectorItemGap', true) ); - polygon.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + var selectorRect = selectorGroup.getBoundingRect(); + var selectorPos = [-selectorRect.x, -selectorRect.y]; + var selectorButtonGap = legendModel.get('selectorButtonGap', true); - setLabelStyle( - polygon.style, polygon.hoverStyle, labelModel, labelHoverModel, - { - labelFetcher: maModel, - labelDataIndex: idx, - defaultText: areaData.getName(idx) || '', - isRectText: true, - autoColor: color - } - ); + var orientIdx = legendModel.getOrient().index; + var wh = orientIdx === 0 ? 'width' : 'height'; + var hw = orientIdx === 0 ? 'height' : 'width'; + var yx = orientIdx === 0 ? 'y' : 'x'; - setHoverStyle(polygon, {}); + if (selectorPosition === 'end') { + selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap; + } + else { + contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap; + } - polygon.dataModel = maModel; - }); + //Always align selector to content as 'middle' + selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2; + selectorGroup.attr('position', selectorPos); + contentGroup.attr('position', contentPos); - polygonGroup.__data = areaData; + var mainRect = {x: 0, y: 0}; + mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]); + mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]); + return mainRect; + } + else { + contentGroup.attr('position', contentPos); + return this.group.getBoundingRect(); + } + }, - polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); + /** + * @protected + */ + remove: function () { + this.getContentGroup().removeAll(); + this._isFirstRender = true; } -}); -/** - * @inner - * @param {module:echarts/coord/*} coordSys - * @param {module:echarts/model/Series} seriesModel - * @param {module:echarts/model/Model} mpModel - */ -function createList$3(coordSys, seriesModel, maModel) { +}); - var coordDimsInfos; - var areaData; - var dims = ['x0', 'y0', 'x1', 'y1']; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var data = seriesModel.getData(); - var info = data.getDimensionInfo( - data.mapDimension(coordDim) - ) || {}; - // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return defaults({name: coordDim}, info); - }); - areaData = new List(map(dims, function (dim, idx) { - return { - name: dim, - type: coordDimsInfos[idx % 2].type - }; - }), maModel); +function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, isSelected) { + var itemStyle; + if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) { + itemStyle = legendModelItemStyle.getItemStyle(); + symbol.style.stroke = borderColor; + if (!isSelected) { + itemStyle.stroke = inactiveBorderColor; + } } else { - coordDimsInfos =[{ - name: 'value', - type: 'float' - }]; - areaData = new List(coordDimsInfos, maModel); - } - - var optData = map(maModel.get('data'), curry( - markAreaTransform, seriesModel, coordSys, maModel - )); - if (coordSys) { - optData = filter( - optData, curry(markAreaFilter, coordSys) - ); + itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']); } + return symbol.setStyle(itemStyle); +} - var dimValueGetter$$1 = coordSys ? function (item, dimName, dataIndex, dimIndex) { - return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; - } : function (item) { - return item.value; - }; - areaData.initData(optData, null, dimValueGetter$$1); - areaData.hasItemOption = true; - return areaData; +function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) { + // downplay before unselect + dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId); + api.dispatchAction({ + type: 'legendToggleSelect', + name: seriesName != null ? seriesName : dataName + }); + // highlight after select + dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId); } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) { + // If element hover will move to a hoverLayer. + var el = api.getZr().storage.getDisplayList()[0]; + if (!(el && el.useHoverLayer)) { + api.dispatchAction({ + type: 'highlight', + seriesName: seriesName, + name: dataName, + excludeSeriesId: excludeSeriesId + }); + } +} -registerPreprocessor(function (opt) { - // Make sure markArea component is enabled - opt.markArea = opt.markArea || {}; -}); +function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) { + // If element hover will move to a hoverLayer. + var el = api.getZr().storage.getDisplayList()[0]; + if (!(el && el.useHoverLayer)) { + api.dispatchAction({ + type: 'downplay', + seriesName: seriesName, + name: dataName, + excludeSeriesId: excludeSeriesId + }); + } +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -86594,83 +89618,25 @@ registerPreprocessor(function (opt) { * under the License. */ -var preprocessor$3 = function (option) { - var timelineOpt = option && option.timeline; - - if (!isArray(timelineOpt)) { - timelineOpt = timelineOpt ? [timelineOpt] : []; - } - - each$1(timelineOpt, function (opt) { - if (!opt) { - return; - } +var legendFilter = function (ecModel) { - compatibleEC2(opt); + var legendModels = ecModel.findComponents({ + mainType: 'legend' }); -}; - -function compatibleEC2(opt) { - var type = opt.type; - - var ec2Types = {'number': 'value', 'time': 'time'}; - - // Compatible with ec2 - if (ec2Types[type]) { - opt.axisType = ec2Types[type]; - delete opt.type; - } - - transferItem(opt); - - if (has$2(opt, 'controlPosition')) { - var controlStyle = opt.controlStyle || (opt.controlStyle = {}); - if (!has$2(controlStyle, 'position')) { - controlStyle.position = opt.controlPosition; - } - if (controlStyle.position === 'none' && !has$2(controlStyle, 'show')) { - controlStyle.show = false; - delete controlStyle.position; - } - delete opt.controlPosition; - } - - each$1(opt.data || [], function (dataItem) { - if (isObject$1(dataItem) && !isArray(dataItem)) { - if (!has$2(dataItem, 'value') && has$2(dataItem, 'name')) { - // In ec2, using name as value. - dataItem.value = dataItem.name; + if (legendModels && legendModels.length) { + ecModel.filterSeries(function (series) { + // If in any legend component the status is not selected. + // Because in legend series is assumed selected when it is not in the legend data. + for (var i = 0; i < legendModels.length; i++) { + if (!legendModels[i].isSelected(series.name)) { + return false; + } } - transferItem(dataItem); - } - }); -} - -function transferItem(opt) { - var itemStyle = opt.itemStyle || (opt.itemStyle = {}); - - var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); - - // Transfer label out - var label = opt.label || (opt.label || {}); - var labelNormal = label.normal || (label.normal = {}); - var excludeLabelAttr = {normal: 1, emphasis: 1}; - - each$1(label, function (value, name) { - if (!excludeLabelAttr[name] && !has$2(labelNormal, name)) { - labelNormal[name] = value; - } - }); - - if (itemStyleEmphasis.label && !has$2(label, 'emphasis')) { - label.emphasis = itemStyleEmphasis.label; - delete itemStyleEmphasis.label; + return true; + }); } -} -function has$2(obj, attr) { - return obj.hasOwnProperty(attr); -} +}; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -86691,9 +89657,15 @@ function has$2(obj, attr) { * under the License. */ -ComponentModel.registerSubTypeDefaulter('timeline', function () { - // Only slider now. - return 'slider'; + +// Do not contain scrollable legend, for sake of file size. + +// Series Filter +registerProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter); + +ComponentModel.registerSubTypeDefaulter('legend', function () { + // Default 'plain' when no type specified. + return 'plain'; }); /* @@ -86715,41 +89687,68 @@ ComponentModel.registerSubTypeDefaulter('timeline', function () { * under the License. */ -registerAction( - - {type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'}, +var ScrollableLegendModel = LegendModel.extend({ - function (payload, ecModel) { + type: 'legend.scroll', - var timelineModel = ecModel.getComponent('timeline'); - if (timelineModel && payload.currentIndex != null) { - timelineModel.setCurrentIndex(payload.currentIndex); + /** + * @param {number} scrollDataIndex + */ + setScrollDataIndex: function (scrollDataIndex) { + this.option.scrollDataIndex = scrollDataIndex; + }, - if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) { - timelineModel.setPlayState(false); - } - } + defaultOption: { + scrollDataIndex: 0, + pageButtonItemGap: 5, + pageButtonGap: null, + pageButtonPosition: 'end', // 'start' or 'end' + pageFormatter: '{current}/{total}', // If null/undefined, do not show page. + pageIcons: { + horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'], + vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z'] + }, + pageIconColor: '#2f4554', + pageIconInactiveColor: '#aaa', + pageIconSize: 15, // Can be [10, 3], which represents [width, height] + pageTextStyle: { + color: '#333' + }, - // Set normalized currentIndex to payload. - ecModel.resetOption('timeline'); + animationDurationUpdate: 800 + }, - return defaults({ - currentIndex: timelineModel.option.currentIndex - }, payload); - } -); + /** + * @override + */ + init: function (option, parentModel, ecModel, extraOpt) { + var inputPositionParams = getLayoutParams(option); -registerAction( + ScrollableLegendModel.superCall(this, 'init', option, parentModel, ecModel, extraOpt); - {type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update'}, + mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams); + }, - function (payload, ecModel) { - var timelineModel = ecModel.getComponent('timeline'); - if (timelineModel && payload.playState != null) { - timelineModel.setPlayState(payload.playState); - } + /** + * @override + */ + mergeOption: function (option, extraOpt) { + ScrollableLegendModel.superCall(this, 'mergeOption', option, extraOpt); + + mergeAndNormalizeLayoutParams$1(this, this.option, option); } -); + +}); + +// Do not `ignoreSize` to enable setting {left: 10, right: 10}. +function mergeAndNormalizeLayoutParams$1(legendModel, target, raw) { + var orient = legendModel.getOrient(); + var ignoreSize = [1, 1]; + ignoreSize[orient.index] = 0; + mergeLayoutParam(target, raw, { + type: 'box', ignoreSize: ignoreSize + }); +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -86770,179 +89769,467 @@ registerAction( * under the License. */ -var TimelineModel = ComponentModel.extend({ - - type: 'timeline', - - layoutMode: 'box', - - /** - * @protected - */ - defaultOption: { - - zlevel: 0, // 一级层叠 - z: 4, // 二级层叠 - show: true, +/** + * Separate legend and scrollable legend to reduce package size. + */ - axisType: 'time', // 模式是时间类型,支持 value, category +var Group$4 = Group; - realtime: true, +var WH$1 = ['width', 'height']; +var XY$1 = ['x', 'y']; - left: '20%', - top: null, - right: '20%', - bottom: 0, - width: null, - height: 40, - padding: 5, +var ScrollableLegendView = LegendView.extend({ - controlPosition: 'left', // 'left' 'right' 'top' 'bottom' 'none' - autoPlay: false, - rewind: false, // 反向播放 - loop: true, - playInterval: 2000, // 播放时间间隔,单位ms + type: 'legend.scroll', - currentIndex: 0, + newlineDisabled: true, - itemStyle: {}, - label: { - color: '#000' - }, + init: function () { - data: [] - }, + ScrollableLegendView.superCall(this, 'init'); - /** - * @override - */ - init: function (option, parentModel, ecModel) { + /** + * @private + * @type {number} For `scroll`. + */ + this._currentIndex = 0; /** * @private - * @type {module:echarts/data/List} + * @type {module:zrender/container/Group} */ - this._data; + this.group.add(this._containerGroup = new Group$4()); + this._containerGroup.add(this.getContentGroup()); /** * @private - * @type {Array.} + * @type {module:zrender/container/Group} */ - this._names; + this.group.add(this._controllerGroup = new Group$4()); - this.mergeDefaultAndTheme(option, ecModel); - this._initData(); + /** + * + * @private + */ + this._showController; }, /** * @override */ - mergeOption: function (option) { - TimelineModel.superApply(this, 'mergeOption', arguments); - this._initData(); + resetInner: function () { + ScrollableLegendView.superCall(this, 'resetInner'); + + this._controllerGroup.removeAll(); + this._containerGroup.removeClipPath(); + this._containerGroup.__rectSize = null; }, /** - * @param {number} [currentIndex] + * @override */ - setCurrentIndex: function (currentIndex) { - if (currentIndex == null) { - currentIndex = this.option.currentIndex; - } - var count = this._data.count(); + renderInner: function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { + var me = this; - if (this.option.loop) { - currentIndex = (currentIndex % count + count) % count; - } - else { - currentIndex >= count && (currentIndex = count - 1); - currentIndex < 0 && (currentIndex = 0); + // Render content items. + ScrollableLegendView.superCall(this, 'renderInner', itemAlign, + legendModel, ecModel, api, selector, orient, selectorPosition); + + var controllerGroup = this._controllerGroup; + + // FIXME: support be 'auto' adapt to size number text length, + // e.g., '3/12345' should not overlap with the control arrow button. + var pageIconSize = legendModel.get('pageIconSize', true); + if (!isArray(pageIconSize)) { + pageIconSize = [pageIconSize, pageIconSize]; } - this.option.currentIndex = currentIndex; + createPageButton('pagePrev', 0); + + var pageTextStyleModel = legendModel.getModel('pageTextStyle'); + controllerGroup.add(new Text({ + name: 'pageText', + style: { + textFill: pageTextStyleModel.getTextColor(), + font: pageTextStyleModel.getFont(), + textVerticalAlign: 'middle', + textAlign: 'center' + }, + silent: true + })); + + createPageButton('pageNext', 1); + + function createPageButton(name, iconIdx) { + var pageDataIndexName = name + 'DataIndex'; + var icon = createIcon( + legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], + { + // Buttons will be created in each render, so we do not need + // to worry about avoiding using legendModel kept in scope. + onclick: bind( + me._pageGo, me, pageDataIndexName, legendModel, api + ) + }, + { + x: -pageIconSize[0] / 2, + y: -pageIconSize[1] / 2, + width: pageIconSize[0], + height: pageIconSize[1] + } + ); + icon.name = name; + controllerGroup.add(icon); + } }, /** - * @return {number} currentIndex + * @override */ - getCurrentIndex: function () { - return this.option.currentIndex; + layoutInner: function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { + var selectorGroup = this.getSelectorGroup(); + + var orientIdx = legendModel.getOrient().index; + var wh = WH$1[orientIdx]; + var xy = XY$1[orientIdx]; + var hw = WH$1[1 - orientIdx]; + var yx = XY$1[1 - orientIdx]; + + selector && box( + // Buttons in selectorGroup always layout horizontally + 'horizontal', + selectorGroup, + legendModel.get('selectorItemGap', true) + ); + + var selectorButtonGap = legendModel.get('selectorButtonGap', true); + var selectorRect = selectorGroup.getBoundingRect(); + var selectorPos = [-selectorRect.x, -selectorRect.y]; + + var processMaxSize = clone(maxSize); + selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap); + + var mainRect = this._layoutContentAndController(legendModel, isFirstRender, + processMaxSize, orientIdx, wh, hw, yx + ); + + if (selector) { + if (selectorPosition === 'end') { + selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap; + } + else { + var offset = selectorRect[wh] + selectorButtonGap; + selectorPos[orientIdx] -= offset; + mainRect[xy] -= offset; + } + mainRect[wh] += selectorRect[wh] + selectorButtonGap; + + selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2; + mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]); + mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]); + + selectorGroup.attr('position', selectorPos); + } + + return mainRect; }, - /** - * @return {boolean} - */ - isIndexMax: function () { - return this.getCurrentIndex() >= this._data.count() - 1; + _layoutContentAndController: function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx) { + var contentGroup = this.getContentGroup(); + var containerGroup = this._containerGroup; + var controllerGroup = this._controllerGroup; + + // Place items in contentGroup. + box( + legendModel.get('orient'), + contentGroup, + legendModel.get('itemGap'), + !orientIdx ? null : maxSize.width, + orientIdx ? null : maxSize.height + ); + + box( + // Buttons in controller are layout always horizontally. + 'horizontal', + controllerGroup, + legendModel.get('pageButtonItemGap', true) + ); + + var contentRect = contentGroup.getBoundingRect(); + var controllerRect = controllerGroup.getBoundingRect(); + var showController = this._showController = contentRect[wh] > maxSize[wh]; + + var contentPos = [-contentRect.x, -contentRect.y]; + // Remain contentPos when scroll animation perfroming. + // If first rendering, `contentGroup.position` is [0, 0], which + // does not make sense and may cause unexepcted animation if adopted. + if (!isFirstRender) { + contentPos[orientIdx] = contentGroup.position[orientIdx]; + } + + // Layout container group based on 0. + var containerPos = [0, 0]; + var controllerPos = [-controllerRect.x, -controllerRect.y]; + var pageButtonGap = retrieve2( + legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true) + ); + + // Place containerGroup and controllerGroup and contentGroup. + if (showController) { + var pageButtonPosition = legendModel.get('pageButtonPosition', true); + // controller is on the right / bottom. + if (pageButtonPosition === 'end') { + controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; + } + // controller is on the left / top. + else { + containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; + } + } + + // Always align controller to content as 'middle'. + controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; + + contentGroup.attr('position', contentPos); + containerGroup.attr('position', containerPos); + controllerGroup.attr('position', controllerPos); + + // Calculate `mainRect` and set `clipPath`. + // mainRect should not be calculated by `this.group.getBoundingRect()` + // for sake of the overflow. + var mainRect = {x: 0, y: 0}; + + // Consider content may be overflow (should be clipped). + mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); + + // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. + mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); + + containerGroup.__rectSize = maxSize[wh]; + if (showController) { + var clipShape = {x: 0, y: 0}; + clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); + clipShape[hw] = mainRect[hw]; + containerGroup.setClipPath(new Rect({shape: clipShape})); + // Consider content may be larger than container, container rect + // can not be obtained from `containerGroup.getBoundingRect()`. + containerGroup.__rectSize = clipShape[wh]; + } + else { + // Do not remove or ignore controller. Keep them set as placeholders. + controllerGroup.eachChild(function (child) { + child.attr({invisible: true, silent: true}); + }); + } + + // Content translate animation. + var pageInfo = this._getPageInfo(legendModel); + pageInfo.pageIndex != null && updateProps( + contentGroup, + {position: pageInfo.contentPosition}, + // When switch from "show controller" to "not show controller", view should be + // updated immediately without animation, otherwise causes weird effect. + showController ? legendModel : false + ); + + this._updatePageInfoView(legendModel, pageInfo); + + return mainRect; }, - /** - * @param {boolean} state true: play, false: stop - */ - setPlayState: function (state) { - this.option.autoPlay = !!state; + _pageGo: function (to, legendModel, api) { + var scrollDataIndex = this._getPageInfo(legendModel)[to]; + + scrollDataIndex != null && api.dispatchAction({ + type: 'legendScroll', + scrollDataIndex: scrollDataIndex, + legendId: legendModel.id + }); }, - /** - * @return {boolean} true: play, false: stop - */ - getPlayState: function () { - return !!this.option.autoPlay; + _updatePageInfoView: function (legendModel, pageInfo) { + var controllerGroup = this._controllerGroup; + + each$1(['pagePrev', 'pageNext'], function (name) { + var canJump = pageInfo[name + 'DataIndex'] != null; + var icon = controllerGroup.childOfName(name); + if (icon) { + icon.setStyle( + 'fill', + canJump + ? legendModel.get('pageIconColor', true) + : legendModel.get('pageIconInactiveColor', true) + ); + icon.cursor = canJump ? 'pointer' : 'default'; + } + }); + + var pageText = controllerGroup.childOfName('pageText'); + var pageFormatter = legendModel.get('pageFormatter'); + var pageIndex = pageInfo.pageIndex; + var current = pageIndex != null ? pageIndex + 1 : 0; + var total = pageInfo.pageCount; + + pageText && pageFormatter && pageText.setStyle( + 'text', + isString(pageFormatter) + ? pageFormatter.replace('{current}', current).replace('{total}', total) + : pageFormatter({current: current, total: total}) + ); }, /** - * @private + * @param {module:echarts/model/Model} legendModel + * @return {Object} { + * contentPosition: Array., null when data item not found. + * pageIndex: number, null when data item not found. + * pageCount: number, always be a number, can be 0. + * pagePrevDataIndex: number, null when no previous page. + * pageNextDataIndex: number, null when no next page. + * } */ - _initData: function () { - var thisOption = this.option; - var dataArr = thisOption.data || []; - var axisType = thisOption.axisType; - var names = this._names = []; + _getPageInfo: function (legendModel) { + var scrollDataIndex = legendModel.get('scrollDataIndex', true); + var contentGroup = this.getContentGroup(); + var containerRectSize = this._containerGroup.__rectSize; + var orientIdx = legendModel.getOrient().index; + var wh = WH$1[orientIdx]; + var xy = XY$1[orientIdx]; - if (axisType === 'category') { - var idxArr = []; - each$1(dataArr, function (item, index) { - var value = getDataItemValue(item); - var newItem; + var targetItemIndex = this._findTargetItemIndex(scrollDataIndex); + var children = contentGroup.children(); + var targetItem = children[targetItemIndex]; + var itemCount = children.length; + var pCount = !itemCount ? 0 : 1; - if (isObject$1(item)) { - newItem = clone(item); - newItem.value = index; - } - else { - newItem = index; - } + var result = { + contentPosition: contentGroup.position.slice(), + pageCount: pCount, + pageIndex: pCount - 1, + pagePrevDataIndex: null, + pageNextDataIndex: null + }; - idxArr.push(newItem); + if (!targetItem) { + return result; + } - if (!isString(value) && (value == null || isNaN(value))) { - value = ''; + var targetItemInfo = getItemInfo(targetItem); + result.contentPosition[orientIdx] = -targetItemInfo.s; + + // Strategy: + // (1) Always align based on the left/top most item. + // (2) It is user-friendly that the last item shown in the + // current window is shown at the begining of next window. + // Otherwise if half of the last item is cut by the window, + // it will have no chance to display entirely. + // (3) Consider that item size probably be different, we + // have calculate pageIndex by size rather than item index, + // and we can not get page index directly by division. + // (4) The window is to narrow to contain more than + // one item, we should make sure that the page can be fliped. + + for (var i = targetItemIndex + 1, + winStartItemInfo = targetItemInfo, + winEndItemInfo = targetItemInfo, + currItemInfo = null; + i <= itemCount; + ++i + ) { + currItemInfo = getItemInfo(children[i]); + if ( + // Half of the last item is out of the window. + (!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize) + // If the current item does not intersect with the window, the new page + // can be started at the current item or the last item. + || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) + ) { + if (winEndItemInfo.i > winStartItemInfo.i) { + winStartItemInfo = winEndItemInfo; } - - names.push(value + ''); - }); - dataArr = idxArr; + else { // e.g., when page size is smaller than item size. + winStartItemInfo = currItemInfo; + } + if (winStartItemInfo) { + if (result.pageNextDataIndex == null) { + result.pageNextDataIndex = winStartItemInfo.i; + } + ++result.pageCount; + } + } + winEndItemInfo = currItemInfo; } - var dimType = ({category: 'ordinal', time: 'time'})[axisType] || 'number'; + for (var i = targetItemIndex - 1, + winStartItemInfo = targetItemInfo, + winEndItemInfo = targetItemInfo, + currItemInfo = null; + i >= -1; + --i + ) { + currItemInfo = getItemInfo(children[i]); + if ( + // If the the end item does not intersect with the window started + // from the current item, a page can be settled. + (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) + // e.g., when page size is smaller than item size. + && winStartItemInfo.i < winEndItemInfo.i + ) { + winEndItemInfo = winStartItemInfo; + if (result.pagePrevDataIndex == null) { + result.pagePrevDataIndex = winStartItemInfo.i; + } + ++result.pageCount; + ++result.pageIndex; + } + winStartItemInfo = currItemInfo; + } - var data = this._data = new List([{name: 'value', type: dimType}], this); + return result; - data.initData(dataArr, names); - }, + function getItemInfo(el) { + if (el) { + var itemRect = el.getBoundingRect(); + var start = itemRect[xy] + el.position[orientIdx]; + return { + s: start, + e: start + itemRect[wh], + i: el.__legendDataIndex + }; + } + } - getData: function () { - return this._data; + function intersect(itemInfo, winStart) { + return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize; + } }, - /** - * @public - * @return {Array.} categoreis - */ - getCategories: function () { - if (this.get('axisType') === 'category') { - return this._names.slice(); + _findTargetItemIndex: function (targetDataIndex) { + if (!this._showController) { + return 0; } + + var index; + var contentGroup = this.getContentGroup(); + var defaultIndex; + + contentGroup.eachChild(function (child, idx) { + var legendDataIdx = child.__legendDataIndex; + // FIXME + // If the given targetDataIndex (from model) is illegal, + // we use defualtIndex. But the index on the legend model and + // action payload is still illegal. That case will not be + // changed until some scenario requires. + if (defaultIndex == null && legendDataIdx != null) { + defaultIndex = idx; + } + if (legendDataIdx === targetDataIndex) { + index = idx; + } + }); + + return index != null ? index : defaultIndex; } }); @@ -86966,103 +90253,48 @@ var TimelineModel = ComponentModel.extend({ * under the License. */ -var SliderTimelineModel = TimelineModel.extend({ +/** + * @event legendScroll + * @type {Object} + * @property {string} type 'legendScroll' + * @property {string} scrollDataIndex + */ +registerAction( + 'legendScroll', 'legendscroll', + function (payload, ecModel) { + var scrollDataIndex = payload.scrollDataIndex; - type: 'timeline.slider', + scrollDataIndex != null && ecModel.eachComponent( + {mainType: 'legend', subType: 'scroll', query: payload}, + function (legendModel) { + legendModel.setScrollDataIndex(scrollDataIndex); + } + ); + } +); - /** - * @protected - */ - defaultOption: { +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ - backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 - borderColor: '#ccc', // 时间轴边框颜色 - borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) - - orient: 'horizontal', // 'vertical' - inverse: false, - - tooltip: { // boolean or Object - trigger: 'item' // data item may also have tootip attr. - }, - - symbol: 'emptyCircle', - symbolSize: 10, - - lineStyle: { - show: true, - width: 2, - color: '#304654' - }, - label: { // 文本标签 - position: 'auto', // auto left right top bottom - // When using number, label position is not - // restricted by viewRect. - // positive: right/bottom, negative: left/top - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#304654' - }, - itemStyle: { - color: '#304654', - borderWidth: 1 - }, - - checkpointStyle: { - symbol: 'circle', - symbolSize: 13, - color: '#c23531', - borderWidth: 5, - borderColor: 'rgba(194,53,49, 0.5)', - animation: true, - animationDuration: 300, - animationEasing: 'quinticInOut' - }, - - controlStyle: { - show: true, - showPlayBtn: true, - showPrevBtn: true, - showNextBtn: true, - itemSize: 22, - itemGap: 12, - position: 'left', // 'left' 'right' 'top' 'bottom' - playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line - stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line - nextIcon: 'path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z', // jshint ignore:line - prevIcon: 'path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z', // jshint ignore:line - - color: '#304654', - borderColor: '#304654', - borderWidth: 1 - }, - - emphasis: { - label: { - show: true, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#c23531' - }, - - itemStyle: { - color: '#c23531' - }, - - controlStyle: { - color: '#c23531', - borderColor: '#c23531', - borderWidth: 2 - } - }, - data: [] - } - -}); - -mixin(SliderTimelineModel, dataFormatMixin); +/** + * Legend component entry file8 + */ /* * Licensed to the Apache Software Foundation (ASF) under one @@ -87083,81 +90315,71 @@ mixin(SliderTimelineModel, dataFormatMixin); * under the License. */ -var TimelineView = Component.extend({ - type: 'timeline' -}); - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ +var SliderZoomModel = DataZoomModel.extend({ -/** - * Extend axis 2d - * @constructor module:echarts/coord/cartesian/Axis2D - * @extends {module:echarts/coord/cartesian/Axis} - * @param {string} dim - * @param {*} scale - * @param {Array.} coordExtent - * @param {string} axisType - * @param {string} position - */ -var TimelineAxis = function (dim, scale, coordExtent, axisType) { + type: 'dataZoom.slider', - Axis.call(this, dim, scale, coordExtent); + layoutMode: 'box', /** - * Axis type - * - 'category' - * - 'value' - * - 'time' - * - 'log' - * @type {string} + * @protected */ - this.type = axisType || 'value'; + defaultOption: { + show: true, - /** - * Axis model - * @param {module:echarts/component/TimelineModel} - */ - this.model = null; -}; + // ph => placeholder. Using placehoder here because + // deault value can only be drived in view stage. + right: 'ph', // Default align to grid rect. + top: 'ph', // Default align to grid rect. + width: 'ph', // Default align to grid rect. + height: 'ph', // Default align to grid rect. + left: null, // Default align to grid rect. + bottom: null, // Default align to grid rect. -TimelineAxis.prototype = { + backgroundColor: 'rgba(47,69,84,0)', // Background of slider zoom component. + // dataBackgroundColor: '#ddd', // Background coor of data shadow and border of box, + // highest priority, remain for compatibility of + // previous version, but not recommended any more. + dataBackground: { + lineStyle: { + color: '#2f4554', + width: 0.5, + opacity: 0.3 + }, + areaStyle: { + color: 'rgba(47,69,84,0.3)', + opacity: 0.3 + } + }, + borderColor: '#ddd', // border color of the box. For compatibility, + // if dataBackgroundColor is set, borderColor + // is ignored. - constructor: TimelineAxis, + fillerColor: 'rgba(167,183,204,0.4)', // Color of selected area. + // handleColor: 'rgba(89,170,216,0.95)', // Color of handle. + // handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z', + /* eslint-disable */ + handleIcon: 'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z', + /* eslint-enable */ + // Percent of the slider height + handleSize: '100%', - /** - * @override - */ - getLabelModel: function () { - return this.model.getModel('label'); - }, + handleStyle: { + color: '#a7b7cc' + }, - /** - * @override - */ - isHorizontal: function () { - return this.model.get('orient') === 'horizontal'; + labelPrecision: null, + labelFormatter: null, + showDetail: true, + showDataShadow: 'auto', // Default auto decision. + realtime: true, + zoomLock: false, // Whether disable zoom. + textStyle: { + color: '#333' + } } -}; - -inherits(TimelineAxis, Axis); +}); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -87178,685 +90400,788 @@ inherits(TimelineAxis, Axis); * under the License. */ -var bind$6 = bind; -var each$27 = each$1; +var Rect$2 = Rect; +var linearMap$1 = linearMap; +var asc$2 = asc; +var bind$5 = bind; +var each$26 = each$1; -var PI$4 = Math.PI; +// Constants +var DEFAULT_LOCATION_EDGE_GAP = 7; +var DEFAULT_FRAME_BORDER_WIDTH = 1; +var DEFAULT_FILLER_SIZE = 30; +var HORIZONTAL = 'horizontal'; +var VERTICAL = 'vertical'; +var LABEL_GAP = 5; +var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter']; -TimelineView.extend({ +var SliderZoomView = DataZoomView.extend({ - type: 'timeline.slider', + type: 'dataZoom.slider', init: function (ecModel, api) { - this.api = api; + /** + * @private + * @type {Object} + */ + this._displayables = {}; /** * @private - * @type {module:echarts/component/timeline/TimelineAxis} + * @type {string} */ - this._axis; + this._orient; /** + * [0, 100] * @private - * @type {module:zrender/core/BoundingRect} */ - this._viewRect; + this._range; + + /** + * [coord of the first handle, coord of the second handle] + * @private + */ + this._handleEnds; + + /** + * [length, thick] + * @private + * @type {Array.} + */ + this._size; /** + * @private * @type {number} */ - this._timer; + this._handleWidth; /** - * @type {module:zrender/Element} + * @private + * @type {number} */ - this._currentPointer; + this._handleHeight; /** - * @type {module:zrender/container/Group} + * @private */ - this._mainGroup; + this._location; /** - * @type {module:zrender/container/Group} + * @private */ - this._labelGroup; + this._dragging; + + /** + * @private + */ + this._dataShadowInfo; + + this.api = api; }, /** * @override */ - render: function (timelineModel, ecModel, api, payload) { - this.model = timelineModel; - this.api = api; - this.ecModel = ecModel; - - this.group.removeAll(); - - if (timelineModel.get('show', true)) { - - var layoutInfo = this._layout(timelineModel, api); - var mainGroup = this._createGroup('mainGroup'); - var labelGroup = this._createGroup('labelGroup'); + render: function (dataZoomModel, ecModel, api, payload) { + SliderZoomView.superApply(this, 'render', arguments); - /** - * @private - * @type {module:echarts/component/timeline/TimelineAxis} - */ - var axis = this._axis = this._createAxis(layoutInfo, timelineModel); + createOrUpdate( + this, + '_dispatchZoomAction', + this.dataZoomModel.get('throttle'), + 'fixRate' + ); - timelineModel.formatTooltip = function (dataIndex) { - return encodeHTML(axis.scale.getLabel(dataIndex)); - }; + this._orient = dataZoomModel.get('orient'); - each$27( - ['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], - function (name) { - this['_render' + name](layoutInfo, mainGroup, axis, timelineModel); - }, - this - ); + if (this.dataZoomModel.get('show') === false) { + this.group.removeAll(); + return; + } - this._renderAxisLabel(layoutInfo, labelGroup, axis, timelineModel); - this._position(layoutInfo, timelineModel); + // Notice: this._resetInterval() should not be executed when payload.type + // is 'dataZoom', origin this._range should be maintained, otherwise 'pan' + // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction, + if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) { + this._buildView(); } - this._doPlayStop(); + this._updateView(); }, /** * @override */ remove: function () { - this._clearTimer(); - this.group.removeAll(); + SliderZoomView.superApply(this, 'remove', arguments); + clear(this, '_dispatchZoomAction'); }, /** * @override */ dispose: function () { - this._clearTimer(); + SliderZoomView.superApply(this, 'dispose', arguments); + clear(this, '_dispatchZoomAction'); }, - _layout: function (timelineModel, api) { - var labelPosOpt = timelineModel.get('label.position'); - var orient = timelineModel.get('orient'); - var viewRect = getViewRect$4(timelineModel, api); - // Auto label offset. - if (labelPosOpt == null || labelPosOpt === 'auto') { - labelPosOpt = orient === 'horizontal' - ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+') - : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-'); - } - else if (isNaN(labelPosOpt)) { - labelPosOpt = ({ - horizontal: {top: '-', bottom: '+'}, - vertical: {left: '-', right: '+'} - })[orient][labelPosOpt]; - } - - var labelAlignMap = { - horizontal: 'center', - vertical: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'left' : 'right' - }; + _buildView: function () { + var thisGroup = this.group; - var labelBaselineMap = { - horizontal: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'top' : 'bottom', - vertical: 'middle' - }; - var rotationMap = { - horizontal: 0, - vertical: PI$4 / 2 - }; + thisGroup.removeAll(); - // Position - var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; + this._resetLocation(); + this._resetInterval(); - var controlModel = timelineModel.getModel('controlStyle'); - var showControl = controlModel.get('show', true); - var controlSize = showControl ? controlModel.get('itemSize') : 0; - var controlGap = showControl ? controlModel.get('itemGap') : 0; - var sizePlusGap = controlSize + controlGap; + var barGroup = this._displayables.barGroup = new Group(); - // Special label rotate. - var labelRotation = timelineModel.get('label.rotate') || 0; - labelRotation = labelRotation * PI$4 / 180; // To radian. + this._renderBackground(); - var playPosition; - var prevBtnPosition; - var nextBtnPosition; - var axisExtent; - var controlPosition = controlModel.get('position', true); - var showPlayBtn = showControl && controlModel.get('showPlayBtn', true); - var showPrevBtn = showControl && controlModel.get('showPrevBtn', true); - var showNextBtn = showControl && controlModel.get('showNextBtn', true); - var xLeft = 0; - var xRight = mainLength; + this._renderHandle(); - // position[0] means left, position[1] means middle. - if (controlPosition === 'left' || controlPosition === 'bottom') { - showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap); - showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap); - showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - } - else { // 'top' 'right' - showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); - showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - } - axisExtent = [xLeft, xRight]; + this._renderDataShadow(); - if (timelineModel.get('inverse')) { - axisExtent.reverse(); - } + thisGroup.add(barGroup); - return { - viewRect: viewRect, - mainLength: mainLength, - orient: orient, + this._positionGroup(); + }, - rotation: rotationMap[orient], - labelRotation: labelRotation, - labelPosOpt: labelPosOpt, - labelAlign: timelineModel.get('label.align') || labelAlignMap[orient], - labelBaseline: timelineModel.get('label.verticalAlign') - || timelineModel.get('label.baseline') - || labelBaselineMap[orient], + /** + * @private + */ + _resetLocation: function () { + var dataZoomModel = this.dataZoomModel; + var api = this.api; - // Based on mainGroup. - playPosition: playPosition, - prevBtnPosition: prevBtnPosition, - nextBtnPosition: nextBtnPosition, - axisExtent: axisExtent, + // If some of x/y/width/height are not specified, + // auto-adapt according to target grid. + var coordRect = this._findCoordRect(); + var ecSize = {width: api.getWidth(), height: api.getHeight()}; + // Default align by coordinate system rect. + var positionInfo = this._orient === HORIZONTAL + ? { + // Why using 'right', because right should be used in vertical, + // and it is better to be consistent for dealing with position param merge. + right: ecSize.width - coordRect.x - coordRect.width, + top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP), + width: coordRect.width, + height: DEFAULT_FILLER_SIZE + } + : { // vertical + right: DEFAULT_LOCATION_EDGE_GAP, + top: coordRect.y, + width: DEFAULT_FILLER_SIZE, + height: coordRect.height + }; - controlSize: controlSize, - controlGap: controlGap - }; - }, + // Do not write back to option and replace value 'ph', because + // the 'ph' value should be recalculated when resize. + var layoutParams = getLayoutParams(dataZoomModel.option); - _position: function (layoutInfo, timelineModel) { - // Position is be called finally, because bounding rect is needed for - // adapt content to fill viewRect (auto adapt offset). + // Replace the placeholder value. + each$1(['right', 'top', 'width', 'height'], function (name) { + if (layoutParams[name] === 'ph') { + layoutParams[name] = positionInfo[name]; + } + }); - // Timeline may be not all in the viewRect when 'offset' is specified - // as a number, because it is more appropriate that label aligns at - // 'offset' but not the other edge defined by viewRect. + var layoutRect = getLayoutRect( + layoutParams, + ecSize, + dataZoomModel.padding + ); - var mainGroup = this._mainGroup; - var labelGroup = this._labelGroup; + this._location = {x: layoutRect.x, y: layoutRect.y}; + this._size = [layoutRect.width, layoutRect.height]; + this._orient === VERTICAL && this._size.reverse(); + }, - var viewRect = layoutInfo.viewRect; - if (layoutInfo.orient === 'vertical') { - // transform to horizontal, inverse rotate by left-top point. - var m = create$1(); - var rotateOriginX = viewRect.x; - var rotateOriginY = viewRect.y + viewRect.height; - translate(m, m, [-rotateOriginX, -rotateOriginY]); - rotate(m, m, -PI$4 / 2); - translate(m, m, [rotateOriginX, rotateOriginY]); - viewRect = viewRect.clone(); - viewRect.applyTransform(m); - } + /** + * @private + */ + _positionGroup: function () { + var thisGroup = this.group; + var location = this._location; + var orient = this._orient; - var viewBound = getBound(viewRect); - var mainBound = getBound(mainGroup.getBoundingRect()); - var labelBound = getBound(labelGroup.getBoundingRect()); + // Just use the first axis to determine mapping. + var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); + var inverse = targetAxisModel && targetAxisModel.get('inverse'); - var mainPosition = mainGroup.position; - var labelsPosition = labelGroup.position; + var barGroup = this._displayables.barGroup; + var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; - labelsPosition[0] = mainPosition[0] = viewBound[0][0]; + // Transform barGroup. + barGroup.attr( + (orient === HORIZONTAL && !inverse) + ? {scale: otherAxisInverse ? [1, 1] : [1, -1]} + : (orient === HORIZONTAL && inverse) + ? {scale: otherAxisInverse ? [-1, 1] : [-1, -1]} + : (orient === VERTICAL && !inverse) + ? {scale: otherAxisInverse ? [1, -1] : [1, 1], rotation: Math.PI / 2} + // Dont use Math.PI, considering shadow direction. + : {scale: otherAxisInverse ? [-1, -1] : [-1, 1], rotation: Math.PI / 2} + ); - var labelPosOpt = layoutInfo.labelPosOpt; + // Position barGroup + var rect = thisGroup.getBoundingRect([barGroup]); + thisGroup.attr('position', [location.x - rect.x, location.y - rect.y]); + }, - if (isNaN(labelPosOpt)) { // '+' or '-' - var mainBoundIdx = labelPosOpt === '+' ? 0 : 1; - toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); - toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); - } - else { - var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; - toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); - labelsPosition[1] = mainPosition[1] + labelPosOpt; - } + /** + * @private + */ + _getViewExtent: function () { + return [0, this._size[0]]; + }, - mainGroup.attr('position', mainPosition); - labelGroup.attr('position', labelsPosition); - mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; + _renderBackground: function () { + var dataZoomModel = this.dataZoomModel; + var size = this._size; + var barGroup = this._displayables.barGroup; - setOrigin(mainGroup); - setOrigin(labelGroup); + barGroup.add(new Rect$2({ + silent: true, + shape: { + x: 0, y: 0, width: size[0], height: size[1] + }, + style: { + fill: dataZoomModel.get('backgroundColor') + }, + z2: -40 + })); - function setOrigin(targetGroup) { - var pos = targetGroup.position; - targetGroup.origin = [ - viewBound[0][0] - pos[0], - viewBound[1][0] - pos[1] - ]; - } + // Click panel, over shadow, below handles. + barGroup.add(new Rect$2({ + shape: { + x: 0, y: 0, width: size[0], height: size[1] + }, + style: { + fill: 'transparent' + }, + z2: 0, + onclick: bind(this._onClickPanelClick, this) + })); + }, - function getBound(rect) { - // [[xmin, xmax], [ymin, ymax]] - return [ - [rect.x, rect.x + rect.width], - [rect.y, rect.y + rect.height] - ]; + _renderDataShadow: function () { + var info = this._dataShadowInfo = this._prepareDataShadowInfo(); + + if (!info) { + return; } - function toBound(fromPos, from, to, dimIdx, boundIdx) { - fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; + var size = this._size; + var seriesModel = info.series; + var data = seriesModel.getRawData(); + + var otherDim = seriesModel.getShadowDim + ? seriesModel.getShadowDim() // @see candlestick + : info.otherDim; + + if (otherDim == null) { + return; } - }, - _createAxis: function (layoutInfo, timelineModel) { - var data = timelineModel.getData(); - var axisType = timelineModel.get('axisType'); + var otherDataExtent = data.getDataExtent(otherDim); + // Nice extent. + var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3; + otherDataExtent = [ + otherDataExtent[0] - otherOffset, + otherDataExtent[1] + otherOffset + ]; + var otherShadowExtent = [0, size[1]]; - var scale = createScaleByModel(timelineModel, axisType); + var thisShadowExtent = [0, size[0]]; - // Customize scale. The `tickValue` is `dataIndex`. - scale.getTicks = function () { - return data.mapArray(['value'], function (value) { - return value; - }); - }; + var areaPoints = [[size[0], 0], [0, 0]]; + var linePoints = []; + var step = thisShadowExtent[1] / (data.count() - 1); + var thisCoord = 0; - var dataExtent = data.getDataExtent('value'); - scale.setExtent(dataExtent[0], dataExtent[1]); - scale.niceTicks(); + // Optimize for large data shadow + var stride = Math.round(data.count() / size[0]); + var lastIsEmpty; + data.each([otherDim], function (value, index) { + if (stride > 0 && (index % stride)) { + thisCoord += step; + return; + } - var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); - axis.model = timelineModel; + // FIXME + // Should consider axis.min/axis.max when drawing dataShadow. - return axis; - }, + // FIXME + // 应该使用统一的空判断?还是在list里进行空判断? + var isEmpty = value == null || isNaN(value) || value === ''; + // See #4235. + var otherCoord = isEmpty + ? 0 : linearMap$1(value, otherDataExtent, otherShadowExtent, true); - _createGroup: function (name) { - var newGroup = this['_' + name] = new Group(); - this.group.add(newGroup); - return newGroup; - }, + // Attempt to draw data shadow precisely when there are empty value. + if (isEmpty && !lastIsEmpty && index) { + areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]); + linePoints.push([linePoints[linePoints.length - 1][0], 0]); + } + else if (!isEmpty && lastIsEmpty) { + areaPoints.push([thisCoord, 0]); + linePoints.push([thisCoord, 0]); + } - _renderAxisLine: function (layoutInfo, group, axis, timelineModel) { - var axisExtent = axis.getExtent(); + areaPoints.push([thisCoord, otherCoord]); + linePoints.push([thisCoord, otherCoord]); - if (!timelineModel.get('lineStyle.show')) { - return; - } + thisCoord += step; + lastIsEmpty = isEmpty; + }); - group.add(new Line({ - shape: { - x1: axisExtent[0], y1: 0, - x2: axisExtent[1], y2: 0 - }, - style: extend( - {lineCap: 'round'}, - timelineModel.getModel('lineStyle').getLineStyle() + var dataZoomModel = this.dataZoomModel; + // var dataBackgroundModel = dataZoomModel.getModel('dataBackground'); + this._displayables.barGroup.add(new Polygon({ + shape: {points: areaPoints}, + style: defaults( + {fill: dataZoomModel.get('dataBackgroundColor')}, + dataZoomModel.getModel('dataBackground.areaStyle').getAreaStyle() ), silent: true, - z2: 1 + z2: -20 + })); + this._displayables.barGroup.add(new Polyline({ + shape: {points: linePoints}, + style: dataZoomModel.getModel('dataBackground.lineStyle').getLineStyle(), + silent: true, + z2: -19 })); }, - /** - * @private - */ - _renderAxisTick: function (layoutInfo, group, axis, timelineModel) { - var data = timelineModel.getData(); - // Show all ticks, despite ignoring strategy. - var ticks = axis.scale.getTicks(); + _prepareDataShadowInfo: function () { + var dataZoomModel = this.dataZoomModel; + var showDataShadow = dataZoomModel.get('showDataShadow'); - // The value is dataIndex, see the costomized scale. - each$27(ticks, function (value) { - var tickCoord = axis.dataToCoord(value); - var itemModel = data.getItemModel(value); - var itemStyleModel = itemModel.getModel('itemStyle'); - var hoverStyleModel = itemModel.getModel('emphasis.itemStyle'); - var symbolOpt = { - position: [tickCoord, 0], - onclick: bind$6(this._changeTimeline, this, value) - }; - var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); - setHoverStyle(el, hoverStyleModel.getItemStyle()); + if (showDataShadow === false) { + return; + } - if (itemModel.get('tooltip')) { - el.dataIndex = value; - el.dataModel = timelineModel; - } - else { - el.dataIndex = el.dataModel = null; - } + // Find a representative series. + var result; + var ecModel = this.ecModel; - }, this); - }, + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { + var seriesModels = dataZoomModel + .getAxisProxy(dimNames.name, axisIndex) + .getTargetSeriesModels(); - /** - * @private - */ - _renderAxisLabel: function (layoutInfo, group, axis, timelineModel) { - var labelModel = axis.getLabelModel(); + each$1(seriesModels, function (seriesModel) { + if (result) { + return; + } - if (!labelModel.get('show')) { - return; - } + if (showDataShadow !== true && indexOf( + SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type') + ) < 0 + ) { + return; + } - var data = timelineModel.getData(); - var labels = axis.getViewLabels(); + var thisAxis = ecModel.getComponent(dimNames.axis, axisIndex).axis; + var otherDim = getOtherDim(dimNames.name); + var otherAxisInverse; + var coordSys = seriesModel.coordinateSystem; - each$27(labels, function (labelItem) { - // The tickValue is dataIndex, see the costomized scale. - var dataIndex = labelItem.tickValue; + if (otherDim != null && coordSys.getOtherAxis) { + otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; + } - var itemModel = data.getItemModel(dataIndex); - var normalLabelModel = itemModel.getModel('label'); - var hoverLabelModel = itemModel.getModel('emphasis.label'); - var tickCoord = axis.dataToCoord(labelItem.tickValue); - var textEl = new Text({ - position: [tickCoord, 0], - rotation: layoutInfo.labelRotation - layoutInfo.rotation, - onclick: bind$6(this._changeTimeline, this, dataIndex), - silent: false - }); - setTextStyle(textEl.style, normalLabelModel, { - text: labelItem.formattedLabel, - textAlign: layoutInfo.labelAlign, - textVerticalAlign: layoutInfo.labelBaseline - }); + otherDim = seriesModel.getData().mapDimension(otherDim); - group.add(textEl); - setHoverStyle( - textEl, setTextStyle({}, hoverLabelModel) - ); + result = { + thisAxis: thisAxis, + series: seriesModel, + thisDim: dimNames.name, + otherDim: otherDim, + otherAxisInverse: otherAxisInverse + }; + + }, this); }, this); - }, - /** - * @private - */ - _renderControl: function (layoutInfo, group, axis, timelineModel) { - var controlSize = layoutInfo.controlSize; - var rotation = layoutInfo.rotation; + return result; + }, - var itemStyle = timelineModel.getModel('controlStyle').getItemStyle(); - var hoverStyle = timelineModel.getModel('emphasis.controlStyle').getItemStyle(); - var rect = [0, -controlSize / 2, controlSize, controlSize]; - var playState = timelineModel.getPlayState(); - var inverse = timelineModel.get('inverse', true); + _renderHandle: function () { + var displaybles = this._displayables; + var handles = displaybles.handles = []; + var handleLabels = displaybles.handleLabels = []; + var barGroup = this._displayables.barGroup; + var size = this._size; + var dataZoomModel = this.dataZoomModel; - makeBtn( - layoutInfo.nextBtnPosition, - 'controlStyle.nextIcon', - bind$6(this._changeTimeline, this, inverse ? '-' : '+') - ); - makeBtn( - layoutInfo.prevBtnPosition, - 'controlStyle.prevIcon', - bind$6(this._changeTimeline, this, inverse ? '+' : '-') - ); - makeBtn( - layoutInfo.playPosition, - 'controlStyle.' + (playState ? 'stopIcon' : 'playIcon'), - bind$6(this._handlePlayClick, this, !playState), - true - ); + barGroup.add(displaybles.filler = new Rect$2({ + draggable: true, + cursor: getCursor(this._orient), + drift: bind$5(this._onDragMove, this, 'all'), + ondragstart: bind$5(this._showDataInfo, this, true), + ondragend: bind$5(this._onDragEnd, this), + onmouseover: bind$5(this._showDataInfo, this, true), + onmouseout: bind$5(this._showDataInfo, this, false), + style: { + fill: dataZoomModel.get('fillerColor'), + textPosition: 'inside' + } + })); - function makeBtn(position, iconPath, onclick, willRotate) { - if (!position) { - return; + // Frame border. + barGroup.add(new Rect$2({ + silent: true, + subPixelOptimize: true, + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1] + }, + style: { + stroke: dataZoomModel.get('dataBackgroundColor') + || dataZoomModel.get('borderColor'), + lineWidth: DEFAULT_FRAME_BORDER_WIDTH, + fill: 'rgba(0,0,0,0)' } - var opt = { - position: position, - origin: [controlSize / 2, 0], - rotation: willRotate ? -rotation : 0, - rectHover: true, - style: itemStyle, - onclick: onclick - }; - var btn = makeIcon(timelineModel, iconPath, rect, opt); - group.add(btn); - setHoverStyle(btn, hoverStyle); - } - }, + })); - _renderCurrentPointer: function (layoutInfo, group, axis, timelineModel) { - var data = timelineModel.getData(); - var currentIndex = timelineModel.getCurrentIndex(); - var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle'); - var me = this; + each$26([0, 1], function (handleIndex) { + var path = createIcon( + dataZoomModel.get('handleIcon'), + { + cursor: getCursor(this._orient), + draggable: true, + drift: bind$5(this._onDragMove, this, handleIndex), + ondragend: bind$5(this._onDragEnd, this), + onmouseover: bind$5(this._showDataInfo, this, true), + onmouseout: bind$5(this._showDataInfo, this, false) + }, + {x: -1, y: 0, width: 2, height: 2} + ); - var callback = { - onCreate: function (pointer) { - pointer.draggable = true; - pointer.drift = bind$6(me._handlePointerDrag, me); - pointer.ondragend = bind$6(me._handlePointerDragend, me); - pointerMoveTo(pointer, currentIndex, axis, timelineModel, true); - }, - onUpdate: function (pointer) { - pointerMoveTo(pointer, currentIndex, axis, timelineModel); + var bRect = path.getBoundingRect(); + this._handleHeight = parsePercent$1(dataZoomModel.get('handleSize'), this._size[1]); + this._handleWidth = bRect.width / bRect.height * this._handleHeight; + + path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); + var handleColor = dataZoomModel.get('handleColor'); + // Compatitable with previous version + if (handleColor != null) { + path.style.fill = handleColor; } - }; - // Reuse when exists, for animation and drag. - this._currentPointer = giveSymbol( - pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback - ); - }, + barGroup.add(handles[handleIndex] = path); - _handlePlayClick: function (nextState) { - this._clearTimer(); - this.api.dispatchAction({ - type: 'timelinePlayChange', - playState: nextState, - from: this.uid - }); - }, + var textStyleModel = dataZoomModel.textStyleModel; - _handlePointerDrag: function (dx, dy, e) { - this._clearTimer(); - this._pointerChangeTimeline([e.offsetX, e.offsetY]); - }, + this.group.add( + handleLabels[handleIndex] = new Text({ + silent: true, + invisible: true, + style: { + x: 0, y: 0, text: '', + textVerticalAlign: 'middle', + textAlign: 'center', + textFill: textStyleModel.getTextColor(), + textFont: textStyleModel.getFont() + }, + z2: 10 + })); - _handlePointerDragend: function (e) { - this._pointerChangeTimeline([e.offsetX, e.offsetY], true); + }, this); }, - _pointerChangeTimeline: function (mousePos, trigger) { - var toCoord = this._toAxisCoord(mousePos)[0]; + /** + * @private + */ + _resetInterval: function () { + var range = this._range = this.dataZoomModel.getPercentRange(); + var viewExtent = this._getViewExtent(); - var axis = this._axis; - var axisExtent = asc(axis.getExtent().slice()); + this._handleEnds = [ + linearMap$1(range[0], [0, 100], viewExtent, true), + linearMap$1(range[1], [0, 100], viewExtent, true) + ]; + }, - toCoord > axisExtent[1] && (toCoord = axisExtent[1]); - toCoord < axisExtent[0] && (toCoord = axisExtent[0]); + /** + * @private + * @param {(number|string)} handleIndex 0 or 1 or 'all' + * @param {number} delta + * @return {boolean} changed + */ + _updateInterval: function (handleIndex, delta) { + var dataZoomModel = this.dataZoomModel; + var handleEnds = this._handleEnds; + var viewExtend = this._getViewExtent(); + var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + var percentExtent = [0, 100]; - this._currentPointer.position[0] = toCoord; - this._currentPointer.dirty(); + sliderMove( + delta, + handleEnds, + viewExtend, + dataZoomModel.get('zoomLock') ? 'all' : handleIndex, + minMaxSpan.minSpan != null + ? linearMap$1(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, + minMaxSpan.maxSpan != null + ? linearMap$1(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null + ); - var targetDataIndex = this._findNearestTick(toCoord); - var timelineModel = this.model; + var lastRange = this._range; + var range = this._range = asc$2([ + linearMap$1(handleEnds[0], viewExtend, percentExtent, true), + linearMap$1(handleEnds[1], viewExtend, percentExtent, true) + ]); - if (trigger || ( - targetDataIndex !== timelineModel.getCurrentIndex() - && timelineModel.get('realtime') - )) { - this._changeTimeline(targetDataIndex); - } + return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; }, - _doPlayStop: function () { - this._clearTimer(); + /** + * @private + */ + _updateView: function (nonRealtime) { + var displaybles = this._displayables; + var handleEnds = this._handleEnds; + var handleInterval = asc$2(handleEnds.slice()); + var size = this._size; - if (this.model.getPlayState()) { - this._timer = setTimeout( - bind$6(handleFrame, this), - this.model.get('playInterval') - ); - } + each$26([0, 1], function (handleIndex) { + // Handles + var handle = displaybles.handles[handleIndex]; + var handleHeight = this._handleHeight; + handle.attr({ + scale: [handleHeight / 2, handleHeight / 2], + position: [handleEnds[handleIndex], size[1] / 2 - handleHeight / 2] + }); + }, this); - function handleFrame() { - // Do not cache - var timelineModel = this.model; - this._changeTimeline( - timelineModel.getCurrentIndex() - + (timelineModel.get('rewind', true) ? -1 : 1) - ); - } - }, + // Filler + displaybles.filler.setShape({ + x: handleInterval[0], + y: 0, + width: handleInterval[1] - handleInterval[0], + height: size[1] + }); - _toAxisCoord: function (vertex) { - var trans = this._mainGroup.getLocalTransform(); - return applyTransform$1(vertex, trans, true); + this._updateDataInfo(nonRealtime); }, - _findNearestTick: function (axisCoord) { - var data = this.model.getData(); - var dist = Infinity; - var targetDataIndex; - var axis = this._axis; - - data.each(['value'], function (value, dataIndex) { - var coord = axis.dataToCoord(value); - var d = Math.abs(coord - axisCoord); - if (d < dist) { - dist = d; - targetDataIndex = dataIndex; + /** + * @private + */ + _updateDataInfo: function (nonRealtime) { + var dataZoomModel = this.dataZoomModel; + var displaybles = this._displayables; + var handleLabels = displaybles.handleLabels; + var orient = this._orient; + var labelTexts = ['', '']; + + // FIXME + // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter) + if (dataZoomModel.get('showDetail')) { + var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + + if (axisProxy) { + var axis = axisProxy.getAxisModel().axis; + var range = this._range; + + var dataInterval = nonRealtime + // See #4434, data and axis are not processed and reset yet in non-realtime mode. + ? axisProxy.calculateDataWindow({ + start: range[0], end: range[1] + }).valueWindow + : axisProxy.getDataValueWindow(); + + labelTexts = [ + this._formatLabel(dataInterval[0], axis), + this._formatLabel(dataInterval[1], axis) + ]; } - }); + } - return targetDataIndex; - }, + var orderedHandleEnds = asc$2(this._handleEnds.slice()); - _clearTimer: function () { - if (this._timer) { - clearTimeout(this._timer); - this._timer = null; + setLabel.call(this, 0); + setLabel.call(this, 1); + + function setLabel(handleIndex) { + // Label + // Text should not transform by barGroup. + // Ignore handlers transform + var barTransform = getTransform( + displaybles.handles[handleIndex].parent, this.group + ); + var direction = transformDirection( + handleIndex === 0 ? 'right' : 'left', barTransform + ); + var offset = this._handleWidth / 2 + LABEL_GAP; + var textPoint = applyTransform$1( + [ + orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), + this._size[1] / 2 + ], + barTransform + ); + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + textVerticalAlign: orient === HORIZONTAL ? 'middle' : direction, + textAlign: orient === HORIZONTAL ? direction : 'center', + text: labelTexts[handleIndex] + }); } }, - _changeTimeline: function (nextIndex) { - var currentIndex = this.model.getCurrentIndex(); + /** + * @private + */ + _formatLabel: function (value, axis) { + var dataZoomModel = this.dataZoomModel; + var labelFormatter = dataZoomModel.get('labelFormatter'); - if (nextIndex === '+') { - nextIndex = currentIndex + 1; - } - else if (nextIndex === '-') { - nextIndex = currentIndex - 1; + var labelPrecision = dataZoomModel.get('labelPrecision'); + if (labelPrecision == null || labelPrecision === 'auto') { + labelPrecision = axis.getPixelPrecision(); } - this.api.dispatchAction({ - type: 'timelineChange', - currentIndex: nextIndex, - from: this.uid - }); - } + var valueStr = (value == null || isNaN(value)) + ? '' + // FIXME Glue code + : (axis.type === 'category' || axis.type === 'time') + ? axis.scale.getLabel(Math.round(value)) + // param of toFixed should less then 20. + : value.toFixed(Math.min(labelPrecision, 20)); -}); + return isFunction$1(labelFormatter) + ? labelFormatter(value, valueStr) + : isString(labelFormatter) + ? labelFormatter.replace('{value}', valueStr) + : valueStr; + }, -function getViewRect$4(model, api) { - return getLayoutRect( - model.getBoxLayoutParams(), - { - width: api.getWidth(), - height: api.getHeight() - }, - model.get('padding') - ); -} + /** + * @private + * @param {boolean} showOrHide true: show, false: hide + */ + _showDataInfo: function (showOrHide) { + // Always show when drgging. + showOrHide = this._dragging || showOrHide; -function makeIcon(timelineModel, objPath, rect, opts) { - var icon = makePath( - timelineModel.get(objPath).replace(/^path:\/\//, ''), - clone(opts || {}), - new BoundingRect(rect[0], rect[1], rect[2], rect[3]), - 'center' - ); + var handleLabels = this._displayables.handleLabels; + handleLabels[0].attr('invisible', !showOrHide); + handleLabels[1].attr('invisible', !showOrHide); + }, - return icon; -} + _onDragMove: function (handleIndex, dx, dy, event) { + this._dragging = true; -/** - * Create symbol or update symbol - * opt: basic position and event handlers - */ -function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { - var color = itemStyleModel.get('color'); + // For mobile device, prevent screen slider on the button. + stop(event.event); - if (!symbol) { - var symbolType = hostModel.get('symbol'); - symbol = createSymbol(symbolType, -1, -1, 2, 2, color); - symbol.setStyle('strokeNoScale', true); - group.add(symbol); - callback && callback.onCreate(symbol); - } - else { - symbol.setColor(color); - group.add(symbol); // Group may be new, also need to add. - callback && callback.onUpdate(symbol); - } + // Transform dx, dy to bar coordination. + var barTransform = this._displayables.barGroup.getLocalTransform(); + var vertex = applyTransform$1([dx, dy], barTransform, true); - // Style - var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']); - symbol.setStyle(itemStyle); + var changed = this._updateInterval(handleIndex, vertex[0]); - // Transform and events. - opt = merge({ - rectHover: true, - z2: 100 - }, opt, true); + var realtime = this.dataZoomModel.get('realtime'); - var symbolSize = hostModel.get('symbolSize'); - symbolSize = symbolSize instanceof Array - ? symbolSize.slice() - : [+symbolSize, +symbolSize]; - symbolSize[0] /= 2; - symbolSize[1] /= 2; - opt.scale = symbolSize; + this._updateView(!realtime); - var symbolOffset = hostModel.get('symbolOffset'); - if (symbolOffset) { - var pos = opt.position = opt.position || [0, 0]; - pos[0] += parsePercent$1(symbolOffset[0], symbolSize[0]); - pos[1] += parsePercent$1(symbolOffset[1], symbolSize[1]); - } + // Avoid dispatch dataZoom repeatly but range not changed, + // which cause bad visual effect when progressive enabled. + changed && realtime && this._dispatchZoomAction(); + }, - var symbolRotate = hostModel.get('symbolRotate'); - opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + _onDragEnd: function () { + this._dragging = false; + this._showDataInfo(false); - symbol.attr(opt); + // While in realtime mode and stream mode, dispatch action when + // drag end will cause the whole view rerender, which is unnecessary. + var realtime = this.dataZoomModel.get('realtime'); + !realtime && this._dispatchZoomAction(); + }, - // FIXME - // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, - // getBoundingRect will return wrong result. - // (This is supposed to be resolved in zrender, but it is a little difficult to - // leverage performance and auto updateTransform) - // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. - symbol.updateTransform(); + _onClickPanelClick: function (e) { + var size = this._size; + var localPoint = this._displayables.barGroup.transformCoordToLocal(e.offsetX, e.offsetY); - return symbol; -} + if (localPoint[0] < 0 || localPoint[0] > size[0] + || localPoint[1] < 0 || localPoint[1] > size[1] + ) { + return; + } -function pointerMoveTo(pointer, dataIndex, axis, timelineModel, noAnimation) { - if (pointer.dragging) { - return; - } + var handleEnds = this._handleEnds; + var center = (handleEnds[0] + handleEnds[1]) / 2; - var pointerModel = timelineModel.getModel('checkpointStyle'); - var toCoord = axis.dataToCoord(timelineModel.getData().get(['value'], dataIndex)); + var changed = this._updateInterval('all', localPoint[0] - center); + this._updateView(); + changed && this._dispatchZoomAction(); + }, - if (noAnimation || !pointerModel.get('animation', true)) { - pointer.attr({position: [toCoord, 0]}); - } - else { - pointer.stopAnimation(true); - pointer.animateTo( - {position: [toCoord, 0]}, - pointerModel.get('animationDuration', true), - pointerModel.get('animationEasing', true) - ); + /** + * This action will be throttled. + * @private + */ + _dispatchZoomAction: function () { + var range = this._range; + + this.api.dispatchAction({ + type: 'dataZoom', + from: this.uid, + dataZoomId: this.dataZoomModel.id, + start: range[0], + end: range[1] + }); + }, + + /** + * @private + */ + _findCoordRect: function () { + // Find the grid coresponding to the first axis referred by dataZoom. + var rect; + each$26(this.getTargetCoordInfo(), function (coordInfoList) { + if (!rect && coordInfoList.length) { + var coordSys = coordInfoList[0].model.coordinateSystem; + rect = coordSys.getRect && coordSys.getRect(); + } + }); + if (!rect) { + var width = this.api.getWidth(); + var height = this.api.getHeight(); + rect = { + x: width * 0.2, + y: height * 0.2, + width: width * 0.6, + height: height * 0.6 + }; + } + + return rect; } + +}); + +function getOtherDim(thisDim) { + // FIXME + // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好 + var map$$1 = {x: 'y', y: 'x', radius: 'angle', angle: 'radius'}; + return map$$1[thisDim]; +} + +function getCursor(orient) { + return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; } /* @@ -87878,12 +91203,6 @@ function pointerMoveTo(pointer, dataIndex, axis, timelineModel, noAnimation) { * under the License. */ -/** - * DataZoom component entry - */ - -registerPreprocessor(preprocessor$3); - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -87903,69 +91222,20 @@ registerPreprocessor(preprocessor$3); * under the License. */ -var ToolboxModel = extendComponentModel({ - - type: 'toolbox', - - layoutMode: { - type: 'box', - ignoreSize: true - }, - - optionUpdated: function () { - ToolboxModel.superApply(this, 'optionUpdated', arguments); +DataZoomModel.extend({ - each$1(this.option.feature, function (featureOpt, featureName) { - var Feature = get$1(featureName); - Feature && merge(featureOpt, Feature.defaultOption); - }); - }, + type: 'dataZoom.inside', + /** + * @protected + */ defaultOption: { - - show: true, - - z: 6, - - zlevel: 0, - - orient: 'horizontal', - - left: 'right', - - top: 'top', - - // right - // bottom - - backgroundColor: 'transparent', - - borderColor: '#ccc', - - borderRadius: 0, - - borderWidth: 0, - - padding: 5, - - itemSize: 15, - - itemGap: 8, - - showTitle: true, - - iconStyle: { - borderColor: '#666', - color: 'none' - }, - emphasis: { - iconStyle: { - borderColor: '#3E98C5' - } - } - // textStyle: {}, - - // feature + disabled: false, // Whether disable this inside zoom. + zoomLock: false, // Whether disable zoom but only pan. + zoomOnMouseWheel: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. + moveOnMouseMove: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. + moveOnMouseWheel: false, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. + preventDefaultMouseMove: true } }); @@ -87988,231 +91258,211 @@ var ToolboxModel = extendComponentModel({ * under the License. */ -extendComponentView({ +// Only create one roam controller for each coordinate system. +// one roam controller might be refered by two inside data zoom +// components (for example, one for x and one for y). When user +// pan or zoom, only dispatch one action for those data zoom +// components. - type: 'toolbox', +var ATTR$2 = '\0_ec_dataZoom_roams'; - render: function (toolboxModel, ecModel, api, payload) { - var group = this.group; - group.removeAll(); - if (!toolboxModel.get('show')) { - return; - } +/** + * @public + * @param {module:echarts/ExtensionAPI} api + * @param {Object} dataZoomInfo + * @param {string} dataZoomInfo.coordId + * @param {Function} dataZoomInfo.containsPoint + * @param {Array.} dataZoomInfo.allCoordIds + * @param {string} dataZoomInfo.dataZoomId + * @param {Object} dataZoomInfo.getRange + * @param {Function} dataZoomInfo.getRange.pan + * @param {Function} dataZoomInfo.getRange.zoom + * @param {Function} dataZoomInfo.getRange.scrollMove + * @param {boolean} dataZoomInfo.dataZoomModel + */ +function register$2(api, dataZoomInfo) { + var store = giveStore$1(api); + var theDataZoomId = dataZoomInfo.dataZoomId; + var theCoordId = dataZoomInfo.coordId; - var itemSize = +toolboxModel.get('itemSize'); - var featureOpts = toolboxModel.get('feature') || {}; - var features = this._features || (this._features = {}); + // Do clean when a dataZoom changes its target coordnate system. + // Avoid memory leak, dispose all not-used-registered. + each$1(store, function (record, coordId) { + var dataZoomInfos = record.dataZoomInfos; + if (dataZoomInfos[theDataZoomId] + && indexOf(dataZoomInfo.allCoordIds, theCoordId) < 0 + ) { + delete dataZoomInfos[theDataZoomId]; + record.count--; + } + }); - var featureNames = []; - each$1(featureOpts, function (opt, name) { - featureNames.push(name); - }); + cleanStore(store); - (new DataDiffer(this._featureNames || [], featureNames)) - .add(processFeature) - .update(processFeature) - .remove(curry(processFeature, null)) - .execute(); + var record = store[theCoordId]; + // Create if needed. + if (!record) { + record = store[theCoordId] = { + coordId: theCoordId, + dataZoomInfos: {}, + count: 0 + }; + record.controller = createController(api, record); + record.dispatchAction = curry(dispatchAction$1, api); + } - // Keep for diff. - this._featureNames = featureNames; + // Update reference of dataZoom. + !(record.dataZoomInfos[theDataZoomId]) && record.count++; + record.dataZoomInfos[theDataZoomId] = dataZoomInfo; - function processFeature(newIndex, oldIndex) { - var featureName = featureNames[newIndex]; - var oldName = featureNames[oldIndex]; - var featureOpt = featureOpts[featureName]; - var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel); - var feature; + var controllerParams = mergeControllerParams(record.dataZoomInfos); + record.controller.enable(controllerParams.controlType, controllerParams.opt); - if (featureName && !oldName) { // Create - if (isUserFeatureName(featureName)) { - feature = { - model: featureModel, - onclick: featureModel.option.onclick, - featureName: featureName - }; - } - else { - var Feature = get$1(featureName); - if (!Feature) { - return; - } - feature = new Feature(featureModel, ecModel, api); - } - features[featureName] = feature; - } - else { - feature = features[oldName]; - // If feature does not exsit. - if (!feature) { - return; - } - feature.model = featureModel; - feature.ecModel = ecModel; - feature.api = api; - } + // Consider resize, area should be always updated. + record.controller.setPointerChecker(dataZoomInfo.containsPoint); - if (!featureName && oldName) { - feature.dispose && feature.dispose(ecModel, api); - return; - } + // Update throttle. + createOrUpdate( + record, + 'dispatchAction', + dataZoomInfo.dataZoomModel.get('throttle', true), + 'fixRate' + ); +} - if (!featureModel.get('show') || feature.unusable) { - feature.remove && feature.remove(ecModel, api); - return; - } +/** + * @public + * @param {module:echarts/ExtensionAPI} api + * @param {string} dataZoomId + */ +function unregister$1(api, dataZoomId) { + var store = giveStore$1(api); - createIconPaths(featureModel, feature, featureName); + each$1(store, function (record) { + record.controller.dispose(); + var dataZoomInfos = record.dataZoomInfos; + if (dataZoomInfos[dataZoomId]) { + delete dataZoomInfos[dataZoomId]; + record.count--; + } + }); - featureModel.setIconStatus = function (iconName, status) { - var option = this.option; - var iconPaths = this.iconPaths; - option.iconStatus = option.iconStatus || {}; - option.iconStatus[iconName] = status; - // FIXME - iconPaths[iconName] && iconPaths[iconName].trigger(status); - }; + cleanStore(store); +} - if (feature.render) { - feature.render(featureModel, ecModel, api, payload); - } - } +/** + * @public + */ +function generateCoordId(coordModel) { + return coordModel.type + '\0_' + coordModel.id; +} - function createIconPaths(featureModel, feature, featureName) { - var iconStyleModel = featureModel.getModel('iconStyle'); - var iconStyleEmphasisModel = featureModel.getModel('emphasis.iconStyle'); +/** + * Key: coordId, value: {dataZoomInfos: [], count, controller} + * @type {Array.} + */ +function giveStore$1(api) { + // Mount store on zrender instance, so that we do not + // need to worry about dispose. + var zr = api.getZr(); + return zr[ATTR$2] || (zr[ATTR$2] = {}); +} - // If one feature has mutiple icon. they are orginaized as - // { - // icon: { - // foo: '', - // bar: '' - // }, - // title: { - // foo: '', - // bar: '' - // } - // } - var icons = feature.getIcons ? feature.getIcons() : featureModel.get('icon'); - var titles = featureModel.get('title') || {}; - if (typeof icons === 'string') { - var icon = icons; - var title = titles; - icons = {}; - titles = {}; - icons[featureName] = icon; - titles[featureName] = title; - } - var iconPaths = featureModel.iconPaths = {}; - each$1(icons, function (iconStr, iconName) { - var path = createIcon( - iconStr, - {}, - { - x: -itemSize / 2, - y: -itemSize / 2, - width: itemSize, - height: itemSize - } - ); - path.setStyle(iconStyleModel.getItemStyle()); - path.hoverStyle = iconStyleEmphasisModel.getItemStyle(); +function createController(api, newRecord) { + var controller = new RoamController(api.getZr()); - setHoverStyle(path); + each$1(['pan', 'zoom', 'scrollMove'], function (eventName) { + controller.on(eventName, function (event) { + var batch = []; - if (toolboxModel.get('showTitle')) { - path.__title = titles[iconName]; - path.on('mouseover', function () { - // Should not reuse above hoverStyle, which might be modified. - var hoverStyle = iconStyleEmphasisModel.getItemStyle(); - path.setStyle({ - text: titles[iconName], - textPosition: hoverStyle.textPosition || 'bottom', - textFill: hoverStyle.fill || hoverStyle.stroke || '#000', - textAlign: hoverStyle.textAlign || 'center' - }); - }) - .on('mouseout', function () { - path.setStyle({ - textFill: null - }); - }); + each$1(newRecord.dataZoomInfos, function (info) { + // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove, + // moveOnMouseWheel, ...) enabled. + if (!event.isAvailableBehavior(info.dataZoomModel.option)) { + return; } - path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal'); - group.add(path); - path.on('click', bind( - feature.onclick, feature, ecModel, api, iconName - )); + var method = (info.getRange || {})[eventName]; + var range = method && method(newRecord.controller, event); - iconPaths[iconName] = path; + !info.dataZoomModel.get('disabled', true) && range && batch.push({ + dataZoomId: info.dataZoomId, + start: range[0], + end: range[1] + }); }); - } - layout$3(group, toolboxModel, api); - // Render background after group is layout - // FIXME - group.add(makeBackground(group.getBoundingRect(), toolboxModel)); + batch.length && newRecord.dispatchAction(batch); + }); + }); - // Adjust icon title positions to avoid them out of screen - group.eachChild(function (icon) { - var titleText = icon.__title; - var hoverStyle = icon.hoverStyle; - // May be background element - if (hoverStyle && titleText) { - var rect = getBoundingRect( - titleText, makeFont(hoverStyle) - ); - var offsetX = icon.position[0] + group.position[0]; - var offsetY = icon.position[1] + group.position[1] + itemSize; + return controller; +} - var needPutOnTop = false; - if (offsetY + rect.height > api.getHeight()) { - hoverStyle.textPosition = 'top'; - needPutOnTop = true; - } - var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8); - if (offsetX + rect.width / 2 > api.getWidth()) { - hoverStyle.textPosition = ['100%', topOffset]; - hoverStyle.textAlign = 'right'; - } - else if (offsetX - rect.width / 2 < 0) { - hoverStyle.textPosition = [0, topOffset]; - hoverStyle.textAlign = 'left'; - } - } - }); - }, +function cleanStore(store) { + each$1(store, function (record, coordId) { + if (!record.count) { + record.controller.dispose(); + delete store[coordId]; + } + }); +} - updateView: function (toolboxModel, ecModel, api, payload) { - each$1(this._features, function (feature) { - feature.updateView && feature.updateView(feature.model, ecModel, api, payload); - }); - }, +/** + * This action will be throttled. + */ +function dispatchAction$1(api, batch) { + api.dispatchAction({ + type: 'dataZoom', + batch: batch + }); +} - // updateLayout: function (toolboxModel, ecModel, api, payload) { - // zrUtil.each(this._features, function (feature) { - // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); - // }); - // }, +/** + * Merge roamController settings when multiple dataZooms share one roamController. + */ +function mergeControllerParams(dataZoomInfos) { + var controlType; + // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated + // as string, it is probably revert to reserved word by compress tool. See #7411. + var prefix = 'type_'; + var typePriority = { + 'type_true': 2, + 'type_move': 1, + 'type_false': 0, + 'type_undefined': -1 + }; + var preventDefaultMouseMove = true; - remove: function (ecModel, api) { - each$1(this._features, function (feature) { - feature.remove && feature.remove(ecModel, api); - }); - this.group.removeAll(); - }, + each$1(dataZoomInfos, function (dataZoomInfo) { + var dataZoomModel = dataZoomInfo.dataZoomModel; + var oneType = dataZoomModel.get('disabled', true) + ? false + : dataZoomModel.get('zoomLock', true) + ? 'move' + : true; + if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { + controlType = oneType; + } - dispose: function (ecModel, api) { - each$1(this._features, function (feature) { - feature.dispose && feature.dispose(ecModel, api); - }); - } -}); + // Prevent default move event by default. If one false, do not prevent. Otherwise + // users may be confused why it does not work when multiple insideZooms exist. + preventDefaultMouseMove &= dataZoomModel.get('preventDefaultMouseMove', true); + }); -function isUserFeatureName(featureName) { - return featureName.indexOf('my') === 0; + return { + controlType: controlType, + opt: { + // RoamController will enable all of these functionalities, + // and the final behavior is determined by its event listener + // provided by each inside zoom. + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: true, + preventDefaultMouseMove: !!preventDefaultMouseMove + } + }; } /* @@ -88234,80 +91484,265 @@ function isUserFeatureName(featureName) { * under the License. */ -var saveAsImageLang = lang.toolbox.saveAsImage; +var bind$6 = bind; -function SaveAsImage(model) { - this.model = model; -} +var InsideZoomView = DataZoomView.extend({ -SaveAsImage.defaultOption = { - show: true, - icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0', - title: saveAsImageLang.title, - type: 'png', - // Default use option.backgroundColor - // backgroundColor: '#fff', - name: '', - excludeComponents: ['toolbox'], - pixelRatio: 1, - lang: saveAsImageLang.lang.slice() -}; + type: 'dataZoom.inside', -SaveAsImage.prototype.unusable = !env$1.canvasSupported; + /** + * @override + */ + init: function (ecModel, api) { + /** + * 'throttle' is used in this.dispatchAction, so we save range + * to avoid missing some 'pan' info. + * @private + * @type {Array.} + */ + this._range; + }, -var proto$4 = SaveAsImage.prototype; + /** + * @override + */ + render: function (dataZoomModel, ecModel, api, payload) { + InsideZoomView.superApply(this, 'render', arguments); -proto$4.onclick = function (ecModel, api) { - var model = this.model; - var title = model.get('name') || ecModel.get('title.0.text') || 'echarts'; - var $a = document.createElement('a'); - var type = model.get('type', true) || 'png'; - $a.download = title + '.' + type; - $a.target = '_blank'; - var url = api.getConnectedDataURL({ - type: type, - backgroundColor: model.get('backgroundColor', true) - || ecModel.get('backgroundColor') || '#fff', - excludeComponents: model.get('excludeComponents'), - pixelRatio: model.get('pixelRatio') - }); - $a.href = url; - // Chrome and Firefox - if (typeof MouseEvent === 'function' && !env$1.browser.ie && !env$1.browser.edge) { - var evt = new MouseEvent('click', { - view: window, - bubbles: true, - cancelable: false - }); - $a.dispatchEvent(evt); + // Hence the `throttle` util ensures to preserve command order, + // here simply updating range all the time will not cause missing + // any of the the roam change. + this._range = dataZoomModel.getPercentRange(); + + // Reset controllers. + each$1(this.getTargetCoordInfo(), function (coordInfoList, coordSysName) { + + var allCoordIds = map(coordInfoList, function (coordInfo) { + return generateCoordId(coordInfo.model); + }); + + each$1(coordInfoList, function (coordInfo) { + var coordModel = coordInfo.model; + + var getRange = {}; + each$1(['pan', 'zoom', 'scrollMove'], function (eventName) { + getRange[eventName] = bind$6(roamHandlers[eventName], this, coordInfo, coordSysName); + }, this); + + register$2( + api, + { + coordId: generateCoordId(coordModel), + allCoordIds: allCoordIds, + containsPoint: function (e, x, y) { + return coordModel.coordinateSystem.containPoint([x, y]); + }, + dataZoomId: dataZoomModel.id, + dataZoomModel: dataZoomModel, + getRange: getRange + } + ); + }, this); + + }, this); + }, + + /** + * @override + */ + dispose: function () { + unregister$1(this.api, this.dataZoomModel.id); + InsideZoomView.superApply(this, 'dispose', arguments); + this._range = null; } - // IE - else { - if (window.navigator.msSaveOrOpenBlob) { - var bstr = atob(url.split(',')[1]); - var n = bstr.length; - var u8arr = new Uint8Array(n); - while(n--) { - u8arr[n] = bstr.charCodeAt(n); - } - var blob = new Blob([u8arr]); - window.navigator.msSaveOrOpenBlob(blob, title + '.' + type); + +}); + +var roamHandlers = { + + /** + * @this {module:echarts/component/dataZoom/InsideZoomView} + */ + zoom: function (coordInfo, coordSysName, controller, e) { + var lastRange = this._range; + var range = lastRange.slice(); + + // Calculate transform by the first axis. + var axisModel = coordInfo.axisModels[0]; + if (!axisModel) { + return; } - else { - var lang$$1 = model.get('lang'); - var html = '' + - '' + - '' + - ''; - var tab = window.open(); - tab.document.write(html); + + var directionInfo = getDirectionInfo[coordSysName]( + null, [e.originX, e.originY], axisModel, controller, coordInfo + ); + var percentPoint = ( + directionInfo.signal > 0 + ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel) + : (directionInfo.pixel - directionInfo.pixelStart) + ) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; + + var scale = Math.max(1 / e.scale, 0); + range[0] = (range[0] - percentPoint) * scale + percentPoint; + range[1] = (range[1] - percentPoint) * scale + percentPoint; + + // Restrict range. + var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + + sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); + + this._range = range; + + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }, + + /** + * @this {module:echarts/component/dataZoom/InsideZoomView} + */ + pan: makeMover(function (range, axisModel, coordInfo, coordSysName, controller, e) { + var directionInfo = getDirectionInfo[coordSysName]( + [e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordInfo + ); + + return directionInfo.signal + * (range[1] - range[0]) + * directionInfo.pixel / directionInfo.pixelLength; + }), + + /** + * @this {module:echarts/component/dataZoom/InsideZoomView} + */ + scrollMove: makeMover(function (range, axisModel, coordInfo, coordSysName, controller, e) { + var directionInfo = getDirectionInfo[coordSysName]( + [0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordInfo + ); + return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta; + }) +}; + +function makeMover(getPercentDelta) { + return function (coordInfo, coordSysName, controller, e) { + var lastRange = this._range; + var range = lastRange.slice(); + + // Calculate transform by the first axis. + var axisModel = coordInfo.axisModels[0]; + if (!axisModel) { + return; + } + + var percentDelta = getPercentDelta( + range, axisModel, coordInfo, coordSysName, controller, e + ); + + sliderMove(percentDelta, range, [0, 100], 'all'); + + this._range = range; + + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }; +} + +var getDirectionInfo = { + + grid: function (oldPoint, newPoint, axisModel, controller, coordInfo) { + var axis = axisModel.axis; + var ret = {}; + var rect = coordInfo.model.coordinateSystem.getRect(); + oldPoint = oldPoint || [0, 0]; + + if (axis.dim === 'x') { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } + else { // axis.dim === 'y' + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; + }, + + polar: function (oldPoint, newPoint, axisModel, controller, coordInfo) { + var axis = axisModel.axis; + var ret = {}; + var polar = coordInfo.model.coordinateSystem; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var angleExtent = polar.getAngleAxis().getExtent(); + + oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; + newPoint = polar.pointToCoord(newPoint); + + if (axisModel.mainType === 'radiusAxis') { + ret.pixel = newPoint[0] - oldPoint[0]; + // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); + // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); + ret.pixelLength = radiusExtent[1] - radiusExtent[0]; + ret.pixelStart = radiusExtent[0]; + ret.signal = axis.inverse ? 1 : -1; + } + else { // 'angleAxis' + ret.pixel = newPoint[1] - oldPoint[1]; + // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); + // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); + ret.pixelLength = angleExtent[1] - angleExtent[0]; + ret.pixelStart = angleExtent[0]; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; + }, + + singleAxis: function (oldPoint, newPoint, axisModel, controller, coordInfo) { + var axis = axisModel.axis; + var rect = coordInfo.model.coordinateSystem.getRect(); + var ret = {}; + + oldPoint = oldPoint || [0, 0]; + + if (axis.orient === 'horizontal') { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; } + else { // 'vertical' + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; } }; -register$1( - 'saveAsImage', SaveAsImage -); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ /* * Licensed to the Apache Software Foundation (ASF) under one @@ -88328,171 +91763,105 @@ register$1( * under the License. */ -var magicTypeLang = lang.toolbox.magicType; -function MagicType(model) { - this.model = model; -} -MagicType.defaultOption = { - show: true, - type: [], - // Icon group - icon: { - line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4', - bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7', - stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z', // jshint ignore:line - tiled: 'M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z' - }, - // `line`, `bar`, `stack`, `tiled` - title: clone(magicTypeLang.title), - option: {}, - seriesIndex: {} -}; +// Do not include './dataZoomSelect', +// since it only work for toolbox dataZoom. -var proto$5 = MagicType.prototype; - -proto$5.getIcons = function () { - var model = this.model; - var availableIcons = model.get('icon'); - var icons = {}; - each$1(model.get('type'), function (type) { - if (availableIcons[type]) { - icons[type] = availableIcons[type]; - } - }); - return icons; -}; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -var seriesOptGenreator = { - 'line': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'bar') { - return merge({ - id: seriesId, - type: 'line', - // Preserve data related option - data: seriesModel.get('data'), - stack: seriesModel.get('stack'), - markPoint: seriesModel.get('markPoint'), - markLine: seriesModel.get('markLine') - }, model.get('option.line') || {}, true); - } - }, - 'bar': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'line') { - return merge({ - id: seriesId, - type: 'bar', - // Preserve data related option - data: seriesModel.get('data'), - stack: seriesModel.get('stack'), - markPoint: seriesModel.get('markPoint'), - markLine: seriesModel.get('markLine') - }, model.get('option.bar') || {}, true); - } - }, - 'stack': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'line' || seriesType === 'bar') { - return merge({ - id: seriesId, - stack: '__ec_magicType_stack__' - }, model.get('option.stack') || {}, true); - } - }, - 'tiled': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'line' || seriesType === 'bar') { - return merge({ - id: seriesId, - stack: '' - }, model.get('option.tiled') || {}, true); - } - } -}; +var each$27 = each$1; -var radioTypes = [ - ['line', 'bar'], - ['stack', 'tiled'] -]; +var preprocessor$3 = function (option) { + var visualMap = option && option.visualMap; -proto$5.onclick = function (ecModel, api, type) { - var model = this.model; - var seriesIndex = model.get('seriesIndex.' + type); - // Not supported magicType - if (!seriesOptGenreator[type]) { - return; + if (!isArray(visualMap)) { + visualMap = visualMap ? [visualMap] : []; } - var newOption = { - series: [] - }; - var generateNewSeriesTypes = function (seriesModel) { - var seriesType = seriesModel.subType; - var seriesId = seriesModel.id; - var newSeriesOpt = seriesOptGenreator[type]( - seriesType, seriesId, seriesModel, model - ); - if (newSeriesOpt) { - // PENDING If merge original option? - defaults(newSeriesOpt, seriesModel.option); - newOption.series.push(newSeriesOpt); + + each$27(visualMap, function (opt) { + if (!opt) { + return; } - // Modify boundaryGap - var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { - var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; - if (categoryAxis) { - var axisDim = categoryAxis.dim; - var axisType = axisDim + 'Axis'; - var axisModel = ecModel.queryComponents({ - mainType: axisType, - index: seriesModel.get(name + 'Index'), - id: seriesModel.get(name + 'Id') - })[0]; - var axisIndex = axisModel.componentIndex; - newOption[axisType] = newOption[axisType] || []; - for (var i = 0; i <= axisIndex; i++) { - newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; - } - newOption[axisType][axisIndex].boundaryGap = type === 'bar' ? true : false; - } + // rename splitList to pieces + if (has$2(opt, 'splitList') && !has$2(opt, 'pieces')) { + opt.pieces = opt.splitList; + delete opt.splitList; } - }; - each$1(radioTypes, function (radio) { - if (indexOf(radio, type) >= 0) { - each$1(radio, function (item) { - model.setIconStatus(item, 'normal'); + var pieces = opt.pieces; + if (pieces && isArray(pieces)) { + each$27(pieces, function (piece) { + if (isObject$1(piece)) { + if (has$2(piece, 'start') && !has$2(piece, 'min')) { + piece.min = piece.start; + } + if (has$2(piece, 'end') && !has$2(piece, 'max')) { + piece.max = piece.end; + } + } }); } }); +}; - model.setIconStatus(type, 'emphasis'); +function has$2(obj, name) { + return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); +} - ecModel.eachComponent( - { - mainType: 'series', - query: seriesIndex == null ? null : { - seriesIndex: seriesIndex - } - }, generateNewSeriesTypes - ); - api.dispatchAction({ - type: 'changeMagicType', - currentType: type, - newOption: newOption - }); -}; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ -registerAction({ - type: 'changeMagicType', - event: 'magicTypeChanged', - update: 'prepareAndUpdate' -}, function (payload, ecModel) { - ecModel.mergeOption(payload.newOption); +ComponentModel.registerSubTypeDefaulter('visualMap', function (option) { + // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used. + return ( + !option.categories + && ( + !( + option.pieces + ? option.pieces.length > 0 + : option.splitNumber > 0 + ) + || option.calculable + ) + ) + ? 'continuous' : 'piecewise'; }); -register$1('magicType', MagicType); - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -88512,654 +91881,2653 @@ register$1('magicType', MagicType); * under the License. */ -var dataViewLang = lang.toolbox.dataView; - -var BLOCK_SPLITER = new Array(60).join('-'); -var ITEM_SPLITER = '\t'; -/** - * Group series into two types - * 1. on category axis, like line, bar - * 2. others, like scatter, pie - * @param {module:echarts/model/Global} ecModel - * @return {Object} - * @inner - */ -function groupSeries(ecModel) { - var seriesGroupByCategoryAxis = {}; - var otherSeries = []; - var meta = []; - ecModel.eachRawSeries(function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; +var VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT; - if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) { - var baseAxis = coordSys.getBaseAxis(); - if (baseAxis.type === 'category') { - var key = baseAxis.dim + '_' + baseAxis.index; - if (!seriesGroupByCategoryAxis[key]) { - seriesGroupByCategoryAxis[key] = { - categoryAxis: baseAxis, - valueAxis: coordSys.getOtherAxis(baseAxis), - series: [] - }; - meta.push({ - axisDim: baseAxis.dim, - axisIndex: baseAxis.index - }); - } - seriesGroupByCategoryAxis[key].series.push(seriesModel); - } - else { - otherSeries.push(seriesModel); +registerVisual(VISUAL_PRIORITY, { + createOnAllSeries: true, + reset: function (seriesModel, ecModel) { + var resetDefines = []; + ecModel.eachComponent('visualMap', function (visualMapModel) { + var pipelineContext = seriesModel.pipelineContext; + if (!visualMapModel.isTargetSeries(seriesModel) + || (pipelineContext && pipelineContext.large) + ) { + return; } - } - else { - otherSeries.push(seriesModel); - } - }); - return { - seriesGroupByCategoryAxis: seriesGroupByCategoryAxis, - other: otherSeries, - meta: meta - }; -} + resetDefines.push(incrementalApplyVisual( + visualMapModel.stateList, + visualMapModel.targetVisuals, + bind(visualMapModel.getValueState, visualMapModel), + visualMapModel.getDataDimension(seriesModel.getData()) + )); + }); -/** - * Assemble content of series on cateogory axis - * @param {Array.} series - * @return {string} - * @inner - */ -function assembleSeriesWithCategoryAxis(series) { - var tables = []; - each$1(series, function (group, key) { - var categoryAxis = group.categoryAxis; - var valueAxis = group.valueAxis; - var valueAxisDim = valueAxis.dim; + return resetDefines; + } +}); - var headers = [' '].concat(map(group.series, function (series) { - return series.name; - })); - var columns = [categoryAxis.model.getCategories()]; - each$1(group.series, function (series) { - columns.push(series.getRawData().mapArray(valueAxisDim, function (val) { - return val; - })); - }); - // Assemble table content - var lines = [headers.join(ITEM_SPLITER)]; - for (var i = 0; i < columns[0].length; i++) { - var items = []; - for (var j = 0; j < columns.length; j++) { - items.push(columns[j][i]); - } - lines.push(items.join(ITEM_SPLITER)); - } - tables.push(lines.join('\n')); - }); - return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); -} +// Only support color. +registerVisual(VISUAL_PRIORITY, { + createOnAllSeries: true, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); + var visualMetaList = []; -/** - * Assemble content of other series - * @param {Array.} series - * @return {string} - * @inner - */ -function assembleOtherSeries(series) { - return map(series, function (series) { - var data = series.getRawData(); - var lines = [series.name]; - var vals = []; - data.each(data.dimensions, function () { - var argLen = arguments.length; - var dataIndex = arguments[argLen - 1]; - var name = data.getName(dataIndex); - for (var i = 0; i < argLen - 1; i++) { - vals[i] = arguments[i]; + ecModel.eachComponent('visualMap', function (visualMapModel) { + if (visualMapModel.isTargetSeries(seriesModel)) { + var visualMeta = visualMapModel.getVisualMeta( + bind(getColorVisual, null, seriesModel, visualMapModel) + ) || {stops: [], outerColors: []}; + + var concreteDim = visualMapModel.getDataDimension(data); + var dimInfo = data.getDimensionInfo(concreteDim); + if (dimInfo != null) { + // visualMeta.dimension should be dimension index, but not concrete dimension. + visualMeta.dimension = dimInfo.index; + visualMetaList.push(visualMeta); + } } - lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER)); }); - return lines.join('\n'); - }).join('\n\n' + BLOCK_SPLITER + '\n\n'); -} -/** - * @param {module:echarts/model/Global} - * @return {Object} - * @inner - */ -function getContentFromModel(ecModel) { + // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); + seriesModel.getData().setVisual('visualMeta', visualMetaList); + } +}); - var result = groupSeries(ecModel); +// FIXME +// performance and export for heatmap? +// value can be Infinity or -Infinity +function getColorVisual(seriesModel, visualMapModel, value, valueState) { + var mappings = visualMapModel.targetVisuals[valueState]; + var visualTypes = VisualMapping.prepareVisualTypes(mappings); + var resultVisual = { + color: seriesModel.getData().getVisual('color') // default color. + }; - return { - value: filter([ - assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), - assembleOtherSeries(result.other) - ], function (str) { - return str.replace(/[\n\t\s]/g, ''); - }).join('\n\n' + BLOCK_SPLITER + '\n\n'), + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + var mapping = mappings[ + type === 'opacity' ? '__alphaForOpacity' : type + ]; + mapping && mapping.applyVisual(value, getVisual, setVisual); + } - meta: result.meta - }; -} + return resultVisual.color; + function getVisual(key) { + return resultVisual[key]; + } -function trim$1(str) { - return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); -} -/** - * If a block is tsv format - */ -function isTSVFormat(block) { - // Simple method to find out if a block is tsv format - var firstLine = block.slice(0, block.indexOf('\n')); - if (firstLine.indexOf(ITEM_SPLITER) >= 0) { - return true; + function setVisual(key, value) { + resultVisual[key] = value; } } -var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g'); +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + /** - * @param {string} tsv - * @return {Object} + * @file Visual mapping. */ -function parseTSVContents(tsv) { - var tsvLines = tsv.split(/\n+/g); - var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); - var categories = []; - var series = map(headers, function (header) { - return { - name: header, - data: [] - }; - }); - for (var i = 0; i < tsvLines.length; i++) { - var items = trim$1(tsvLines[i]).split(itemSplitRegex); - categories.push(items.shift()); - for (var j = 0; j < items.length; j++) { - series[j] && (series[j].data[i] = items[j]); - } - } - return { - series: series, - categories: categories - }; -} +var visualDefault = { -/** - * @param {string} str - * @return {Array.} - * @inner - */ -function parseListContents(str) { - var lines = str.split(/\n+/g); - var seriesName = trim$1(lines.shift()); + /** + * @public + */ + get: function (visualType, key, isCategory) { + var value = clone( + (defaultOption$3[visualType] || {})[key] + ); - var data = []; - for (var i = 0; i < lines.length; i++) { - var items = trim$1(lines[i]).split(itemSplitRegex); - var name = ''; - var value; - var hasName = false; - if (isNaN(items[0])) { // First item is name - hasName = true; - name = items[0]; - items = items.slice(1); - data[i] = { - name: name, - value: [] - }; - value = data[i].value; - } - else { - value = data[i] = []; - } - for (var j = 0; j < items.length; j++) { - value.push(+items[j]); - } - if (value.length === 1) { - hasName ? (data[i].value = value[0]) : (data[i] = value[0]); - } + return isCategory + ? (isArray(value) ? value[value.length - 1] : value) + : value; } - return { - name: seriesName, - data: data - }; -} +}; -/** - * @param {string} str - * @param {Array.} blockMetaList - * @return {Object} - * @inner - */ -function parseContents(str, blockMetaList) { - var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); - var newOption = { - series: [] - }; - each$1(blocks, function (block, idx) { - if (isTSVFormat(block)) { - var result = parseTSVContents(block); - var blockMeta = blockMetaList[idx]; - var axisKey = blockMeta.axisDim + 'Axis'; +var defaultOption$3 = { - if (blockMeta) { - newOption[axisKey] = newOption[axisKey] || []; - newOption[axisKey][blockMeta.axisIndex] = { - data: result.categories - }; - newOption.series = newOption.series.concat(result.series); - } - } - else { - var result = parseListContents(block); - newOption.series.push(result); + color: { + active: ['#006edd', '#e0ffff'], + inactive: ['rgba(0,0,0,0)'] + }, + + colorHue: { + active: [0, 360], + inactive: [0, 0] + }, + + colorSaturation: { + active: [0.3, 1], + inactive: [0, 0] + }, + + colorLightness: { + active: [0.9, 0.5], + inactive: [0, 0] + }, + + colorAlpha: { + active: [0.3, 1], + inactive: [0, 0] + }, + + opacity: { + active: [0.3, 1], + inactive: [0, 0] + }, + + symbol: { + active: ['circle', 'roundRect', 'diamond'], + inactive: ['none'] + }, + + symbolSize: { + active: [10, 50], + inactive: [0, 0] + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var mapVisual$2 = VisualMapping.mapVisual; +var eachVisual = VisualMapping.eachVisual; +var isArray$3 = isArray; +var each$28 = each$1; +var asc$3 = asc; +var linearMap$2 = linearMap; +var noop$2 = noop; + +var VisualMapModel = extendComponentModel({ + + type: 'visualMap', + + dependencies: ['series'], + + /** + * @readOnly + * @type {Array.} + */ + stateList: ['inRange', 'outOfRange'], + + /** + * @readOnly + * @type {Array.} + */ + replacableOptionKeys: [ + 'inRange', 'outOfRange', 'target', 'controller', 'color' + ], + + /** + * [lowerBound, upperBound] + * + * @readOnly + * @type {Array.} + */ + dataBound: [-Infinity, Infinity], + + /** + * @readOnly + * @type {string|Object} + */ + layoutMode: {type: 'box', ignoreSize: true}, + + /** + * @protected + */ + defaultOption: { + show: true, + + zlevel: 0, + z: 4, + + seriesIndex: 'all', // 'all' or null/undefined: all series. + // A number or an array of number: the specified series. + + // set min: 0, max: 200, only for campatible with ec2. + // In fact min max should not have default value. + min: 0, // min value, must specified if pieces is not specified. + max: 200, // max value, must specified if pieces is not specified. + + dimension: null, + inRange: null, // 'color', 'colorHue', 'colorSaturation', 'colorLightness', 'colorAlpha', + // 'symbol', 'symbolSize' + outOfRange: null, // 'color', 'colorHue', 'colorSaturation', + // 'colorLightness', 'colorAlpha', + // 'symbol', 'symbolSize' + + left: 0, // 'center' ¦ 'left' ¦ 'right' ¦ {number} (px) + right: null, // The same as left. + top: null, // 'top' ¦ 'bottom' ¦ 'center' ¦ {number} (px) + bottom: 0, // The same as top. + + itemWidth: null, + itemHeight: null, + inverse: false, + orient: 'vertical', // 'horizontal' ¦ 'vertical' + + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 值域边框颜色 + contentColor: '#5793f3', + inactiveColor: '#aaa', + borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) + padding: 5, // 值域内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + textGap: 10, // + precision: 0, // 小数精度,默认为0,无小数点 + color: null, //颜色(deprecated,兼容ec2,顺序同pieces,不同于inRange/outOfRange) + + formatter: null, + text: null, // 文本,如['高', '低'],兼容ec2,text[0]对应高值,text[1]对应低值 + textStyle: { + color: '#333' // 值域文字颜色 + } + }, + + /** + * @protected + */ + init: function (option, parentModel, ecModel) { + + /** + * @private + * @type {Array.} + */ + this._dataExtent; + + /** + * @readOnly + */ + this.targetVisuals = {}; + + /** + * @readOnly + */ + this.controllerVisuals = {}; + + /** + * @readOnly + */ + this.textStyleModel; + + /** + * [width, height] + * @readOnly + * @type {Array.} + */ + this.itemSize; + + this.mergeDefaultAndTheme(option, ecModel); + }, + + /** + * @protected + */ + optionUpdated: function (newOption, isInit) { + var thisOption = this.option; + + // FIXME + // necessary? + // Disable realtime view update if canvas is not supported. + if (!env$1.canvasSupported) { + thisOption.realtime = false; + } + + !isInit && replaceVisualOption( + thisOption, newOption, this.replacableOptionKeys + ); + + this.textStyleModel = this.getModel('textStyle'); + + this.resetItemSize(); + + this.completeVisualOption(); + }, + + /** + * @protected + */ + resetVisual: function (supplementVisualOption) { + var stateList = this.stateList; + supplementVisualOption = bind(supplementVisualOption, this); + + this.controllerVisuals = createVisualMappings( + this.option.controller, stateList, supplementVisualOption + ); + this.targetVisuals = createVisualMappings( + this.option.target, stateList, supplementVisualOption + ); + }, + + /** + * @protected + * @return {Array.} An array of series indices. + */ + getTargetSeriesIndices: function () { + var optionSeriesIndex = this.option.seriesIndex; + var seriesIndices = []; + + if (optionSeriesIndex == null || optionSeriesIndex === 'all') { + this.ecModel.eachSeries(function (seriesModel, index) { + seriesIndices.push(index); + }); + } + else { + seriesIndices = normalizeToArray(optionSeriesIndex); + } + + return seriesIndices; + }, + + /** + * @public + */ + eachTargetSeries: function (callback, context) { + each$1(this.getTargetSeriesIndices(), function (seriesIndex) { + callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex)); + }, this); + }, + + /** + * @pubilc + */ + isTargetSeries: function (seriesModel) { + var is = false; + this.eachTargetSeries(function (model) { + model === seriesModel && (is = true); + }); + return is; + }, + + /** + * @example + * this.formatValueText(someVal); // format single numeric value to text. + * this.formatValueText(someVal, true); // format single category value to text. + * this.formatValueText([min, max]); // format numeric min-max to text. + * this.formatValueText([this.dataBound[0], max]); // using data lower bound. + * this.formatValueText([min, this.dataBound[1]]); // using data upper bound. + * + * @param {number|Array.} value Real value, or this.dataBound[0 or 1]. + * @param {boolean} [isCategory=false] Only available when value is number. + * @param {Array.} edgeSymbols Open-close symbol when value is interval. + * @return {string} + * @protected + */ + formatValueText: function (value, isCategory, edgeSymbols) { + var option = this.option; + var precision = option.precision; + var dataBound = this.dataBound; + var formatter = option.formatter; + var isMinMax; + var textValue; + edgeSymbols = edgeSymbols || ['<', '>']; + + if (isArray(value)) { + value = value.slice(); + isMinMax = true; + } + + textValue = isCategory + ? value + : (isMinMax + ? [toFixed(value[0]), toFixed(value[1])] + : toFixed(value) + ); + + if (isString(formatter)) { + return formatter + .replace('{value}', isMinMax ? textValue[0] : textValue) + .replace('{value2}', isMinMax ? textValue[1] : textValue); + } + else if (isFunction$1(formatter)) { + return isMinMax + ? formatter(value[0], value[1]) + : formatter(value); + } + + if (isMinMax) { + if (value[0] === dataBound[0]) { + return edgeSymbols[0] + ' ' + textValue[1]; + } + else if (value[1] === dataBound[1]) { + return edgeSymbols[1] + ' ' + textValue[0]; + } + else { + return textValue[0] + ' - ' + textValue[1]; + } + } + else { // Format single value (includes category case). + return textValue; + } + + function toFixed(val) { + return val === dataBound[0] + ? 'min' + : val === dataBound[1] + ? 'max' + : (+val).toFixed(Math.min(precision, 20)); + } + }, + + /** + * @protected + */ + resetExtent: function () { + var thisOption = this.option; + + // Can not calculate data extent by data here. + // Because series and data may be modified in processing stage. + // So we do not support the feature "auto min/max". + + var extent = asc$3([thisOption.min, thisOption.max]); + + this._dataExtent = extent; + }, + + /** + * @public + * @param {module:echarts/data/List} list + * @return {string} Concrete dimention. If return null/undefined, + * no dimension used. + */ + getDataDimension: function (list) { + var optDim = this.option.dimension; + var listDimensions = list.dimensions; + if (optDim == null && !listDimensions.length) { + return; + } + + if (optDim != null) { + return list.getDimension(optDim); + } + + var dimNames = list.dimensions; + for (var i = dimNames.length - 1; i >= 0; i--) { + var dimName = dimNames[i]; + var dimInfo = list.getDimensionInfo(dimName); + if (!dimInfo.isCalculationCoord) { + return dimName; + } + } + }, + + /** + * @public + * @override + */ + getExtent: function () { + return this._dataExtent.slice(); + }, + + /** + * @protected + */ + completeVisualOption: function () { + var ecModel = this.ecModel; + var thisOption = this.option; + var base = {inRange: thisOption.inRange, outOfRange: thisOption.outOfRange}; + + var target = thisOption.target || (thisOption.target = {}); + var controller = thisOption.controller || (thisOption.controller = {}); + + merge(target, base); // Do not override + merge(controller, base); // Do not override + + var isCategory = this.isCategory(); + + completeSingle.call(this, target); + completeSingle.call(this, controller); + completeInactive.call(this, target, 'inRange', 'outOfRange'); + // completeInactive.call(this, target, 'outOfRange', 'inRange'); + completeController.call(this, controller); + + function completeSingle(base) { + // Compatible with ec2 dataRange.color. + // The mapping order of dataRange.color is: [high value, ..., low value] + // whereas inRange.color and outOfRange.color is [low value, ..., high value] + // Notice: ec2 has no inverse. + if (isArray$3(thisOption.color) + // If there has been inRange: {symbol: ...}, adding color is a mistake. + // So adding color only when no inRange defined. + && !base.inRange + ) { + base.inRange = {color: thisOption.color.slice().reverse()}; + } + + // Compatible with previous logic, always give a defautl color, otherwise + // simple config with no inRange and outOfRange will not work. + // Originally we use visualMap.color as the default color, but setOption at + // the second time the default color will be erased. So we change to use + // constant DEFAULT_COLOR. + // If user do not want the defualt color, set inRange: {color: null}. + base.inRange = base.inRange || {color: ecModel.get('gradientColor')}; + + // If using shortcut like: {inRange: 'symbol'}, complete default value. + each$28(this.stateList, function (state) { + var visualType = base[state]; + + if (isString(visualType)) { + var defa = visualDefault.get(visualType, 'active', isCategory); + if (defa) { + base[state] = {}; + base[state][visualType] = defa; + } + else { + // Mark as not specified. + delete base[state]; + } + } + }, this); + } + + function completeInactive(base, stateExist, stateAbsent) { + var optExist = base[stateExist]; + var optAbsent = base[stateAbsent]; + + if (optExist && !optAbsent) { + optAbsent = base[stateAbsent] = {}; + each$28(optExist, function (visualData, visualType) { + if (!VisualMapping.isValidType(visualType)) { + return; + } + + var defa = visualDefault.get(visualType, 'inactive', isCategory); + + if (defa != null) { + optAbsent[visualType] = defa; + + // Compatibable with ec2: + // Only inactive color to rgba(0,0,0,0) can not + // make label transparent, so use opacity also. + if (visualType === 'color' + && !optAbsent.hasOwnProperty('opacity') + && !optAbsent.hasOwnProperty('colorAlpha') + ) { + optAbsent.opacity = [0, 0]; + } + } + }); + } + } + + function completeController(controller) { + var symbolExists = (controller.inRange || {}).symbol + || (controller.outOfRange || {}).symbol; + var symbolSizeExists = (controller.inRange || {}).symbolSize + || (controller.outOfRange || {}).symbolSize; + var inactiveColor = this.get('inactiveColor'); + + each$28(this.stateList, function (state) { + + var itemSize = this.itemSize; + var visuals = controller[state]; + + // Set inactive color for controller if no other color + // attr (like colorAlpha) specified. + if (!visuals) { + visuals = controller[state] = { + color: isCategory ? inactiveColor : [inactiveColor] + }; + } + + // Consistent symbol and symbolSize if not specified. + if (visuals.symbol == null) { + visuals.symbol = symbolExists + && clone(symbolExists) + || (isCategory ? 'roundRect' : ['roundRect']); + } + if (visuals.symbolSize == null) { + visuals.symbolSize = symbolSizeExists + && clone(symbolSizeExists) + || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); + } + + // Filter square and none. + visuals.symbol = mapVisual$2(visuals.symbol, function (symbol) { + return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol; + }); + + // Normalize symbolSize + var symbolSize = visuals.symbolSize; + + if (symbolSize != null) { + var max = -Infinity; + // symbolSize can be object when categories defined. + eachVisual(symbolSize, function (value) { + value > max && (max = value); + }); + visuals.symbolSize = mapVisual$2(symbolSize, function (value) { + return linearMap$2(value, [0, max], [0, itemSize[0]], true); + }); + } + + }, this); + } + }, + + /** + * @protected + */ + resetItemSize: function () { + this.itemSize = [ + parseFloat(this.get('itemWidth')), + parseFloat(this.get('itemHeight')) + ]; + }, + + /** + * @public + */ + isCategory: function () { + return !!this.option.categories; + }, + + /** + * @public + * @abstract + */ + setSelected: noop$2, + + /** + * @public + * @abstract + * @param {*|module:echarts/data/List} valueOrData + * @param {number} dataIndex + * @return {string} state See this.stateList + */ + getValueState: noop$2, + + /** + * FIXME + * Do not publish to thirt-part-dev temporarily + * util the interface is stable. (Should it return + * a function but not visual meta?) + * + * @pubilc + * @abstract + * @param {Function} getColorVisual + * params: value, valueState + * return: color + * @return {Object} visualMeta + * should includes {stops, outerColors} + * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] + */ + getVisualMeta: noop$2 + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +// Constant +var DEFAULT_BAR_BOUND = [20, 140]; + +var ContinuousModel = VisualMapModel.extend({ + + type: 'visualMap.continuous', + + /** + * @protected + */ + defaultOption: { + align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom' + calculable: false, // This prop effect default component type determine, + // See echarts/component/visualMap/typeDefaulter. + range: null, // selected range. In default case `range` is [min, max] + // and can auto change along with modification of min max, + // util use specifid a range. + realtime: true, // Whether realtime update. + itemHeight: null, // The length of the range control edge. + itemWidth: null, // The length of the other side. + hoverLink: true, // Enable hover highlight. + hoverLinkDataSize: null, // The size of hovered data. + hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle. + // If not specified, follow the value of `realtime`. + }, + + /** + * @override + */ + optionUpdated: function (newOption, isInit) { + ContinuousModel.superApply(this, 'optionUpdated', arguments); + + this.resetExtent(); + + this.resetVisual(function (mappingOption) { + mappingOption.mappingMethod = 'linear'; + mappingOption.dataExtent = this.getExtent(); + }); + + this._resetRange(); + }, + + /** + * @protected + * @override + */ + resetItemSize: function () { + ContinuousModel.superApply(this, 'resetItemSize', arguments); + + var itemSize = this.itemSize; + + this._orient === 'horizontal' && itemSize.reverse(); + + (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); + (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); + }, + + /** + * @private + */ + _resetRange: function () { + var dataExtent = this.getExtent(); + var range = this.option.range; + + if (!range || range.auto) { + // `range` should always be array (so we dont use other + // value like 'auto') for user-friend. (consider getOption). + dataExtent.auto = 1; + this.option.range = dataExtent; + } + else if (isArray(range)) { + if (range[0] > range[1]) { + range.reverse(); + } + range[0] = Math.max(range[0], dataExtent[0]); + range[1] = Math.min(range[1], dataExtent[1]); + } + }, + + /** + * @protected + * @override + */ + completeVisualOption: function () { + VisualMapModel.prototype.completeVisualOption.apply(this, arguments); + + each$1(this.stateList, function (state) { + var symbolSize = this.option.controller[state].symbolSize; + if (symbolSize && symbolSize[0] !== symbolSize[1]) { + symbolSize[0] = 0; // For good looking. + } + }, this); + }, + + /** + * @override + */ + setSelected: function (selected) { + this.option.range = selected.slice(); + this._resetRange(); + }, + + /** + * @public + */ + getSelected: function () { + var dataExtent = this.getExtent(); + + var dataInterval = asc( + (this.get('range') || []).slice() + ); + + // Clamp + dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); + dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); + dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); + dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); + + return dataInterval; + }, + + /** + * @override + */ + getValueState: function (value) { + var range = this.option.range; + var dataExtent = this.getExtent(); + + // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'. + // range[1] is processed likewise. + return ( + (range[0] <= dataExtent[0] || range[0] <= value) + && (range[1] >= dataExtent[1] || value <= range[1]) + ) ? 'inRange' : 'outOfRange'; + }, + + /** + * @params {Array.} range target value: range[0] <= value && value <= range[1] + * @return {Array.} [{seriesId, dataIndices: >}, ...] + */ + findTargetDataIndices: function (range) { + var result = []; + + this.eachTargetSeries(function (seriesModel) { + var dataIndices = []; + var data = seriesModel.getData(); + + data.each(this.getDataDimension(data), function (value, dataIndex) { + range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); + }, this); + + result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); + }, this); + + return result; + }, + + /** + * @implement + */ + getVisualMeta: function (getColorVisual) { + var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); + var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); + var stops = []; + + function setStop(value, valueState) { + stops.push({ + value: value, + color: getColorVisual(value, valueState) + }); + } + + // Format to: outOfRange -- inRange -- outOfRange. + var iIdx = 0; + var oIdx = 0; + var iLen = iVals.length; + var oLen = oVals.length; + + for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { + // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. + if (oVals[oIdx] < iVals[iIdx]) { + setStop(oVals[oIdx], 'outOfRange'); + } + } + for (var first = 1; iIdx < iLen; iIdx++, first = 0) { + // If range is full, value beyond min, max will be clamped. + // make a singularity + first && stops.length && setStop(iVals[iIdx], 'outOfRange'); + setStop(iVals[iIdx], 'inRange'); + } + for (var first = 1; oIdx < oLen; oIdx++) { + if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { + // make a singularity + if (first) { + stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); + first = 0; + } + setStop(oVals[oIdx], 'outOfRange'); + } + } + + var stopsLen = stops.length; + + return { + stops: stops, + outerColors: [ + stopsLen ? stops[0].color : 'transparent', + stopsLen ? stops[stopsLen - 1].color : 'transparent' + ] + }; + } + +}); + +function getColorStopValues(visualMapModel, valueState, dataExtent) { + if (dataExtent[0] === dataExtent[1]) { + return dataExtent.slice(); + } + + // When using colorHue mapping, it is not linear color any more. + // Moreover, canvas gradient seems not to be accurate linear. + // FIXME + // Should be arbitrary value 100? or based on pixel size? + var count = 200; + var step = (dataExtent[1] - dataExtent[0]) / count; + + var value = dataExtent[0]; + var stopValues = []; + for (var i = 0; i <= count && value < dataExtent[1]; i++) { + stopValues.push(value); + value += step; + } + stopValues.push(dataExtent[1]); + + return stopValues; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var VisualMapView = extendComponentView({ + + type: 'visualMap', + + /** + * @readOnly + * @type {Object} + */ + autoPositionValues: {left: 1, right: 1, top: 1, bottom: 1}, + + init: function (ecModel, api) { + /** + * @readOnly + * @type {module:echarts/model/Global} + */ + this.ecModel = ecModel; + + /** + * @readOnly + * @type {module:echarts/ExtensionAPI} + */ + this.api = api; + + /** + * @readOnly + * @type {module:echarts/component/visualMap/visualMapModel} + */ + this.visualMapModel; + }, + + /** + * @protected + */ + render: function (visualMapModel, ecModel, api, payload) { + this.visualMapModel = visualMapModel; + + if (visualMapModel.get('show') === false) { + this.group.removeAll(); + return; + } + + this.doRender.apply(this, arguments); + }, + + /** + * @protected + */ + renderBackground: function (group) { + var visualMapModel = this.visualMapModel; + var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0); + var rect = group.getBoundingRect(); + + group.add(new Rect({ + z2: -1, // Lay background rect on the lowest layer. + silent: true, + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[3] + padding[1], + height: rect.height + padding[0] + padding[2] + }, + style: { + fill: visualMapModel.get('backgroundColor'), + stroke: visualMapModel.get('borderColor'), + lineWidth: visualMapModel.get('borderWidth') + } + })); + }, + + /** + * @protected + * @param {number} targetValue can be Infinity or -Infinity + * @param {string=} visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' + * @param {Object} [opts] + * @param {string=} [opts.forceState] Specify state, instead of using getValueState method. + * @param {string=} [opts.convertOpacityToAlpha=false] For color gradient in controller widget. + * @return {*} Visual value. + */ + getControllerVisual: function (targetValue, visualCluster, opts) { + opts = opts || {}; + + var forceState = opts.forceState; + var visualMapModel = this.visualMapModel; + var visualObj = {}; + + // Default values. + if (visualCluster === 'symbol') { + visualObj.symbol = visualMapModel.get('itemSymbol'); + } + if (visualCluster === 'color') { + var defaultColor = visualMapModel.get('contentColor'); + visualObj.color = defaultColor; + } + + function getter(key) { + return visualObj[key]; + } + + function setter(key, value) { + visualObj[key] = value; + } + + var mappings = visualMapModel.controllerVisuals[ + forceState || visualMapModel.getValueState(targetValue) + ]; + var visualTypes = VisualMapping.prepareVisualTypes(mappings); + + each$1(visualTypes, function (type) { + var visualMapping = mappings[type]; + if (opts.convertOpacityToAlpha && type === 'opacity') { + type = 'colorAlpha'; + visualMapping = mappings.__alphaForOpacity; + } + if (VisualMapping.dependsOn(type, visualCluster)) { + visualMapping && visualMapping.applyVisual( + targetValue, getter, setter + ); + } + }); + + return visualObj[visualCluster]; + }, + + /** + * @protected + */ + positionGroup: function (group) { + var model = this.visualMapModel; + var api = this.api; + + positionElement( + group, + model.getBoxLayoutParams(), + {width: api.getWidth(), height: api.getHeight()} + ); + }, + + /** + * @protected + * @abstract + */ + doRender: noop + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/** + * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\ + * @param {module:echarts/ExtensionAPI} api + * @param {Array.} itemSize always [short, long] + * @return {string} 'left' or 'right' or 'top' or 'bottom' + */ +function getItemAlign(visualMapModel, api, itemSize) { + var modelOption = visualMapModel.option; + var itemAlign = modelOption.align; + + if (itemAlign != null && itemAlign !== 'auto') { + return itemAlign; + } + + // Auto decision align. + var ecSize = {width: api.getWidth(), height: api.getHeight()}; + var realIndex = modelOption.orient === 'horizontal' ? 1 : 0; + + var paramsSet = [ + ['left', 'right', 'width'], + ['top', 'bottom', 'height'] + ]; + var reals = paramsSet[realIndex]; + var fakeValue = [0, null, 10]; + + var layoutInput = {}; + for (var i = 0; i < 3; i++) { + layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; + layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; + } + + var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex]; + var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); + + return reals[ + (rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 + < ecSize[rParam[1]] * 0.5 ? 0 : 1 + ]; +} + +/** + * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and + * dataIndexInside means filtered index. + */ +function makeHighDownBatch(batch, visualMapModel) { + each$1(batch || [], function (batchItem) { + if (batchItem.dataIndex != null) { + batchItem.dataIndexInside = batchItem.dataIndex; + batchItem.dataIndex = null; + } + batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : ''); + }); + return batch; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var linearMap$3 = linearMap; +var each$29 = each$1; +var mathMin$8 = Math.min; +var mathMax$8 = Math.max; + +// Arbitrary value +var HOVER_LINK_SIZE = 12; +var HOVER_LINK_OUT = 6; + +// Notice: +// Any "interval" should be by the order of [low, high]. +// "handle0" (handleIndex === 0) maps to +// low data value: this._dataInterval[0] and has low coord. +// "handle1" (handleIndex === 1) maps to +// high data value: this._dataInterval[1] and has high coord. +// The logic of transform is implemented in this._createBarGroup. + +var ContinuousView = VisualMapView.extend({ + + type: 'visualMap.continuous', + + /** + * @override + */ + init: function () { + + ContinuousView.superApply(this, 'init', arguments); + + /** + * @private + */ + this._shapes = {}; + + /** + * @private + */ + this._dataInterval = []; + + /** + * @private + */ + this._handleEnds = []; + + /** + * @private + */ + this._orient; + + /** + * @private + */ + this._useHandle; + + /** + * @private + */ + this._hoverLinkDataIndices = []; + + /** + * @private + */ + this._dragging; + + /** + * @private + */ + this._hovering; + }, + + /** + * @protected + * @override + */ + doRender: function (visualMapModel, ecModel, api, payload) { + if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { + this._buildView(); + } + }, + + /** + * @private + */ + _buildView: function () { + this.group.removeAll(); + + var visualMapModel = this.visualMapModel; + var thisGroup = this.group; + + this._orient = visualMapModel.get('orient'); + this._useHandle = visualMapModel.get('calculable'); + + this._resetInterval(); + + this._renderBar(thisGroup); + + var dataRangeText = visualMapModel.get('text'); + this._renderEndsText(thisGroup, dataRangeText, 0); + this._renderEndsText(thisGroup, dataRangeText, 1); + + // Do this for background size calculation. + this._updateView(true); + + // After updating view, inner shapes is built completely, + // and then background can be rendered. + this.renderBackground(thisGroup); + + // Real update view + this._updateView(); + + this._enableHoverLinkToSeries(); + this._enableHoverLinkFromSeries(); + + this.positionGroup(thisGroup); + }, + + /** + * @private + */ + _renderEndsText: function (group, dataRangeText, endsIndex) { + if (!dataRangeText) { + return; + } + + // Compatible with ec2, text[0] map to high value, text[1] map low value. + var text = dataRangeText[1 - endsIndex]; + text = text != null ? text + '' : ''; + + var visualMapModel = this.visualMapModel; + var textGap = visualMapModel.get('textGap'); + var itemSize = visualMapModel.itemSize; + + var barGroup = this._shapes.barGroup; + var position = this._applyTransform( + [ + itemSize[0] / 2, + endsIndex === 0 ? -textGap : itemSize[1] + textGap + ], + barGroup + ); + var align = this._applyTransform( + endsIndex === 0 ? 'bottom' : 'top', + barGroup + ); + var orient = this._orient; + var textStyleModel = this.visualMapModel.textStyleModel; + + this.group.add(new Text({ + style: { + x: position[0], + y: position[1], + textVerticalAlign: orient === 'horizontal' ? 'middle' : align, + textAlign: orient === 'horizontal' ? align : 'center', + text: text, + textFont: textStyleModel.getFont(), + textFill: textStyleModel.getTextColor() + } + })); + }, + + /** + * @private + */ + _renderBar: function (targetGroup) { + var visualMapModel = this.visualMapModel; + var shapes = this._shapes; + var itemSize = visualMapModel.itemSize; + var orient = this._orient; + var useHandle = this._useHandle; + var itemAlign = getItemAlign(visualMapModel, this.api, itemSize); + var barGroup = shapes.barGroup = this._createBarGroup(itemAlign); + + // Bar + barGroup.add(shapes.outOfRange = createPolygon()); + barGroup.add(shapes.inRange = createPolygon( + null, + useHandle ? getCursor$1(this._orient) : null, + bind(this._dragHandle, this, 'all', false), + bind(this._dragHandle, this, 'all', true) + )); + + var textRect = visualMapModel.textStyleModel.getTextRect('国'); + var textSize = mathMax$8(textRect.width, textRect.height); + + // Handle + if (useHandle) { + shapes.handleThumbs = []; + shapes.handleLabels = []; + shapes.handleLabelPoints = []; + + this._createHandle(barGroup, 0, itemSize, textSize, orient, itemAlign); + this._createHandle(barGroup, 1, itemSize, textSize, orient, itemAlign); + } + + this._createIndicator(barGroup, itemSize, textSize, orient); + + targetGroup.add(barGroup); + }, + + /** + * @private + */ + _createHandle: function (barGroup, handleIndex, itemSize, textSize, orient) { + var onDrift = bind(this._dragHandle, this, handleIndex, false); + var onDragEnd = bind(this._dragHandle, this, handleIndex, true); + var handleThumb = createPolygon( + createHandlePoints(handleIndex, textSize), + getCursor$1(this._orient), + onDrift, + onDragEnd + ); + handleThumb.position[0] = itemSize[0]; + barGroup.add(handleThumb); + + // Text is always horizontal layout but should not be effected by + // transform (orient/inverse). So label is built separately but not + // use zrender/graphic/helper/RectText, and is located based on view + // group (according to handleLabelPoint) but not barGroup. + var textStyleModel = this.visualMapModel.textStyleModel; + var handleLabel = new Text({ + draggable: true, + drift: onDrift, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: onDragEnd, + style: { + x: 0, y: 0, text: '', + textFont: textStyleModel.getFont(), + textFill: textStyleModel.getTextColor() + } + }); + this.group.add(handleLabel); + + var handleLabelPoint = [ + orient === 'horizontal' + ? textSize / 2 + : textSize * 1.5, + orient === 'horizontal' + ? (handleIndex === 0 ? -(textSize * 1.5) : (textSize * 1.5)) + : (handleIndex === 0 ? -textSize / 2 : textSize / 2) + ]; + + var shapes = this._shapes; + shapes.handleThumbs[handleIndex] = handleThumb; + shapes.handleLabelPoints[handleIndex] = handleLabelPoint; + shapes.handleLabels[handleIndex] = handleLabel; + }, + + /** + * @private + */ + _createIndicator: function (barGroup, itemSize, textSize, orient) { + var indicator = createPolygon([[0, 0]], 'move'); + indicator.position[0] = itemSize[0]; + indicator.attr({invisible: true, silent: true}); + barGroup.add(indicator); + + var textStyleModel = this.visualMapModel.textStyleModel; + var indicatorLabel = new Text({ + silent: true, + invisible: true, + style: { + x: 0, y: 0, text: '', + textFont: textStyleModel.getFont(), + textFill: textStyleModel.getTextColor() + } + }); + this.group.add(indicatorLabel); + + var indicatorLabelPoint = [ + orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT + 3, + 0 + ]; + + var shapes = this._shapes; + shapes.indicator = indicator; + shapes.indicatorLabel = indicatorLabel; + shapes.indicatorLabelPoint = indicatorLabelPoint; + }, + + /** + * @private + */ + _dragHandle: function (handleIndex, isEnd, dx, dy) { + if (!this._useHandle) { + return; + } + + this._dragging = !isEnd; + + if (!isEnd) { + // Transform dx, dy to bar coordination. + var vertex = this._applyTransform([dx, dy], this._shapes.barGroup, true); + this._updateInterval(handleIndex, vertex[1]); + + // Considering realtime, update view should be executed + // before dispatch action. + this._updateView(); + } + + // dragEnd do not dispatch action when realtime. + if (isEnd === !this.visualMapModel.get('realtime')) { // jshint ignore:line + this.api.dispatchAction({ + type: 'selectDataRange', + from: this.uid, + visualMapId: this.visualMapModel.id, + selected: this._dataInterval.slice() + }); + } + + if (isEnd) { + !this._hovering && this._clearHoverLinkToSeries(); + } + else if (useHoverLinkOnHandle(this.visualMapModel)) { + this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); + } + }, + + /** + * @private + */ + _resetInterval: function () { + var visualMapModel = this.visualMapModel; + + var dataInterval = this._dataInterval = visualMapModel.getSelected(); + var dataExtent = visualMapModel.getExtent(); + var sizeExtent = [0, visualMapModel.itemSize[1]]; + + this._handleEnds = [ + linearMap$3(dataInterval[0], dataExtent, sizeExtent, true), + linearMap$3(dataInterval[1], dataExtent, sizeExtent, true) + ]; + }, + + /** + * @private + * @param {(number|string)} handleIndex 0 or 1 or 'all' + * @param {number} dx + * @param {number} dy + */ + _updateInterval: function (handleIndex, delta) { + delta = delta || 0; + var visualMapModel = this.visualMapModel; + var handleEnds = this._handleEnds; + var sizeExtent = [0, visualMapModel.itemSize[1]]; + + sliderMove( + delta, + handleEnds, + sizeExtent, + handleIndex, + // cross is forbiden + 0 + ); + + var dataExtent = visualMapModel.getExtent(); + // Update data interval. + this._dataInterval = [ + linearMap$3(handleEnds[0], sizeExtent, dataExtent, true), + linearMap$3(handleEnds[1], sizeExtent, dataExtent, true) + ]; + }, + + /** + * @private + */ + _updateView: function (forSketch) { + var visualMapModel = this.visualMapModel; + var dataExtent = visualMapModel.getExtent(); + var shapes = this._shapes; + + var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; + var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; + + var visualInRange = this._createBarVisual( + this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange' + ); + var visualOutOfRange = this._createBarVisual( + dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange' + ); + + shapes.inRange + .setStyle({ + fill: visualInRange.barColor, + opacity: visualInRange.opacity + }) + .setShape('points', visualInRange.barPoints); + shapes.outOfRange + .setStyle({ + fill: visualOutOfRange.barColor, + opacity: visualOutOfRange.opacity + }) + .setShape('points', visualOutOfRange.barPoints); + + this._updateHandle(inRangeHandleEnds, visualInRange); + }, + + /** + * @private + */ + _createBarVisual: function (dataInterval, dataExtent, handleEnds, forceState) { + var opts = { + forceState: forceState, + convertOpacityToAlpha: true + }; + var colorStops = this._makeColorGradient(dataInterval, opts); + + var symbolSizes = [ + this.getControllerVisual(dataInterval[0], 'symbolSize', opts), + this.getControllerVisual(dataInterval[1], 'symbolSize', opts) + ]; + var barPoints = this._createBarPoints(handleEnds, symbolSizes); + + return { + barColor: new LinearGradient(0, 0, 0, 1, colorStops), + barPoints: barPoints, + handlesColor: [ + colorStops[0].color, + colorStops[colorStops.length - 1].color + ] + }; + }, + + /** + * @private + */ + _makeColorGradient: function (dataInterval, opts) { + // Considering colorHue, which is not linear, so we have to sample + // to calculate gradient color stops, but not only caculate head + // and tail. + var sampleNumber = 100; // Arbitrary value. + var colorStops = []; + var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; + + colorStops.push({ + color: this.getControllerVisual(dataInterval[0], 'color', opts), + offset: 0 + }); + + for (var i = 1; i < sampleNumber; i++) { + var currValue = dataInterval[0] + step * i; + if (currValue > dataInterval[1]) { + break; + } + colorStops.push({ + color: this.getControllerVisual(currValue, 'color', opts), + offset: i / sampleNumber + }); + } + + colorStops.push({ + color: this.getControllerVisual(dataInterval[1], 'color', opts), + offset: 1 + }); + + return colorStops; + }, + + /** + * @private + */ + _createBarPoints: function (handleEnds, symbolSizes) { + var itemSize = this.visualMapModel.itemSize; + + return [ + [itemSize[0] - symbolSizes[0], handleEnds[0]], + [itemSize[0], handleEnds[0]], + [itemSize[0], handleEnds[1]], + [itemSize[0] - symbolSizes[1], handleEnds[1]] + ]; + }, + + /** + * @private + */ + _createBarGroup: function (itemAlign) { + var orient = this._orient; + var inverse = this.visualMapModel.get('inverse'); + + return new Group( + (orient === 'horizontal' && !inverse) + ? {scale: itemAlign === 'bottom' ? [1, 1] : [-1, 1], rotation: Math.PI / 2} + : (orient === 'horizontal' && inverse) + ? {scale: itemAlign === 'bottom' ? [-1, 1] : [1, 1], rotation: -Math.PI / 2} + : (orient === 'vertical' && !inverse) + ? {scale: itemAlign === 'left' ? [1, -1] : [-1, -1]} + : {scale: itemAlign === 'left' ? [1, 1] : [-1, 1]} + ); + }, + + /** + * @private + */ + _updateHandle: function (handleEnds, visualInRange) { + if (!this._useHandle) { + return; + } + + var shapes = this._shapes; + var visualMapModel = this.visualMapModel; + var handleThumbs = shapes.handleThumbs; + var handleLabels = shapes.handleLabels; + + each$29([0, 1], function (handleIndex) { + var handleThumb = handleThumbs[handleIndex]; + handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); + handleThumb.position[1] = handleEnds[handleIndex]; + + // Update handle label position. + var textPoint = applyTransform$1( + shapes.handleLabelPoints[handleIndex], + getTransform(handleThumb, this.group) + ); + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), + textVerticalAlign: 'middle', + textAlign: this._applyTransform( + this._orient === 'horizontal' + ? (handleIndex === 0 ? 'bottom' : 'top') + : 'left', + shapes.barGroup + ) + }); + }, this); + }, + + /** + * @private + * @param {number} cursorValue + * @param {number} textValue + * @param {string} [rangeSymbol] + * @param {number} [halfHoverLinkSize] + */ + _showIndicator: function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { + var visualMapModel = this.visualMapModel; + var dataExtent = visualMapModel.getExtent(); + var itemSize = visualMapModel.itemSize; + var sizeExtent = [0, itemSize[1]]; + var pos = linearMap$3(cursorValue, dataExtent, sizeExtent, true); + + var shapes = this._shapes; + var indicator = shapes.indicator; + if (!indicator) { + return; + } + + indicator.position[1] = pos; + indicator.attr('invisible', false); + indicator.setShape('points', createIndicatorPoints( + !!rangeSymbol, halfHoverLinkSize, pos, itemSize[1] + )); + + var opts = {convertOpacityToAlpha: true}; + var color = this.getControllerVisual(cursorValue, 'color', opts); + indicator.setStyle('fill', color); + + // Update handle label position. + var textPoint = applyTransform$1( + shapes.indicatorLabelPoint, + getTransform(indicator, this.group) + ); + + var indicatorLabel = shapes.indicatorLabel; + indicatorLabel.attr('invisible', false); + var align = this._applyTransform('left', shapes.barGroup); + var orient = this._orient; + indicatorLabel.setStyle({ + text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), + textVerticalAlign: orient === 'horizontal' ? align : 'middle', + textAlign: orient === 'horizontal' ? 'center' : align, + x: textPoint[0], + y: textPoint[1] + }); + }, + + /** + * @private + */ + _enableHoverLinkToSeries: function () { + var self = this; + this._shapes.barGroup + + .on('mousemove', function (e) { + self._hovering = true; + + if (!self._dragging) { + var itemSize = self.visualMapModel.itemSize; + var pos = self._applyTransform( + [e.offsetX, e.offsetY], self._shapes.barGroup, true, true + ); + // For hover link show when hover handle, which might be + // below or upper than sizeExtent. + pos[1] = mathMin$8(mathMax$8(0, pos[1]), itemSize[1]); + self._doHoverLinkToSeries( + pos[1], + 0 <= pos[0] && pos[0] <= itemSize[0] + ); + } + }) + + .on('mouseout', function () { + // When mouse is out of handle, hoverLink still need + // to be displayed when realtime is set as false. + self._hovering = false; + !self._dragging && self._clearHoverLinkToSeries(); + }); + }, + + /** + * @private + */ + _enableHoverLinkFromSeries: function () { + var zr = this.api.getZr(); + + if (this.visualMapModel.option.hoverLink) { + zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); + zr.on('mouseout', this._hideIndicator, this); + } + else { + this._clearHoverLinkFromSeries(); + } + }, + + /** + * @private + */ + _doHoverLinkToSeries: function (cursorPos, hoverOnBar) { + var visualMapModel = this.visualMapModel; + var itemSize = visualMapModel.itemSize; + + if (!visualMapModel.option.hoverLink) { + return; + } + + var sizeExtent = [0, itemSize[1]]; + var dataExtent = visualMapModel.getExtent(); + + // For hover link show when hover handle, which might be below or upper than sizeExtent. + cursorPos = mathMin$8(mathMax$8(sizeExtent[0], cursorPos), sizeExtent[1]); + + var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); + var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; + var cursorValue = linearMap$3(cursorPos, sizeExtent, dataExtent, true); + var valueRange = [ + linearMap$3(hoverRange[0], sizeExtent, dataExtent, true), + linearMap$3(hoverRange[1], sizeExtent, dataExtent, true) + ]; + // Consider data range is out of visualMap range, see test/visualMap-continuous.html, + // where china and india has very large population. + hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); + hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); + + // Do not show indicator when mouse is over handle, + // otherwise labels overlap, especially when dragging. + if (hoverOnBar) { + if (valueRange[0] === -Infinity) { + this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); + } + else if (valueRange[1] === Infinity) { + this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); + } + else { + this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); + } + } + + // When realtime is set as false, handles, which are in barGroup, + // also trigger hoverLink, which help user to realize where they + // focus on when dragging. (see test/heatmap-large.html) + // When realtime is set as true, highlight will not show when hover + // handle, because the label on handle, which displays a exact value + // but not range, might mislead users. + var oldBatch = this._hoverLinkDataIndices; + var newBatch = []; + if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { + newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); + } + + var resultBatches = compressBatches(oldBatch, newBatch); + + this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel)); + this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel)); + }, + + /** + * @private + */ + _hoverLinkFromSeriesMouseOver: function (e) { + var el = e.target; + var visualMapModel = this.visualMapModel; + + if (!el || el.dataIndex == null) { + return; + } + + var dataModel = this.ecModel.getSeriesByIndex(el.seriesIndex); + + if (!visualMapModel.isTargetSeries(dataModel)) { + return; + } + + var data = dataModel.getData(el.dataType); + var value = data.get(visualMapModel.getDataDimension(data), el.dataIndex, true); + + if (!isNaN(value)) { + this._showIndicator(value, value); } + }, + + /** + * @private + */ + _hideIndicator: function () { + var shapes = this._shapes; + shapes.indicator && shapes.indicator.attr('invisible', true); + shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); + }, + + /** + * @private + */ + _clearHoverLinkToSeries: function () { + this._hideIndicator(); + + var indices = this._hoverLinkDataIndices; + this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel)); + + indices.length = 0; + }, + + /** + * @private + */ + _clearHoverLinkFromSeries: function () { + this._hideIndicator(); + + var zr = this.api.getZr(); + zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); + zr.off('mouseout', this._hideIndicator); + }, + + /** + * @private + */ + _applyTransform: function (vertex, element, inverse, global) { + var transform = getTransform(element, global ? null : this.group); + + return graphic[ + isArray(vertex) ? 'applyTransform' : 'transformDirection' + ](vertex, transform, inverse); + }, + + /** + * @private + */ + _dispatchHighDown: function (type, batch) { + batch && batch.length && this.api.dispatchAction({ + type: type, + batch: batch + }); + }, + + /** + * @override + */ + dispose: function () { + this._clearHoverLinkFromSeries(); + this._clearHoverLinkToSeries(); + }, + + /** + * @override + */ + remove: function () { + this._clearHoverLinkFromSeries(); + this._clearHoverLinkToSeries(); + } + +}); + +function createPolygon(points, cursor, onDrift, onDragEnd) { + return new Polygon({ + shape: {points: points}, + draggable: !!onDrift, + cursor: cursor, + drift: onDrift, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: onDragEnd }); - return newOption; } -/** - * @alias {module:echarts/component/toolbox/feature/DataView} - * @constructor - * @param {module:echarts/model/Model} model - */ -function DataView(model) { +function createHandlePoints(handleIndex, textSize) { + return handleIndex === 0 + ? [[0, 0], [textSize, 0], [textSize, -textSize]] + : [[0, 0], [textSize, 0], [textSize, textSize]]; +} - this._dom = null; +function createIndicatorPoints(isRange, halfHoverLinkSize, pos, extentMax) { + return isRange + ? [ // indicate range + [0, -mathMin$8(halfHoverLinkSize, mathMax$8(pos, 0))], + [HOVER_LINK_OUT, 0], + [0, mathMin$8(halfHoverLinkSize, mathMax$8(extentMax - pos, 0))] + ] + : [ // indicate single value + [0, 0], [5, -5], [5, 5] + ]; +} - this.model = model; +function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { + var halfHoverLinkSize = HOVER_LINK_SIZE / 2; + var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); + if (hoverLinkDataSize) { + halfHoverLinkSize = linearMap$3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; + } + return halfHoverLinkSize; } -DataView.defaultOption = { - show: true, - readOnly: false, - optionToContent: null, - contentToOption: null, +function useHoverLinkOnHandle(visualMapModel) { + var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); + return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); +} - icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28', - title: clone(dataViewLang.title), - lang: clone(dataViewLang.lang), - backgroundColor: '#fff', - textColor: '#000', - textareaColor: '#fff', - textareaBorderColor: '#333', - buttonColor: '#c23531', - buttonTextColor: '#fff' +function getCursor$1(orient) { + return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var actionInfo$2 = { + type: 'selectDataRange', + event: 'dataRangeSelected', + // FIXME use updateView appears wrong + update: 'update' }; -DataView.prototype.onclick = function (ecModel, api) { - var container = api.getDom(); - var model = this.model; - if (this._dom) { - container.removeChild(this._dom); - } - var root = document.createElement('div'); - root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;'; - root.style.backgroundColor = model.get('backgroundColor') || '#fff'; +registerAction(actionInfo$2, function (payload, ecModel) { - // Create elements - var header = document.createElement('h4'); - var lang$$1 = model.get('lang') || []; - header.innerHTML = lang$$1[0] || model.get('title'); - header.style.cssText = 'margin: 10px 20px;'; - header.style.color = model.get('textColor'); + ecModel.eachComponent({mainType: 'visualMap', query: payload}, function (model) { + model.setSelected(payload.selected); + }); - var viewMain = document.createElement('div'); - var textarea = document.createElement('textarea'); - viewMain.style.cssText = 'display:block;width:100%;overflow:auto;'; +}); - var optionToContent = model.get('optionToContent'); - var contentToOption = model.get('contentToOption'); - var result = getContentFromModel(ecModel); - if (typeof optionToContent === 'function') { - var htmlOrDom = optionToContent(api.getOption()); - if (typeof htmlOrDom === 'string') { - viewMain.innerHTML = htmlOrDom; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/** + * DataZoom component entry + */ + +registerPreprocessor(preprocessor$3); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +var PiecewiseModel = VisualMapModel.extend({ + + type: 'visualMap.piecewise', + + /** + * Order Rule: + * + * option.categories / option.pieces / option.text / option.selected: + * If !option.inverse, + * Order when vertical: ['top', ..., 'bottom']. + * Order when horizontal: ['left', ..., 'right']. + * If option.inverse, the meaning of + * the order should be reversed. + * + * this._pieceList: + * The order is always [low, ..., high]. + * + * Mapping from location to low-high: + * If !option.inverse + * When vertical, top is high. + * When horizontal, right is high. + * If option.inverse, reverse. + */ + + /** + * @protected + */ + defaultOption: { + selected: null, // Object. If not specified, means selected. + // When pieces and splitNumber: {'0': true, '5': true} + // When categories: {'cate1': false, 'cate3': true} + // When selected === false, means all unselected. + + minOpen: false, // Whether include values that smaller than `min`. + maxOpen: false, // Whether include values that bigger than `max`. + + align: 'auto', // 'auto', 'left', 'right' + itemWidth: 20, // When put the controller vertically, it is the length of + // horizontal side of each item. Otherwise, vertical side. + itemHeight: 14, // When put the controller vertically, it is the length of + // vertical side of each item. Otherwise, horizontal side. + itemSymbol: 'roundRect', + pieceList: null, // Each item is Object, with some of those attrs: + // {min, max, lt, gt, lte, gte, value, + // color, colorSaturation, colorAlpha, opacity, + // symbol, symbolSize}, which customize the range or visual + // coding of the certain piece. Besides, see "Order Rule". + categories: null, // category names, like: ['some1', 'some2', 'some3']. + // Attr min/max are ignored when categories set. See "Order Rule" + splitNumber: 5, // If set to 5, auto split five pieces equally. + // If set to 0 and component type not set, component type will be + // determined as "continuous". (It is less reasonable but for ec2 + // compatibility, see echarts/component/visualMap/typeDefaulter) + selectedMode: 'multiple', // Can be 'multiple' or 'single'. + itemGap: 10, // The gap between two items, in px. + hoverLink: true, // Enable hover highlight. + + showLabel: null // By default, when text is used, label will hide (the logic + // is remained for compatibility reason) + }, + + /** + * @override + */ + optionUpdated: function (newOption, isInit) { + PiecewiseModel.superApply(this, 'optionUpdated', arguments); + + /** + * The order is always [low, ..., high]. + * [{text: string, interval: Array.}, ...] + * @private + * @type {Array.} + */ + this._pieceList = []; + + this.resetExtent(); + + /** + * 'pieces', 'categories', 'splitNumber' + * @type {string} + */ + var mode = this._mode = this._determineMode(); + + resetMethods[this._mode].call(this); + + this._resetSelected(newOption, isInit); + + var categories = this.option.categories; + + this.resetVisual(function (mappingOption, state) { + if (mode === 'categories') { + mappingOption.mappingMethod = 'category'; + mappingOption.categories = clone(categories); + } + else { + mappingOption.dataExtent = this.getExtent(); + mappingOption.mappingMethod = 'piecewise'; + mappingOption.pieceList = map(this._pieceList, function (piece) { + var piece = clone(piece); + if (state !== 'inRange') { + // FIXME + // outOfRange do not support special visual in pieces. + piece.visual = null; + } + return piece; + }); + } + }); + }, + + /** + * @protected + * @override + */ + completeVisualOption: function () { + // Consider this case: + // visualMap: { + // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] + // } + // where no inRange/outOfRange set but only pieces. So we should make + // default inRange/outOfRange for this case, otherwise visuals that only + // appear in `pieces` will not be taken into account in visual encoding. + + var option = this.option; + var visualTypesInPieces = {}; + var visualTypes = VisualMapping.listVisualTypes(); + var isCategory = this.isCategory(); + + each$1(option.pieces, function (piece) { + each$1(visualTypes, function (visualType) { + if (piece.hasOwnProperty(visualType)) { + visualTypesInPieces[visualType] = 1; + } + }); + }); + + each$1(visualTypesInPieces, function (v, visualType) { + var exists = 0; + each$1(this.stateList, function (state) { + exists |= has(option, state, visualType) + || has(option.target, state, visualType); + }, this); + + !exists && each$1(this.stateList, function (state) { + (option[state] || (option[state] = {}))[visualType] = visualDefault.get( + visualType, state === 'inRange' ? 'active' : 'inactive', isCategory + ); + }); + }, this); + + function has(obj, state, visualType) { + return obj && obj[state] && ( + isObject$1(obj[state]) + ? obj[state].hasOwnProperty(visualType) + : obj[state] === visualType // e.g., inRange: 'symbol' + ); } - else if (isDom(htmlOrDom)) { - viewMain.appendChild(htmlOrDom); + + VisualMapModel.prototype.completeVisualOption.apply(this, arguments); + }, + + _resetSelected: function (newOption, isInit) { + var thisOption = this.option; + var pieceList = this._pieceList; + + // Selected do not merge but all override. + var selected = (isInit ? thisOption : newOption).selected || {}; + thisOption.selected = selected; + + // Consider 'not specified' means true. + each$1(pieceList, function (piece, index) { + var key = this.getSelectedMapKey(piece); + if (!selected.hasOwnProperty(key)) { + selected[key] = true; + } + }, this); + + if (thisOption.selectedMode === 'single') { + // Ensure there is only one selected. + var hasSel = false; + + each$1(pieceList, function (piece, index) { + var key = this.getSelectedMapKey(piece); + if (selected[key]) { + hasSel + ? (selected[key] = false) + : (hasSel = true); + } + }, this); } - } - else { - // Use default textarea - viewMain.appendChild(textarea); - textarea.readOnly = model.get('readOnly'); - textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;'; - textarea.style.color = model.get('textColor'); - textarea.style.borderColor = model.get('textareaBorderColor'); - textarea.style.backgroundColor = model.get('textareaColor'); - textarea.value = result.value; - } + // thisOption.selectedMode === 'multiple', default: all selected. + }, - var blockMetaList = result.meta; + /** + * @public + */ + getSelectedMapKey: function (piece) { + return this._mode === 'categories' + ? piece.value + '' : piece.index + ''; + }, - var buttonContainer = document.createElement('div'); - buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;'; + /** + * @public + */ + getPieceList: function () { + return this._pieceList; + }, - var buttonStyle = 'float:right;margin-right:20px;border:none;' - + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px'; - var closeButton = document.createElement('div'); - var refreshButton = document.createElement('div'); + /** + * @private + * @return {string} + */ + _determineMode: function () { + var option = this.option; - buttonStyle += ';background-color:' + model.get('buttonColor'); - buttonStyle += ';color:' + model.get('buttonTextColor'); + return option.pieces && option.pieces.length > 0 + ? 'pieces' + : this.option.categories + ? 'categories' + : 'splitNumber'; + }, - var self = this; + /** + * @public + * @override + */ + setSelected: function (selected) { + this.option.selected = clone(selected); + }, - function close() { - container.removeChild(root); - self._dom = null; - } - addEventListener(closeButton, 'click', close); + /** + * @public + * @override + */ + getValueState: function (value) { + var index = VisualMapping.findPieceIndex(value, this._pieceList); - addEventListener(refreshButton, 'click', function () { - var newOption; - try { - if (typeof contentToOption === 'function') { - newOption = contentToOption(viewMain, api.getOption()); + return index != null + ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])] + ? 'inRange' : 'outOfRange' + ) + : 'outOfRange'; + }, + + /** + * @public + * @params {number} pieceIndex piece index in visualMapModel.getPieceList() + * @return {Array.} [{seriesId, dataIndex: >}, ...] + */ + findTargetDataIndices: function (pieceIndex) { + var result = []; + + this.eachTargetSeries(function (seriesModel) { + var dataIndices = []; + var data = seriesModel.getData(); + + data.each(this.getDataDimension(data), function (value, dataIndex) { + // Should always base on model pieceList, because it is order sensitive. + var pIdx = VisualMapping.findPieceIndex(value, this._pieceList); + pIdx === pieceIndex && dataIndices.push(dataIndex); + }, this); + + result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); + }, this); + + return result; + }, + + /** + * @private + * @param {Object} piece piece.value or piece.interval is required. + * @return {number} Can be Infinity or -Infinity + */ + getRepresentValue: function (piece) { + var representValue; + if (this.isCategory()) { + representValue = piece.value; + } + else { + if (piece.value != null) { + representValue = piece.value; + } + else { + var pieceInterval = piece.interval || []; + representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity) + ? 0 + : (pieceInterval[0] + pieceInterval[1]) / 2; + } + } + return representValue; + }, + + getVisualMeta: function (getColorVisual) { + // Do not support category. (category axis is ordinal, numerical) + if (this.isCategory()) { + return; + } + + var stops = []; + var outerColors = []; + var visualMapModel = this; + + function setStop(interval, valueState) { + var representValue = visualMapModel.getRepresentValue({interval: interval}); + if (!valueState) { + valueState = visualMapModel.getValueState(representValue); + } + var color = getColorVisual(representValue, valueState); + if (interval[0] === -Infinity) { + outerColors[0] = color; + } + else if (interval[1] === Infinity) { + outerColors[1] = color; } else { - newOption = parseContents(textarea.value, blockMetaList); + stops.push( + {value: interval[0], color: color}, + {value: interval[1], color: color} + ); } } - catch (e) { - close(); - throw new Error('Data view format error ' + e); + + // Suplement + var pieceList = this._pieceList.slice(); + if (!pieceList.length) { + pieceList.push({interval: [-Infinity, Infinity]}); } - if (newOption) { - api.dispatchAction({ - type: 'changeDataView', - newOption: newOption - }); + else { + var edge = pieceList[0].interval[0]; + edge !== -Infinity && pieceList.unshift({interval: [-Infinity, edge]}); + edge = pieceList[pieceList.length - 1].interval[1]; + edge !== Infinity && pieceList.push({interval: [edge, Infinity]}); } - close(); - }); - - closeButton.innerHTML = lang$$1[1]; - refreshButton.innerHTML = lang$$1[2]; - refreshButton.style.cssText = buttonStyle; - closeButton.style.cssText = buttonStyle; + var curr = -Infinity; + each$1(pieceList, function (piece) { + var interval = piece.interval; + if (interval) { + // Fulfill gap. + interval[0] > curr && setStop([curr, interval[0]], 'outOfRange'); + setStop(interval.slice()); + curr = interval[1]; + } + }, this); - !model.get('readOnly') && buttonContainer.appendChild(refreshButton); - buttonContainer.appendChild(closeButton); + return {stops: stops, outerColors: outerColors}; + } - // http://stackoverflow.com/questions/6637341/use-tab-to-indent-in-textarea - addEventListener(textarea, 'keydown', function (e) { - if ((e.keyCode || e.which) === 9) { - // get caret position/selection - var val = this.value; - var start = this.selectionStart; - var end = this.selectionEnd; +}); - // set textarea value to: text before caret + tab + text after caret - this.value = val.substring(0, start) + ITEM_SPLITER + val.substring(end); +/** + * Key is this._mode + * @type {Object} + * @this {module:echarts/component/viusalMap/PiecewiseMode} + */ +var resetMethods = { - // put caret at right position again - this.selectionStart = this.selectionEnd = start + 1; + splitNumber: function () { + var thisOption = this.option; + var pieceList = this._pieceList; + var precision = Math.min(thisOption.precision, 20); + var dataExtent = this.getExtent(); + var splitNumber = thisOption.splitNumber; + splitNumber = Math.max(parseInt(splitNumber, 10), 1); + thisOption.splitNumber = splitNumber; - // prevent the focus lose - stop(e); + var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; + // Precision auto-adaption + while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { + precision++; } - }); - - root.appendChild(header); - root.appendChild(viewMain); - root.appendChild(buttonContainer); - - viewMain.style.height = (container.clientHeight - 80) + 'px'; - - container.appendChild(root); - this._dom = root; -}; - -DataView.prototype.remove = function (ecModel, api) { - this._dom && api.getDom().removeChild(this._dom); -}; - -DataView.prototype.dispose = function (ecModel, api) { - this.remove(ecModel, api); -}; + thisOption.precision = precision; + splitStep = +splitStep.toFixed(precision); -/** - * @inner - */ -function tryMergeDataOption(newData, originalData) { - return map(newData, function (newVal, idx) { - var original = originalData && originalData[idx]; - if (isObject$1(original) && !isArray(original)) { - if (isObject$1(newVal) && !isArray(newVal)) { - newVal = newVal.value; - } - // Original data has option - return defaults({ - value: newVal - }, original); - } - else { - return newVal; + if (thisOption.minOpen) { + pieceList.push({ + interval: [-Infinity, dataExtent[0]], + close: [0, 0] + }); } - }); -} -register$1('dataView', DataView); + for ( + var index = 0, curr = dataExtent[0]; + index < splitNumber; + curr += splitStep, index++ + ) { + var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep); -registerAction({ - type: 'changeDataView', - event: 'dataViewChanged', - update: 'prepareAndUpdate' -}, function (payload, ecModel) { - var newSeriesOptList = []; - each$1(payload.newOption.series, function (seriesOpt) { - var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; - if (!seriesModel) { - // New created series - // Geuss the series type - newSeriesOptList.push(extend({ - // Default is scatter - type: 'scatter' - }, seriesOpt)); + pieceList.push({ + interval: [curr, max], + close: [1, 1] + }); } - else { - var originalData = seriesModel.get('data'); - newSeriesOptList.push({ - name: seriesOpt.name, - data: tryMergeDataOption(seriesOpt.data, originalData) + + if (thisOption.maxOpen) { + pieceList.push({ + interval: [dataExtent[1], Infinity], + close: [0, 0] }); } - }); - ecModel.mergeOption(defaults({ - series: newSeriesOptList - }, payload.newOption)); -}); + reformIntervals(pieceList); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + each$1(pieceList, function (piece, index) { + piece.index = index; + piece.text = this.formatValueText(piece.interval); + }, this); + }, -var each$29 = each$1; + categories: function () { + var thisOption = this.option; + each$1(thisOption.categories, function (cate) { + // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 + // 是否改一致。 + this._pieceList.push({ + text: this.formatValueText(cate, true), + value: cate + }); + }, this); -var ATTR$2 = '\0_ec_hist_store'; + // See "Order Rule". + normalizeReverse(thisOption, this._pieceList); + }, -/** - * @param {module:echarts/model/Global} ecModel - * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]} - */ -function push(ecModel, newSnapshot) { - var store = giveStore$1(ecModel); + pieces: function () { + var thisOption = this.option; + var pieceList = this._pieceList; - // If previous dataZoom can not be found, - // complete an range with current range. - each$29(newSnapshot, function (batchItem, dataZoomId) { - var i = store.length - 1; - for (; i >= 0; i--) { - var snapshot = store[i]; - if (snapshot[dataZoomId]) { - break; - } - } - if (i < 0) { - // No origin range set, create one by current range. - var dataZoomModel = ecModel.queryComponents( - {mainType: 'dataZoom', subType: 'select', id: dataZoomId} - )[0]; - if (dataZoomModel) { - var percentRange = dataZoomModel.getPercentRange(); - store[0][dataZoomId] = { - dataZoomId: dataZoomId, - start: percentRange[0], - end: percentRange[1] - }; + each$1(thisOption.pieces, function (pieceListItem, index) { + + if (!isObject$1(pieceListItem)) { + pieceListItem = {value: pieceListItem}; } - } - }); - store.push(newSnapshot); -} + var item = {text: '', index: index}; -/** - * @param {module:echarts/model/Global} ecModel - * @return {Object} snapshot - */ -function pop(ecModel) { - var store = giveStore$1(ecModel); - var head = store[store.length - 1]; - store.length > 1 && store.pop(); + if (pieceListItem.label != null) { + item.text = pieceListItem.label; + } - // Find top for all dataZoom. - var snapshot = {}; - each$29(head, function (batchItem, dataZoomId) { - for (var i = store.length - 1; i >= 0; i--) { - var batchItem = store[i][dataZoomId]; - if (batchItem) { - snapshot[dataZoomId] = batchItem; - break; + if (pieceListItem.hasOwnProperty('value')) { + var value = item.value = pieceListItem.value; + item.interval = [value, value]; + item.close = [1, 1]; } - } - }); + else { + // `min` `max` is legacy option. + // `lt` `gt` `lte` `gte` is recommanded. + var interval = item.interval = []; + var close = item.close = [0, 0]; - return snapshot; -} + var closeList = [1, 0, 1]; + var infinityList = [-Infinity, Infinity]; -/** - * @param {module:echarts/model/Global} ecModel - */ -function clear$1(ecModel) { - ecModel[ATTR$2] = null; -} + var useMinMax = []; + for (var lg = 0; lg < 2; lg++) { + var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg]; + for (var i = 0; i < 3 && interval[lg] == null; i++) { + interval[lg] = pieceListItem[names[i]]; + close[lg] = closeList[i]; + useMinMax[lg] = i === 2; + } + interval[lg] == null && (interval[lg] = infinityList[lg]); + } + useMinMax[0] && interval[1] === Infinity && (close[0] = 0); + useMinMax[1] && interval[0] === -Infinity && (close[1] = 0); -/** - * @param {module:echarts/model/Global} ecModel - * @return {number} records. always >= 1. - */ -function count(ecModel) { - return giveStore$1(ecModel).length; -} + if (__DEV__) { + if (interval[0] > interval[1]) { + console.warn( + 'Piece ' + index + 'is illegal: ' + interval + + ' lower bound should not greater then uppper bound.' + ); + } + } -/** - * [{key: dataZoomId, value: {dataZoomId, range}}, ...] - * History length of each dataZoom may be different. - * this._history[0] is used to store origin range. - * @type {Array.} - */ -function giveStore$1(ecModel) { - var store = ecModel[ATTR$2]; - if (!store) { - store = ecModel[ATTR$2] = [{}]; - } - return store; -} + if (interval[0] === interval[1] && close[0] && close[1]) { + // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}], + // we use value to lift the priority when min === max + item.value = interval[0]; + } + } -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + item.visual = VisualMapping.retrieveVisuals(pieceListItem); -DataZoomModel.extend({ - type: 'dataZoom.select' -}); + pieceList.push(item); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + }, this); -DataZoomView.extend({ - type: 'dataZoom.select' -}); + // See "Order Rule". + normalizeReverse(thisOption, pieceList); + // Only pieces + reformIntervals(pieceList); -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + each$1(pieceList, function (piece) { + var close = piece.close; + var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]]; + piece.text = piece.text || this.formatValueText( + piece.value != null ? piece.value : piece.interval, + false, + edgeSymbols + ); + }, this); + } +}; -/** - * DataZoom component entry - */ +function normalizeReverse(thisOption, pieceList) { + var inverse = thisOption.inverse; + if (thisOption.orient === 'vertical' ? !inverse : inverse) { + pieceList.reverse(); + } +} /* * Licensed to the Apache Software Foundation (ASF) under one @@ -89180,296 +94548,215 @@ DataZoomView.extend({ * under the License. */ -// Use dataZoomSelect -var dataZoomLang = lang.toolbox.dataZoom; -var each$28 = each$1; - -// Spectial component id start with \0ec\0, see echarts/model/Global.js~hasInnerId -var DATA_ZOOM_ID_BASE = '\0_ec_\0toolbox-dataZoom_'; - -function DataZoom(model, ecModel, api) { +var PiecewiseVisualMapView = VisualMapView.extend({ - /** - * @private - * @type {module:echarts/component/helper/BrushController} - */ - (this._brushController = new BrushController(api.getZr())) - .on('brush', bind(this._onBrush, this)) - .mount(); + type: 'visualMap.piecewise', /** - * @private - * @type {boolean} + * @protected + * @override */ - this._isZoomActive; -} - -DataZoom.defaultOption = { - show: true, - // Icon group - icon: { - zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1', - back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26' - }, - // `zoom`, `back` - title: clone(dataZoomLang.title) -}; - -var proto$6 = DataZoom.prototype; - -proto$6.render = function (featureModel, ecModel, api, payload) { - this.model = featureModel; - this.ecModel = ecModel; - this.api = api; - - updateZoomBtnStatus(featureModel, ecModel, this, payload, api); - updateBackBtnStatus(featureModel, ecModel); -}; - -proto$6.onclick = function (ecModel, api, type) { - handlers$1[type].call(this); -}; - -proto$6.remove = function (ecModel, api) { - this._brushController.unmount(); -}; - -proto$6.dispose = function (ecModel, api) { - this._brushController.dispose(); -}; - -/** - * @private - */ -var handlers$1 = { - - zoom: function () { - var nextActive = !this._isZoomActive; - - this.api.dispatchAction({ - type: 'takeGlobalCursor', - key: 'dataZoomSelect', - dataZoomSelectActive: nextActive - }); - }, - - back: function () { - this._dispatchZoomAction(pop(this.ecModel)); - } -}; - -/** - * @private - */ -proto$6._onBrush = function (areas, opt) { - if (!opt.isEnd || !areas.length) { - return; - } - var snapshot = {}; - var ecModel = this.ecModel; - - this._brushController.updateCovers([]); // remove cover - - var brushTargetManager = new BrushTargetManager( - retrieveAxisSetting(this.model.option), ecModel, {include: ['grid']} - ); - brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { - if (coordSys.type !== 'cartesian2d') { - return; - } - - var brushType = area.brushType; - if (brushType === 'rect') { - setBatch('x', coordSys, coordRange[0]); - setBatch('y', coordSys, coordRange[1]); - } - else { - setBatch(({lineX: 'x', lineY: 'y'})[brushType], coordSys, coordRange); - } - }); - - push(ecModel, snapshot); - - this._dispatchZoomAction(snapshot); - - function setBatch(dimName, coordSys, minMax) { - var axis = coordSys.getAxis(dimName); - var axisModel = axis.model; - var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); + doRender: function () { + var thisGroup = this.group; - // Restrict range. - var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); - if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { - minMax = sliderMove( - 0, minMax.slice(), axis.scale.getExtent(), 0, - minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan - ); - } + thisGroup.removeAll(); - dataZoomModel && (snapshot[dataZoomModel.id] = { - dataZoomId: dataZoomModel.id, - startValue: minMax[0], - endValue: minMax[1] - }); - } + var visualMapModel = this.visualMapModel; + var textGap = visualMapModel.get('textGap'); + var textStyleModel = visualMapModel.textStyleModel; + var textFont = textStyleModel.getFont(); + var textFill = textStyleModel.getTextColor(); + var itemAlign = this._getItemAlign(); + var itemSize = visualMapModel.itemSize; + var viewData = this._getViewData(); + var endsText = viewData.endsText; + var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); - function findDataZoom(dimName, axisModel, ecModel) { - var found; - ecModel.eachComponent({mainType: 'dataZoom', subType: 'select'}, function (dzModel) { - var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); - has && (found = dzModel); - }); - return found; - } -}; + endsText && this._renderEndsText( + thisGroup, endsText[0], itemSize, showLabel, itemAlign + ); -/** - * @private - */ -proto$6._dispatchZoomAction = function (snapshot) { - var batch = []; + each$1(viewData.viewPieceList, renderItem, this); - // Convert from hash map to array. - each$28(snapshot, function (batchItem, dataZoomId) { - batch.push(clone(batchItem)); - }); + endsText && this._renderEndsText( + thisGroup, endsText[1], itemSize, showLabel, itemAlign + ); - batch.length && this.api.dispatchAction({ - type: 'dataZoom', - from: this.uid, - batch: batch - }); -}; + box( + visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap') + ); -function retrieveAxisSetting(option) { - var setting = {}; - // Compatible with previous setting: null => all axis, false => no axis. - each$1(['xAxisIndex', 'yAxisIndex'], function (name) { - setting[name] = option[name]; - setting[name] == null && (setting[name] = 'all'); - (setting[name] === false || setting[name] === 'none') && (setting[name] = []); - }); - return setting; -} + this.renderBackground(thisGroup); -function updateBackBtnStatus(featureModel, ecModel) { - featureModel.setIconStatus( - 'back', - count(ecModel) > 1 ? 'emphasis' : 'normal' - ); -} + this.positionGroup(thisGroup); -function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) { - var zoomActive = view._isZoomActive; + function renderItem(item) { + var piece = item.piece; - if (payload && payload.type === 'takeGlobalCursor') { - zoomActive = payload.key === 'dataZoomSelect' - ? payload.dataZoomSelectActive : false; - } + var itemGroup = new Group(); + itemGroup.onclick = bind(this._onItemClick, this, piece); - view._isZoomActive = zoomActive; + this._enableHoverLink(itemGroup, item.indexInModelPieceList); - featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); + var representValue = visualMapModel.getRepresentValue(piece); - var brushTargetManager = new BrushTargetManager( - retrieveAxisSetting(featureModel.option), ecModel, {include: ['grid']} - ); + this._createItemSymbol( + itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]] + ); - view._brushController - .setPanels(brushTargetManager.makePanelOpts(api, function (targetInfo) { - return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared) - ? 'lineX' - : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared) - ? 'lineY' - : 'rect'; - })) - .enableBrush( - zoomActive - ? { - brushType: 'auto', - brushStyle: { - // FIXME user customized? - lineWidth: 0, - fill: 'rgba(0,0,0,0.2)' - } + if (showLabel) { + var visualState = this.visualMapModel.getValueState(representValue); + + itemGroup.add(new Text({ + style: { + x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, + y: itemSize[1] / 2, + text: piece.text, + textVerticalAlign: 'middle', + textAlign: itemAlign, + textFont: textFont, + textFill: textFill, + opacity: visualState === 'outOfRange' ? 0.5 : 1 + } + })); } - : false - ); -} + thisGroup.add(itemGroup); + } + }, -register$1('dataZoom', DataZoom); + /** + * @private + */ + _enableHoverLink: function (itemGroup, pieceIndex) { + itemGroup + .on('mouseover', bind(onHoverLink, this, 'highlight')) + .on('mouseout', bind(onHoverLink, this, 'downplay')); + function onHoverLink(method) { + var visualMapModel = this.visualMapModel; -// Create special dataZoom option for select -// FIXME consider the case of merge option, where axes options are not exists. -registerPreprocessor(function (option) { - if (!option) { - return; - } + visualMapModel.option.hoverLink && this.api.dispatchAction({ + type: method, + batch: makeHighDownBatch( + visualMapModel.findTargetDataIndices(pieceIndex), + visualMapModel + ) + }); + } + }, - var dataZoomOpts = option.dataZoom || (option.dataZoom = []); - if (!isArray(dataZoomOpts)) { - option.dataZoom = dataZoomOpts = [dataZoomOpts]; - } + /** + * @private + */ + _getItemAlign: function () { + var visualMapModel = this.visualMapModel; + var modelOption = visualMapModel.option; - var toolboxOpt = option.toolbox; - if (toolboxOpt) { - // Assume there is only one toolbox - if (isArray(toolboxOpt)) { - toolboxOpt = toolboxOpt[0]; + if (modelOption.orient === 'vertical') { + return getItemAlign( + visualMapModel, this.api, visualMapModel.itemSize + ); } - - if (toolboxOpt && toolboxOpt.feature) { - var dataZoomOpt = toolboxOpt.feature.dataZoom; - // FIXME: If add dataZoom when setOption in merge mode, - // no axis info to be added. See `test/dataZoom-extreme.html` - addForAxis('xAxis', dataZoomOpt); - addForAxis('yAxis', dataZoomOpt); + else { // horizontal, most case left unless specifying right. + var align = modelOption.align; + if (!align || align === 'auto') { + align = 'left'; + } + return align; } - } + }, - function addForAxis(axisName, dataZoomOpt) { - if (!dataZoomOpt) { + /** + * @private + */ + _renderEndsText: function (group, text, itemSize, showLabel, itemAlign) { + if (!text) { return; } - // Try not to modify model, because it is not merged yet. - var axisIndicesName = axisName + 'Index'; - var givenAxisIndices = dataZoomOpt[axisIndicesName]; - if (givenAxisIndices != null - && givenAxisIndices != 'all' - && !isArray(givenAxisIndices) - ) { - givenAxisIndices = (givenAxisIndices === false || givenAxisIndices === 'none') ? [] : [givenAxisIndices]; - } + var itemGroup = new Group(); + var textStyleModel = this.visualMapModel.textStyleModel; - forEachComponent(axisName, function (axisOpt, axisIndex) { - if (givenAxisIndices != null - && givenAxisIndices != 'all' - && indexOf(givenAxisIndices, axisIndex) === -1 - ) { - return; + itemGroup.add(new Text({ + style: { + x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2, + y: itemSize[1] / 2, + textVerticalAlign: 'middle', + textAlign: showLabel ? itemAlign : 'center', + text: text, + textFont: textStyleModel.getFont(), + textFill: textStyleModel.getTextColor() } - var newOpt = { - type: 'select', - $fromToolbox: true, - // Id for merge mapping. - id: DATA_ZOOM_ID_BASE + axisName + axisIndex - }; - // FIXME - // Only support one axis now. - newOpt[axisIndicesName] = axisIndex; - dataZoomOpts.push(newOpt); + })); + + group.add(itemGroup); + }, + + /** + * @private + * @return {Object} {peiceList, endsText} The order is the same as screen pixel order. + */ + _getViewData: function () { + var visualMapModel = this.visualMapModel; + + var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { + return {piece: piece, indexInModelPieceList: index}; }); - } + var endsText = visualMapModel.get('text'); - function forEachComponent(mainType, cb) { - var opts = option[mainType]; - if (!isArray(opts)) { - opts = opts ? [opts] : []; + // Consider orient and inverse. + var orient = visualMapModel.get('orient'); + var inverse = visualMapModel.get('inverse'); + + // Order of model pieceList is always [low, ..., high] + if (orient === 'horizontal' ? inverse : !inverse) { + viewPieceList.reverse(); + } + // Origin order of endsText is [high, low] + else if (endsText) { + endsText = endsText.slice().reverse(); + } + + return {viewPieceList: viewPieceList, endsText: endsText}; + }, + + /** + * @private + */ + _createItemSymbol: function (group, representValue, shapeParam) { + group.add(createSymbol( + this.getControllerVisual(representValue, 'symbol'), + shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], + this.getControllerVisual(representValue, 'color') + )); + }, + + /** + * @private + */ + _onItemClick: function (piece) { + var visualMapModel = this.visualMapModel; + var option = visualMapModel.option; + var selected = clone(option.selected); + var newKey = visualMapModel.getSelectedMapKey(piece); + + if (option.selectedMode === 'single') { + selected[newKey] = true; + each$1(selected, function (o, key) { + selected[key] = key === newKey; + }); + } + else { + selected[newKey] = !selected[newKey]; } - each$28(opts, cb); + + this.api.dispatchAction({ + type: 'selectDataRange', + from: this.uid, + visualMapId: this.visualMapModel.id, + selected: selected + }); } }); @@ -89492,37 +94779,11 @@ registerPreprocessor(function (option) { * under the License. */ -var restoreLang = lang.toolbox.restore; - -function Restore(model) { - this.model = model; -} - -Restore.defaultOption = { - show: true, - icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', - title: restoreLang.title -}; - -var proto$7 = Restore.prototype; - -proto$7.onclick = function (ecModel, api, type) { - clear$1(ecModel); - - api.dispatchAction({ - type: 'restore', - from: this.uid - }); -}; - -register$1('restore', Restore); +/** + * DataZoom component entry + */ -registerAction( - {type: 'restore', event: 'restore', update: 'prepareAndUpdate'}, - function (payload, ecModel) { - ecModel.resetOption('recreate'); - } -); +registerPreprocessor(preprocessor$3); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -89543,6 +94804,10 @@ registerAction( * under the License. */ +/** + * visualMap component entry + */ + var urn = 'urn:schemas-microsoft-com:vml'; var win = typeof window === 'undefined' ? null : window; @@ -89597,7 +94862,7 @@ var sqrt = Math.sqrt; var abs$1 = Math.abs; var cos = Math.cos; var sin = Math.sin; -var mathMax$8 = Math.max; +var mathMax$9 = Math.max; if (!env$1.canvasSupported) { @@ -89612,7 +94877,7 @@ if (!env$1.canvasSupported) { var initRootElStyle = function (el) { el.style.cssText = 'position:absolute;left:0;top:0;width:1px;height:1px;'; - el.coordsize = Z + ',' + Z; + el.coordsize = Z + ',' + Z; el.coordorigin = '0,0'; }; @@ -89641,15 +94906,7 @@ if (!env$1.canvasSupported) { return (parseFloat(zlevel) || 0) * ZLEVEL_BASE + (parseFloat(z) || 0) * Z_BASE$1 + z2; }; - var parsePercent$3 = function (value, maxValue) { - if (typeof value === 'string') { - if (value.lastIndexOf('%') >= 0) { - return parseFloat(value) / 100 * maxValue; - } - return parseFloat(value); - } - return value; - }; + var parsePercent$3 = parsePercent; /*************************************************** * PATH @@ -89732,7 +94989,7 @@ if (!env$1.canvasSupported) { width /= scale$$1[0] * Z; height /= scale$$1[1] * Z; - var dimension = mathMax$8(width, height); + var dimension = mathMax$9(width, height); shift = 2 * 0 / dimension; expansion = 2 * fill.r / dimension - shift; } @@ -89740,7 +94997,7 @@ if (!env$1.canvasSupported) { // We need to sort the color stops in ascending order by offset, // otherwise IE won't interpret it correctly. var stops = fill.colorStops.slice(); - stops.sort(function(cs1, cs2) { + stops.sort(function (cs1, cs2) { return cs1.offset - cs2.offset; }); @@ -89797,7 +95054,7 @@ if (!env$1.canvasSupported) { // if (style.lineCap != null) { // el.endcap = style.lineCap; // } - if (style.lineDash != null) { + if (style.lineDash) { el.dashstyle = style.lineDash.join(' '); } if (style.stroke != null && !(style.stroke instanceof Gradient)) { @@ -89806,7 +95063,7 @@ if (!env$1.canvasSupported) { }; var updateFillAndStroke = function (vmlEl, type, style, zrEl) { - var isFill = type == 'fill'; + var isFill = type === 'fill'; var el = vmlEl.getElementsByTagName(type)[0]; // Stroke must have lineWidth if (style[type] != null && style[type] !== 'none' && (isFill || (!isFill && style.lineWidth))) { @@ -90061,6 +95318,7 @@ if (!env$1.canvasSupported) { var path = this.path || (this.path = new PathProxy()); if (this.__dirtyPath) { path.beginPath(); + path.subPixelOptimize = false; this.buildPath(path, this.shape); path.toStatic(); this.__dirtyPath = false; @@ -90198,8 +95456,8 @@ if (!env$1.canvasSupported) { applyTransform(p2, p2, m); applyTransform(p3, p3, m); - var maxX = mathMax$8(p0[0], p1[0], p2[0], p3[0]); - var maxY = mathMax$8(p0[1], p1[1], p2[1], p3[1]); + var maxX = mathMax$9(p0[0], p1[0], p2[0], p3[0]); + var maxY = mathMax$9(p0[1], p1[1], p2[1], p3[1]); var transformFilter = []; transformFilter.push('M11=', m[0] / scaleX, comma, @@ -90235,7 +95493,7 @@ if (!env$1.canvasSupported) { var imageELStyle = imageEl.style; if (hasCrop) { // Needs know image original width and height - if (! (ow && oh)) { + if (!(ow && oh)) { var tmpImage = new Image(); var self = this; tmpImage.onload = function () { @@ -90258,7 +95516,7 @@ if (!env$1.canvasSupported) { imageELStyle.height = round$3(scaleY * oh * dh / sh) + 'px'; } - if (! cropEl) { + if (!cropEl) { cropEl = doc.createElement('div'); cropEl.style.overflow = 'hidden'; this._cropEl = cropEl; @@ -90269,10 +95527,10 @@ if (!env$1.canvasSupported) { cropElStyle.filter = imageTransformPrefix + '.Matrix(Dx=' + (-sx * dw / sw * scaleX) + ',Dy=' + (-sy * dh / sh * scaleY) + ')'; - if (! cropEl.parentNode) { + if (!cropEl.parentNode) { vmlEl.appendChild(cropEl); } - if (imageEl.parentNode != cropEl) { + if (imageEl.parentNode !== cropEl) { cropEl.appendChild(imageEl); } } @@ -90380,7 +95638,8 @@ if (!env$1.canvasSupported) { try { textMeasureEl.style.font = textFont; - } catch (ex) { + } + catch (ex) { // Ignore failures to set to invalid font. } textMeasureEl.innerHTML = ''; @@ -90433,7 +95692,9 @@ if (!env$1.canvasSupported) { var font = fontStyle.style + ' ' + fontStyle.variant + ' ' + fontStyle.weight + ' ' + fontStyle.size + 'px "' + fontStyle.family + '"'; - textRect = textRect || getBoundingRect(text, font, align, verticalAlign); + textRect = textRect || getBoundingRect( + text, font, align, verticalAlign, style.textPadding, style.textLineHeight + ); // Transform rect to view space var m = this.transform; @@ -90446,7 +95707,6 @@ if (!env$1.canvasSupported) { if (!fromTextEl) { var textPosition = style.textPosition; - var distance$$1 = style.textDistance; // Text position represented by coord if (textPosition instanceof Array) { x = rect.x + parsePercent$3(textPosition[0], rect.width); @@ -90455,9 +95715,9 @@ if (!env$1.canvasSupported) { align = align || 'left'; } else { - var res = adjustTextPositionOnRect( - textPosition, rect, distance$$1 - ); + var res = this.calculateTextPosition + ? this.calculateTextPosition({}, style, rect) + : calculateTextPosition({}, style, rect); x = res.x; y = res.y; @@ -90559,8 +95819,8 @@ if (!env$1.canvasSupported) { skewEl.on = true; - skewEl.matrix = m[0].toFixed(3) + comma + m[2].toFixed(3) + comma + - m[1].toFixed(3) + comma + m[3].toFixed(3) + ',0,0'; + skewEl.matrix = m[0].toFixed(3) + comma + m[2].toFixed(3) + comma + + m[1].toFixed(3) + comma + m[3].toFixed(3) + ',0,0'; // Text position skewEl.offset = (round$3(coords[0]) || 0) + ',' + (round$3(coords[1]) || 0); @@ -90591,7 +95851,7 @@ if (!env$1.canvasSupported) { updateFillAndStroke(textVmlEl, 'stroke', { stroke: style.textStroke, opacity: style.opacity, - lineDash: style.lineDash + lineDash: style.lineDash || null // style.lineDash can be `false`. }, this); textVmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2); @@ -90772,7 +96032,7 @@ VMLPainter.prototype = { var width = width == null ? this._getWidth() : width; var height = height == null ? this._getHeight() : height; - if (this._width != width || this._height != height) { + if (this._width !== width || this._height !== height) { this._width = width; this._height = height; @@ -90826,7 +96086,7 @@ VMLPainter.prototype = { // Not supported methods function createMethodNotSupport(method) { return function () { - zrLog('In IE8.0 VML mode painter not support method "' + method + '"'); + logError$1('In IE8.0 VML mode painter not support method "' + method + '"'); }; } @@ -90857,9 +96117,9 @@ var NONE = 'none'; var mathRound = Math.round; var mathSin$3 = Math.sin; var mathCos$3 = Math.cos; -var PI$5 = Math.PI; -var PI2$7 = Math.PI * 2; -var degree = 180 / PI$5; +var PI$6 = Math.PI; +var PI2$6 = Math.PI * 2; +var degree = 180 / PI$6; var EPSILON$4 = 1e-4; @@ -90890,9 +96150,6 @@ function setTransform(svgEl, m) { function attr(el, key, val) { if (!val || val.type !== 'linear' && val.type !== 'radial') { // Don't set attribute for gradient, since it need new dom nodes - if (typeof val === 'string' && val.indexOf('NaN') > -1) { - console.log(val); - } el.setAttribute(key, val); } } @@ -90905,26 +96162,6 @@ function bindStyle(svgEl, style, isText, el) { if (pathHasFill(style, isText)) { var fill = isText ? style.textFill : style.fill; fill = fill === 'transparent' ? NONE : fill; - - /** - * FIXME: - * This is a temporary fix for Chrome's clipping bug - * that happens when a clip-path is referring another one. - * This fix should be used before Chrome's bug is fixed. - * For an element that has clip-path, and fill is none, - * set it to be "rgba(0, 0, 0, 0.002)" will hide the element. - * Otherwise, it will show black fill color. - * 0.002 is used because this won't work for alpha values smaller - * than 0.002. - * - * See - * https://bugs.chromium.org/p/chromium/issues/detail?id=659790 - * for more information. - */ - if (svgEl.getAttribute('clip-path') !== 'none' && fill === NONE) { - fill = 'rgba(0, 0, 0, 0.002)'; - } - attr(svgEl, 'fill', fill); attr(svgEl, 'fill-opacity', style.fillOpacity != null ? style.fillOpacity * style.opacity : style.opacity); } @@ -91004,19 +96241,21 @@ function pathDataToString$1(path) { var clockwise = data[i++]; var dThetaPositive = Math.abs(dTheta); - var isCircle = isAroundZero$1(dThetaPositive - PI2$7) - && !isAroundZero$1(dThetaPositive); + var isCircle = isAroundZero$1(dThetaPositive - PI2$6) + || (clockwise ? dTheta >= PI2$6 : -dTheta >= PI2$6); + + // Mapping to 0~2PI + var unifiedTheta = dTheta > 0 ? dTheta % PI2$6 : (dTheta % PI2$6 + PI2$6); var large = false; - if (dThetaPositive >= PI2$7) { + if (isCircle) { large = true; } else if (isAroundZero$1(dThetaPositive)) { large = false; } else { - large = (dTheta > -PI$5 && dTheta < 0 || dTheta > PI$5) - === !!clockwise; + large = (unifiedTheta >= PI$6) === !!clockwise; } var x0 = round4(cx + rx * mathCos$3(theta)); @@ -91027,10 +96266,10 @@ function pathDataToString$1(path) { // FIXME A better way to draw circle ? if (isCircle) { if (clockwise) { - dTheta = PI2$7 - 1e-4; + dTheta = PI2$6 - 1e-4; } else { - dTheta = -PI2$7 + 1e-4; + dTheta = -PI2$6 + 1e-4; } large = true; @@ -91095,6 +96334,7 @@ svgPath.brush = function (el) { if (el.__dirtyPath) { path.beginPath(); + path.subPixelOptimize = false; el.buildPath(path, el.shape); el.__dirtyPath = false; @@ -91112,6 +96352,9 @@ svgPath.brush = function (el) { if (style.text != null) { svgTextDrawRectText(el, el.getBoundingRect()); } + else { + removeOldTextNode(el); + } }; /*************************************************** @@ -91126,7 +96369,7 @@ svgImage.brush = function (el) { var src = image.src; image = src; } - if (! image) { + if (!image) { return; } @@ -91137,7 +96380,7 @@ svgImage.brush = function (el) { var dh = style.height; var svgEl = el.__svgEl; - if (! svgEl) { + if (!svgEl) { svgEl = createElement('image'); el.__svgEl = svgEl; } @@ -91159,205 +96402,218 @@ svgImage.brush = function (el) { if (style.text != null) { svgTextDrawRectText(el, el.getBoundingRect()); } + else { + removeOldTextNode(el); + } }; /*************************************************** * TEXT **************************************************/ var svgText = {}; -var tmpRect$3 = new BoundingRect(); +var _tmpTextHostRect = new BoundingRect(); +var _tmpTextBoxPos = {}; +var _tmpTextTransform = []; +var TEXT_ALIGN_TO_ANCHRO = { + left: 'start', + right: 'end', + center: 'middle', + middle: 'middle' +}; -var svgTextDrawRectText = function (el, rect, textRect) { +/** + * @param {module:zrender/Element} el + * @param {Object|boolean} [hostRect] {x, y, width, height} + * If set false, rect text is not used. + */ +var svgTextDrawRectText = function (el, hostRect) { var style = el.style; + var elTransform = el.transform; + var needTransformTextByHostEl = el instanceof Text || style.transformText; el.__dirty && normalizeTextStyle(style, true); var text = style.text; // Convert to string - if (text == null) { - // Draw no text only when text is set to null, but not '' + text != null && (text += ''); + if (!needDrawText(text, style)) { return; } - else { - text += ''; + // render empty text for svg if no text but need draw text. + text == null && (text = ''); + + // Follow the setting in the canvas renderer, if not transform the + // text, transform the hostRect, by which the text is located. + if (!needTransformTextByHostEl && elTransform) { + _tmpTextHostRect.copy(hostRect); + _tmpTextHostRect.applyTransform(elTransform); + hostRect = _tmpTextHostRect; } var textSvgEl = el.__textSvgEl; - if (! textSvgEl) { + if (!textSvgEl) { textSvgEl = createElement('text'); el.__textSvgEl = textSvgEl; } - var x; - var y; - var textPosition = style.textPosition; - var distance = style.textDistance; - var align = style.textAlign || 'left'; - - if (typeof style.fontSize === 'number') { - style.fontSize += 'px'; + // style.font has been normalized by `normalizeTextStyle`. + var textSvgElStyle = textSvgEl.style; + var font = style.font || DEFAULT_FONT$1; + var computedFont = textSvgEl.__computedFont; + if (font !== textSvgEl.__styleFont) { + textSvgElStyle.font = textSvgEl.__styleFont = font; + // The computedFont might not be the orginal font if it is illegal font. + computedFont = textSvgEl.__computedFont = textSvgElStyle.font; } - var font = style.font - || [ - style.fontStyle || '', - style.fontWeight || '', - style.fontSize || '', - style.fontFamily || '' - ].join(' ') - || DEFAULT_FONT; - var verticalAlign = getVerticalAlignForSvg(style.textVerticalAlign); - - textRect = getBoundingRect(text, font, align, - verticalAlign); + var textPadding = style.textPadding; + var textLineHeight = style.textLineHeight; - var lineHeight = textRect.lineHeight; - // Text position represented by coord - if (textPosition instanceof Array) { - x = rect.x + textPosition[0]; - y = rect.y + textPosition[1]; - } - else { - var newPos = adjustTextPositionOnRect( - textPosition, rect, distance + var contentBlock = el.__textCotentBlock; + if (!contentBlock || el.__dirtyText) { + contentBlock = el.__textCotentBlock = parsePlainText( + text, computedFont, textPadding, textLineHeight, style.truncate ); - x = newPos.x; - y = newPos.y; - verticalAlign = getVerticalAlignForSvg(newPos.textVerticalAlign); - align = newPos.textAlign; } - attr(textSvgEl, 'alignment-baseline', verticalAlign); + var outerHeight = contentBlock.outerHeight; + var lineHeight = contentBlock.lineHeight; - if (font) { - textSvgEl.style.font = font; - } + getBoxPosition(_tmpTextBoxPos, el, style, hostRect); + var baseX = _tmpTextBoxPos.baseX; + var baseY = _tmpTextBoxPos.baseY; + var textAlign = _tmpTextBoxPos.textAlign || 'left'; + var textVerticalAlign = _tmpTextBoxPos.textVerticalAlign; - var textPadding = style.textPadding; + setTextTransform( + textSvgEl, needTransformTextByHostEl, elTransform, style, hostRect, baseX, baseY + ); - // Make baseline top - attr(textSvgEl, 'x', x); - attr(textSvgEl, 'y', y); + var boxY = adjustTextY(baseY, outerHeight, textVerticalAlign); + var textX = baseX; + var textY = boxY; - bindStyle(textSvgEl, style, true, el); - if (el instanceof Text || el.style.transformText) { - // Transform text with element - setTransform(textSvgEl, el.transform); + // TODO needDrawBg + if (textPadding) { + textX = getTextXForPadding$1(baseX, textAlign, textPadding); + textY += textPadding[0]; } - else { - if (el.transform) { - tmpRect$3.copy(rect); - tmpRect$3.applyTransform(el.transform); - rect = tmpRect$3; - } - else { - var pos = el.transformCoordToGlobal(rect.x, rect.y); - rect.x = pos[0]; - rect.y = pos[1]; - el.transform = identity(create$1()); - } - // Text rotation, but no element transform - var origin = style.textOrigin; - if (origin === 'center') { - x = textRect.width / 2 + x; - y = textRect.height / 2 + y; - } - else if (origin) { - x = origin[0] + x; - y = origin[1] + y; - } - var rotate$$1 = -style.textRotation || 0; - var transform = create$1(); - // Apply textRotate to element matrix - rotate(transform, transform, rotate$$1); + // `textBaseline` is set as 'middle'. + textY += lineHeight / 2; - var pos = [el.transform[4], el.transform[5]]; - translate(transform, transform, pos); - setTransform(textSvgEl, transform); - } + bindStyle(textSvgEl, style, true, el); - var textLines = text.split('\n'); - var nTextLines = textLines.length; - var textAnchor = align; - // PENDING - if (textAnchor === 'left') { - textAnchor = 'start'; - textPadding && (x += textPadding[3]); - } - else if (textAnchor === 'right') { - textAnchor = 'end'; - textPadding && (x -= textPadding[1]); - } - else if (textAnchor === 'center') { - textAnchor = 'middle'; - textPadding && (x += (textPadding[3] - textPadding[1]) / 2); - } + // FIXME + // Add a