webpackJsonp([11],{ /***/ "++K3": /***/ (function(module, exports) { /** * Copyright 2004-present Facebook. All Rights Reserved. * * @providesModule UserAgent_DEPRECATED */ /** * Provides entirely client-side User Agent and OS detection. You should prefer * the non-deprecated UserAgent module when possible, which exposes our * authoritative server-side PHP-based detection to the client. * * Usage is straightforward: * * if (UserAgent_DEPRECATED.ie()) { * // IE * } * * You can also do version checks: * * if (UserAgent_DEPRECATED.ie() >= 7) { * // IE7 or better * } * * The browser functions will return NaN if the browser does not match, so * you can also do version compares the other way: * * if (UserAgent_DEPRECATED.ie() < 7) { * // IE6 or worse * } * * Note that the version is a float and may include a minor version number, * so you should always use range operators to perform comparisons, not * strict equality. * * **Note:** You should **strongly** prefer capability detection to browser * version detection where it's reasonable: * * http://www.quirksmode.org/js/support.html * * Further, we have a large number of mature wrapper functions and classes * which abstract away many browser irregularities. Check the documentation, * grep for things, or ask on javascript@lists.facebook.com before writing yet * another copy of "event || window.event". * */ var _populated = false; // Browsers var _ie, _firefox, _opera, _webkit, _chrome; // Actual IE browser for compatibility mode var _ie_real_version; // Platforms var _osx, _windows, _linux, _android; // Architectures var _win64; // Devices var _iphone, _ipad, _native; var _mobile; function _populate() { if (_populated) { return; } _populated = true; // To work around buggy JS libraries that can't handle multi-digit // version numbers, Opera 10's user agent string claims it's Opera // 9, then later includes a Version/X.Y field: // // Opera/9.80 (foo) Presto/2.2.15 Version/10.10 var uas = navigator.userAgent; var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); _ipad = /\b(iP[ao]d)/.exec(uas); _android = /Android/i.exec(uas); _native = /FBAN\/\w+;/i.exec(uas); _mobile = /Mobile/i.exec(uas); // Note that the IE team blog would have you believe you should be checking // for 'Win64; x64'. But MSDN then reveals that you can actually be coming // from either x64 or ia64; so ultimately, you should just check for Win64 // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit // Windows will send 'WOW64' instead. _win64 = !!(/Win64/.exec(uas)); if (agent) { _ie = agent[1] ? parseFloat(agent[1]) : ( agent[5] ? parseFloat(agent[5]) : NaN); // IE compatibility mode if (_ie && document && document.documentMode) { _ie = document.documentMode; } // grab the "true" ie version from the trident token if available var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; _firefox = agent[2] ? parseFloat(agent[2]) : NaN; _opera = agent[3] ? parseFloat(agent[3]) : NaN; _webkit = agent[4] ? parseFloat(agent[4]) : NaN; if (_webkit) { // We do not add the regexp to the above test, because it will always // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in // the userAgent string. agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; } else { _chrome = NaN; } } else { _ie = _firefox = _opera = _chrome = _webkit = NaN; } if (os) { if (os[1]) { // Detect OS X version. If no version number matches, set _osx to true. // Version examples: 10, 10_6_1, 10.7 // Parses version number as a float, taking only first two sets of // digits. If only one set of digits is found, returns just the major // version number. var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true; } else { _osx = false; } _windows = !!os[2]; _linux = !!os[3]; } else { _osx = _windows = _linux = false; } } var UserAgent_DEPRECATED = { /** * Check if the UA is Internet Explorer. * * * @return float|NaN Version number (if match) or NaN. */ ie: function() { return _populate() || _ie; }, /** * Check if we're in Internet Explorer compatibility mode. * * @return bool true if in compatibility mode, false if * not compatibility mode or not ie */ ieCompatibilityMode: function() { return _populate() || (_ie_real_version > _ie); }, /** * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we * only need this because Skype can't handle 64-bit IE yet. We need to remove * this when we don't need it -- tracked by #601957. */ ie64: function() { return UserAgent_DEPRECATED.ie() && _win64; }, /** * Check if the UA is Firefox. * * * @return float|NaN Version number (if match) or NaN. */ firefox: function() { return _populate() || _firefox; }, /** * Check if the UA is Opera. * * * @return float|NaN Version number (if match) or NaN. */ opera: function() { return _populate() || _opera; }, /** * Check if the UA is WebKit. * * * @return float|NaN Version number (if match) or NaN. */ webkit: function() { return _populate() || _webkit; }, /** * For Push * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit */ safari: function() { return UserAgent_DEPRECATED.webkit(); }, /** * Check if the UA is a Chrome browser. * * * @return float|NaN Version number (if match) or NaN. */ chrome : function() { return _populate() || _chrome; }, /** * Check if the user is running Windows. * * @return bool `true' if the user's OS is Windows. */ windows: function() { return _populate() || _windows; }, /** * Check if the user is running Mac OS X. * * @return float|bool Returns a float if a version number is detected, * otherwise true/false. */ osx: function() { return _populate() || _osx; }, /** * Check if the user is running Linux. * * @return bool `true' if the user's OS is some flavor of Linux. */ linux: function() { return _populate() || _linux; }, /** * Check if the user is running on an iPhone or iPod platform. * * @return bool `true' if the user is running some flavor of the * iPhone OS. */ iphone: function() { return _populate() || _iphone; }, mobile: function() { return _populate() || (_iphone || _ipad || _android || _mobile); }, nativeApp: function() { // webviews inside of the native apps return _populate() || _native; }, android: function() { return _populate() || _android; }, ipad: function() { return _populate() || _ipad; } }; module.exports = UserAgent_DEPRECATED; /***/ }), /***/ "+2Ke": /***/ (function(module, exports) { /* * 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; /***/ }), /***/ "+2s9": /***/ (function(module, exports, __webpack_require__) { // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` var documentCreateElement = __webpack_require__("P1fK"); var classList = documentCreateElement('span').classList; var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; /***/ }), /***/ "+3lO": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("abPz"); var global = __webpack_require__("YjQv"); var hide = __webpack_require__("aLzV"); var Iterators = __webpack_require__("yYxz"); var TO_STRING_TAG = __webpack_require__("hgbu")('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } /***/ }), /***/ "+5dC": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var isArray = __webpack_require__("rF9q"); // eslint-disable-next-line es/no-object-isfrozen -- safe var isFrozen = Object.isFrozen; var isFrozenStringArray = function (array, allowUndefined) { if (!isFrozen || !isArray(array) || !isFrozen(array)) return false; var index = 0; var length = array.length; var element; while (index < length) { element = array[index++]; if (!(typeof element == 'string' || (allowUndefined && element === undefined))) { return false; } } return length !== 0; }; // `Array.isTemplateObject` method // https://github.com/tc39/proposal-array-is-template-object $({ target: 'Array', stat: true, sham: true, forced: true }, { isTemplateObject: function isTemplateObject(value) { if (!isFrozenStringArray(value, true)) return false; var raw = value.raw; return raw.length === value.length && isFrozenStringArray(raw, false); } }); /***/ }), /***/ "+6E9": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var iterate = __webpack_require__("UHV6"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); // `Iterator.prototype.every` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { every: function every(predicate) { anObject(this); aCallable(predicate); var record = getIteratorDirect(this); var counter = 0; return !iterate(record, function (value, stop) { if (!predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); /***/ }), /***/ "+7iT": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var anObject = __webpack_require__("5+O3"); var iterate = __webpack_require__("UHV6"); var getIteratorDirect = __webpack_require__("tcso"); var push = [].push; // `Iterator.prototype.toArray` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { toArray: function toArray() { var result = []; iterate(getIteratorDirect(anObject(this)), push, { that: result, IS_RECORD: true }); return result; } }); /***/ }), /***/ "+Dgo": /***/ (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 ComponentModel = __webpack_require__("Y5nL"); var ComponentView = __webpack_require__("Pgdp"); var _sourceHelper = __webpack_require__("kdOt"); var detectSourceFormat = _sourceHelper.detectSourceFormat; var _sourceType = __webpack_require__("+2Ke"); var SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN; /* * 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 module is imported by echarts directly. * * Notice: * Always keep this file exists for backward compatibility. * Because before 4.1.0, dataset is an optional component, * some users may import this module manually. */ ComponentModel.extend({ type: 'dataset', /** * @protected */ defaultOption: { // 'row', 'column' seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, // null/'auto': auto detect header, see "module:echarts/data/helper/sourceHelper" sourceHeader: null, dimensions: null, source: null }, optionUpdated: function () { detectSourceFormat(this); } }); ComponentView.extend({ type: 'dataset' }); /***/ }), /***/ "+GuK": /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-promise-finally var $export = __webpack_require__("Wdy1"); var core = __webpack_require__("iANj"); var global = __webpack_require__("YjQv"); var speciesConstructor = __webpack_require__("BfX3"); var promiseResolve = __webpack_require__("qC2Z"); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); /***/ }), /***/ "+K7g": /***/ (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 echarts = __webpack_require__("Icdr"); /* * 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. */ /** * @payload * @property {number} [seriesIndex] * @property {string} [seriesId] * @property {string} [seriesName] * @property {number} [dataIndex] */ echarts.registerAction({ type: 'focusNodeAdjacency', event: 'focusNodeAdjacency', update: 'series:focusNodeAdjacency' }, function () {}); /** * @payload * @property {number} [seriesIndex] * @property {string} [seriesId] * @property {string} [seriesName] */ echarts.registerAction({ type: 'unfocusNodeAdjacency', event: 'unfocusNodeAdjacency', update: 'series:unfocusNodeAdjacency' }, function () {}); /***/ }), /***/ "+MZ2": /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /***/ "+PQg": /***/ (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 echarts = __webpack_require__("Icdr"); var zrUtil = __webpack_require__("/gxq"); var textContain = __webpack_require__("3h1/"); var featureManager = __webpack_require__("dCQY"); var graphic = __webpack_require__("0sHC"); var Model = __webpack_require__("Pdtn"); var DataDiffer = __webpack_require__("1Hui"); var listComponentHelper = __webpack_require__("v/cD"); /* * 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 _default = echarts.extendComponentView({ type: 'toolbox', render: function (toolboxModel, ecModel, api, payload) { var group = this.group; group.removeAll(); if (!toolboxModel.get('show')) { return; } var itemSize = +toolboxModel.get('itemSize'); var featureOpts = toolboxModel.get('feature') || {}; var features = this._features || (this._features = {}); var featureNames = []; zrUtil.each(featureOpts, function (opt, name) { featureNames.push(name); }); new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(zrUtil.curry(processFeature, null)).execute(); // Keep for diff. this._featureNames = featureNames; 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; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ? if (payload && payload.newTitle != null && payload.featureName === featureName) { featureOpt.title = payload.newTitle; } if (featureName && !oldName) { // Create if (isUserFeatureName(featureName)) { feature = { model: featureModel, onclick: featureModel.option.onclick, featureName: featureName }; } else { var Feature = featureManager.get(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; } if (!featureModel.get('show') || feature.unusable) { feature.remove && feature.remove(ecModel, api); return; } 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); } } 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 = {}; zrUtil.each(icons, function (iconStr, iconName) { var path = graphic.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', zrUtil.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)); } graphic.setHoverStyle(path); 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', zrUtil.bind(feature.onclick, feature, ecModel, api, iconName)); iconPaths[iconName] = path; }); } listComponentHelper.layout(group, toolboxModel, api); // Render background after group is layout // FIXME group.add(listComponentHelper.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 = textContain.getBoundingRect(titleText, textContain.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'; } } }); }, updateView: function (toolboxModel, ecModel, api, payload) { zrUtil.each(this._features, function (feature) { feature.updateView && feature.updateView(feature.model, ecModel, api, payload); }); }, // updateLayout: function (toolboxModel, ecModel, api, payload) { // zrUtil.each(this._features, function (feature) { // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); // }); // }, remove: function (ecModel, api) { zrUtil.each(this._features, function (feature) { feature.remove && feature.remove(ecModel, api); }); this.group.removeAll(); }, dispose: function (ecModel, api) { zrUtil.each(this._features, function (feature) { feature.dispose && feature.dispose(ecModel, api); }); } }); function isUserFeatureName(featureName) { return featureName.indexOf('my') === 0; } module.exports = _default; /***/ }), /***/ "+SdG": /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__("a/OS")('keys'); var uid = __webpack_require__("GmwO"); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; /***/ }), /***/ "+TtN": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__("Pjea"); /***/ }), /***/ "+UTs": /***/ (function(module, exports, __webpack_require__) { var Path = __webpack_require__("GxVO"); var polyHelper = __webpack_require__("No7X"); /** * 多边形 * @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; /***/ }), /***/ "+VX5": /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__("W6Rd"); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }), /***/ "+Y0c": /***/ (function(module, exports, __webpack_require__) { var LRU = __webpack_require__("zMj2"); 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; /***/ }), /***/ "+ZEg": /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__("hcE8"); var call = __webpack_require__("celx"); var ArrayBufferViewCore = __webpack_require__("fduV"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var toOffset = __webpack_require__("HBY2"); var toIndexedObject = __webpack_require__("EJk4"); var fails = __webpack_require__("r54x"); var RangeError = global.RangeError; var Int8Array = global.Int8Array; var Int8ArrayPrototype = Int8Array && Int8Array.prototype; var $set = Int8ArrayPrototype && Int8ArrayPrototype.set; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Uint8ClampedArray(2); call($set, array, { length: 1, 0: 3 }, 1); return array[1] !== 3; }); // https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () { var array = new Int8Array(2); array.set(1); array.set('2', 1); return array[0] !== 0 || array[1] !== 2; }); // `%TypedArray%.prototype.set` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set exportTypedArrayMethod('set', function set(arrayLike /* , offset */) { aTypedArray(this); var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); var src = toIndexedObject(arrayLike); if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset); var length = this.length; var len = lengthOfArrayLike(src); var index = 0; if (len + offset > length) throw RangeError('Wrong length'); while (index < len) this[offset + index] = src[index++]; }, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); /***/ }), /***/ "+bDV": /***/ (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__("/gxq"); var each = _util.each; var createHashMap = _util.createHashMap; var SeriesModel = __webpack_require__("EJsE"); var createListFromArray = __webpack_require__("ao1T"); /* * 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 _default = SeriesModel.extend({ type: 'series.parallel', dependencies: ['parallel'], visualColorAccessPath: 'lineStyle.color', getInitialData: function (option, ecModel) { var source = this.getSource(); setEncodeAndDimensions(source, this); return createListFromArray(source, this); }, /** * User can get data raw indices on 'axisAreaSelected' event received. * * @public * @param {string} activeState 'active' or 'inactive' or 'normal' * @return {Array.} Raw indices */ getRawIndicesByActiveState: function (activeState) { var coordSys = this.coordinateSystem; var data = this.getData(); var indices = []; coordSys.eachActiveState(data, function (theActiveState, dataIndex) { if (activeState === theActiveState) { indices.push(data.getRawIndex(dataIndex)); } }); return indices; }, defaultOption: { zlevel: 0, // 一级层叠 z: 2, // 二级层叠 coordinateSystem: 'parallel', parallelIndex: 0, label: { show: false }, inactiveOpacity: 0.05, activeOpacity: 1, lineStyle: { width: 1, opacity: 0.45, type: 'solid' }, emphasis: { label: { show: false } }, progressive: 500, smooth: false, // true | false | number animationEasing: 'linear' } }); function setEncodeAndDimensions(source, seriesModel) { // The mapping of parallelAxis dimension to data dimension can // be specified in parallelAxis.option.dim. For example, if // parallelAxis.option.dim is 'dim3', it mapping to the third // dimension of data. But `data.encode` has higher priority. // Moreover, parallelModel.dimension should not be regarded as data // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6']; if (source.encodeDefine) { return; } var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); if (!parallelModel) { return; } var encodeDefine = source.encodeDefine = createHashMap(); each(parallelModel.dimensions, function (axisDim) { var dataDimIndex = convertDimNameToNumber(axisDim); encodeDefine.set(axisDim, dataDimIndex); }); } function convertDimNameToNumber(dimName) { return +dimName.replace('dim', ''); } module.exports = _default; /***/ }), /***/ "+bS+": /***/ (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 BaseAxisPointer = __webpack_require__("Ou7x"); var viewHelper = __webpack_require__("zAPJ"); var singleAxisHelper = __webpack_require__("fzS+"); var AxisView = __webpack_require__("43ae"); /* * 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 XY = ['x', 'y']; var WH = ['width', 'height']; var SingleAxisPointer = BaseAxisPointer.extend({ /** * @override */ makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { var axis = axisModel.axis; var coordSys = axis.coordinateSystem; var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis)); var pixelValue = coordSys.dataToPoint(value)[0]; var axisPointerType = axisPointerModel.get('type'); if (axisPointerType && axisPointerType !== 'none') { var elStyle = viewHelper.buildElStyle(axisPointerModel); var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent); pointerOption.style = elStyle; elOption.graphicKey = pointerOption.type; elOption.pointer = pointerOption; } var layoutInfo = singleAxisHelper.layout(axisModel); viewHelper.buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api); }, /** * @override */ getHandleTransform: function (value, axisModel, axisPointerModel) { var layoutInfo = singleAxisHelper.layout(axisModel, { labelInside: false }); layoutInfo.labelMargin = axisPointerModel.get('handle.margin'); return { position: viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo), rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) }; }, /** * @override */ updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) { var axis = axisModel.axis; var coordSys = axis.coordinateSystem; var dimIndex = getPointDimIndex(axis); var axisExtent = getGlobalExtent(coordSys, dimIndex); var currPosition = transform.position; currPosition[dimIndex] += delta[dimIndex]; currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex); var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; var cursorPoint = [cursorOtherValue, cursorOtherValue]; cursorPoint[dimIndex] = currPosition[dimIndex]; return { position: currPosition, rotation: transform.rotation, cursorPoint: cursorPoint, tooltipOption: { verticalAlign: 'middle' } }; } }); var pointerShapeBuilder = { line: function (axis, pixelValue, otherExtent) { var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis)); return { type: 'Line', subPixelOptimize: true, shape: targetShape }; }, shadow: function (axis, pixelValue, otherExtent) { var bandWidth = axis.getBandWidth(); var span = otherExtent[1] - otherExtent[0]; return { type: 'Rect', shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis)) }; } }; function getPointDimIndex(axis) { return axis.isHorizontal() ? 0 : 1; } function getGlobalExtent(coordSys, dimIndex) { var rect = coordSys.getRect(); return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]]; } AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer); var _default = SingleAxisPointer; module.exports = _default; /***/ }), /***/ "+e1w": /***/ (function(module, exports, __webpack_require__) { var toPrimitive = __webpack_require__("whWw"); var isSymbol = __webpack_require__("3dPm"); // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; /***/ }), /***/ "+hPR": /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__("VpOn"); var anObject = __webpack_require__("PGRs"); var toMetaKey = metadata.key; var ordinaryDefineOwnMetadata = metadata.set; metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); } }); /***/ }), /***/ "+iDZ": /***/ (function(module, exports, __webpack_require__) { var document = __webpack_require__("YjQv").document; module.exports = document && document.documentElement; /***/ }), /***/ "+jMe": /***/ (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__("/gxq"); var Model = __webpack_require__("Pdtn"); var linkList = __webpack_require__("NGRG"); var List = __webpack_require__("Rfu2"); var createDimensions = __webpack_require__("hcq/"); /* * 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. */ /** * Tree data structure * * @module echarts/data/Tree */ /** * @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 || ''; /** * Depth of node * * @type {number} * @readOnly */ this.depth = 0; /** * Height of the subtree rooted at this node. * @type {number} * @readOnly */ this.height = 0; /** * @type {module:echarts/data/Tree~TreeNode} * @readOnly */ this.parentNode = null; /** * 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; /** * @type {Array.} * @readOnly */ this.children = []; /** * @type {Array.} * @pubilc */ this.viewChildren = []; /** * @type {moduel:echarts/data/Tree} * @readOnly */ this.hostTree = hostTree; }; TreeNode.prototype = { constructor: TreeNode, /** * The node is removed. * @return {boolean} is removed. */ isRemoved: function () { return this.dataIndex < 0; }, /** * 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; } options = options || {}; if (zrUtil.isString(options)) { options = { order: options }; } var order = options.order || 'preorder'; var children = this[options.attr || 'children']; var suppressVisitSub; order === 'preorder' && (suppressVisitSub = cb.call(context, this)); for (var i = 0; !suppressVisitSub && i < children.length; i++) { children[i].eachNode(options, cb, context); } order === 'postorder' && cb.call(context, this); }, /** * 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; }, /** * @param {string} id * @return {module:echarts/data/Tree~TreeNode} */ 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; } } }, /** * @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; } } }, /** * @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. */ getValue: function (dimension) { var data = this.hostTree.data; return data.get(data.getDimension(dimension || 'value'), this.dataIndex); }, /** * @param {Object} layout * @param {boolean=} [merge=false] */ setLayout: function (layout, merge) { this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge); }, /** * @return {Object} layout */ getLayout: function () { return this.hostTree.data.getItemLayout(this.dataIndex); }, /** * @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(); // FIXME: refactor levelModel to "beforeLink", and remove levelModel here. if (levelModel) { return itemModel.getModel(path, levelModel.getModel(path)); } else { return itemModel.getModel(path); } }, /** * @return {module:echarts/model/Model} */ getLevelModel: function () { return (this.hostTree.levelModels || [])[this.depth]; }, /** * @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); }, /** * @public * @return {number} */ getRawIndex: function () { return this.hostTree.data.getRawIndex(this.dataIndex); }, /** * @public * @return {string} */ getId: function () { return this.hostTree.data.getId(this.dataIndex); }, /** * 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; }, /** * 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; /** * @type {module:echarts/data/List} * @readOnly */ this.data; /** * Index of each item is the same as the raw index of coresponding list item. * @private * @type {Array.} treeOptions.levels * @return module:echarts/data/Tree */ Tree.createTree = function (dataRoot, hostModel, treeOptions, beforeLink) { var tree = new Tree(hostModel, treeOptions && treeOptions.levels); var listData = []; var dimMax = 1; buildHierarchy(dataRoot); function buildHierarchy(dataNode, parentNode) { var value = dataNode.value; dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1); listData.push(dataNode); var node = new TreeNode(dataNode.name, tree); parentNode ? addChild(node, parentNode) : tree.root = node; tree._nodes.push(node); var children = dataNode.children; if (children) { for (var i = 0; i < children.length; i++) { buildHierarchy(children[i], node); } } } tree.root.updateDepthAndHeight(0); var dimensionsInfo = createDimensions(listData, { coordDimensions: ['value'], dimensionsCount: dimMax }); var list = new List(dimensionsInfo, hostModel); list.initData(listData); beforeLink && beforeLink(list); 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; } var _default = Tree; module.exports = _default; /***/ }), /***/ "+pdh": /***/ (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 echarts = __webpack_require__("Icdr"); var helper = __webpack_require__("gOx9"); /* * 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 Treemap action */ var noop = function () {}; var actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove']; for (var i = 0; i < actionTypes.length; i++) { echarts.registerAction({ type: actionTypes[i], update: 'updateView' }, noop); } echarts.registerAction({ type: 'treemapRootToNode', update: 'updateView' }, function (payload, ecModel) { ecModel.eachComponent({ mainType: 'series', subType: 'treemap', query: payload }, handleRootToNode); function handleRootToNode(model, index) { var types = ['treemapZoomToNode', 'treemapRootToNode']; var targetInfo = helper.retrieveTargetInfo(payload, types, model); if (targetInfo) { var originViewRoot = model.getViewRoot(); if (originViewRoot) { payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; } model.resetViewRoot(targetInfo.node); } } }); /***/ }), /***/ "+qBm": /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__("HTem"); module.exports = function (method, arg) { return !!method && fails(function () { // eslint-disable-next-line no-useless-call arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); }); }; /***/ }), /***/ "+r76": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var isPrototypeOf = __webpack_require__("Epdv"); var getPrototypeOf = __webpack_require__("wzd1"); var setPrototypeOf = __webpack_require__("jE8y"); var copyConstructorProperties = __webpack_require__("PYrI"); var create = __webpack_require__("43zn"); var createNonEnumerableProperty = __webpack_require__("asqq"); var createPropertyDescriptor = __webpack_require__("C1ru"); var installErrorStack = __webpack_require__("jLFK"); var normalizeStringArgument = __webpack_require__("59rh"); var wellKnownSymbol = __webpack_require__("jAiL"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Error = Error; var $SuppressedError = function SuppressedError(error, suppressed, message) { var isInstance = isPrototypeOf(SuppressedErrorPrototype, this); var that; if (setPrototypeOf) { that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : SuppressedErrorPrototype); } else { that = isInstance ? this : create(SuppressedErrorPrototype); createNonEnumerableProperty(that, TO_STRING_TAG, 'Error'); } if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message)); installErrorStack(that, $SuppressedError, that.stack, 1); createNonEnumerableProperty(that, 'error', error); createNonEnumerableProperty(that, 'suppressed', suppressed); return that; }; if (setPrototypeOf) setPrototypeOf($SuppressedError, $Error); else copyConstructorProperties($SuppressedError, $Error, { name: true }); var SuppressedErrorPrototype = $SuppressedError.prototype = create($Error.prototype, { constructor: createPropertyDescriptor(1, $SuppressedError), message: createPropertyDescriptor(1, ''), name: createPropertyDescriptor(1, 'SuppressedError') }); // `SuppressedError` constructor // https://github.com/tc39/proposal-explicit-resource-management $({ global: true, constructor: true, arity: 3 }, { SuppressedError: $SuppressedError }); /***/ }), /***/ "+rQu": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Math.isubh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $({ target: 'Math', stat: true, forced: true }, { isubh: function isubh(x0, x1, y0, y1) { var $x0 = x0 >>> 0; var $x1 = x1 >>> 0; var $y0 = y0 >>> 0; return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } }); /***/ }), /***/ "+u5N": /***/ (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 SeriesModel = __webpack_require__("EJsE"); var createGraphFromNodeEdge = __webpack_require__("d1IL"); var _format = __webpack_require__("HHfb"); var encodeHTML = _format.encodeHTML; var Model = __webpack_require__("Pdtn"); var _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; /* * 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 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, 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 (nodes && links) { 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) { var dataItem = this.option.data[dataIndex]; dataItem.localX = localPosition[0]; dataItem.localY = localPosition[1]; }, /** * Return the graphic data structure * * @return {module:echarts/data/Graph} graphic data structure */ getGraph: function () { return this.getData().graph; }, /** * Get edge data of graphic data structure * * @return {module:echarts/data/List} data structure of list */ getEdgeData: function () { return this.getGraph().edgeData; }, /** * @override */ formatTooltip: function (dataIndex, multipleSeries, dataType) { // dataType === 'node' or empty do not show tooltip by default if (dataType === 'edge') { var params = this.getDataParams(dataIndex, dataType); var rawDataOpt = params.data; var html = rawDataOpt.source + ' -- ' + rawDataOpt.target; if (params.value) { html += ' : ' + params.value; } 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, coordinateSystem: 'view', layout: null, // The position of the whole view left: '5%', top: '5%', right: '20%', bottom: '5%', // Value can be 'vertical' orient: 'horizontal', // The dx of the node nodeWidth: 20, // The vertical distance between two nodes nodeGap: 8, // 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 layoutIterations: 32, label: { show: true, position: 'right', color: '#000', fontSize: 12 }, levels: [], // Value can be 'left' or 'right' nodeAlign: 'justify', itemStyle: { borderWidth: 1, borderColor: '#333' }, lineStyle: { color: '#314656', opacity: 0.2, curveness: 0.5 }, emphasis: { label: { show: true }, lineStyle: { opacity: 0.5 } }, animationEasing: 'linear', animationDuration: 1000 } }); var _default = SankeySeries; module.exports = _default; /***/ }), /***/ "+vtj": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__("YPgT"); /***/ }), /***/ "+yxk": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var iterate = __webpack_require__("UHV6"); var createProperty = __webpack_require__("hffE"); // `Object.fromEntries` method // https://github.com/tc39/proposal-object-from-entries $({ target: 'Object', stat: true }, { fromEntries: function fromEntries(iterable) { var obj = {}; iterate(iterable, function (k, v) { createProperty(obj, k, v); }, { AS_ENTRIES: true }); return obj; } }); /***/ }), /***/ "+zJ9": /***/ (function(module, exports, __webpack_require__) { var META = __webpack_require__("GmwO")('meta'); var isObject = __webpack_require__("8ANE"); var has = __webpack_require__("x//u"); var setDesc = __webpack_require__("GCs6").f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; var FREEZE = !__webpack_require__("zyKz")(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { setDesc(it, META, { value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function (it, create) { if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; /***/ }), /***/ "/+sa": /***/ (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 clazzUtil = __webpack_require__("BNYN"); /* * 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. */ /** * // Scale class management * @module echarts/scale/Scale */ /** * @param {Object} [setting] */ function Scale(setting) { this._setting = setting || {}; /** * Extent * @type {Array.} * @protected */ this._extent = [Infinity, -Infinity]; /** * Step is calculated in adjustExtent * @type {Array.} * @protected */ this._interval = 0; this.init && this.init.apply(this, arguments); } /** * Parse input val to valid inner number. * @param {*} val * @return {number} */ Scale.prototype.parse = function (val) { // Notice: This would be a trap here, If the implementation // of this method depends on extent, and this method is used // before extent set (like in dataZoom), it would be wrong. // Nevertheless, parse does not depend on extent generally. return val; }; Scale.prototype.getSetting = function (name) { return this._setting[name]; }; Scale.prototype.contain = function (val) { var extent = this._extent; return val >= extent[0] && val <= extent[1]; }; /** * Normalize value to linear [0, 1], return 0.5 if extent span is 0 * @param {number} val * @return {number} */ Scale.prototype.normalize = function (val) { var extent = this._extent; if (extent[1] === extent[0]) { return 0.5; } return (val - extent[0]) / (extent[1] - extent[0]); }; /** * Scale normalized value * @param {number} val * @return {number} */ Scale.prototype.scale = function (val) { var extent = this._extent; return val * (extent[1] - extent[0]) + extent[0]; }; /** * Set extent from data * @param {Array.} other */ Scale.prototype.unionExtent = function (other) { var extent = this._extent; other[0] < extent[0] && (extent[0] = other[0]); other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power // this.setExtent(extent[0], extent[1]); }; /** * Set extent from data * @param {module:echarts/data/List} data * @param {string} dim */ Scale.prototype.unionExtentFromData = function (data, dim) { this.unionExtent(data.getApproximateExtent(dim)); }; /** * Get extent * @return {Array.} */ Scale.prototype.getExtent = function () { return this._extent.slice(); }; /** * Set extent * @param {number} start * @param {number} end */ Scale.prototype.setExtent = function (start, end) { var thisExtent = this._extent; if (!isNaN(start)) { thisExtent[0] = start; } if (!isNaN(end)) { thisExtent[1] = end; } }; /** * When axis extent depends on data and no data exists, * axis ticks should not be drawn, which is named 'blank'. */ Scale.prototype.isBlank = function () { return this._isBlank; }, /** * When axis extent depends on data and no data exists, * axis ticks should not be drawn, which is named 'blank'. */ Scale.prototype.setBlank = function (isBlank) { this._isBlank = isBlank; }; /** * @abstract * @param {*} tick * @return {string} label of the tick. */ Scale.prototype.getLabel = null; clazzUtil.enableClassExtend(Scale); clazzUtil.enableClassManagement(Scale, { registerWhenExtend: true }); var _default = Scale; module.exports = _default; /***/ }), /***/ "//Fk": /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__("x/31"), __esModule: true }; /***/ }), /***/ "/09a": /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__("AMIE"); var enumBugKeys = __webpack_require__("YveC"); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /***/ "/86O": /***/ (function(module, exports, __webpack_require__) { var Displayable = __webpack_require__("9qnA"); var zrUtil = __webpack_require__("/gxq"); var textContain = __webpack_require__("3h1/"); var textHelper = __webpack_require__("qjrH"); var _constant = __webpack_require__("28kU"); 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; /***/ }), /***/ "/99E": /***/ (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. */ __webpack_require__("0BOU"); __webpack_require__("yEXw"); __webpack_require__("w6Zv"); /***/ }), /***/ "/BOW": /***/ (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__("/gxq"); var Axis = __webpack_require__("2HcM"); /* * 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 module:echarts/coord/parallel/ParallelAxis * @extends {module:echarts/coord/Axis} * @param {string} dim * @param {*} scale * @param {Array.} coordExtent * @param {string} axisType */ var ParallelAxis = function (dim, scale, coordExtent, axisType, axisIndex) { Axis.call(this, dim, scale, coordExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = axisType || 'value'; /** * @type {number} * @readOnly */ this.axisIndex = axisIndex; }; ParallelAxis.prototype = { constructor: ParallelAxis, /** * Axis model * @param {module:echarts/coord/parallel/AxisModel} */ model: null, /** * @override */ isHorizontal: function () { return this.coordinateSystem.getModel().get('layout') !== 'horizontal'; } }; zrUtil.inherits(ParallelAxis, Axis); var _default = ParallelAxis; module.exports = _default; /***/ }), /***/ "/CZk": /***/ (function(module, exports, __webpack_require__) { "use strict"; // B.2.3.8 String.prototype.fontsize(size) __webpack_require__("48Hh")('fontsize', function (createHTML) { return function fontsize(size) { return createHTML(this, 'font', 'size', size); }; }); /***/ }), /***/ "/Gyr": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var isObject = __webpack_require__("HAas"); var onFreeze = __webpack_require__("0LGO").onFreeze; var FREEZING = __webpack_require__("wjiB"); var fails = __webpack_require__("r54x"); // eslint-disable-next-line es/no-object-seal -- safe var $seal = Object.seal; var FAILS_ON_PRIMITIVES = fails(function () { $seal(1); }); // `Object.seal` method // https://tc39.es/ecma262/#sec-object.seal $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { seal: function seal(it) { return $seal && isObject(it) ? $seal(onFreeze(it)) : it; } }); /***/ }), /***/ "/JgL": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var log1p = __webpack_require__("sMRE"); // `Math.log1p` method // https://tc39.es/ecma262/#sec-math.log1p $({ target: 'Math', stat: true }, { log1p: log1p }); /***/ }), /***/ "/TzG": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var $map = __webpack_require__("TRbm").map; var arrayMethodHasSpeciesSupport = __webpack_require__("pVRE"); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /***/ "/YkF": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__("AvFv"); /***/ }), /***/ "/ZBO": /***/ (function(module, exports, __webpack_require__) { var matrix = __webpack_require__("dOVI"); var vector = __webpack_require__("C7PF"); /** * 提供变换扩展 * @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; /***/ }), /***/ "/Zs0": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var $transfer = __webpack_require__("CFQz"); // `ArrayBuffer.prototype.transfer` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transfer: function transfer() { return $transfer(this, arguments.length ? arguments[0] : undefined, true); } }); /***/ }), /***/ "/cVT": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Reflect.has` method // https://tc39.es/ecma262/#sec-reflect.has $({ target: 'Reflect', stat: true }, { has: function has(target, propertyKey) { return propertyKey in target; } }); /***/ }), /***/ "/dY/": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__("AIRG"); var enumBugKeys = __webpack_require__("iYN6"); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /***/ "/gZK": /***/ (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 createDimensions = __webpack_require__("hcq/"); var List = __webpack_require__("Rfu2"); var _util = __webpack_require__("/gxq"); var extend = _util.extend; var isArray = _util.isArray; /* * 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. */ /** * [Usage]: * (1) * createListSimply(seriesModel, ['value']); * (2) * createListSimply(seriesModel, { * coordDimensions: ['value'], * dimensionsCount: 5 * }); * * @param {module:echarts/model/Series} seriesModel * @param {Object|Array.} opt opt or coordDimensions * The options in opt, see `echarts/data/helper/createDimensions` * @param {Array.} [nameList] * @return {module:echarts/data/List} */ function _default(seriesModel, opt, nameList) { opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt); var source = seriesModel.getSource(); var dimensionsInfo = createDimensions(source, opt); var list = new List(dimensionsInfo, seriesModel); list.initData(source, nameList); return list; } module.exports = _default; /***/ }), /***/ "/gxq": /***/ (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; /***/ }), /***/ "/mti": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var parseInt = __webpack_require__("LFdw"); // `Number.parseInt` method // https://tc39.es/ecma262/#sec-number.parseint // eslint-disable-next-line es/no-number-parseint -- required for testing $({ target: 'Number', stat: true, forced: Number.parseInt != parseInt }, { parseInt: parseInt }); /***/ }), /***/ "/n1K": /***/ (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__("/gxq"); 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__("vXqC"); var normalizeToArray = _model.normalizeToArray; var _sourceHelper = __webpack_require__("kdOt"); var guessOrdinal = _sourceHelper.guessOrdinal; var BE_ORDINAL = _sourceHelper.BE_ORDINAL; var Source = __webpack_require__("rrAD"); var _dimensionHelper = __webpack_require__("mvCM"); var OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS; var DataDimensionInfo = __webpack_require__("1DJE"); /* * 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. */ /** * @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); } 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. 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. 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); } 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(dataDims, function (resultDimIdx, idx) { // The input resultDimIdx can be dim name or index. isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx)); if (resultDimIdx != null && resultDimIdx < dimCount) { validDataDims[idx] = resultDimIdx; applyDim(result[resultDimIdx], coordDim, idx); } }); }); // Apply templetes and default order from `sysDims`. 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. sysDimItemDimsDef = sysDimItem.dimsDef; sysDimItemOtherDims = sysDimItem.otherDims; sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null; } 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++) { while (availDimIdx < result.length && result[availDimIdx].coordDim != null) { availDimIdx++; } availDimIdx < result.length && dataDims.push(availDimIdx++); } } // Apply templates. 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}} 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'. 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; if (coordDim == null) { resultItem.coordDim = genName(extra, coordDimNameMap, fromZero); resultItem.coordDimIndex = 0; if (!generateCoord || generateCoordCount <= 0) { resultItem.isExtraCoord = true; } generateCoordCount--; } resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap)); 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? 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; while (map.get(name + i) != null) { i++; } name += i; } map.set(name, true); return name; } var _default = completeDimensions; module.exports = _default; /***/ }), /***/ "/o7K": /***/ (function(module, exports, __webpack_require__) { var lengthOfArrayLike = __webpack_require__("H8Gx"); // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed module.exports = function (O, C) { var len = lengthOfArrayLike(O); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = O[len - k - 1]; return A; }; /***/ }), /***/ "/ocq": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** * vue-router v3.0.1 * (c) 2017 Evan You * @license MIT */ /* */ function assert (condition, message) { if (!condition) { throw new Error(("[vue-router] " + message)) } } function warn (condition, message) { if (false) { typeof console !== 'undefined' && console.warn(("[vue-router] " + message)); } } function isError (err) { return Object.prototype.toString.call(err).indexOf('Error') > -1 } var View = { name: 'router-view', functional: true, props: { name: { type: String, default: 'default' } }, render: function render (_, ref) { var props = ref.props; var children = ref.children; var parent = ref.parent; var data = ref.data; data.routerView = true; // directly use parent context's createElement() function // so that components rendered by router-view can resolve named slots var h = parent.$createElement; var name = props.name; var route = parent.$route; var cache = parent._routerViewCache || (parent._routerViewCache = {}); // determine current view depth, also check to see if the tree // has been toggled inactive but kept-alive. var depth = 0; var inactive = false; while (parent && parent._routerRoot !== parent) { if (parent.$vnode && parent.$vnode.data.routerView) { depth++; } if (parent._inactive) { inactive = true; } parent = parent.$parent; } data.routerViewDepth = depth; // render previous view if the tree is inactive and kept-alive if (inactive) { return h(cache[name], data, children) } var matched = route.matched[depth]; // render empty node if no matched route if (!matched) { cache[name] = null; return h() } var component = cache[name] = matched.components[name]; // attach instance registration hook // this will be called in the instance's injected lifecycle hooks data.registerRouteInstance = function (vm, val) { // val could be undefined for unregistration var current = matched.instances[name]; if ( (val && current !== vm) || (!val && current === vm) ) { matched.instances[name] = val; } } // also register instance in prepatch hook // in case the same component instance is reused across different routes ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) { matched.instances[name] = vnode.componentInstance; }; // resolve props var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]); if (propsToPass) { // clone to prevent mutation propsToPass = data.props = extend({}, propsToPass); // pass non-declared props as attrs var attrs = data.attrs = data.attrs || {}; for (var key in propsToPass) { if (!component.props || !(key in component.props)) { attrs[key] = propsToPass[key]; delete propsToPass[key]; } } } return h(component, data, children) } }; function resolveProps (route, config) { switch (typeof config) { case 'undefined': return case 'object': return config case 'function': return config(route) case 'boolean': return config ? route.params : undefined default: if (false) { warn( false, "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " + "expecting an object, function or boolean." ); } } } function extend (to, from) { for (var key in from) { to[key] = from[key]; } return to } /* */ var encodeReserveRE = /[!'()*]/g; var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); }; var commaRE = /%2C/g; // fixed encodeURIComponent which is more conformant to RFC3986: // - escapes [!'()*] // - preserve commas var encode = function (str) { return encodeURIComponent(str) .replace(encodeReserveRE, encodeReserveReplacer) .replace(commaRE, ','); }; var decode = decodeURIComponent; function resolveQuery ( query, extraQuery, _parseQuery ) { if ( extraQuery === void 0 ) extraQuery = {}; var parse = _parseQuery || parseQuery; var parsedQuery; try { parsedQuery = parse(query || ''); } catch (e) { "production" !== 'production' && warn(false, e.message); parsedQuery = {}; } for (var key in extraQuery) { parsedQuery[key] = extraQuery[key]; } return parsedQuery } function parseQuery (query) { var res = {}; query = query.trim().replace(/^(\?|#|&)/, ''); if (!query) { return res } query.split('&').forEach(function (param) { var parts = param.replace(/\+/g, ' ').split('='); var key = decode(parts.shift()); var val = parts.length > 0 ? decode(parts.join('=')) : null; if (res[key] === undefined) { res[key] = val; } else if (Array.isArray(res[key])) { res[key].push(val); } else { res[key] = [res[key], val]; } }); return res } function stringifyQuery (obj) { var res = obj ? Object.keys(obj).map(function (key) { var val = obj[key]; if (val === undefined) { return '' } if (val === null) { return encode(key) } if (Array.isArray(val)) { var result = []; val.forEach(function (val2) { if (val2 === undefined) { return } if (val2 === null) { result.push(encode(key)); } else { result.push(encode(key) + '=' + encode(val2)); } }); return result.join('&') } return encode(key) + '=' + encode(val) }).filter(function (x) { return x.length > 0; }).join('&') : null; return res ? ("?" + res) : '' } /* */ var trailingSlashRE = /\/?$/; function createRoute ( record, location, redirectedFrom, router ) { var stringifyQuery$$1 = router && router.options.stringifyQuery; var query = location.query || {}; try { query = clone(query); } catch (e) {} var route = { name: location.name || (record && record.name), meta: (record && record.meta) || {}, path: location.path || '/', hash: location.hash || '', query: query, params: location.params || {}, fullPath: getFullPath(location, stringifyQuery$$1), matched: record ? formatMatch(record) : [] }; if (redirectedFrom) { route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1); } return Object.freeze(route) } function clone (value) { if (Array.isArray(value)) { return value.map(clone) } else if (value && typeof value === 'object') { var res = {}; for (var key in value) { res[key] = clone(value[key]); } return res } else { return value } } // the starting route that represents the initial state var START = createRoute(null, { path: '/' }); function formatMatch (record) { var res = []; while (record) { res.unshift(record); record = record.parent; } return res } function getFullPath ( ref, _stringifyQuery ) { var path = ref.path; var query = ref.query; if ( query === void 0 ) query = {}; var hash = ref.hash; if ( hash === void 0 ) hash = ''; var stringify = _stringifyQuery || stringifyQuery; return (path || '/') + stringify(query) + hash } function isSameRoute (a, b) { if (b === START) { return a === b } else if (!b) { return false } else if (a.path && b.path) { return ( a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && a.hash === b.hash && isObjectEqual(a.query, b.query) ) } else if (a.name && b.name) { return ( a.name === b.name && a.hash === b.hash && isObjectEqual(a.query, b.query) && isObjectEqual(a.params, b.params) ) } else { return false } } function isObjectEqual (a, b) { if ( a === void 0 ) a = {}; if ( b === void 0 ) b = {}; // handle null value #1566 if (!a || !b) { return a === b } var aKeys = Object.keys(a); var bKeys = Object.keys(b); if (aKeys.length !== bKeys.length) { return false } return aKeys.every(function (key) { var aVal = a[key]; var bVal = b[key]; // check nested equality if (typeof aVal === 'object' && typeof bVal === 'object') { return isObjectEqual(aVal, bVal) } return String(aVal) === String(bVal) }) } function isIncludedRoute (current, target) { return ( current.path.replace(trailingSlashRE, '/').indexOf( target.path.replace(trailingSlashRE, '/') ) === 0 && (!target.hash || current.hash === target.hash) && queryIncludes(current.query, target.query) ) } function queryIncludes (current, target) { for (var key in target) { if (!(key in current)) { return false } } return true } /* */ // work around weird flow bug var toTypes = [String, Object]; var eventTypes = [String, Array]; var Link = { name: 'router-link', props: { to: { type: toTypes, required: true }, tag: { type: String, default: 'a' }, exact: Boolean, append: Boolean, replace: Boolean, activeClass: String, exactActiveClass: String, event: { type: eventTypes, default: 'click' } }, render: function render (h) { var this$1 = this; var router = this.$router; var current = this.$route; var ref = router.resolve(this.to, current, this.append); var location = ref.location; var route = ref.route; var href = ref.href; var classes = {}; var globalActiveClass = router.options.linkActiveClass; var globalExactActiveClass = router.options.linkExactActiveClass; // Support global empty active class var activeClassFallback = globalActiveClass == null ? 'router-link-active' : globalActiveClass; var exactActiveClassFallback = globalExactActiveClass == null ? 'router-link-exact-active' : globalExactActiveClass; var activeClass = this.activeClass == null ? activeClassFallback : this.activeClass; var exactActiveClass = this.exactActiveClass == null ? exactActiveClassFallback : this.exactActiveClass; var compareTarget = location.path ? createRoute(null, location, null, router) : route; classes[exactActiveClass] = isSameRoute(current, compareTarget); classes[activeClass] = this.exact ? classes[exactActiveClass] : isIncludedRoute(current, compareTarget); var handler = function (e) { if (guardEvent(e)) { if (this$1.replace) { router.replace(location); } else { router.push(location); } } }; var on = { click: guardEvent }; if (Array.isArray(this.event)) { this.event.forEach(function (e) { on[e] = handler; }); } else { on[this.event] = handler; } var data = { class: classes }; if (this.tag === 'a') { data.on = on; data.attrs = { href: href }; } else { // find the first child and apply listener and href var a = findAnchor(this.$slots.default); if (a) { // in case the is a static node a.isStatic = false; var extend = _Vue.util.extend; var aData = a.data = extend({}, a.data); aData.on = on; var aAttrs = a.data.attrs = extend({}, a.data.attrs); aAttrs.href = href; } else { // doesn't have child, apply listener to self data.on = on; } } return h(this.tag, data, this.$slots.default) } }; function guardEvent (e) { // don't redirect with control keys if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return } // don't redirect when preventDefault called if (e.defaultPrevented) { return } // don't redirect on right click if (e.button !== undefined && e.button !== 0) { return } // don't redirect if `target="_blank"` if (e.currentTarget && e.currentTarget.getAttribute) { var target = e.currentTarget.getAttribute('target'); if (/\b_blank\b/i.test(target)) { return } } // this may be a Weex event which doesn't have this method if (e.preventDefault) { e.preventDefault(); } return true } function findAnchor (children) { if (children) { var child; for (var i = 0; i < children.length; i++) { child = children[i]; if (child.tag === 'a') { return child } if (child.children && (child = findAnchor(child.children))) { return child } } } } var _Vue; function install (Vue) { if (install.installed && _Vue === Vue) { return } install.installed = true; _Vue = Vue; var isDef = function (v) { return v !== undefined; }; var registerInstance = function (vm, callVal) { var i = vm.$options._parentVnode; if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) { i(vm, callVal); } }; Vue.mixin({ beforeCreate: function beforeCreate () { if (isDef(this.$options.router)) { this._routerRoot = this; this._router = this.$options.router; this._router.init(this); Vue.util.defineReactive(this, '_route', this._router.history.current); } else { this._routerRoot = (this.$parent && this.$parent._routerRoot) || this; } registerInstance(this, this); }, destroyed: function destroyed () { registerInstance(this); } }); Object.defineProperty(Vue.prototype, '$router', { get: function get () { return this._routerRoot._router } }); Object.defineProperty(Vue.prototype, '$route', { get: function get () { return this._routerRoot._route } }); Vue.component('router-view', View); Vue.component('router-link', Link); var strats = Vue.config.optionMergeStrategies; // use the same hook merging strategy for route hooks strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created; } /* */ var inBrowser = typeof window !== 'undefined'; /* */ function resolvePath ( relative, base, append ) { var firstChar = relative.charAt(0); if (firstChar === '/') { return relative } if (firstChar === '?' || firstChar === '#') { return base + relative } var stack = base.split('/'); // remove trailing segment if: // - not appending // - appending to trailing slash (last segment is empty) if (!append || !stack[stack.length - 1]) { stack.pop(); } // resolve relative path var segments = relative.replace(/^\//, '').split('/'); for (var i = 0; i < segments.length; i++) { var segment = segments[i]; if (segment === '..') { stack.pop(); } else if (segment !== '.') { stack.push(segment); } } // ensure leading slash if (stack[0] !== '') { stack.unshift(''); } return stack.join('/') } function parsePath (path) { var hash = ''; var query = ''; var hashIndex = path.indexOf('#'); if (hashIndex >= 0) { hash = path.slice(hashIndex); path = path.slice(0, hashIndex); } var queryIndex = path.indexOf('?'); if (queryIndex >= 0) { query = path.slice(queryIndex + 1); path = path.slice(0, queryIndex); } return { path: path, query: query, hash: hash } } function cleanPath (path) { return path.replace(/\/\//g, '/') } var isarray = Array.isArray || function (arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; /** * Expose `pathToRegexp`. */ var pathToRegexp_1 = pathToRegexp; var parse_1 = parse; var compile_1 = compile; var tokensToFunction_1 = tokensToFunction; var tokensToRegExp_1 = tokensToRegExp; /** * The main path matching regexp utility. * * @type {RegExp} */ var PATH_REGEXP = new RegExp([ // Match escaped characters that would otherwise appear in future matches. // This allows the user to escape special characters that won't transform. '(\\\\.)', // Match Express-style parameters and un-named parameters with a prefix // and optional suffixes. Matches appear as: // // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' ].join('|'), 'g'); /** * Parse a string for the raw tokens. * * @param {string} str * @param {Object=} options * @return {!Array} */ function parse (str, options) { var tokens = []; var key = 0; var index = 0; var path = ''; var defaultDelimiter = options && options.delimiter || '/'; var res; while ((res = PATH_REGEXP.exec(str)) != null) { var m = res[0]; var escaped = res[1]; var offset = res.index; path += str.slice(index, offset); index = offset + m.length; // Ignore already escaped sequences. if (escaped) { path += escaped[1]; continue } var next = str[index]; var prefix = res[2]; var name = res[3]; var capture = res[4]; var group = res[5]; var modifier = res[6]; var asterisk = res[7]; // Push the current path onto the tokens. if (path) { tokens.push(path); path = ''; } var partial = prefix != null && next != null && next !== prefix; var repeat = modifier === '+' || modifier === '*'; var optional = modifier === '?' || modifier === '*'; var delimiter = res[2] || defaultDelimiter; var pattern = capture || group; tokens.push({ name: name || key++, prefix: prefix || '', delimiter: delimiter, optional: optional, repeat: repeat, partial: partial, asterisk: !!asterisk, pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') }); } // Match any characters still remaining. if (index < str.length) { path += str.substr(index); } // If the path exists, push it onto the end. if (path) { tokens.push(path); } return tokens } /** * Compile a string to a template function for the path. * * @param {string} str * @param {Object=} options * @return {!function(Object=, Object=)} */ function compile (str, options) { return tokensToFunction(parse(str, options)) } /** * Prettier encoding of URI path segments. * * @param {string} * @return {string} */ function encodeURIComponentPretty (str) { return encodeURI(str).replace(/[\/?#]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } /** * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. * * @param {string} * @return {string} */ function encodeAsterisk (str) { return encodeURI(str).replace(/[?#]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } /** * Expose a method for transforming tokens into the path function. */ function tokensToFunction (tokens) { // Compile all the tokens into regexps. var matches = new Array(tokens.length); // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$'); } } return function (obj, opts) { var path = ''; var data = obj || {}; var options = opts || {}; var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (typeof token === 'string') { path += token; continue } var value = data[token.name]; var segment; if (value == null) { if (token.optional) { // Prepend partial segment prefixes. if (token.partial) { path += token.prefix; } continue } else { throw new TypeError('Expected "' + token.name + '" to be defined') } } if (isarray(value)) { if (!token.repeat) { throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') } if (value.length === 0) { if (token.optional) { continue } else { throw new TypeError('Expected "' + token.name + '" to not be empty') } } for (var j = 0; j < value.length; j++) { segment = encode(value[j]); if (!matches[i].test(segment)) { throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') } path += (j === 0 ? token.prefix : token.delimiter) + segment; } continue } segment = token.asterisk ? encodeAsterisk(value) : encode(value); if (!matches[i].test(segment)) { throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') } path += token.prefix + segment; } return path } } /** * Escape a regular expression string. * * @param {string} str * @return {string} */ function escapeString (str) { return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') } /** * Escape the capturing group by escaping special characters and meaning. * * @param {string} group * @return {string} */ function escapeGroup (group) { return group.replace(/([=!:$\/()])/g, '\\$1') } /** * Attach the keys as a property of the regexp. * * @param {!RegExp} re * @param {Array} keys * @return {!RegExp} */ function attachKeys (re, keys) { re.keys = keys; return re } /** * Get the flags for a regexp from the options. * * @param {Object} options * @return {string} */ function flags (options) { return options.sensitive ? '' : 'i' } /** * Pull out keys from a regexp. * * @param {!RegExp} path * @param {!Array} keys * @return {!RegExp} */ function regexpToRegexp (path, keys) { // Use a negative lookahead to match only capturing groups. var groups = path.source.match(/\((?!\?)/g); if (groups) { for (var i = 0; i < groups.length; i++) { keys.push({ name: i, prefix: null, delimiter: null, optional: false, repeat: false, partial: false, asterisk: false, pattern: null }); } } return attachKeys(path, keys) } /** * Transform an array into a regexp. * * @param {!Array} path * @param {Array} keys * @param {!Object} options * @return {!RegExp} */ function arrayToRegexp (path, keys, options) { var parts = []; for (var i = 0; i < path.length; i++) { parts.push(pathToRegexp(path[i], keys, options).source); } var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); return attachKeys(regexp, keys) } /** * Create a path regexp from string input. * * @param {string} path * @param {!Array} keys * @param {!Object} options * @return {!RegExp} */ function stringToRegexp (path, keys, options) { return tokensToRegExp(parse(path, options), keys, options) } /** * Expose a function for taking tokens and returning a RegExp. * * @param {!Array} tokens * @param {(Array|Object)=} keys * @param {Object=} options * @return {!RegExp} */ function tokensToRegExp (tokens, keys, options) { if (!isarray(keys)) { options = /** @type {!Object} */ (keys || options); keys = []; } options = options || {}; var strict = options.strict; var end = options.end !== false; var route = ''; // Iterate over the tokens and create our regexp string. for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (typeof token === 'string') { route += escapeString(token); } else { var prefix = escapeString(token.prefix); var capture = '(?:' + token.pattern + ')'; keys.push(token); if (token.repeat) { capture += '(?:' + prefix + capture + ')*'; } if (token.optional) { if (!token.partial) { capture = '(?:' + prefix + '(' + capture + '))?'; } else { capture = prefix + '(' + capture + ')?'; } } else { capture = prefix + '(' + capture + ')'; } route += capture; } } var delimiter = escapeString(options.delimiter || '/'); var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; // In non-strict mode we allow a slash at the end of match. If the path to // match already ends with a slash, we remove it for consistency. The slash // is valid at the end of a path match, not in the middle. This is important // in non-ending mode, where "/test/" shouldn't match "/test//route". if (!strict) { route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'; } if (end) { route += '$'; } else { // In non-ending mode, we need the capturing groups to match as much as // possible by using a positive lookahead to the end or next path segment. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'; } return attachKeys(new RegExp('^' + route, flags(options)), keys) } /** * Normalize the given path string, returning a regular expression. * * An empty array can be passed in for the keys, which will hold the * placeholder key descriptions. For example, using `/user/:id`, `keys` will * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. * * @param {(string|RegExp|Array)} path * @param {(Array|Object)=} keys * @param {Object=} options * @return {!RegExp} */ function pathToRegexp (path, keys, options) { if (!isarray(keys)) { options = /** @type {!Object} */ (keys || options); keys = []; } options = options || {}; if (path instanceof RegExp) { return regexpToRegexp(path, /** @type {!Array} */ (keys)) } if (isarray(path)) { return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) } return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) } pathToRegexp_1.parse = parse_1; pathToRegexp_1.compile = compile_1; pathToRegexp_1.tokensToFunction = tokensToFunction_1; pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; /* */ // $flow-disable-line var regexpCompileCache = Object.create(null); function fillParams ( path, params, routeMsg ) { try { var filler = regexpCompileCache[path] || (regexpCompileCache[path] = pathToRegexp_1.compile(path)); return filler(params || {}, { pretty: true }) } catch (e) { if (false) { warn(false, ("missing param for " + routeMsg + ": " + (e.message))); } return '' } } /* */ function createRouteMap ( routes, oldPathList, oldPathMap, oldNameMap ) { // the path list is used to control path matching priority var pathList = oldPathList || []; // $flow-disable-line var pathMap = oldPathMap || Object.create(null); // $flow-disable-line var nameMap = oldNameMap || Object.create(null); routes.forEach(function (route) { addRouteRecord(pathList, pathMap, nameMap, route); }); // ensure wildcard routes are always at the end for (var i = 0, l = pathList.length; i < l; i++) { if (pathList[i] === '*') { pathList.push(pathList.splice(i, 1)[0]); l--; i--; } } return { pathList: pathList, pathMap: pathMap, nameMap: nameMap } } function addRouteRecord ( pathList, pathMap, nameMap, route, parent, matchAs ) { var path = route.path; var name = route.name; if (false) { assert(path != null, "\"path\" is required in a route configuration."); assert( typeof route.component !== 'string', "route config \"component\" for path: " + (String(path || name)) + " cannot be a " + "string id. Use an actual component instead." ); } var pathToRegexpOptions = route.pathToRegexpOptions || {}; var normalizedPath = normalizePath( path, parent, pathToRegexpOptions.strict ); if (typeof route.caseSensitive === 'boolean') { pathToRegexpOptions.sensitive = route.caseSensitive; } var record = { path: normalizedPath, regex: compileRouteRegex(normalizedPath, pathToRegexpOptions), components: route.components || { default: route.component }, instances: {}, name: name, parent: parent, matchAs: matchAs, redirect: route.redirect, beforeEnter: route.beforeEnter, meta: route.meta || {}, props: route.props == null ? {} : route.components ? route.props : { default: route.props } }; if (route.children) { // Warn if route is named, does not redirect and has a default child route. // If users navigate to this route by name, the default child will // not be rendered (GH Issue #629) if (false) { if (route.name && !route.redirect && route.children.some(function (child) { return /^\/?$/.test(child.path); })) { warn( false, "Named Route '" + (route.name) + "' has a default child route. " + "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " + "the default child route will not be rendered. Remove the name from " + "this route and use the name of the default child route for named " + "links instead." ); } } route.children.forEach(function (child) { var childMatchAs = matchAs ? cleanPath((matchAs + "/" + (child.path))) : undefined; addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs); }); } if (route.alias !== undefined) { var aliases = Array.isArray(route.alias) ? route.alias : [route.alias]; aliases.forEach(function (alias) { var aliasRoute = { path: alias, children: route.children }; addRouteRecord( pathList, pathMap, nameMap, aliasRoute, parent, record.path || '/' // matchAs ); }); } if (!pathMap[record.path]) { pathList.push(record.path); pathMap[record.path] = record; } if (name) { if (!nameMap[name]) { nameMap[name] = record; } else if (false) { warn( false, "Duplicate named routes definition: " + "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }" ); } } } function compileRouteRegex (path, pathToRegexpOptions) { var regex = pathToRegexp_1(path, [], pathToRegexpOptions); if (false) { var keys = Object.create(null); regex.keys.forEach(function (key) { warn(!keys[key.name], ("Duplicate param keys in route with path: \"" + path + "\"")); keys[key.name] = true; }); } return regex } function normalizePath (path, parent, strict) { if (!strict) { path = path.replace(/\/$/, ''); } if (path[0] === '/') { return path } if (parent == null) { return path } return cleanPath(((parent.path) + "/" + path)) } /* */ function normalizeLocation ( raw, current, append, router ) { var next = typeof raw === 'string' ? { path: raw } : raw; // named target if (next.name || next._normalized) { return next } // relative params if (!next.path && next.params && current) { next = assign({}, next); next._normalized = true; var params = assign(assign({}, current.params), next.params); if (current.name) { next.name = current.name; next.params = params; } else if (current.matched.length) { var rawPath = current.matched[current.matched.length - 1].path; next.path = fillParams(rawPath, params, ("path " + (current.path))); } else if (false) { warn(false, "relative params navigation requires a current route."); } return next } var parsedPath = parsePath(next.path || ''); var basePath = (current && current.path) || '/'; var path = parsedPath.path ? resolvePath(parsedPath.path, basePath, append || next.append) : basePath; var query = resolveQuery( parsedPath.query, next.query, router && router.options.parseQuery ); var hash = next.hash || parsedPath.hash; if (hash && hash.charAt(0) !== '#') { hash = "#" + hash; } return { _normalized: true, path: path, query: query, hash: hash } } function assign (a, b) { for (var key in b) { a[key] = b[key]; } return a } /* */ function createMatcher ( routes, router ) { var ref = createRouteMap(routes); var pathList = ref.pathList; var pathMap = ref.pathMap; var nameMap = ref.nameMap; function addRoutes (routes) { createRouteMap(routes, pathList, pathMap, nameMap); } function match ( raw, currentRoute, redirectedFrom ) { var location = normalizeLocation(raw, currentRoute, false, router); var name = location.name; if (name) { var record = nameMap[name]; if (false) { warn(record, ("Route with name '" + name + "' does not exist")); } if (!record) { return _createRoute(null, location) } var paramNames = record.regex.keys .filter(function (key) { return !key.optional; }) .map(function (key) { return key.name; }); if (typeof location.params !== 'object') { location.params = {}; } if (currentRoute && typeof currentRoute.params === 'object') { for (var key in currentRoute.params) { if (!(key in location.params) && paramNames.indexOf(key) > -1) { location.params[key] = currentRoute.params[key]; } } } if (record) { location.path = fillParams(record.path, location.params, ("named route \"" + name + "\"")); return _createRoute(record, location, redirectedFrom) } } else if (location.path) { location.params = {}; for (var i = 0; i < pathList.length; i++) { var path = pathList[i]; var record$1 = pathMap[path]; if (matchRoute(record$1.regex, location.path, location.params)) { return _createRoute(record$1, location, redirectedFrom) } } } // no match return _createRoute(null, location) } function redirect ( record, location ) { var originalRedirect = record.redirect; var redirect = typeof originalRedirect === 'function' ? originalRedirect(createRoute(record, location, null, router)) : originalRedirect; if (typeof redirect === 'string') { redirect = { path: redirect }; } if (!redirect || typeof redirect !== 'object') { if (false) { warn( false, ("invalid redirect option: " + (JSON.stringify(redirect))) ); } return _createRoute(null, location) } var re = redirect; var name = re.name; var path = re.path; var query = location.query; var hash = location.hash; var params = location.params; query = re.hasOwnProperty('query') ? re.query : query; hash = re.hasOwnProperty('hash') ? re.hash : hash; params = re.hasOwnProperty('params') ? re.params : params; if (name) { // resolved named direct var targetRecord = nameMap[name]; if (false) { assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found.")); } return match({ _normalized: true, name: name, query: query, hash: hash, params: params }, undefined, location) } else if (path) { // 1. resolve relative redirect var rawPath = resolveRecordPath(path, record); // 2. resolve params var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\"")); // 3. rematch with existing query and hash return match({ _normalized: true, path: resolvedPath, query: query, hash: hash }, undefined, location) } else { if (false) { warn(false, ("invalid redirect option: " + (JSON.stringify(redirect)))); } return _createRoute(null, location) } } function alias ( record, location, matchAs ) { var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\"")); var aliasedMatch = match({ _normalized: true, path: aliasedPath }); if (aliasedMatch) { var matched = aliasedMatch.matched; var aliasedRecord = matched[matched.length - 1]; location.params = aliasedMatch.params; return _createRoute(aliasedRecord, location) } return _createRoute(null, location) } function _createRoute ( record, location, redirectedFrom ) { if (record && record.redirect) { return redirect(record, redirectedFrom || location) } if (record && record.matchAs) { return alias(record, location, record.matchAs) } return createRoute(record, location, redirectedFrom, router) } return { match: match, addRoutes: addRoutes } } function matchRoute ( regex, path, params ) { var m = path.match(regex); if (!m) { return false } else if (!params) { return true } for (var i = 1, len = m.length; i < len; ++i) { var key = regex.keys[i - 1]; var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]; if (key) { params[key.name] = val; } } return true } function resolveRecordPath (path, record) { return resolvePath(path, record.parent ? record.parent.path : '/', true) } /* */ var positionStore = Object.create(null); function setupScroll () { // Fix for #1585 for Firefox window.history.replaceState({ key: getStateKey() }, ''); window.addEventListener('popstate', function (e) { saveScrollPosition(); if (e.state && e.state.key) { setStateKey(e.state.key); } }); } function handleScroll ( router, to, from, isPop ) { if (!router.app) { return } var behavior = router.options.scrollBehavior; if (!behavior) { return } if (false) { assert(typeof behavior === 'function', "scrollBehavior must be a function"); } // wait until re-render finishes before scrolling router.app.$nextTick(function () { var position = getScrollPosition(); var shouldScroll = behavior(to, from, isPop ? position : null); if (!shouldScroll) { return } if (typeof shouldScroll.then === 'function') { shouldScroll.then(function (shouldScroll) { scrollToPosition((shouldScroll), position); }).catch(function (err) { if (false) { assert(false, err.toString()); } }); } else { scrollToPosition(shouldScroll, position); } }); } function saveScrollPosition () { var key = getStateKey(); if (key) { positionStore[key] = { x: window.pageXOffset, y: window.pageYOffset }; } } function getScrollPosition () { var key = getStateKey(); if (key) { return positionStore[key] } } function getElementPosition (el, offset) { var docEl = document.documentElement; var docRect = docEl.getBoundingClientRect(); var elRect = el.getBoundingClientRect(); return { x: elRect.left - docRect.left - offset.x, y: elRect.top - docRect.top - offset.y } } function isValidPosition (obj) { return isNumber(obj.x) || isNumber(obj.y) } function normalizePosition (obj) { return { x: isNumber(obj.x) ? obj.x : window.pageXOffset, y: isNumber(obj.y) ? obj.y : window.pageYOffset } } function normalizeOffset (obj) { return { x: isNumber(obj.x) ? obj.x : 0, y: isNumber(obj.y) ? obj.y : 0 } } function isNumber (v) { return typeof v === 'number' } function scrollToPosition (shouldScroll, position) { var isObject = typeof shouldScroll === 'object'; if (isObject && typeof shouldScroll.selector === 'string') { var el = document.querySelector(shouldScroll.selector); if (el) { var offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {}; offset = normalizeOffset(offset); position = getElementPosition(el, offset); } else if (isValidPosition(shouldScroll)) { position = normalizePosition(shouldScroll); } } else if (isObject && isValidPosition(shouldScroll)) { position = normalizePosition(shouldScroll); } if (position) { window.scrollTo(position.x, position.y); } } /* */ var supportsPushState = inBrowser && (function () { var ua = window.navigator.userAgent; if ( (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1 ) { return false } return window.history && 'pushState' in window.history })(); // use User Timing api (if present) for more accurate key precision var Time = inBrowser && window.performance && window.performance.now ? window.performance : Date; var _key = genKey(); function genKey () { return Time.now().toFixed(3) } function getStateKey () { return _key } function setStateKey (key) { _key = key; } function pushState (url, replace) { saveScrollPosition(); // try...catch the pushState call to get around Safari // DOM Exception 18 where it limits to 100 pushState calls var history = window.history; try { if (replace) { history.replaceState({ key: _key }, '', url); } else { _key = genKey(); history.pushState({ key: _key }, '', url); } } catch (e) { window.location[replace ? 'replace' : 'assign'](url); } } function replaceState (url) { pushState(url, true); } /* */ function runQueue (queue, fn, cb) { var step = function (index) { if (index >= queue.length) { cb(); } else { if (queue[index]) { fn(queue[index], function () { step(index + 1); }); } else { step(index + 1); } } }; step(0); } /* */ function resolveAsyncComponents (matched) { return function (to, from, next) { var hasAsync = false; var pending = 0; var error = null; flatMapComponents(matched, function (def, _, match, key) { // if it's a function and doesn't have cid attached, // assume it's an async component resolve function. // we are not using Vue's default async resolving mechanism because // we want to halt the navigation until the incoming component has been // resolved. if (typeof def === 'function' && def.cid === undefined) { hasAsync = true; pending++; var resolve = once(function (resolvedDef) { if (isESModule(resolvedDef)) { resolvedDef = resolvedDef.default; } // save resolved on async factory in case it's used elsewhere def.resolved = typeof resolvedDef === 'function' ? resolvedDef : _Vue.extend(resolvedDef); match.components[key] = resolvedDef; pending--; if (pending <= 0) { next(); } }); var reject = once(function (reason) { var msg = "Failed to resolve async component " + key + ": " + reason; "production" !== 'production' && warn(false, msg); if (!error) { error = isError(reason) ? reason : new Error(msg); next(error); } }); var res; try { res = def(resolve, reject); } catch (e) { reject(e); } if (res) { if (typeof res.then === 'function') { res.then(resolve, reject); } else { // new syntax in Vue 2.3 var comp = res.component; if (comp && typeof comp.then === 'function') { comp.then(resolve, reject); } } } } }); if (!hasAsync) { next(); } } } function flatMapComponents ( matched, fn ) { return flatten(matched.map(function (m) { return Object.keys(m.components).map(function (key) { return fn( m.components[key], m.instances[key], m, key ); }) })) } function flatten (arr) { return Array.prototype.concat.apply([], arr) } var hasSymbol = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; function isESModule (obj) { return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module') } // in Webpack 2, require.ensure now also returns a Promise // so the resolve/reject functions may get called an extra time // if the user uses an arrow function shorthand that happens to // return that Promise. function once (fn) { var called = false; return function () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; if (called) { return } called = true; return fn.apply(this, args) } } /* */ var History = function History (router, base) { this.router = router; this.base = normalizeBase(base); // start with a route object that stands for "nowhere" this.current = START; this.pending = null; this.ready = false; this.readyCbs = []; this.readyErrorCbs = []; this.errorCbs = []; }; History.prototype.listen = function listen (cb) { this.cb = cb; }; History.prototype.onReady = function onReady (cb, errorCb) { if (this.ready) { cb(); } else { this.readyCbs.push(cb); if (errorCb) { this.readyErrorCbs.push(errorCb); } } }; History.prototype.onError = function onError (errorCb) { this.errorCbs.push(errorCb); }; History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) { var this$1 = this; var route = this.router.match(location, this.current); this.confirmTransition(route, function () { this$1.updateRoute(route); onComplete && onComplete(route); this$1.ensureURL(); // fire ready cbs once if (!this$1.ready) { this$1.ready = true; this$1.readyCbs.forEach(function (cb) { cb(route); }); } }, function (err) { if (onAbort) { onAbort(err); } if (err && !this$1.ready) { this$1.ready = true; this$1.readyErrorCbs.forEach(function (cb) { cb(err); }); } }); }; History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) { var this$1 = this; var current = this.current; var abort = function (err) { if (isError(err)) { if (this$1.errorCbs.length) { this$1.errorCbs.forEach(function (cb) { cb(err); }); } else { warn(false, 'uncaught error during route navigation:'); console.error(err); } } onAbort && onAbort(err); }; if ( isSameRoute(route, current) && // in the case the route map has been dynamically appended to route.matched.length === current.matched.length ) { this.ensureURL(); return abort() } var ref = resolveQueue(this.current.matched, route.matched); var updated = ref.updated; var deactivated = ref.deactivated; var activated = ref.activated; var queue = [].concat( // in-component leave guards extractLeaveGuards(deactivated), // global before hooks this.router.beforeHooks, // in-component update hooks extractUpdateHooks(updated), // in-config enter guards activated.map(function (m) { return m.beforeEnter; }), // async components resolveAsyncComponents(activated) ); this.pending = route; var iterator = function (hook, next) { if (this$1.pending !== route) { return abort() } try { hook(route, current, function (to) { if (to === false || isError(to)) { // next(false) -> abort navigation, ensure current URL this$1.ensureURL(true); abort(to); } else if ( typeof to === 'string' || (typeof to === 'object' && ( typeof to.path === 'string' || typeof to.name === 'string' )) ) { // next('/') or next({ path: '/' }) -> redirect abort(); if (typeof to === 'object' && to.replace) { this$1.replace(to); } else { this$1.push(to); } } else { // confirm transition and pass on the value next(to); } }); } catch (e) { abort(e); } }; runQueue(queue, iterator, function () { var postEnterCbs = []; var isValid = function () { return this$1.current === route; }; // wait until async components are resolved before // extracting in-component enter guards var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid); var queue = enterGuards.concat(this$1.router.resolveHooks); runQueue(queue, iterator, function () { if (this$1.pending !== route) { return abort() } this$1.pending = null; onComplete(route); if (this$1.router.app) { this$1.router.app.$nextTick(function () { postEnterCbs.forEach(function (cb) { cb(); }); }); } }); }); }; History.prototype.updateRoute = function updateRoute (route) { var prev = this.current; this.current = route; this.cb && this.cb(route); this.router.afterHooks.forEach(function (hook) { hook && hook(route, prev); }); }; function normalizeBase (base) { if (!base) { if (inBrowser) { // respect tag var baseEl = document.querySelector('base'); base = (baseEl && baseEl.getAttribute('href')) || '/'; // strip full URL origin base = base.replace(/^https?:\/\/[^\/]+/, ''); } else { base = '/'; } } // make sure there's the starting slash if (base.charAt(0) !== '/') { base = '/' + base; } // remove trailing slash return base.replace(/\/$/, '') } function resolveQueue ( current, next ) { var i; var max = Math.max(current.length, next.length); for (i = 0; i < max; i++) { if (current[i] !== next[i]) { break } } return { updated: next.slice(0, i), activated: next.slice(i), deactivated: current.slice(i) } } function extractGuards ( records, name, bind, reverse ) { var guards = flatMapComponents(records, function (def, instance, match, key) { var guard = extractGuard(def, name); if (guard) { return Array.isArray(guard) ? guard.map(function (guard) { return bind(guard, instance, match, key); }) : bind(guard, instance, match, key) } }); return flatten(reverse ? guards.reverse() : guards) } function extractGuard ( def, key ) { if (typeof def !== 'function') { // extend now so that global mixins are applied. def = _Vue.extend(def); } return def.options[key] } function extractLeaveGuards (deactivated) { return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true) } function extractUpdateHooks (updated) { return extractGuards(updated, 'beforeRouteUpdate', bindGuard) } function bindGuard (guard, instance) { if (instance) { return function boundRouteGuard () { return guard.apply(instance, arguments) } } } function extractEnterGuards ( activated, cbs, isValid ) { return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) { return bindEnterGuard(guard, match, key, cbs, isValid) }) } function bindEnterGuard ( guard, match, key, cbs, isValid ) { return function routeEnterGuard (to, from, next) { return guard(to, from, function (cb) { next(cb); if (typeof cb === 'function') { cbs.push(function () { // #750 // if a router-view is wrapped with an out-in transition, // the instance may not have been registered at this time. // we will need to poll for registration until current route // is no longer valid. poll(cb, match.instances, key, isValid); }); } }) } } function poll ( cb, // somehow flow cannot infer this is a function instances, key, isValid ) { if (instances[key]) { cb(instances[key]); } else if (isValid()) { setTimeout(function () { poll(cb, instances, key, isValid); }, 16); } } /* */ var HTML5History = (function (History$$1) { function HTML5History (router, base) { var this$1 = this; History$$1.call(this, router, base); var expectScroll = router.options.scrollBehavior; if (expectScroll) { setupScroll(); } var initLocation = getLocation(this.base); window.addEventListener('popstate', function (e) { var current = this$1.current; // Avoiding first `popstate` event dispatched in some browsers but first // history route not updated since async guard at the same time. var location = getLocation(this$1.base); if (this$1.current === START && location === initLocation) { return } this$1.transitionTo(location, function (route) { if (expectScroll) { handleScroll(router, route, current, true); } }); }); } if ( History$$1 ) HTML5History.__proto__ = History$$1; HTML5History.prototype = Object.create( History$$1 && History$$1.prototype ); HTML5History.prototype.constructor = HTML5History; HTML5History.prototype.go = function go (n) { window.history.go(n); }; HTML5History.prototype.push = function push (location, onComplete, onAbort) { var this$1 = this; var ref = this; var fromRoute = ref.current; this.transitionTo(location, function (route) { pushState(cleanPath(this$1.base + route.fullPath)); handleScroll(this$1.router, route, fromRoute, false); onComplete && onComplete(route); }, onAbort); }; HTML5History.prototype.replace = function replace (location, onComplete, onAbort) { var this$1 = this; var ref = this; var fromRoute = ref.current; this.transitionTo(location, function (route) { replaceState(cleanPath(this$1.base + route.fullPath)); handleScroll(this$1.router, route, fromRoute, false); onComplete && onComplete(route); }, onAbort); }; HTML5History.prototype.ensureURL = function ensureURL (push) { if (getLocation(this.base) !== this.current.fullPath) { var current = cleanPath(this.base + this.current.fullPath); push ? pushState(current) : replaceState(current); } }; HTML5History.prototype.getCurrentLocation = function getCurrentLocation () { return getLocation(this.base) }; return HTML5History; }(History)); function getLocation (base) { var path = window.location.pathname; if (base && path.indexOf(base) === 0) { path = path.slice(base.length); } return (path || '/') + window.location.search + window.location.hash } /* */ var HashHistory = (function (History$$1) { function HashHistory (router, base, fallback) { History$$1.call(this, router, base); // check history fallback deeplinking if (fallback && checkFallback(this.base)) { return } ensureSlash(); } if ( History$$1 ) HashHistory.__proto__ = History$$1; HashHistory.prototype = Object.create( History$$1 && History$$1.prototype ); HashHistory.prototype.constructor = HashHistory; // this is delayed until the app mounts // to avoid the hashchange listener being fired too early HashHistory.prototype.setupListeners = function setupListeners () { var this$1 = this; var router = this.router; var expectScroll = router.options.scrollBehavior; var supportsScroll = supportsPushState && expectScroll; if (supportsScroll) { setupScroll(); } window.addEventListener(supportsPushState ? 'popstate' : 'hashchange', function () { var current = this$1.current; if (!ensureSlash()) { return } this$1.transitionTo(getHash(), function (route) { if (supportsScroll) { handleScroll(this$1.router, route, current, true); } if (!supportsPushState) { replaceHash(route.fullPath); } }); }); }; HashHistory.prototype.push = function push (location, onComplete, onAbort) { var this$1 = this; var ref = this; var fromRoute = ref.current; this.transitionTo(location, function (route) { pushHash(route.fullPath); handleScroll(this$1.router, route, fromRoute, false); onComplete && onComplete(route); }, onAbort); }; HashHistory.prototype.replace = function replace (location, onComplete, onAbort) { var this$1 = this; var ref = this; var fromRoute = ref.current; this.transitionTo(location, function (route) { replaceHash(route.fullPath); handleScroll(this$1.router, route, fromRoute, false); onComplete && onComplete(route); }, onAbort); }; HashHistory.prototype.go = function go (n) { window.history.go(n); }; HashHistory.prototype.ensureURL = function ensureURL (push) { var current = this.current.fullPath; if (getHash() !== current) { push ? pushHash(current) : replaceHash(current); } }; HashHistory.prototype.getCurrentLocation = function getCurrentLocation () { return getHash() }; return HashHistory; }(History)); function checkFallback (base) { var location = getLocation(base); if (!/^\/#/.test(location)) { window.location.replace( cleanPath(base + '/#' + location) ); return true } } function ensureSlash () { var path = getHash(); if (path.charAt(0) === '/') { return true } replaceHash('/' + path); return false } function getHash () { // We can't use window.location.hash here because it's not // consistent across browsers - Firefox will pre-decode it! var href = window.location.href; var index = href.indexOf('#'); return index === -1 ? '' : href.slice(index + 1) } function getUrl (path) { var href = window.location.href; var i = href.indexOf('#'); var base = i >= 0 ? href.slice(0, i) : href; return (base + "#" + path) } function pushHash (path) { if (supportsPushState) { pushState(getUrl(path)); } else { window.location.hash = path; } } function replaceHash (path) { if (supportsPushState) { replaceState(getUrl(path)); } else { window.location.replace(getUrl(path)); } } /* */ var AbstractHistory = (function (History$$1) { function AbstractHistory (router, base) { History$$1.call(this, router, base); this.stack = []; this.index = -1; } if ( History$$1 ) AbstractHistory.__proto__ = History$$1; AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype ); AbstractHistory.prototype.constructor = AbstractHistory; AbstractHistory.prototype.push = function push (location, onComplete, onAbort) { var this$1 = this; this.transitionTo(location, function (route) { this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route); this$1.index++; onComplete && onComplete(route); }, onAbort); }; AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) { var this$1 = this; this.transitionTo(location, function (route) { this$1.stack = this$1.stack.slice(0, this$1.index).concat(route); onComplete && onComplete(route); }, onAbort); }; AbstractHistory.prototype.go = function go (n) { var this$1 = this; var targetIndex = this.index + n; if (targetIndex < 0 || targetIndex >= this.stack.length) { return } var route = this.stack[targetIndex]; this.confirmTransition(route, function () { this$1.index = targetIndex; this$1.updateRoute(route); }); }; AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () { var current = this.stack[this.stack.length - 1]; return current ? current.fullPath : '/' }; AbstractHistory.prototype.ensureURL = function ensureURL () { // noop }; return AbstractHistory; }(History)); /* */ var VueRouter = function VueRouter (options) { if ( options === void 0 ) options = {}; this.app = null; this.apps = []; this.options = options; this.beforeHooks = []; this.resolveHooks = []; this.afterHooks = []; this.matcher = createMatcher(options.routes || [], this); var mode = options.mode || 'hash'; this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false; if (this.fallback) { mode = 'hash'; } if (!inBrowser) { mode = 'abstract'; } this.mode = mode; switch (mode) { case 'history': this.history = new HTML5History(this, options.base); break case 'hash': this.history = new HashHistory(this, options.base, this.fallback); break case 'abstract': this.history = new AbstractHistory(this, options.base); break default: if (false) { assert(false, ("invalid mode: " + mode)); } } }; var prototypeAccessors = { currentRoute: { configurable: true } }; VueRouter.prototype.match = function match ( raw, current, redirectedFrom ) { return this.matcher.match(raw, current, redirectedFrom) }; prototypeAccessors.currentRoute.get = function () { return this.history && this.history.current }; VueRouter.prototype.init = function init (app /* Vue component instance */) { var this$1 = this; "production" !== 'production' && assert( install.installed, "not installed. Make sure to call `Vue.use(VueRouter)` " + "before creating root instance." ); this.apps.push(app); // main app already initialized. if (this.app) { return } this.app = app; var history = this.history; if (history instanceof HTML5History) { history.transitionTo(history.getCurrentLocation()); } else if (history instanceof HashHistory) { var setupHashListener = function () { history.setupListeners(); }; history.transitionTo( history.getCurrentLocation(), setupHashListener, setupHashListener ); } history.listen(function (route) { this$1.apps.forEach(function (app) { app._route = route; }); }); }; VueRouter.prototype.beforeEach = function beforeEach (fn) { return registerHook(this.beforeHooks, fn) }; VueRouter.prototype.beforeResolve = function beforeResolve (fn) { return registerHook(this.resolveHooks, fn) }; VueRouter.prototype.afterEach = function afterEach (fn) { return registerHook(this.afterHooks, fn) }; VueRouter.prototype.onReady = function onReady (cb, errorCb) { this.history.onReady(cb, errorCb); }; VueRouter.prototype.onError = function onError (errorCb) { this.history.onError(errorCb); }; VueRouter.prototype.push = function push (location, onComplete, onAbort) { this.history.push(location, onComplete, onAbort); }; VueRouter.prototype.replace = function replace (location, onComplete, onAbort) { this.history.replace(location, onComplete, onAbort); }; VueRouter.prototype.go = function go (n) { this.history.go(n); }; VueRouter.prototype.back = function back () { this.go(-1); }; VueRouter.prototype.forward = function forward () { this.go(1); }; VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) { var route = to ? to.matched ? to : this.resolve(to).route : this.currentRoute; if (!route) { return [] } return [].concat.apply([], route.matched.map(function (m) { return Object.keys(m.components).map(function (key) { return m.components[key] }) })) }; VueRouter.prototype.resolve = function resolve ( to, current, append ) { var location = normalizeLocation( to, current || this.history.current, append, this ); var route = this.match(location, current); var fullPath = route.redirectedFrom || route.fullPath; var base = this.history.base; var href = createHref(base, fullPath, this.mode); return { location: location, route: route, href: href, // for backwards compat normalizedTo: location, resolved: route } }; VueRouter.prototype.addRoutes = function addRoutes (routes) { this.matcher.addRoutes(routes); if (this.history.current !== START) { this.history.transitionTo(this.history.getCurrentLocation()); } }; Object.defineProperties( VueRouter.prototype, prototypeAccessors ); function registerHook (list, fn) { list.push(fn); return function () { var i = list.indexOf(fn); if (i > -1) { list.splice(i, 1); } } } function createHref (base, fullPath, mode) { var path = mode === 'hash' ? '#' + fullPath : fullPath; return base ? cleanPath(base + '/' + path) : path } VueRouter.install = install; VueRouter.version = '3.0.1'; if (inBrowser && window.Vue) { window.Vue.use(VueRouter); } /* harmony default export */ __webpack_exports__["a"] = (VueRouter); /***/ }), /***/ "/sOT": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("q0qZ"); var fails = __webpack_require__("r54x"); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 module.exports = DESCRIPTORS && fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype != 42; }); /***/ }), /***/ "/vN/": /***/ (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 echarts = __webpack_require__("Icdr"); var createListSimply = __webpack_require__("/gZK"); var zrUtil = __webpack_require__("/gxq"); var modelUtil = __webpack_require__("vXqC"); var _number = __webpack_require__("wWR3"); var getPercentWithPrecision = _number.getPercentWithPrecision; var dataSelectableMixin = __webpack_require__("kQD9"); var _dataProvider = __webpack_require__("5KBG"); var retrieveRawAttr = _dataProvider.retrieveRawAttr; var _sourceHelper = __webpack_require__("kdOt"); var makeSeriesEncodeForNameBased = _sourceHelper.makeSeriesEncodeForNameBased; var LegendVisualProvider = __webpack_require__("FCaW"); /* * 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 = echarts.extendSeriesModel({ type: 'series.pie', // Overwrite init: function (option) { PieSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)); this.updateSelectedMap(this._createSelectableList()); this._defaultLabelLine(option); }, // Overwrite mergeOption: function (newOption) { PieSeries.superCall(this, 'mergeOption', newOption); this.updateSelectedMap(this._createSelectableList()); }, getInitialData: function (option, ecModel) { return createListSimply(this, { coordDimensions: ['value'], encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this) }); }, _createSelectableList: function () { var data = this.getRawData(); var valueDim = data.mapDimension('value'); var targetList = []; for (var i = 0, len = data.count(); i < len; i++) { targetList.push({ name: data.getName(i), value: data.get(valueDim, i), selected: retrieveRawAttr(data, i, 'selected') }); } return targetList; }, // Overwrite getDataParams: function (dataIndex) { var data = this.getData(); var params = PieSeries.superCall(this, 'getDataParams', dataIndex); // FIXME toFixed? var valueList = []; data.each(data.mapDimension('value'), function (value) { valueList.push(value); }); params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision')); params.$vars.push('percent'); return params; }, _defaultLabelLine: function (option) { // Extend labelLine emphasis modelUtil.defaultEmphasis(option, 'labelLine', ['show']); var labelLineNormalOpt = option.labelLine; var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; }, defaultOption: { zlevel: 0, z: 2, legendHoverLink: true, hoverAnimation: true, // 默认全局居中 center: ['50%', '50%'], radius: [0, '75%'], // 默认顺时针 clockwise: true, startAngle: 90, // 最小角度改为0 minAngle: 0, // If the angle of a sector less than `minShowLabelAngle`, // the label will not be displayed. minShowLabelAngle: 0, // 选中时扇区偏移量 selectedOffset: 10, // 高亮扇区偏移量 hoverOffset: 10, // If use strategy to avoid label overlapping avoidLabelOverlap: true, // 选择模式,默认关闭,可选single,multiple // selectedMode: false, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) // roseType: null, percentPrecision: 2, // If still show when all data zero. stillShowZeroSum: true, // 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', // '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位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 }, // Enabled when label.normal.position is 'outer' labelLine: { show: true, // 引导线两段中的第一段长度 length: 15, // 引导线两段中的第二段长度 length2: 15, smooth: false, lineStyle: { // color: 各异, width: 1, type: 'solid' } }, itemStyle: { borderWidth: 1 }, // Animation type. Valid values: expansion, scale animationType: 'expansion', // Animation type when update. Valid values: transition, expansion animationTypeUpdate: 'transition', animationEasing: 'cubicOut' } }); zrUtil.mixin(PieSeries, dataSelectableMixin); var _default = PieSeries; module.exports = _default; /***/ }), /***/ "/w37": /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.1.3.7 String.prototype.includes(searchString, position = 0) var $export = __webpack_require__("eqAp"); var context = __webpack_require__("bmV0"); var INCLUDES = 'includes'; $export($export.P + $export.F * __webpack_require__("rNRh")(INCLUDES), 'String', { includes: function includes(searchString /* , position = 0 */) { return !!~context(this, searchString, INCLUDES) .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /***/ "/xsj": /***/ (function(module, exports) { /* * 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. */ var colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF']; var _default = { color: colorAll, colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll] }; module.exports = _default; /***/ }), /***/ "0/jl": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ECMAScript 6 symbols shim var global = __webpack_require__("YjQv"); var has = __webpack_require__("x//u"); var DESCRIPTORS = __webpack_require__("qs+f"); var $export = __webpack_require__("Wdy1"); var redefine = __webpack_require__("1RnF"); var META = __webpack_require__("+zJ9").KEY; var $fails = __webpack_require__("zyKz"); var shared = __webpack_require__("a/OS"); var setToStringTag = __webpack_require__("LhDF"); var uid = __webpack_require__("GmwO"); var wks = __webpack_require__("hgbu"); var wksExt = __webpack_require__("4DQ7"); var wksDefine = __webpack_require__("Ntt2"); var enumKeys = __webpack_require__("6rdy"); var isArray = __webpack_require__("NU0k"); var anObject = __webpack_require__("FKWp"); var isObject = __webpack_require__("8ANE"); var toObject = __webpack_require__("wXdB"); var toIObject = __webpack_require__("ksFB"); var toPrimitive = __webpack_require__("9MbE"); var createDesc = __webpack_require__("YTz9"); var _create = __webpack_require__("NZ8V"); var gOPNExt = __webpack_require__("6tLb"); var $GOPD = __webpack_require__("rjjF"); var $GOPS = __webpack_require__("THEY"); var $DP = __webpack_require__("GCs6"); var $keys = __webpack_require__("pEGt"); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; var $Symbol = global.Symbol; var $JSON = global.JSON; var _stringify = $JSON && $JSON.stringify; var PROTOTYPE = 'prototype'; var HIDDEN = wks('_hidden'); var TO_PRIMITIVE = wks('toPrimitive'); var isEnum = {}.propertyIsEnumerable; var SymbolRegistry = shared('symbol-registry'); var AllSymbols = shared('symbols'); var OPSymbols = shared('op-symbols'); var ObjectProto = Object[PROTOTYPE]; var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function () { return _create(dP({}, 'a', { get: function () { return dP(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (it, key, D) { var protoDesc = gOPD(ObjectProto, key); if (protoDesc) delete ObjectProto[key]; dP(it, key, D); if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); } : dP; var wrap = function (tag) { var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D) { if (it === ObjectProto) $defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if (has(AllSymbols, key)) { if (!D.enumerable) { if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; D = _create(D, { enumerable: createDesc(0, false) }); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P) { anObject(it); var keys = enumKeys(P = toIObject(P)); var i = 0; var l = keys.length; var key; while (l > i) $defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P) { return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key) { var E = isEnum.call(this, key = toPrimitive(key, true)); if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { it = toIObject(it); key = toPrimitive(key, true); if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; var D = gOPD(it, key); if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it) { var names = gOPN(toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { var IS_OP = it === ObjectProto; var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if (!USE_NATIVE) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function (value) { if (this === ObjectProto) $set.call(OPSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; __webpack_require__("2m2c").f = gOPNExt.f = $getOwnPropertyNames; __webpack_require__("bSeU").f = $propertyIsEnumerable; $GOPS.f = $getOwnPropertySymbols; if (DESCRIPTORS && !__webpack_require__("c8Kh")) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function (name) { return wrap(wks(name)); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); for (var es6Symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function (key) { return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { getOwnPropertySymbols: function getOwnPropertySymbols(it) { return $GOPS.f(toObject(it)); } }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it) { var args = [it]; var i = 1; var replacer, $replacer; while (arguments.length > i) args.push(arguments[i++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__("aLzV")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); /***/ }), /***/ "02w1": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.removeResizeListener = exports.addResizeListener = undefined; var _resizeObserverPolyfill = __webpack_require__("z+gd"); var _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill); var _throttleDebounce = __webpack_require__("HzcN"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var isServer = typeof window === 'undefined'; /* istanbul ignore next */ var resizeHandler = function resizeHandler(entries) { for (var _iterator = entries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var entry = _ref; var listeners = entry.target.__resizeListeners__ || []; if (listeners.length) { listeners.forEach(function (fn) { fn(); }); } } }; /* istanbul ignore next */ var addResizeListener = exports.addResizeListener = function addResizeListener(element, fn) { if (isServer) return; if (!element.__resizeListeners__) { element.__resizeListeners__ = []; element.__ro__ = new _resizeObserverPolyfill2.default((0, _throttleDebounce.debounce)(16, resizeHandler)); element.__ro__.observe(element); } element.__resizeListeners__.push(fn); }; /* istanbul ignore next */ var removeResizeListener = exports.removeResizeListener = function removeResizeListener(element, fn) { if (!element || !element.__resizeListeners__) return; element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { element.__ro__.disconnect(); } }; /***/ }), /***/ "04uI": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` var defineWellKnownSymbol = __webpack_require__("8lki"); // `Symbol.metadata` well-known symbol // https://github.com/tc39/proposal-decorators defineWellKnownSymbol('metadata'); /***/ }), /***/ "07De": /***/ (function(module, exports, __webpack_require__) { "use strict"; // 25.4.1.5 NewPromiseCapability(C) var aFunction = __webpack_require__("B63G"); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /***/ "0Amz": /***/ (function(module, exports, __webpack_require__) { "use strict"; var ArrayBufferViewCore = __webpack_require__("fduV"); var $includes = __webpack_require__("A2uy").includes; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.includes` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) { return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); /***/ }), /***/ "0BNI": /***/ (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__("/gxq"); var graphic = __webpack_require__("0sHC"); var Model = __webpack_require__("Pdtn"); var AxisView = __webpack_require__("43ae"); var AxisBuilder = __webpack_require__("vjPX"); /* * 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 elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea']; 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] }; } 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(); } } var _default = 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 minorTickAngles = angleAxis.getMinorTicksCoords(); var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) { var labelItem = zrUtil.clone(labelItem); labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue); return labelItem; }); fixAngleOverlap(labels); fixAngleOverlap(ticksAngles); zrUtil.each(elementList, function (name) { if (angleAxisModel.get(name + '.show') && (!angleAxis.scale.isBlank() || name === 'axisLine')) { this['_' + name](angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels); } }, this); }, /** * @private */ _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 graphic.Circle({ shape: { cx: polar.cx, cy: polar.cy, r: radiusExtent[rId] }, style: lineStyleModel.getLineStyle(), z2: 1, silent: true }); } else { shape = new graphic.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); }, /** * @private */ _axisTick: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { var tickModel = angleAxisModel.getModel('axisTick'); var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length'); var radius = radiusExtent[getRadiusIdx(polar)]; var lines = zrUtil.map(ticksAngles, function (tickAngleItem) { return new graphic.Line({ shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) }); }); this.group.add(graphic.mergePath(lines, { style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), { stroke: angleAxisModel.get('axisLine.lineStyle.color') }) })); }, /** * @private */ _minorTick: function (angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) { if (!minorTickAngles.length) { return; } 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 graphic.Line({ shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord) })); } } this.group.add(graphic.mergePath(lines, { style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), { stroke: angleAxisModel.get('axisLine.lineStyle.color') })) })); }, /** * @private */ _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 zrUtil.each(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 graphic.Text({ silent: AxisBuilder.isLabelSilent(angleAxisModel) }); this.group.add(textEl); graphic.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; } }, this); }, /** * @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]; var splitLines = []; for (var i = 0; i < ticksAngles.length; i++) { var colorIndex = lineCount++ % lineColors.length; splitLines[colorIndex] = splitLines[colorIndex] || []; splitLines[colorIndex].push(new graphic.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(graphic.mergePath(splitLines[i], { style: zrUtil.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 graphic.Line({ shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord) })); } } this.group.add(graphic.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 graphic.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(graphic.mergePath(splitAreas[i], { style: zrUtil.defaults({ fill: areaColors[i % areaColors.length] }, areaStyleModel.getAreaStyle()), silent: true })); } } }); module.exports = _default; /***/ }), /***/ "0BOU": /***/ (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__("/gxq"); var layout = __webpack_require__("1Xuh"); var numberUtil = __webpack_require__("wWR3"); var CoordinateSystem = __webpack_require__("rctg"); /* * 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. */ // (24*60*60*1000) var PROXIMATE_ONE_DAY = 86400000; /** * Calendar * * @constructor * * @param {Object} calendarModel calendarModel * @param {Object} ecModel ecModel * @param {Object} api api */ function Calendar(calendarModel, ecModel, api) { this._model = calendarModel; } Calendar.prototype = { constructor: Calendar, type: 'calendar', dimensions: ['time', 'value'], // Required in createListFromData getDimensionsInfo: function () { return [{ name: 'time', type: 'time' }, 'value']; }, getRangeInfo: function () { return this._rangeInfo; }, getModel: function () { return this._model; }, getRect: function () { return this._rect; }, getCellWidth: function () { return this._sw; }, getCellHeight: function () { return this._sh; }, getOrient: function () { return this._orient; }, /** * getFirstDayOfWeek * * @example * 0 : start at Sunday * 1 : start at Monday * * @return {number} */ getFirstDayOfWeek: function () { return this._firstDayOfWeek; }, /** * 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) { date = numberUtil.parseDate(date); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? '0' + m : m; var d = date.getDate(); d = d < 10 ? '0' + d : d; var day = date.getDay(); day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); return { y: y, m: m, d: d, day: day, time: date.getTime(), formatedDate: y + '-' + m + '-' + d, date: date }; }, getNextNDay: function (date, n) { n = n || 0; if (n === 0) { return this.getDateInfo(date); } 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]; zrUtil.each([0, 1], function (idx) { if (cellSizeSpecified(cellSize, idx)) { layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; } }); var whGlobal = { width: api.getWidth(), height: api.getHeight() }; var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal); zrUtil.each([0, 1], function (idx) { if (!cellSizeSpecified(cellSize, idx)) { cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; } }); function cellSizeSpecified(cellSize, idx) { return cellSize[idx] != null && cellSize[idx] !== 'auto'; } 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 */ dataToPoint: function (data, clamp) { zrUtil.isArray(data) && (data = data[0]); clamp == null && (clamp = true); var dayInfo = this.getDateInfo(data); var range = this._rangeInfo; var date = dayInfo.formatedDate; // 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]; } 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]; } return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2]; }, /** * Convert a (x, y) point to time data * * @override * @param {string} point point * @return {string} data */ pointToData: function (point) { var date = this.pointToDate(point); return date && date.time; }, /** * 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); 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 }, center: point, tl: [point[0] - this._sw / 2, point[1] - this._sh / 2], tr: [point[0] + this._sw / 2, point[1] - this._sh / 2], br: [point[0] + this._sw / 2, point[1] + this._sh / 2], bl: [point[0] - this._sw / 2, point[1] + this._sh / 2] }; }, /** * 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; if (this._orient === 'vertical') { return this._getDateByWeeksAndDay(nthY, nthX - 1, range); } return this._getDateByWeeksAndDay(nthX, nthY - 1, range); }, /** * @inheritDoc */ convertToPixel: zrUtil.curry(doConvert, 'dataToPoint'), /** * @inheritDoc */ convertFromPixel: zrUtil.curry(doConvert, 'pointToData'), /** * initRange * * @private * @return {Array} [start, end] */ _initRangeOption: function () { var range = this._model.get('range'); var rg = range; if (zrUtil.isArray(rg) && rg.length === 1) { rg = rg[0]; } if (/^\d{4}$/.test(rg)) { range = [rg + '-01-01', rg + '-12-31']; } if (/^\d{4}[\/|-]\d{1,2}$/.test(rg)) { var start = this.getDateInfo(rg); var firstDay = start.date; firstDay.setMonth(firstDay.getMonth() + 1); var end = this.getNextNDay(firstDay, -1); range = [start.formatedDate, end.formatedDate]; } if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rg)) { range = [rg, rg]; } var tmp = this._getRangeInfo(range); if (tmp.start.time > tmp.end.time) { range.reverse(); } 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 */ _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(); } var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430): // Set the system timezone as "UK", set the range to `['2016-07-01', '2016-12-31']` // 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); } } 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 }; }, /** * 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} */ _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); } }; Calendar.dimensions = Calendar.prototype.dimensions; Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; Calendar.create = function (ecModel, api) { var calendarList = []; ecModel.eachComponent('calendar', function (calendarModel) { var calendar = new Calendar(calendarModel, ecModel, api); calendarList.push(calendar); calendarModel.coordinateSystem = calendar; }); ecModel.eachSeries(function (calendarSeries) { if (calendarSeries.get('coordinateSystem') === 'calendar') { // Inject coordinate system calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; } }); return calendarList; }; function doConvert(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; } CoordinateSystem.register('calendar', Calendar); var _default = Calendar; module.exports = _default; /***/ }), /***/ "0Fe3": /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__("celx"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); var createIteratorProxy = __webpack_require__("97So"); var callWithSafeIterationClosing = __webpack_require__("f1+4"); var IteratorProxy = createIteratorProxy(function () { var iterator = this.iterator; var result = anObject(call(this.next, iterator)); var done = this.done = !!result.done; if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true); }); // `Iterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers module.exports = function map(mapper) { anObject(this); aCallable(mapper); return new IteratorProxy(getIteratorDirect(this), { mapper: mapper }); }; /***/ }), /***/ "0HNz": /***/ (function(module, exports, __webpack_require__) { "use strict"; // TODO: Remove from `core-js@4` var ArrayBufferViewCore = __webpack_require__("fduV"); var $filterReject = __webpack_require__("TRbm").filterReject; var fromSpeciesAndList = __webpack_require__("Q3nH"); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering exportTypedArrayMethod('filterOut', function filterOut(callbackfn /* , thisArg */) { var list = $filterReject(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList(this, list); }, true); /***/ }), /***/ "0K9+": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove this module from `core-js@4` since it's replaced to module below __webpack_require__("s+Lh"); /***/ }), /***/ "0KjF": /***/ (function(module, exports, __webpack_require__) { var userAgent = __webpack_require__("KdgD"); module.exports = /web0s(?!.*chrome)/i.test(userAgent); /***/ }), /***/ "0LGO": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var hiddenKeys = __webpack_require__("Eb96"); var isObject = __webpack_require__("HAas"); var hasOwn = __webpack_require__("M4w/"); var defineProperty = __webpack_require__("1rEs").f; var getOwnPropertyNamesModule = __webpack_require__("gLsf"); var getOwnPropertyNamesExternalModule = __webpack_require__("hEnP"); var isExtensible = __webpack_require__("HqJP"); var uid = __webpack_require__("17Rs"); var FREEZING = __webpack_require__("wjiB"); var REQUIRED = false; var METADATA = uid('meta'); var id = 0; var setMetadata = function (it) { defineProperty(it, METADATA, { value: { objectID: 'O' + id++, // object ID weakData: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return a primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMetadata(it); // return object ID } return it[METADATA].objectID; }; var getWeakData = function (it, create) { if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMetadata(it); // return the store of weak collections IDs } return it[METADATA].weakData; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); return it; }; var enable = function () { meta.enable = function () { /* empty */ }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = uncurryThis([].splice); var test = {}; test[METADATA] = 1; // prevent exposing of metadata key if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { var result = getOwnPropertyNames(it); for (var i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA) { splice(result, i, 1); break; } } return result; }; $({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }); } }; var meta = module.exports = { enable: enable, fastKey: fastKey, getWeakData: getWeakData, onFreeze: onFreeze }; hiddenKeys[METADATA] = true; /***/ }), /***/ "0Lvz": /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__("W6Rd"); var defined = __webpack_require__("+MZ2"); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }), /***/ "0MCs": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` var $ = __webpack_require__("i9tX"); var ReflectMetadataModule = __webpack_require__("AmrS"); var anObject = __webpack_require__("5+O3"); var ordinaryHasOwnMetadata = ReflectMetadataModule.has; var toMetadataKey = ReflectMetadataModule.toKey; // `Reflect.hasOwnMetadata` method // https://github.com/rbuckton/reflect-metadata $({ target: 'Reflect', stat: true }, { hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); return ordinaryHasOwnMetadata(metadataKey, anObject(target), targetKey); } }); /***/ }), /***/ "0MNY": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var _util = __webpack_require__("/gxq"); var createHashMap = _util.createHashMap; var isString = _util.isString; var isArray = _util.isArray; var each = _util.each; var assert = _util.assert; var _parseSVG = __webpack_require__("jDhh"); var parseXML = _parseSVG.parseXML; /* * 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 storage = createHashMap(); // For minimize the code size of common echarts package, // do not put too much logic in this module. var _default = { // The format of record: see `echarts.registerMap`. // Compatible with previous `echarts.registerMap`. registerMap: function (mapName, rawGeoJson, rawSpecialAreas) { var records; if (isArray(rawGeoJson)) { records = rawGeoJson; } else if (rawGeoJson.svg) { records = [{ type: 'svg', source: rawGeoJson.svg, specialAreas: rawGeoJson.specialAreas }]; } else { // Backward compatibility. if (rawGeoJson.geoJson && !rawGeoJson.features) { rawSpecialAreas = rawGeoJson.specialAreas; rawGeoJson = rawGeoJson.geoJson; } records = [{ type: 'geoJSON', source: rawGeoJson, specialAreas: rawSpecialAreas }]; } each(records, function (record) { var type = record.type; type === 'geoJson' && (type = record.type = 'geoJSON'); var parse = parsers[type]; parse(record); }); return storage.set(mapName, records); }, retrieveMap: function (mapName) { return storage.get(mapName); } }; var parsers = { geoJSON: function (record) { var source = record.source; record.geoJSON = !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')(); }, // Only perform parse to XML object here, which might be time // consiming for large SVG. // Although convert XML to zrender element is also time consiming, // if we do it here, the clone of zrender elements has to be // required. So we do it once for each geo instance, util real // performance issues call for optimizing it. svg: function (record) { record.svgXML = parseXML(record.source); } }; module.exports = _default; /***/ }), /***/ "0Ns7": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var shared = __webpack_require__("izte"); var getBuiltIn = __webpack_require__("aqbq"); var uncurryThis = __webpack_require__("u4Az"); var isSymbol = __webpack_require__("3dPm"); var wellKnownSymbol = __webpack_require__("jAiL"); var Symbol = getBuiltIn('Symbol'); var $isWellKnown = Symbol.isWellKnown; var getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames'); var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf); var WellKnownSymbolsStore = shared('wks'); for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) { // some old engines throws on access to some keys like `arguments` or `caller` try { var symbolKey = symbolKeys[i]; if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey); } catch (error) { /* empty */ } } // `Symbol.isWellKnown` method // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknown // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected $({ target: 'Symbol', stat: true, forced: true }, { isWellKnown: function isWellKnown(value) { if ($isWellKnown && $isWellKnown(value)) return true; try { var symbol = thisSymbolValue(value); for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) { if (WellKnownSymbolsStore[keys[j]] == symbol) return true; } } catch (error) { /* empty */ } return false; } }); /***/ }), /***/ "0O1a": /***/ (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 echarts = __webpack_require__("Icdr"); var preprocessor = __webpack_require__("DZTl"); __webpack_require__("Osoq"); __webpack_require__("w2H/"); __webpack_require__("mlpt"); __webpack_require__("XiVP"); __webpack_require__("H4Wn"); /* * 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 */ echarts.registerPreprocessor(preprocessor); /***/ }), /***/ "0W8K": /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of __webpack_require__("YQk9")('WeakMap'); /***/ }), /***/ "0aoy": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove this module from `core-js@4` since it's replaced to module below __webpack_require__("2UJr"); /***/ }), /***/ "0dhg": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__("zOPQ"); /***/ }), /***/ "0fQF": /***/ (function(module, exports) { // Myers' Diff Algorithm // Modified from https://github.com/kpdecker/jsdiff/blob/master/src/diff/base.js function Diff() {} Diff.prototype = { diff: function (oldArr, newArr, equals) { if (!equals) { equals = function (a, b) { return a === b; }; } this.equals = equals; var self = this; oldArr = oldArr.slice(); newArr = newArr.slice(); // Allow subclasses to massage the input prior to running var newLen = newArr.length; var oldLen = oldArr.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newArr, oldArr, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { var indices = []; for (var i = 0; i < newArr.length; i++) { indices.push(i); } // Identity per the equality and tokenizer return [{ indices: indices, count: newArr.length }]; } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath; var addPath = bestPath[diagonalPath - 1]; var removePath = bestPath[diagonalPath + 1]; var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen; var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) { return buildValues(self, basePath.components, newArr, oldArr); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } }, pushComponent: function (components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; } else { components.push({ count: 1, added: added, removed: removed }); } }, extractCommon: function (basePath, newArr, oldArr, diagonalPath) { var newLen = newArr.length; var oldLen = oldArr.length; var newPos = basePath.newPos; var oldPos = newPos - diagonalPath; var commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newArr[newPos + 1], oldArr[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, tokenize: function (value) { return value.slice(); }, join: function (value) { return value.slice(); } }; function buildValues(diff, components, newArr, oldArr) { var componentPos = 0; var componentLen = components.length; var newPos = 0; var oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { var indices = []; for (var i = newPos; i < newPos + component.count; i++) { indices.push(i); } component.indices = indices; newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { var indices = []; for (var i = oldPos; i < oldPos + component.count; i++) { indices.push(i); } component.indices = indices; oldPos += component.count; } } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } var arrayDiff = new Diff(); function _default(oldArr, newArr, callback) { return arrayDiff.diff(oldArr, newArr, callback); } module.exports = _default; /***/ }), /***/ "0jKn": /***/ (function(module, exports, __webpack_require__) { var logError = __webpack_require__("eZxa"); var vmlCore = __webpack_require__("cI6i"); var _util = __webpack_require__("/gxq"); var each = _util.each; /** * VML Painter. * * @module zrender/vml/Painter */ function parseInt10(val) { return parseInt(val, 10); } /** * @alias module:zrender/vml/Painter */ function VMLPainter(root, storage) { vmlCore.initVML(); this.root = root; this.storage = storage; var vmlViewport = document.createElement('div'); var vmlRoot = document.createElement('div'); vmlViewport.style.cssText = 'display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;'; vmlRoot.style.cssText = 'position:absolute;left:0;top:0;'; root.appendChild(vmlViewport); this._vmlRoot = vmlRoot; this._vmlViewport = vmlViewport; this.resize(); // Modify storage var oldDelFromStorage = storage.delFromStorage; var oldAddToStorage = storage.addToStorage; storage.delFromStorage = function (el) { oldDelFromStorage.call(storage, el); if (el) { el.onRemove && el.onRemove(vmlRoot); } }; storage.addToStorage = function (el) { // Displayable already has a vml node el.onAdd && el.onAdd(vmlRoot); oldAddToStorage.call(storage, el); }; this._firstPaint = true; } VMLPainter.prototype = { constructor: VMLPainter, getType: function () { return 'vml'; }, /** * @return {HTMLDivElement} */ getViewportRoot: function () { return this._vmlViewport; }, getViewportRootOffset: function () { var viewportRoot = this.getViewportRoot(); if (viewportRoot) { return { offsetLeft: viewportRoot.offsetLeft || 0, offsetTop: viewportRoot.offsetTop || 0 }; } }, /** * 刷新 */ refresh: function () { var list = this.storage.getDisplayList(true, true); this._paintList(list); }, _paintList: function (list) { var vmlRoot = this._vmlRoot; for (var i = 0; i < list.length; i++) { var el = list[i]; if (el.invisible || el.ignore) { if (!el.__alreadyNotVisible) { el.onRemove(vmlRoot); } // Set as already invisible el.__alreadyNotVisible = true; } else { if (el.__alreadyNotVisible) { el.onAdd(vmlRoot); } el.__alreadyNotVisible = false; if (el.__dirty) { el.beforeBrush && el.beforeBrush(); (el.brushVML || el.brush).call(el, vmlRoot); el.afterBrush && el.afterBrush(); } } el.__dirty = false; } if (this._firstPaint) { // Detached from document at first time // to avoid page refreshing too many times // FIXME 如果每次都先 removeChild 可能会导致一些填充和描边的效果改变 this._vmlViewport.appendChild(vmlRoot); this._firstPaint = false; } }, resize: function (width, height) { var width = width == null ? this._getWidth() : width; var height = height == null ? this._getHeight() : height; if (this._width !== width || this._height !== height) { this._width = width; this._height = height; var vmlViewportStyle = this._vmlViewport.style; vmlViewportStyle.width = width + 'px'; vmlViewportStyle.height = height + 'px'; } }, dispose: function () { this.root.innerHTML = ''; this._vmlRoot = this._vmlViewport = this.storage = null; }, getWidth: function () { return this._width; }, getHeight: function () { return this._height; }, clear: function () { if (this._vmlViewport) { this.root.removeChild(this._vmlViewport); } }, _getWidth: function () { var root = this.root; var stl = root.currentStyle; return (root.clientWidth || parseInt10(stl.width)) - parseInt10(stl.paddingLeft) - parseInt10(stl.paddingRight) | 0; }, _getHeight: function () { var root = this.root; var stl = root.currentStyle; return (root.clientHeight || parseInt10(stl.height)) - parseInt10(stl.paddingTop) - parseInt10(stl.paddingBottom) | 0; } }; // Not supported methods function createMethodNotSupport(method) { return function () { logError('In IE8.0 VML mode painter not support method "' + method + '"'); }; } // Unsupported methods each(['getLayer', 'insertLayer', 'eachLayer', 'eachBuiltinLayer', 'eachOtherLayer', 'getLayers', 'modLayer', 'delLayer', 'clearLayer', 'toDataURL', 'pathToImage'], function (name) { VMLPainter.prototype[name] = createMethodNotSupport(name); }); var _default = VMLPainter; module.exports = _default; /***/ }), /***/ "0kY3": /***/ (function(module, exports, __webpack_require__) { module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 87); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 10: /***/ (function(module, exports) { module.exports = __webpack_require__("HJMx"); /***/ }), /***/ 2: /***/ (function(module, exports) { module.exports = __webpack_require__("2kvA"); /***/ }), /***/ 22: /***/ (function(module, exports) { module.exports = __webpack_require__("1oZe"); /***/ }), /***/ 3: /***/ (function(module, exports) { module.exports = __webpack_require__("ylDJ"); /***/ }), /***/ 30: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1__); /* harmony default export */ __webpack_exports__["a"] = ({ bind: function bind(el, binding, vnode) { var interval = null; var startTime = void 0; var maxIntervals = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1__["isMac"])() ? 100 : 200; var handler = function handler() { return vnode.context[binding.expression].apply(); }; var clear = function clear() { if (Date.now() - startTime < maxIntervals) { handler(); } clearInterval(interval); interval = null; }; Object(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["on"])(el, 'mousedown', function (e) { if (e.button !== 0) return; startTime = Date.now(); Object(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["once"])(document, 'mouseup', clear); clearInterval(interval); interval = setInterval(handler, maxIntervals); }); } }); /***/ }), /***/ 87: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66& var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { class: [ "el-input-number", _vm.inputNumberSize ? "el-input-number--" + _vm.inputNumberSize : "", { "is-disabled": _vm.inputNumberDisabled }, { "is-without-controls": !_vm.controls }, { "is-controls-right": _vm.controlsAtRight } ], on: { dragstart: function($event) { $event.preventDefault() } } }, [ _vm.controls ? _c( "span", { directives: [ { name: "repeat-click", rawName: "v-repeat-click", value: _vm.decrease, expression: "decrease" } ], staticClass: "el-input-number__decrease", class: { "is-disabled": _vm.minDisabled }, attrs: { role: "button" }, on: { keydown: function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter") ) { return null } return _vm.decrease($event) } } }, [ _c("i", { class: "el-icon-" + (_vm.controlsAtRight ? "arrow-down" : "minus") }) ] ) : _vm._e(), _vm.controls ? _c( "span", { directives: [ { name: "repeat-click", rawName: "v-repeat-click", value: _vm.increase, expression: "increase" } ], staticClass: "el-input-number__increase", class: { "is-disabled": _vm.maxDisabled }, attrs: { role: "button" }, on: { keydown: function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter") ) { return null } return _vm.increase($event) } } }, [ _c("i", { class: "el-icon-" + (_vm.controlsAtRight ? "arrow-up" : "plus") }) ] ) : _vm._e(), _c("el-input", { ref: "input", attrs: { value: _vm.displayValue, placeholder: _vm.placeholder, disabled: _vm.inputNumberDisabled, size: _vm.inputNumberSize, max: _vm.max, min: _vm.min, name: _vm.name, label: _vm.label }, on: { blur: _vm.handleBlur, focus: _vm.handleFocus, input: _vm.handleInput, change: _vm.handleInputChange }, nativeOn: { keydown: [ function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"]) ) { return null } $event.preventDefault() return _vm.increase($event) }, function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "down", 40, $event.key, [ "Down", "ArrowDown" ]) ) { return null } $event.preventDefault() return _vm.decrease($event) } ] } }) ], 1 ) } var staticRenderFns = [] render._withStripped = true // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66& // EXTERNAL MODULE: external "element-ui/lib/input" var input_ = __webpack_require__(10); var input_default = /*#__PURE__*/__webpack_require__.n(input_); // EXTERNAL MODULE: external "element-ui/lib/mixins/focus" var focus_ = __webpack_require__(22); var focus_default = /*#__PURE__*/__webpack_require__.n(focus_); // EXTERNAL MODULE: ./src/directives/repeat-click.js var repeat_click = __webpack_require__(30); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var input_numbervue_type_script_lang_js_ = ({ name: 'ElInputNumber', mixins: [focus_default()('input')], inject: { elForm: { default: '' }, elFormItem: { default: '' } }, directives: { repeatClick: repeat_click["a" /* default */] }, components: { ElInput: input_default.a }, props: { step: { type: Number, default: 1 }, stepStrictly: { type: Boolean, default: false }, max: { type: Number, default: Infinity }, min: { type: Number, default: -Infinity }, value: {}, disabled: Boolean, size: String, controls: { type: Boolean, default: true }, controlsPosition: { type: String, default: '' }, name: String, label: String, placeholder: String, precision: { type: Number, validator: function validator(val) { return val >= 0 && val === parseInt(val, 10); } } }, data: function data() { return { currentValue: 0, userInput: null }; }, watch: { value: { immediate: true, handler: function handler(value) { var newVal = value === undefined ? value : Number(value); if (newVal !== undefined) { if (isNaN(newVal)) { return; } if (this.stepStrictly) { var stepPrecision = this.getPrecision(this.step); var precisionFactor = Math.pow(10, stepPrecision); newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor; } if (this.precision !== undefined) { newVal = this.toPrecision(newVal, this.precision); } } if (newVal >= this.max) newVal = this.max; if (newVal <= this.min) newVal = this.min; this.currentValue = newVal; this.userInput = null; this.$emit('input', newVal); } } }, computed: { minDisabled: function minDisabled() { return this._decrease(this.value, this.step) < this.min; }, maxDisabled: function maxDisabled() { return this._increase(this.value, this.step) > this.max; }, numPrecision: function numPrecision() { var value = this.value, step = this.step, getPrecision = this.getPrecision, precision = this.precision; var stepPrecision = getPrecision(step); if (precision !== undefined) { if (stepPrecision > precision) { console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step'); } return precision; } else { return Math.max(getPrecision(value), stepPrecision); } }, controlsAtRight: function controlsAtRight() { return this.controls && this.controlsPosition === 'right'; }, _elFormItemSize: function _elFormItemSize() { return (this.elFormItem || {}).elFormItemSize; }, inputNumberSize: function inputNumberSize() { return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size; }, inputNumberDisabled: function inputNumberDisabled() { return this.disabled || !!(this.elForm || {}).disabled; }, displayValue: function displayValue() { if (this.userInput !== null) { return this.userInput; } var currentValue = this.currentValue; if (typeof currentValue === 'number') { if (this.stepStrictly) { var stepPrecision = this.getPrecision(this.step); var precisionFactor = Math.pow(10, stepPrecision); currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor; } if (this.precision !== undefined) { currentValue = currentValue.toFixed(this.precision); } } return currentValue; } }, methods: { toPrecision: function toPrecision(num, precision) { if (precision === undefined) precision = this.numPrecision; return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)); }, getPrecision: function getPrecision(value) { if (value === undefined) return 0; var valueString = value.toString(); var dotPosition = valueString.indexOf('.'); var precision = 0; if (dotPosition !== -1) { precision = valueString.length - dotPosition - 1; } return precision; }, _increase: function _increase(val, step) { if (typeof val !== 'number' && val !== undefined) return this.currentValue; var precisionFactor = Math.pow(10, this.numPrecision); // Solve the accuracy problem of JS decimal calculation by converting the value to integer. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor); }, _decrease: function _decrease(val, step) { if (typeof val !== 'number' && val !== undefined) return this.currentValue; var precisionFactor = Math.pow(10, this.numPrecision); return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor); }, increase: function increase() { if (this.inputNumberDisabled || this.maxDisabled) return; var value = this.value || 0; var newVal = this._increase(value, this.step); this.setCurrentValue(newVal); }, decrease: function decrease() { if (this.inputNumberDisabled || this.minDisabled) return; var value = this.value || 0; var newVal = this._decrease(value, this.step); this.setCurrentValue(newVal); }, handleBlur: function handleBlur(event) { this.$emit('blur', event); }, handleFocus: function handleFocus(event) { this.$emit('focus', event); }, setCurrentValue: function setCurrentValue(newVal) { var oldVal = this.currentValue; if (typeof newVal === 'number' && this.precision !== undefined) { newVal = this.toPrecision(newVal, this.precision); } if (newVal >= this.max) newVal = this.max; if (newVal <= this.min) newVal = this.min; if (oldVal === newVal) return; this.userInput = null; this.$emit('input', newVal); this.$emit('change', newVal, oldVal); this.currentValue = newVal; }, handleInput: function handleInput(value) { this.userInput = value; }, handleInputChange: function handleInputChange(value) { var newVal = value === '' ? undefined : Number(value); if (!isNaN(newVal) || value === '') { this.setCurrentValue(newVal); } this.userInput = null; }, select: function select() { this.$refs.input.select(); } }, mounted: function mounted() { var innerInput = this.$refs.input.$refs.input; innerInput.setAttribute('role', 'spinbutton'); innerInput.setAttribute('aria-valuemax', this.max); innerInput.setAttribute('aria-valuemin', this.min); innerInput.setAttribute('aria-valuenow', this.currentValue); innerInput.setAttribute('aria-disabled', this.inputNumberDisabled); }, updated: function updated() { if (!this.$refs || !this.$refs.input) return; var innerInput = this.$refs.input.$refs.input; innerInput.setAttribute('aria-valuenow', this.currentValue); } }); // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=script&lang=js& /* harmony default export */ var src_input_numbervue_type_script_lang_js_ = (input_numbervue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(0); // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_input_numbervue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/input-number/src/input-number.vue" /* harmony default export */ var input_number = (component.exports); // CONCATENATED MODULE: ./packages/input-number/index.js /* istanbul ignore next */ input_number.install = function (Vue) { Vue.component(input_number.name, input_number); }; /* harmony default export */ var packages_input_number = __webpack_exports__["default"] = (input_number); /***/ }) /******/ }); /***/ }), /***/ "0nGg": /***/ (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 echarts = __webpack_require__("Icdr"); var zrUtil = __webpack_require__("/gxq"); var SymbolDraw = __webpack_require__("dZZy"); var LineDraw = __webpack_require__("6n1D"); var RoamController = __webpack_require__("5Mek"); var roamHelper = __webpack_require__("YpIy"); var _cursorHelper = __webpack_require__("NKek"); var onIrrelevantElement = _cursorHelper.onIrrelevantElement; var graphic = __webpack_require__("0sHC"); var adjustEdge = __webpack_require__("Goha"); var _graphHelper = __webpack_require__("hD/x"); var getNodeGlobalScale = _graphHelper.getNodeGlobalScale; /* * 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 FOCUS_ADJACENCY = '__focusNodeAdjacency'; var UNFOCUS_ADJACENCY = '__unfocusNodeAdjacency'; var nodeOpacityPath = ['itemStyle', 'opacity']; var lineOpacityPath = ['lineStyle', 'opacity']; function getItemOpacity(item, 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; } el.downplay && el.downplay(); el.traverse(function (child) { if (!child.isGroup) { var opct = child.lineLabelOriginalOpacity; if (opct == null || opacityRatio != null) { opct = opacity; } child.setStyle('opacity', opct); } }); } function fadeInItem(item, opacityPath) { var opacity = getItemOpacity(item, opacityPath); var el = item.getGraphicEl(); // 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) { !child.isGroup && child.setStyle('opacity', opacity); }); el.highlight && el.highlight(); } var _default = echarts.extendChartView({ type: 'graph', init: function (ecModel, api) { var symbolDraw = new SymbolDraw(); var lineDraw = new LineDraw(); var group = this.group; this._controller = new RoamController(api.getZr()); this._controllerHost = { target: group }; group.add(symbolDraw.group); group.add(lineDraw.group); this._symbolDraw = symbolDraw; this._lineDraw = lineDraw; this._firstRender = true; }, render: function (seriesModel, ecModel, api) { var graphView = this; var coordSys = seriesModel.coordinateSystem; this._model = seriesModel; var symbolDraw = this._symbolDraw; var lineDraw = this._lineDraw; var group = this.group; if (coordSys.type === 'view') { var groupNewProp = { position: coordSys.position, scale: coordSys.scale }; if (this._firstRender) { group.attr(groupNewProp); } else { graphic.updateProps(group, groupNewProp, seriesModel); } } // Fix edge contact point with node adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); var data = seriesModel.getData(); symbolDraw.updateData(data); var edgeData = seriesModel.getEdgeData(); lineDraw.updateData(edgeData); this._updateNodeAndLinkScale(); this._updateController(seriesModel, ecModel, api); clearTimeout(this._layoutTimeout); var forceLayout = seriesModel.forceLayout; var layoutAnimation = seriesModel.get('force.layoutAnimation'); if (forceLayout) { this._startForceLayoutIteration(forceLayout, layoutAnimation); } data.eachItemGraphicEl(function (el, idx) { var itemModel = data.getItemModel(idx); // Update draggable el.off('drag').off('dragend'); var draggable = itemModel.get('draggable'); if (draggable) { el.on('drag', function () { if (forceLayout) { forceLayout.warmUp(); !this._layouting && this._startForceLayoutIteration(forceLayout, layoutAnimation); forceLayout.setFixed(idx); // Write position back to layout data.setItemLayout(idx, el.position); } }, this).on('dragend', function () { if (forceLayout) { forceLayout.setUnfixed(idx); } }, this); } el.setDraggable(draggable && forceLayout); 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[FOCUS_ADJACENCY] = function () { graphView._clearTimer(); api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, dataIndex: el.dataIndex }); }); el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () { graphView._dispatchUnfocus(api); }); } }, this); data.graph.eachEdge(function (edge) { var el = edge.getGraphicEl(); 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[FOCUS_ADJACENCY] = function () { graphView._clearTimer(); api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, edgeDataIndex: edge.dataIndex }); }); el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () { graphView._dispatchUnfocus(api); }); } }); var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get('circular.rotateLabel'); 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); var rad = Math.atan2(pos[1] - cy, pos[0] - cx); if (rad < 0) { rad = Math.PI * 2 + rad; } var isLeft = pos[0] < cx; if (isLeft) { rad = rad - Math.PI; } var textPosition = isLeft ? 'left' : 'right'; graphic.modifyLabelStyle(symbolPath, { textRotation: -rad, textPosition: textPosition, textOrigin: 'center' }, { textPosition: textPosition }); } else { graphic.modifyLabelStyle(symbolPath, { textRotation: labelRotate *= Math.PI / 180 }); } }); this._firstRender = false; }, 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 = seriesModel.getData(); var graph = data.graph; var dataIndex = payload.dataIndex; var edgeDataIndex = payload.edgeDataIndex; var node = graph.getNodeByIndex(dataIndex); var edge = graph.getEdgeByIndex(edgeDataIndex); if (!node && !edge) { return; } graph.eachNode(function (node) { fadeOutItem(node, nodeOpacityPath, 0.1); }); graph.eachEdge(function (edge) { fadeOutItem(edge, lineOpacityPath, 0.1); }); if (node) { fadeInItem(node, nodeOpacityPath); zrUtil.each(node.edges, function (adjacentEdge) { if (adjacentEdge.dataIndex < 0) { return; } fadeInItem(adjacentEdge, lineOpacityPath); fadeInItem(adjacentEdge.node1, nodeOpacityPath); fadeInItem(adjacentEdge.node2, nodeOpacityPath); }); } if (edge) { fadeInItem(edge, lineOpacityPath); fadeInItem(edge.node1, nodeOpacityPath); fadeInItem(edge.node2, nodeOpacityPath); } }, unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) { var graph = seriesModel.getData().graph; graph.eachNode(function (node) { fadeOutItem(node, nodeOpacityPath); }); graph.eachEdge(function (edge) { fadeOutItem(edge, lineOpacityPath); }); }, _startForceLayoutIteration: function (forceLayout, layoutAnimation) { var self = this; (function step() { forceLayout.step(function (stopped) { self.updateLayout(self._model); (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step()); }); })(); }, _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); }); if (seriesModel.coordinateSystem.type !== 'view') { controller.disable(); return; } controller.enable(seriesModel.get('roam')); controllerHost.zoomLimit = seriesModel.get('scaleLimit'); controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); controller.off('pan').off('zoom').on('pan', function (e) { roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy); api.dispatchAction({ seriesId: seriesModel.id, type: 'graphRoam', dx: e.dx, dy: e.dy }); }).on('zoom', function (e) { roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); api.dispatchAction({ seriesId: seriesModel.id, type: 'graphRoam', zoom: e.scale, originX: e.originX, originY: e.originY }); this._updateNodeAndLinkScale(); adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); this._lineDraw.updateLayout(); }, this); }, _updateNodeAndLinkScale: function () { var seriesModel = this._model; var data = seriesModel.getData(); var nodeScale = getNodeGlobalScale(seriesModel); var invScale = [nodeScale, nodeScale]; data.eachItemGraphicEl(function (el, idx) { el.attr('scale', invScale); }); }, updateLayout: function (seriesModel) { adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); this._symbolDraw.updateLayout(); this._lineDraw.updateLayout(); }, remove: function (ecModel, api) { this._symbolDraw && this._symbolDraw.remove(); this._lineDraw && this._lineDraw.remove(); } }); module.exports = _default; /***/ }), /***/ "0pMY": /***/ (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__("/gxq"); var featureManager = __webpack_require__("dCQY"); var lang = __webpack_require__("FIAY"); /* * 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 brushLang = lang.toolbox.brush; function Brush(model, ecModel, api) { this.model = model; this.ecModel = ecModel; this.api = api; /** * @private * @type {string} */ this._brushType; /** * @private * @type {string} */ this._brushMode; } 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: zrUtil.clone(brushLang.title) }; var proto = Brush.prototype; // proto.updateLayout = function (featureModel, ecModel, api) { /* eslint-disable */ proto.render = /* eslint-enable */ proto.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; zrUtil.each(featureModel.get('type', true), function (type) { featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal'); }); }; proto.getIcons = function () { var model = this.model; var availableIcons = model.get('icon', true); var icons = {}; zrUtil.each(model.get('type', true), function (type) { if (availableIcons[type]) { icons[type] = availableIcons[type]; } }); return icons; }; proto.onclick = function (ecModel, api, type) { var brushType = this._brushType; var brushMode = this._brushMode; if (type === 'clear') { // Trigger parallel action firstly api.dispatchAction({ type: 'axisAreaSelect', intervals: [] }); 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 } }); } }; featureManager.register('brush', Brush); var _default = Brush; module.exports = _default; /***/ }), /***/ "0pND": /***/ (function(module, exports) { // eslint-disable-next-line es/no-math-expm1 -- safe var $expm1 = Math.expm1; var exp = Math.exp; // `Math.expm1` method implementation // https://tc39.es/ecma262/#sec-math.expm1 module.exports = (!$expm1 // Old FF bug || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 // Tor Browser bug || $expm1(-2e-17) != -2e-17 ) ? function expm1(x) { var n = +x; return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1; } : $expm1; /***/ }), /***/ "0sHC": /***/ (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__("/gxq"); var pathTool = __webpack_require__("dE09"); var colorTool = __webpack_require__("DRaW"); var matrix = __webpack_require__("dOVI"); var vector = __webpack_require__("C7PF"); var Path = __webpack_require__("GxVO"); var Transformable = __webpack_require__("/ZBO"); var ZImage = __webpack_require__("MAom"); exports.Image = ZImage; var Group = __webpack_require__("AlhT"); exports.Group = Group; var Text = __webpack_require__("/86O"); exports.Text = Text; var Circle = __webpack_require__("Of86"); exports.Circle = Circle; var Sector = __webpack_require__("sRta"); exports.Sector = Sector; var Ring = __webpack_require__("6Kqb"); exports.Ring = Ring; var Polygon = __webpack_require__("+UTs"); exports.Polygon = Polygon; var Polyline = __webpack_require__("BeCT"); exports.Polyline = Polyline; var Rect = __webpack_require__("PD67"); exports.Rect = Rect; var Line = __webpack_require__("KsMi"); exports.Line = Line; var BezierCurve = __webpack_require__("67nf"); exports.BezierCurve = BezierCurve; var Arc = __webpack_require__("46eW"); exports.Arc = Arc; var CompoundPath = __webpack_require__("me52"); exports.CompoundPath = CompoundPath; var LinearGradient = __webpack_require__("Gw4f"); exports.LinearGradient = LinearGradient; var RadialGradient = __webpack_require__("jHiU"); exports.RadialGradient = RadialGradient; var BoundingRect = __webpack_require__("8b51"); exports.BoundingRect = BoundingRect; var IncrementalDisplayable = __webpack_require__("thE4"); exports.IncrementalDisplayable = IncrementalDisplayable; var subPixelOptimizeUtil = __webpack_require__("xr8J"); /* * 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; /***/ }), /***/ "15gP": /***/ (function(module, exports, __webpack_require__) { "use strict"; var ArrayBufferViewCore = __webpack_require__("fduV"); var uncurryThis = __webpack_require__("u4Az"); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var $join = uncurryThis([].join); // `%TypedArray%.prototype.join` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join exportTypedArrayMethod('join', function join(separator) { return $join(aTypedArray(this), separator); }); /***/ }), /***/ "17/W": /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries var $export = __webpack_require__("eqAp"); var $values = __webpack_require__("kLED")(false); $export($export.S, 'Object', { values: function values(it) { return $values(it); } }); /***/ }), /***/ "17Rs": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; /***/ }), /***/ "1A4n": /***/ (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__("/gxq"); var graphic = __webpack_require__("0sHC"); var ChartView = __webpack_require__("Ylhr"); /* * 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/model/Series} seriesModel * @param {boolean} hasAnimation * @inner */ function updateDataSelected(uid, seriesModel, hasAnimation, api) { var data = seriesModel.getData(); var dataIndex = this.dataIndex; var name = data.getName(dataIndex); var selectedOffset = seriesModel.get('selectedOffset'); api.dispatchAction({ type: 'pieToggleSelect', from: uid, name: name, seriesId: seriesModel.id }); data.each(function (idx) { toggleItemSelected(data.getItemGraphicEl(idx), data.getItemLayout(idx), seriesModel.isSelected(data.getName(idx)), selectedOffset, hasAnimation); }); } /** * @param {module:zrender/graphic/Sector} el * @param {Object} layout * @param {boolean} isSelected * @param {number} selectedOffset * @param {boolean} hasAnimation * @inner */ function toggleItemSelected(el, layout, isSelected, selectedOffset, hasAnimation) { var midAngle = (layout.startAngle + layout.endAngle) / 2; var dx = Math.cos(midAngle); var dy = Math.sin(midAngle); var offset = isSelected ? selectedOffset : 0; var position = [dx * offset, dy * offset]; hasAnimation // animateTo will stop revious animation like update transition ? el.animate().when(200, { position: position }).start('bounceOut') : el.attr('position', position); } /** * Piece of pie including Sector, Label, LabelLine * @constructor * @extends {module:zrender/graphic/Group} */ function PiePiece(data, idx) { graphic.Group.call(this); var sector = new graphic.Sector({ z2: 2 }); var polyline = new graphic.Polyline(); var text = new graphic.Text(); this.add(sector); this.add(polyline); this.add(text); this.updateData(data, idx, true); } 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); var layout = data.getItemLayout(idx); var sectorShape = zrUtil.extend({}, layout); sectorShape.label = null; var animationTypeUpdate = seriesModel.getShallow('animationTypeUpdate'); if (firstCreate) { sector.setShape(sectorShape); var animationType = seriesModel.getShallow('animationType'); if (animationType === 'scale') { sector.shape.r = layout.r0; graphic.initProps(sector, { shape: { r: layout.r } }, seriesModel, idx); } // Expansion else { sector.shape.endAngle = layout.startAngle; graphic.updateProps(sector, { shape: { endAngle: layout.endAngle } }, seriesModel, idx); } } else { 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 graphic.updateProps(sector, { shape: sectorShape }, seriesModel, idx); } } // Update common style var visualColor = data.getItemVisual(idx, 'color'); sector.useStyle(zrUtil.defaults({ lineJoin: 'bevel', fill: visualColor }, itemModel.getModel('itemStyle').getItemStyle())); sector.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); var cursorStyle = itemModel.getShallow('cursor'); cursorStyle && sector.attr('cursor', cursorStyle); // Toggle selected toggleItemSelected(this, data.getItemLayout(idx), seriesModel.isSelected(data.getName(idx)), seriesModel.get('selectedOffset'), seriesModel.get('animation')); // 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'); } } else { labelLine.ignore = labelLine.normalIgnore; labelText.ignore = labelText.normalIgnore; if (hasAnimation) { sector.stopAnimation(true); sector.animateTo({ shape: { r: layout.r } }, 300, 'elasticOut'); } } } : null; graphic.setHoverStyle(this); }; piePieceProto._updateLabel = function (data, idx, withAnimation) { var labelLine = this.childAt(1); var labelText = this.childAt(2); var seriesModel = data.hostModel; var itemModel = data.getItemModel(idx); var layout = data.getItemLayout(idx); var labelLayout = layout.label; var visualColor = data.getItemVisual(idx, 'color'); 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) { graphic.updateProps(labelLine, { shape: targetLineShape }, seriesModel, idx); graphic.updateProps(labelText, { style: targetTextStyle }, seriesModel, idx); } else { labelLine.attr({ shape: targetLineShape }); labelText.attr({ style: targetTextStyle }); } labelText.attr({ rotation: labelLayout.rotation, origin: [labelLayout.x, labelLayout.y], z2: 10 }); var labelModel = itemModel.getModel('label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var labelLineModel = itemModel.getModel('labelLine'); var labelLineHoverModel = itemModel.getModel('emphasis.labelLine'); var visualColor = data.getItemVisual(idx, 'color'); graphic.setLabelStyle(labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, { labelFetcher: data.hostModel, labelDataIndex: idx, defaultText: labelLayout.text, autoColor: visualColor, useInsideStyle: !!labelLayout.inside }, { textAlign: labelLayout.textAlign, textVerticalAlign: labelLayout.verticalAlign, opacity: data.getItemVisual(idx, 'opacity') }); labelText.ignore = labelText.normalIgnore = !labelModel.get('show'); labelText.hoverIgnore = !labelHoverModel.get('show'); labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show'); labelLine.hoverIgnore = !labelLineHoverModel.get('show'); // Default use item visual color labelLine.setStyle({ stroke: visualColor, opacity: data.getItemVisual(idx, 'opacity') }); labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle()); labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle(); var smooth = labelLineModel.get('smooth'); if (smooth && smooth === true) { smooth = 0.4; } labelLine.setShape({ smooth: smooth }); }; zrUtil.inherits(PiePiece, graphic.Group); // Pie view var PieView = ChartView.extend({ type: 'pie', init: function () { var sectorGroup = new graphic.Group(); this._sectorGroup = sectorGroup; }, render: function (seriesModel, ecModel, api, payload) { if (payload && payload.from === this.uid) { return; } var data = seriesModel.getData(); var oldData = this._data; var group = this.group; var hasAnimation = ecModel.get('animation'); var isFirstRender = !oldData; var animationType = seriesModel.get('animationType'); var animationTypeUpdate = seriesModel.get('animationTypeUpdate'); var onSectorClick = zrUtil.curry(updateDataSelected, this.uid, seriesModel, hasAnimation, api); var selectedMode = seriesModel.get('selectedMode'); data.diff(oldData).add(function (idx) { var piePiece = new PiePiece(data, idx); // Default expansion animation if (isFirstRender && animationType !== 'scale') { piePiece.eachChild(function (child) { child.stopAnimation(true); }); } selectedMode && piePiece.on('click', onSectorClick); data.setItemGraphicEl(idx, piePiece); group.add(piePiece); }).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'); selectedMode && piePiece.on('click', onSectorClick); group.add(piePiece); data.setItemGraphicEl(newIdx, piePiece); }).remove(function (idx) { var piePiece = oldData.getItemGraphicEl(idx); group.remove(piePiece); }).execute(); if (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 = zrUtil.bind(group.removeClipPath, group); group.setClipPath(this._createClipPath(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; }, dispose: function () {}, _createClipPath: function (cx, cy, r, startAngle, clockwise, cb, seriesModel, isFirstRender) { var clipPath = new graphic.Sector({ shape: { cx: cx, cy: cy, r0: 0, r: r, startAngle: startAngle, endAngle: startAngle, clockwise: clockwise } }); var initOrUpdate = isFirstRender ? graphic.initProps : graphic.updateProps; initOrUpdate(clipPath, { shape: { endAngle: startAngle + (clockwise ? 1 : -1) * Math.PI * 2 } }, seriesModel, cb); return clipPath; }, /** * @implement */ containPoint: function (point, seriesModel) { var data = seriesModel.getData(); var itemLayout = data.getItemLayout(0); if (itemLayout) { var dx = point[0] - itemLayout.cx; var dy = point[1] - itemLayout.cy; var radius = Math.sqrt(dx * dx + dy * dy); return radius <= itemLayout.r && radius >= itemLayout.r0; } } }); var _default = PieView; module.exports = _default; /***/ }), /***/ "1DJE": /***/ (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__("/gxq"); /* * 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; /** * 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; } ; var _default = DataDimensionInfo; module.exports = _default; /***/ }), /***/ "1FNb": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("z81E"); __webpack_require__("0nGg"); __webpack_require__("iZVd"); var categoryFilter = __webpack_require__("T6W2"); var visualSymbol = __webpack_require__("AjK0"); var categoryVisual = __webpack_require__("akwy"); var edgeVisual = __webpack_require__("TXKS"); var simpleLayout = __webpack_require__("4RQY"); var circularLayout = __webpack_require__("NAKW"); var forceLayout = __webpack_require__("pzOI"); var createView = __webpack_require__("KGuM"); /* * 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. */ echarts.registerProcessor(categoryFilter); echarts.registerVisual(visualSymbol('graph', 'circle', null)); echarts.registerVisual(categoryVisual); echarts.registerVisual(edgeVisual); echarts.registerLayout(simpleLayout); echarts.registerLayout(echarts.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout); echarts.registerLayout(forceLayout); // Graph view coordinate system echarts.registerCoordinateSystem('graphView', { create: createView }); /***/ }), /***/ "1Hui": /***/ (function(module, exports) { /* * 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. */ function defaultKeyGetter(item) { return item; } /** * @param {Array} oldArr * @param {Array} newArr * @param {Function} oldKeyGetter * @param {Function} newKeyGetter * @param {Object} [context] Can be visited by this.context in callback. */ function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context) { this._old = oldArr; this._new = newArr; this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; this._newKeyGetter = newKeyGetter || defaultKeyGetter; this.context = context; } DataDiffer.prototype = { constructor: DataDiffer, /** * Callback function when add a data */ add: function (func) { this._add = func; return this; }, /** * Callback function when update a data */ update: function (func) { this._update = func; return this; }, /** * Callback function when remove a data */ remove: function (func) { this._remove = func; return this; }, execute: function () { var oldArr = this._old; var newArr = this._new; var oldDataIndexMap = {}; var newDataIndexMap = {}; var oldDataKeyArr = []; var newDataKeyArr = []; var i; initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter', this); initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter', this); for (i = 0; i < oldArr.length; i++) { var key = oldDataKeyArr[i]; var idx = newDataIndexMap[key]; // idx can never be empty array here. see 'set null' logic below. if (idx != null) { // Consider there is duplicate key (for example, use dataItem.name as key). // We should make sure every item in newArr and oldArr can be visited. var len = idx.length; if (len) { len === 1 && (newDataIndexMap[key] = null); idx = idx.shift(); } else { newDataIndexMap[key] = null; } this._update && this._update(idx, i); } else { this._remove && this._remove(i); } } for (var i = 0; i < newDataKeyArr.length; i++) { var key = newDataKeyArr[i]; if (newDataIndexMap.hasOwnProperty(key)) { var idx = newDataIndexMap[key]; if (idx == null) { continue; } // idx can never be empty array here. see 'set null' logic above. if (!idx.length) { this._add && this._add(idx); } else { for (var j = 0, len = idx.length; j < len; j++) { this._add && this._add(idx[j]); } } } } } }; function initIndexMap(arr, map, keyArr, keyGetterName, dataDiffer) { for (var i = 0; i < arr.length; i++) { // Add prefix to avoid conflict with Object.prototype. var key = '_ec_' + dataDiffer[keyGetterName](arr[i], i); var existence = map[key]; if (existence == null) { keyArr.push(key); map[key] = i; } else { if (!existence.length) { map[key] = existence = [existence]; } existence.push(i); } } } var _default = DataDiffer; module.exports = _default; /***/ }), /***/ "1LXj": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var getBuiltIn = __webpack_require__("aqbq"); var apply = __webpack_require__("n561"); var call = __webpack_require__("celx"); var uncurryThis = __webpack_require__("u4Az"); var fails = __webpack_require__("r54x"); var isCallable = __webpack_require__("R09w"); var isSymbol = __webpack_require__("3dPm"); var arraySlice = __webpack_require__("N63j"); var getReplacerFunction = __webpack_require__("XVZV"); var NATIVE_SYMBOL = __webpack_require__("r3E4"); var $String = String; var $stringify = getBuiltIn('JSON', 'stringify'); var exec = uncurryThis(/./.exec); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var replace = uncurryThis(''.replace); var numberToString = uncurryThis(1.0.toString); var tester = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { var symbol = getBuiltIn('Symbol')(); // MS Edge converts symbol values to JSON as {} return $stringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null || $stringify({ a: symbol }) != '{}' // V8 throws on boxed symbols || $stringify(Object(symbol)) != '{}'; }); // https://github.com/tc39/proposal-well-formed-stringify var ILL_FORMED_UNICODE = fails(function () { return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"'; }); var stringifyWithSymbolsFix = function (it, replacer) { var args = arraySlice(arguments); var $replacer = getReplacerFunction(replacer); if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined args[1] = function (key, value) { // some old implementations (like WebKit) could pass numbers as keys if (isCallable($replacer)) value = call($replacer, this, $String(key), value); if (!isSymbol(value)) return value; }; return apply($stringify, null, args); }; var fixIllFormed = function (match, offset, string) { var prev = charAt(string, offset - 1); var next = charAt(string, offset + 1); if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) { return '\\u' + numberToString(charCodeAt(match, 0), 16); } return match; }; if ($stringify) { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var args = arraySlice(arguments); var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args); return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result; } }); } /***/ }), /***/ "1Nix": /***/ (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__("/gxq"); var map = _util.map; var createRenderPlanner = __webpack_require__("CqCN"); var _dataStackHelper = __webpack_require__("qVJQ"); var isDimensionStacked = _dataStackHelper.isDimensionStacked; /* * 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 Float32Array */ function _default(seriesType) { return { seriesType: seriesType, plan: createRenderPlanner(), reset: function (seriesModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; var pipelineContext = seriesModel.pipelineContext; var isLargeRender = pipelineContext.large; if (!coordSys) { return; } var dims = map(coordSys.dimensions, function (dim) { return data.mapDimension(dim); }).slice(0, 2); var dimLen = dims.length; var stackResultDim = data.getCalculationInfo('stackResultDimension'); if (isDimensionStacked(data, dims[0] /*, dims[1]*/ )) { dims[0] = stackResultDim; } if (isDimensionStacked(data, dims[1] /*, dims[0]*/ )) { dims[1] = stackResultDim; } function progress(params, data) { var segCount = params.end - params.start; var points = isLargeRender && new Float32Array(segCount * dimLen); for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) { var point; if (dimLen === 1) { var x = data.get(dims[0], i); point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut); } else { var x = tmpIn[0] = data.get(dims[0], i); var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.}, not undefined to avoid if...else... statement point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut); } if (isLargeRender) { points[offset++] = point ? point[0] : NaN; points[offset++] = point ? point[1] : NaN; } else { data.setItemLayout(i, point && point.slice() || [NaN, NaN]); } } isLargeRender && data.setLayout('symbolPoints', points); } return dimLen && { progress: progress }; } }; } module.exports = _default; /***/ }), /***/ "1RnF": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("aLzV"); /***/ }), /***/ "1SZZ": /***/ (function(module, exports, __webpack_require__) { "use strict"; // B.2.3.7 String.prototype.fontcolor(color) __webpack_require__("48Hh")('fontcolor', function (createHTML) { return function fontcolor(color) { return createHTML(this, 'font', 'color', color); }; }); /***/ }), /***/ "1VkX": /***/ (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__("/gxq"); var ChartView = __webpack_require__("Ylhr"); var graphic = __webpack_require__("0sHC"); var Path = __webpack_require__("GxVO"); var _createClipPathFromCoordSys = __webpack_require__("DDYI"); var createClipPath = _createClipPathFromCoordSys.createClipPath; /* * 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 NORMAL_ITEM_STYLE_PATH = ['itemStyle']; var EMPHASIS_ITEM_STYLE_PATH = ['emphasis', 'itemStyle']; var SKIP_PROPS = ['color', 'color0', 'borderColor', 'borderColor0']; var CandlestickView = ChartView.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 ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel); }, incrementalPrepareRender: function (seriesModel, ecModel, api) { this._clear(); this._updateDrawMode(seriesModel); }, incrementalRender: function (params, seriesModel, ecModel, api) { this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel); }, _updateDrawMode: function (seriesModel) { var isLargeDraw = seriesModel.pipelineContext.large; if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) { this._isLargeDraw = isLargeDraw; this._clear(); } }, _renderNormal: function (seriesModel) { var data = seriesModel.getData(); var oldData = this._data; 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) { group.removeAll(); } data.diff(oldData).add(function (newIdx) { if (data.hasValue(newIdx)) { var el; var itemLayout = data.getItemLayout(newIdx); if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { return; } el = createNormalBox(itemLayout, newIdx, true); graphic.initProps(el, { shape: { points: itemLayout.ends } }, seriesModel, newIdx); setBoxCommon(el, data, newIdx, isSimpleBox); group.add(el); data.setItemGraphicEl(newIdx, el); } }).update(function (newIdx, oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); // Empty data if (!data.hasValue(newIdx)) { group.remove(el); return; } var itemLayout = data.getItemLayout(newIdx); if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { group.remove(el); return; } if (!el) { el = createNormalBox(itemLayout, newIdx); } else { graphic.updateProps(el, { shape: { points: itemLayout.ends } }, seriesModel, newIdx); } setBoxCommon(el, data, newIdx, isSimpleBox); group.add(el); data.setItemGraphicEl(newIdx, el); }).remove(function (oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); el && group.remove(el); }).execute(); this._data = data; }, _renderLarge: function (seriesModel) { this._clear(); createLarge(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) { var data = seriesModel.getData(); var isSimpleBox = data.getLayout('isSimpleBox'); var dataIndex; while ((dataIndex = params.next()) != null) { var el; var itemLayout = data.getItemLayout(dataIndex); el = createNormalBox(itemLayout, dataIndex); setBoxCommon(el, data, dataIndex, isSimpleBox); el.incremental = true; this.group.add(el); } }, _incrementalRenderLarge: function (params, seriesModel) { createLarge(seriesModel, this.group, true); }, remove: function (ecModel) { this._clear(); }, _clear: function () { this.group.removeAll(); this._data = null; }, dispose: zrUtil.noop }); var NormalBoxPath = Path.extend({ type: 'normalCandlestickBox', shape: {}, buildPath: function (ctx, shape) { var ends = shape.points; if (this.__simpleBox) { ctx.moveTo(ends[4][0], ends[4][1]); ctx.lineTo(ends[6][0], ends[6][1]); } else { ctx.moveTo(ends[0][0], ends[0][1]); ctx.lineTo(ends[1][0], ends[1][1]); ctx.lineTo(ends[2][0], ends[2][1]); ctx.lineTo(ends[3][0], ends[3][1]); ctx.closePath(); ctx.moveTo(ends[4][0], ends[4][1]); ctx.lineTo(ends[5][0], ends[5][1]); ctx.moveTo(ends[6][0], ends[6][1]); ctx.lineTo(ends[7][0], ends[7][1]); } } }); function createNormalBox(itemLayout, dataIndex, isInit) { var ends = itemLayout.ends; return new NormalBoxPath({ shape: { points: isInit ? transInit(ends, itemLayout) : ends }, z2: 100 }); } 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); var color = data.getItemVisual(dataIndex, 'color'); var borderColor = data.getItemVisual(dataIndex, 'borderColor') || color; // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke var itemStyle = normalItemStyleModel.getItemStyle(SKIP_PROPS); el.useStyle(itemStyle); el.style.strokeNoScale = true; el.style.fill = color; el.style.stroke = borderColor; el.__simpleBox = isSimpleBox; var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH).getItemStyle(); graphic.setHoverStyle(el, hoverStyle); } function transInit(points, itemLayout) { return zrUtil.map(points, function (point) { point = point.slice(); point[1] = itemLayout.initBaseline; return point; }); } var LargeBoxPath = Path.extend({ type: 'largeCandlestickBox', shape: {}, buildPath: function (ctx, shape) { // Drawing lines is more efficient than drawing // a whole line or drawing rects. var points = shape.points; for (var i = 0; i < points.length;) { if (this.__sign === points[i++]) { var x = points[i++]; ctx.moveTo(x, points[i++]); ctx.lineTo(x, points[i++]); } else { i += 3; } } } }); function createLarge(seriesModel, group, incremental) { var data = seriesModel.getData(); var largePoints = data.getLayout('largePoints'); var elP = new LargeBoxPath({ shape: { points: largePoints }, __sign: 1 }); group.add(elP); var elN = new LargeBoxPath({ shape: { points: largePoints }, __sign: -1 }); group.add(elN); setLargeStyle(1, elP, seriesModel, data); setLargeStyle(-1, elN, seriesModel, data); if (incremental) { elP.incremental = true; elN.incremental = true; } } function setLargeStyle(sign, el, seriesModel, data) { var suffix = sign > 0 ? 'P' : 'N'; var borderColor = data.getVisual('borderColor' + suffix) || data.getVisual('color' + suffix); // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke var itemStyle = seriesModel.getModel(NORMAL_ITEM_STYLE_PATH).getItemStyle(SKIP_PROPS); el.useStyle(itemStyle); el.style.fill = null; el.style.stroke = borderColor; // No different // el.style.lineWidth = .5; } var _default = CandlestickView; module.exports = _default; /***/ }), /***/ "1Xuh": /***/ (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__("/gxq"); var BoundingRect = __webpack_require__("8b51"); var _number = __webpack_require__("wWR3"); var parsePercent = _number.parsePercent; var formatUtil = __webpack_require__("HHfb"); /* * 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. */ // Layout helpers for each component positioning var each = zrUtil.each; /** * @public */ var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height']; /** * @public */ var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']]; function boxLayout(orient, group, gap, maxWidth, maxHeight) { var x = 0; var y = 0; if (maxWidth == null) { maxWidth = Infinity; } if (maxHeight == null) { maxHeight = Infinity; } var currentLineMaxSize = 0; group.eachChild(function (child, idx) { var position = child.position; var rect = child.getBoundingRect(); var nextChild = group.childAt(idx + 1); var nextChildRect = nextChild && nextChild.getBoundingRect(); var nextX; var nextY; if (orient === 'horizontal') { var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0); nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group // FIXME compare before adding gap? if (nextX > maxWidth || child.newline) { x = 0; nextX = moveX; y += currentLineMaxSize + gap; currentLineMaxSize = rect.height; } else { // FIXME: consider rect.y is not `0`? currentLineMaxSize = Math.max(currentLineMaxSize, rect.height); } } else { var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0); nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group if (nextY > maxHeight || child.newline) { x += currentLineMaxSize + gap; y = 0; nextY = moveY; currentLineMaxSize = rect.width; } else { currentLineMaxSize = Math.max(currentLineMaxSize, rect.width); } } if (child.newline) { return; } position[0] = x; position[1] = y; orient === 'horizontal' ? x = nextX + gap : y = nextY + gap; }); } /** * VBox or HBox layouting * @param {string} orient * @param {module:zrender/container/Group} group * @param {number} gap * @param {number} [width=Infinity] * @param {number} [height=Infinity] */ var box = boxLayout; /** * VBox layouting * @param {module:zrender/container/Group} group * @param {number} gap * @param {number} [width=Infinity] * @param {number} [height=Infinity] */ var vbox = zrUtil.curry(boxLayout, 'vertical'); /** * HBox layouting * @param {module:zrender/container/Group} group * @param {number} gap * @param {number} [width=Infinity] * @param {number} [height=Infinity] */ var hbox = zrUtil.curry(boxLayout, 'horizontal'); /** * If x or x2 is not specified or 'center' 'left' 'right', * the width would be as long as possible. * If y or y2 is not specified or 'middle' 'top' 'bottom', * the height would be as long as possible. * * @param {Object} positionInfo * @param {number|string} [positionInfo.x] * @param {number|string} [positionInfo.y] * @param {number|string} [positionInfo.x2] * @param {number|string} [positionInfo.y2] * @param {Object} containerRect {width, height} * @param {string|number} margin * @return {Object} {width, height} */ function getAvailableSize(positionInfo, containerRect, margin) { var containerWidth = containerRect.width; var containerHeight = containerRect.height; var x = parsePercent(positionInfo.x, containerWidth); var y = parsePercent(positionInfo.y, containerHeight); var x2 = parsePercent(positionInfo.x2, containerWidth); var y2 = parsePercent(positionInfo.y2, containerHeight); (isNaN(x) || isNaN(parseFloat(positionInfo.x))) && (x = 0); (isNaN(x2) || isNaN(parseFloat(positionInfo.x2))) && (x2 = containerWidth); (isNaN(y) || isNaN(parseFloat(positionInfo.y))) && (y = 0); (isNaN(y2) || isNaN(parseFloat(positionInfo.y2))) && (y2 = containerHeight); margin = formatUtil.normalizeCssArray(margin || 0); return { width: Math.max(x2 - x - margin[1] - margin[3], 0), height: Math.max(y2 - y - margin[0] - margin[2], 0) }; } /** * Parse position info. * * @param {Object} positionInfo * @param {number|string} [positionInfo.left] * @param {number|string} [positionInfo.top] * @param {number|string} [positionInfo.right] * @param {number|string} [positionInfo.bottom] * @param {number|string} [positionInfo.width] * @param {number|string} [positionInfo.height] * @param {number|string} [positionInfo.aspect] Aspect is width / height * @param {Object} containerRect * @param {string|number} [margin] * * @return {module:zrender/core/BoundingRect} */ function getLayoutRect(positionInfo, containerRect, margin) { margin = formatUtil.normalizeCssArray(margin || 0); var containerWidth = containerRect.width; var containerHeight = containerRect.height; var left = parsePercent(positionInfo.left, containerWidth); var top = parsePercent(positionInfo.top, containerHeight); var right = parsePercent(positionInfo.right, containerWidth); var bottom = parsePercent(positionInfo.bottom, containerHeight); var width = parsePercent(positionInfo.width, containerWidth); var height = parsePercent(positionInfo.height, containerHeight); var verticalMargin = margin[2] + margin[0]; var horizontalMargin = margin[1] + margin[3]; var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right if (isNaN(width)) { width = containerWidth - right - horizontalMargin - left; } if (isNaN(height)) { height = containerHeight - bottom - verticalMargin - top; } if (aspect != null) { // If width and height are not given // 1. Graph should not exceeds the container // 2. Aspect must be keeped // 3. Graph should take the space as more as possible // FIXME // Margin is not considered, because there is no case that both // using margin and aspect so far. if (isNaN(width) && isNaN(height)) { if (aspect > containerWidth / containerHeight) { width = containerWidth * 0.8; } else { height = containerHeight * 0.8; } } // Calculate width or height with given aspect if (isNaN(width)) { width = aspect * height; } if (isNaN(height)) { height = width / aspect; } } // If left is not specified, calculate left from right and width if (isNaN(left)) { left = containerWidth - right - width - horizontalMargin; } if (isNaN(top)) { top = containerHeight - bottom - height - verticalMargin; } // Align left and top switch (positionInfo.left || positionInfo.right) { case 'center': left = containerWidth / 2 - width / 2 - margin[3]; break; case 'right': left = containerWidth - width - horizontalMargin; break; } switch (positionInfo.top || positionInfo.bottom) { case 'middle': case 'center': top = containerHeight / 2 - height / 2 - margin[0]; break; case 'bottom': top = containerHeight - height - verticalMargin; break; } // If something is wrong and left, top, width, height are calculated as NaN left = left || 0; top = top || 0; if (isNaN(width)) { // Width may be NaN if only one value is given except width width = containerWidth - horizontalMargin - left - (right || 0); } if (isNaN(height)) { // Height may be NaN if only one value is given except height height = containerHeight - verticalMargin - top - (bottom || 0); } var rect = new BoundingRect(left + margin[3], top + margin[0], width, height); rect.margin = margin; return rect; } /** * Position a zr element in viewport * Group position is specified by either * {left, top}, {right, bottom} * If all properties exists, right and bottom will be igonred. * * Logic: * 1. Scale (against origin point in parent coord) * 2. Rotate (against origin point in parent coord) * 3. Traslate (with el.position by this method) * So this method only fixes the last step 'Traslate', which does not affect * scaling and rotating. * * If be called repeatly with the same input el, the same result will be gotten. * * @param {module:zrender/Element} el Should have `getBoundingRect` method. * @param {Object} positionInfo * @param {number|string} [positionInfo.left] * @param {number|string} [positionInfo.top] * @param {number|string} [positionInfo.right] * @param {number|string} [positionInfo.bottom] * @param {number|string} [positionInfo.width] Only for opt.boundingModel: 'raw' * @param {number|string} [positionInfo.height] Only for opt.boundingModel: 'raw' * @param {Object} containerRect * @param {string|number} margin * @param {Object} [opt] * @param {Array.} [opt.hv=[1,1]] Only horizontal or only vertical. * @param {Array.} [opt.boundingMode='all'] * Specify how to calculate boundingRect when locating. * 'all': Position the boundingRect that is transformed and uioned * both itself and its descendants. * This mode simplies confine the elements in the bounding * of their container (e.g., using 'right: 0'). * 'raw': Position the boundingRect that is not transformed and only itself. * This mode is useful when you want a element can overflow its * container. (Consider a rotated circle needs to be located in a corner.) * In this mode positionInfo.width/height can only be number. */ function positionElement(el, positionInfo, containerRect, margin, opt) { var h = !opt || !opt.hv || opt.hv[0]; var v = !opt || !opt.hv || opt.hv[1]; var boundingMode = opt && opt.boundingMode || 'all'; if (!h && !v) { return; } var rect; if (boundingMode === 'raw') { rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect(); } else { rect = el.getBoundingRect(); if (el.needLocalTransform()) { var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el, // which should not be modified. rect = rect.clone(); rect.applyTransform(transform); } } // The real width and height can not be specified but calculated by the given el. positionInfo = getLayoutRect(zrUtil.defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform // (see zrender/core/Transformable#getLocalTransform), // we can just only modify el.position to get final result. var elPos = el.position; var dx = h ? positionInfo.x - rect.x : 0; var dy = v ? positionInfo.y - rect.y : 0; el.attr('position', boundingMode === 'raw' ? [dx, dy] : [elPos[0] + dx, elPos[1] + dy]); } /** * @param {Object} option Contains some of the properties in HV_NAMES. * @param {number} hvIdx 0: horizontal; 1: vertical. */ function sizeCalculable(option, hvIdx) { return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null; } /** * Consider Case: * When defulat option has {left: 0, width: 100}, and we set {right: 0} * through setOption or media query, using normal zrUtil.merge will cause * {right: 0} does not take effect. * * @example * ComponentModel.extend({ * init: function () { * ... * var inputPositionParams = layout.getLayoutParams(option); * this.mergeOption(inputPositionParams); * }, * mergeOption: function (newOption) { * newOption && zrUtil.merge(thisOption, newOption, true); * layout.mergeLayoutParam(thisOption, newOption); * } * }); * * @param {Object} targetOption * @param {Object} newOption * @param {Object|string} [opt] * @param {boolean|Array.} [opt.ignoreSize=false] Used for the components * that width (or height) should not be calculated by left and right (or top and bottom). */ function mergeLayoutParam(targetOption, newOption, opt) { !zrUtil.isObject(opt) && (opt = {}); var ignoreSize = opt.ignoreSize; !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]); var hResult = merge(HV_NAMES[0], 0); var vResult = merge(HV_NAMES[1], 1); copy(HV_NAMES[0], targetOption, hResult); copy(HV_NAMES[1], targetOption, vResult); function merge(names, hvIdx) { var newParams = {}; var newValueCount = 0; var merged = {}; var mergedValueCount = 0; var enoughParamNumber = 2; each(names, function (name) { merged[name] = targetOption[name]; }); each(names, function (name) { // Consider case: newOption.width is null, which is // set by user for removing width setting. hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]); hasValue(newParams, name) && newValueCount++; hasValue(merged, name) && mergedValueCount++; }); if (ignoreSize[hvIdx]) { // Only one of left/right is premitted to exist. if (hasValue(newOption, names[1])) { merged[names[2]] = null; } else if (hasValue(newOption, names[2])) { merged[names[1]] = null; } return merged; } // Case: newOption: {width: ..., right: ...}, // or targetOption: {right: ...} and newOption: {width: ...}, // There is no conflict when merged only has params count // little than enoughParamNumber. if (mergedValueCount === enoughParamNumber || !newValueCount) { return merged; } // Case: newOption: {width: ..., right: ...}, // Than we can make sure user only want those two, and ignore // all origin params in targetOption. else if (newValueCount >= enoughParamNumber) { return newParams; } else { // Chose another param from targetOption by priority. for (var i = 0; i < names.length; i++) { var name = names[i]; if (!hasProp(newParams, name) && hasProp(targetOption, name)) { newParams[name] = targetOption[name]; break; } } return newParams; } } function hasProp(obj, name) { return obj.hasOwnProperty(name); } function hasValue(obj, name) { return obj[name] != null && obj[name] !== 'auto'; } function copy(names, target, source) { each(names, function (name) { target[name] = source[name]; }); } } /** * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. * @param {Object} source * @return {Object} Result contains those props. */ function getLayoutParams(source) { return copyLayoutParams({}, source); } /** * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. * @param {Object} source * @return {Object} Result contains those props. */ function copyLayoutParams(target, source) { source && target && each(LOCATION_PARAMS, function (name) { source.hasOwnProperty(name) && (target[name] = source[name]); }); return target; } exports.LOCATION_PARAMS = LOCATION_PARAMS; exports.HV_NAMES = HV_NAMES; exports.box = box; exports.vbox = vbox; exports.hbox = hbox; exports.getAvailableSize = getAvailableSize; exports.getLayoutRect = getLayoutRect; exports.positionElement = positionElement; exports.sizeCalculable = sizeCalculable; exports.mergeLayoutParam = mergeLayoutParam; exports.getLayoutParams = getLayoutParams; exports.copyLayoutParams = copyLayoutParams; /***/ }), /***/ "1Yoh": /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ module.exports = function isBuffer (obj) { return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } /***/ }), /***/ "1bHA": /***/ (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__("/gxq"); var _symbol = __webpack_require__("kK7q"); var createSymbol = _symbol.createSymbol; var graphic = __webpack_require__("0sHC"); var _number = __webpack_require__("wWR3"); var parsePercent = _number.parsePercent; var _labelHelper = __webpack_require__("RjA7"); var getDefaultLabel = _labelHelper.getDefaultLabel; /* * 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/chart/helper/Symbol */ /** * @constructor * @alias {module:echarts/chart/helper/Symbol} * @param {module:echarts/data/List} data * @param {number} idx * @extends {module:zrender/graphic/Group} */ function SymbolClz(data, idx, seriesScope) { graphic.Group.call(this); this.updateData(data, idx, seriesScope); } var symbolProto = SymbolClz.prototype; /** * @public * @static * @param {module:echarts/data/List} data * @param {number} dataIndex * @return {Array.} [width, height] */ var getSymbolSize = SymbolClz.getSymbolSize = function (data, idx) { var symbolSize = data.getItemVisual(idx, 'symbolSize'); return symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize]; }; function getScale(symbolSize) { return [symbolSize[0] / 2, symbolSize[1] / 2]; } function driftSymbol(dx, dy) { this.parent.drift(dx, dy); } symbolProto._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) { // Remove paths created before this.removeAll(); var color = data.getItemVisual(idx, 'color'); // var symbolPath = 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 #4150. var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, color, keepAspect); symbolPath.attr({ z2: 100, culling: true, scale: getScale(symbolSize) }); // Rewrite drift method symbolPath.drift = driftSymbol; this._symbolType = symbolType; this.add(symbolPath); }; /** * Stop animation * @param {boolean} toLastFrame */ symbolProto.stopSymbolAnimation = function (toLastFrame) { this.childAt(0).stopAnimation(toLastFrame); }; /** * FIXME: * Caution: This method breaks the encapsulation of this module, * but it indeed brings convenience. So do not use the method * unless you detailedly know all the implements of `Symbol`, * especially animation. * * Get symbol path element. */ symbolProto.getSymbolPath = function () { return this.childAt(0); }; /** * Get scale(aka, current symbol size). * Including the change caused by animation */ symbolProto.getScale = function () { return this.childAt(0).scale; }; /** * Highlight symbol */ symbolProto.highlight = function () { this.childAt(0).trigger('emphasis'); }; /** * Downplay symbol */ symbolProto.downplay = function () { this.childAt(0).trigger('normal'); }; /** * @param {number} zlevel * @param {number} z */ symbolProto.setZ = function (zlevel, z) { var symbolPath = this.childAt(0); symbolPath.zlevel = zlevel; symbolPath.z = z; }; symbolProto.setDraggable = function (draggable) { var symbolPath = this.childAt(0); symbolPath.draggable = draggable; symbolPath.cursor = draggable ? 'move' : symbolPath.cursor; }; /** * Update symbol properties * @param {module:echarts/data/List} data * @param {number} idx * @param {Object} [seriesScope] * @param {Object} [seriesScope.itemStyle] * @param {Object} [seriesScope.hoverItemStyle] * @param {Object} [seriesScope.symbolRotate] * @param {Object} [seriesScope.symbolOffset] * @param {module:echarts/model/Model} [seriesScope.labelModel] * @param {module:echarts/model/Model} [seriesScope.hoverLabelModel] * @param {boolean} [seriesScope.hoverAnimation] * @param {Object} [seriesScope.cursorStyle] * @param {module:echarts/model/Model} [seriesScope.itemModel] * @param {string} [seriesScope.symbolInnerColor] * @param {Object} [seriesScope.fadeIn=false] */ symbolProto.updateData = function (data, idx, seriesScope) { this.silent = false; var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; var seriesModel = data.hostModel; var symbolSize = getSymbolSize(data, idx); var isInit = symbolType !== this._symbolType; if (isInit) { var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect'); this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); } else { var symbolPath = this.childAt(0); symbolPath.silent = false; graphic.updateProps(symbolPath, { scale: getScale(symbolSize) }, seriesModel, idx); } this._updateCommon(data, idx, symbolSize, seriesScope); if (isInit) { var symbolPath = this.childAt(0); var fadeIn = seriesScope && seriesScope.fadeIn; var target = { scale: symbolPath.scale.slice() }; fadeIn && (target.style = { opacity: symbolPath.style.opacity }); symbolPath.scale = [0, 0]; fadeIn && (symbolPath.style.opacity = 0); graphic.initProps(symbolPath, target, seriesModel, idx); } this._seriesModel = seriesModel; }; // Update common properties var normalStyleAccessPath = ['itemStyle']; var emphasisStyleAccessPath = ['emphasis', 'itemStyle']; var normalLabelAccessPath = ['label']; var emphasisLabelAccessPath = ['emphasis', 'label']; /** * @param {module:echarts/data/List} data * @param {number} idx * @param {Array.} symbolSize * @param {Object} [seriesScope] */ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { var symbolPath = this.childAt(0); var seriesModel = data.hostModel; var color = data.getItemVisual(idx, 'color'); // Reset style if (symbolPath.type !== 'image') { symbolPath.useStyle({ 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 symbolOffset = seriesScope && seriesScope.symbolOffset; var labelModel = seriesScope && seriesScope.labelModel; var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel; var hoverAnimation = seriesScope && seriesScope.hoverAnimation; var cursorStyle = seriesScope && seriesScope.cursorStyle; if (!seriesScope || data.hasItemOption) { var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx); // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke itemStyle = itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']); hoverItemStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle(); symbolOffset = itemModel.getShallow('symbolOffset'); labelModel = itemModel.getModel(normalLabelAccessPath); hoverLabelModel = itemModel.getModel(emphasisLabelAccessPath); hoverAnimation = itemModel.getShallow('hoverAnimation'); cursorStyle = itemModel.getShallow('cursor'); } else { hoverItemStyle = zrUtil.extend({}, hoverItemStyle); } var elStyle = symbolPath.style; var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); if (symbolOffset) { symbolPath.attr('position', [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])]); } cursorStyle && symbolPath.attr('cursor', cursorStyle); // PENDING setColor before setStyle!!! symbolPath.setColor(color, seriesScope && seriesScope.symbolInnerColor); symbolPath.setStyle(itemStyle); var opacity = data.getItemVisual(idx, 'opacity'); if (opacity != null) { elStyle.opacity = opacity; } var liftZ = data.getItemVisual(idx, 'liftZ'); var z2Origin = symbolPath.__z2Origin; if (liftZ != null) { if (z2Origin == null) { symbolPath.__z2Origin = symbolPath.z2; symbolPath.z2 += liftZ; } } else if (z2Origin != null) { symbolPath.z2 = z2Origin; symbolPath.__z2Origin = null; } var useNameLabel = seriesScope && seriesScope.useNameLabel; graphic.setLabelStyle(elStyle, hoverItemStyle, labelModel, hoverLabelModel, { labelFetcher: seriesModel, labelDataIndex: idx, defaultText: getLabelDefaultText, isRectText: true, autoColor: color }); // Do not execute util needed. function getLabelDefaultText(idx, opt) { return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); } symbolPath.__symbolOriginalScale = getScale(symbolSize); symbolPath.hoverStyle = hoverItemStyle; symbolPath.highDownOnUpdate = hoverAnimation && seriesModel.isAnimationEnabled() ? highDownOnUpdate : null; graphic.setHoverStyle(symbolPath); }; 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) { 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'); } } /** * @param {Function} cb * @param {Object} [opt] * @param {Object} [opt.keepLabel=true] */ symbolProto.fadeOut = function (cb, opt) { var symbolPath = this.childAt(0); // Avoid mistaken hover when fading out this.silent = symbolPath.silent = true; // Not show text when animating !(opt && opt.keepLabel) && (symbolPath.style.text = null); graphic.updateProps(symbolPath, { style: { opacity: 0 }, scale: [0, 0] }, this._seriesModel, this.dataIndex, cb); }; zrUtil.inherits(SymbolClz, graphic.Group); var _default = SymbolClz; module.exports = _default; /***/ }), /***/ "1bf2": /***/ (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. */ __webpack_require__("PBlc"); __webpack_require__("rFvp"); /***/ }), /***/ "1cbZ": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var tryNodeRequire = __webpack_require__("clcN"); var getBuiltIn = __webpack_require__("aqbq"); var fails = __webpack_require__("r54x"); var create = __webpack_require__("43zn"); var createPropertyDescriptor = __webpack_require__("C1ru"); var defineProperty = __webpack_require__("1rEs").f; var defineBuiltIn = __webpack_require__("gakl"); var defineBuiltInAccessor = __webpack_require__("5MpO"); var hasOwn = __webpack_require__("M4w/"); var anInstance = __webpack_require__("tyBP"); var anObject = __webpack_require__("5+O3"); var errorToString = __webpack_require__("tmYl"); var normalizeStringArgument = __webpack_require__("59rh"); var DOMExceptionConstants = __webpack_require__("5qJO"); var clearErrorStack = __webpack_require__("focP"); var InternalStateModule = __webpack_require__("I1z2"); var DESCRIPTORS = __webpack_require__("q0qZ"); var IS_PURE = __webpack_require__("pzR0"); var DOM_EXCEPTION = 'DOMException'; var DATA_CLONE_ERR = 'DATA_CLONE_ERR'; var Error = getBuiltIn('Error'); // NodeJS < 17.0 does not expose `DOMException` to global var NativeDOMException = getBuiltIn(DOM_EXCEPTION) || (function () { try { // NodeJS < 15.0 does not expose `MessageChannel` to global var MessageChannel = getBuiltIn('MessageChannel') || tryNodeRequire('worker_threads').MessageChannel; // eslint-disable-next-line es/no-weak-map, unicorn/require-post-message-target-origin -- safe new MessageChannel().port1.postMessage(new WeakMap()); } catch (error) { if (error.name == DATA_CLONE_ERR && error.code == 25) return error.constructor; } })(); var NativeDOMExceptionPrototype = NativeDOMException && NativeDOMException.prototype; var ErrorPrototype = Error.prototype; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(DOM_EXCEPTION); var HAS_STACK = 'stack' in Error(DOM_EXCEPTION); var codeFor = function (name) { return hasOwn(DOMExceptionConstants, name) && DOMExceptionConstants[name].m ? DOMExceptionConstants[name].c : 0; }; var $DOMException = function DOMException() { anInstance(this, DOMExceptionPrototype); var argumentsLength = arguments.length; var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var code = codeFor(name); setInternalState(this, { type: DOM_EXCEPTION, name: name, message: message, code: code }); if (!DESCRIPTORS) { this.name = name; this.message = message; this.code = code; } if (HAS_STACK) { var error = Error(message); error.name = DOM_EXCEPTION; defineProperty(this, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); } }; var DOMExceptionPrototype = $DOMException.prototype = create(ErrorPrototype); var createGetterDescriptor = function (get) { return { enumerable: true, configurable: true, get: get }; }; var getterFor = function (key) { return createGetterDescriptor(function () { return getInternalState(this)[key]; }); }; if (DESCRIPTORS) { // `DOMException.prototype.code` getter defineBuiltInAccessor(DOMExceptionPrototype, 'code', getterFor('code')); // `DOMException.prototype.message` getter defineBuiltInAccessor(DOMExceptionPrototype, 'message', getterFor('message')); // `DOMException.prototype.name` getter defineBuiltInAccessor(DOMExceptionPrototype, 'name', getterFor('name')); } defineProperty(DOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, $DOMException)); // FF36- DOMException is a function, but can't be constructed var INCORRECT_CONSTRUCTOR = fails(function () { return !(new NativeDOMException() instanceof Error); }); // Safari 10.1 / Chrome 32- / IE8- DOMException.prototype.toString bugs var INCORRECT_TO_STRING = INCORRECT_CONSTRUCTOR || fails(function () { return ErrorPrototype.toString !== errorToString || String(new NativeDOMException(1, 2)) !== '2: 1'; }); // Deno 1.6.3- DOMException.prototype.code just missed var INCORRECT_CODE = INCORRECT_CONSTRUCTOR || fails(function () { return new NativeDOMException(1, 'DataCloneError').code !== 25; }); // Deno 1.6.3- DOMException constants just missed var MISSED_CONSTANTS = INCORRECT_CONSTRUCTOR || NativeDOMException[DATA_CLONE_ERR] !== 25 || NativeDOMExceptionPrototype[DATA_CLONE_ERR] !== 25; var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISSED_CONSTANTS : INCORRECT_CONSTRUCTOR; // `DOMException` constructor // https://webidl.spec.whatwg.org/#idl-DOMException $({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, { DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; if (INCORRECT_TO_STRING && (IS_PURE || NativeDOMException === PolyfilledDOMException)) { defineBuiltIn(PolyfilledDOMExceptionPrototype, 'toString', errorToString); } if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMException) { defineBuiltInAccessor(PolyfilledDOMExceptionPrototype, 'code', createGetterDescriptor(function () { return codeFor(anObject(this).name); })); } // `DOMException` constants for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; var descriptor = createPropertyDescriptor(6, constant.c); if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, descriptor); } if (!hasOwn(PolyfilledDOMExceptionPrototype, constantName)) { defineProperty(PolyfilledDOMExceptionPrototype, constantName, descriptor); } } /***/ }), /***/ "1jpT": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); var fails = __webpack_require__("r54x"); var isCallable = __webpack_require__("R09w"); var hasOwn = __webpack_require__("M4w/"); var DESCRIPTORS = __webpack_require__("q0qZ"); var CONFIGURABLE_FUNCTION_NAME = __webpack_require__("iUXx").CONFIGURABLE; var inspectSource = __webpack_require__("ypmV"); var InternalStateModule = __webpack_require__("I1z2"); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); /***/ }), /***/ "1kQw": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var iterate = __webpack_require__("UHV6"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); // `Iterator.prototype.forEach` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { forEach: function forEach(fn) { anObject(this); aCallable(fn); var record = getIteratorDirect(this); var counter = 0; iterate(record, function (value) { fn(value, counter++); }, { IS_RECORD: true }); } }); /***/ }), /***/ "1nVW": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); var notANaN = __webpack_require__("v86+"); var toPositiveInteger = __webpack_require__("PHrF"); var createAsyncIteratorProxy = __webpack_require__("M9Xa"); var createIterResultObject = __webpack_require__("l+3Q"); var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) { var state = this; var iterator = state.iterator; var returnMethod; if (!state.remaining--) { var resultDone = createIterResultObject(undefined, true); state.done = true; returnMethod = iterator['return']; if (returnMethod !== undefined) { return Promise.resolve(call(returnMethod, iterator, undefined)).then(function () { return resultDone; }); } return resultDone; } return Promise.resolve(call(state.next, iterator)).then(function (step) { if (anObject(step).done) { state.done = true; return createIterResultObject(undefined, true); } return createIterResultObject(step.value, false); }).then(null, function (error) { state.done = true; throw error; }); }); // `AsyncIterator.prototype.take` method // https://github.com/tc39/proposal-async-iterator-helpers $({ target: 'AsyncIterator', proto: true, real: true }, { take: function take(limit) { anObject(this); var remaining = toPositiveInteger(notANaN(+limit)); return new AsyncIteratorProxy(getIteratorDirect(this), { remaining: remaining }); } }); /***/ }), /***/ "1nw6": /***/ (function(module, exports, __webpack_require__) { var call = __webpack_require__("celx"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var tryToString = __webpack_require__("Ut8H"); var getIteratorMethod = __webpack_require__("URKv"); var $TypeError = TypeError; module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw $TypeError(tryToString(argument) + ' is not iterable'); }; /***/ }), /***/ "1oJE": /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__("eqAp"); var $parseInt = __webpack_require__("2zMK"); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); /***/ }), /***/ "1oQN": /***/ (function(module, exports, __webpack_require__) { "use strict"; var aSet = __webpack_require__("egot"); var has = __webpack_require__("QdM8").has; var size = __webpack_require__("Gfoz"); var getSetRecord = __webpack_require__("wQj+"); var iterateSet = __webpack_require__("XLIz"); var iterateSimple = __webpack_require__("QFMQ"); var iteratorClose = __webpack_require__("fpEu"); // `Set.prototype.isDisjointFrom` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom module.exports = function isDisjointFrom(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) <= otherRec.size) return iterateSet(O, function (e) { if (otherRec.includes(e)) return false; }, true) !== false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; /***/ }), /***/ "1oZe": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = function (ref) { return { methods: { focus: function focus() { this.$refs[ref].focus(); } } }; }; ; /***/ }), /***/ "1pTL": /***/ (function(module, exports, __webpack_require__) { "use strict"; // TODO: Remove from `core-js@4` var ArrayBufferViewCore = __webpack_require__("fduV"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var isBigIntArray = __webpack_require__("aP1u"); var toAbsoluteIndex = __webpack_require__("40wi"); var toBigInt = __webpack_require__("UNWy"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var fails = __webpack_require__("r54x"); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var max = Math.max; var min = Math.min; // some early implementations, like WebKit, does not follow the final semantic var PROPER_ORDER = !fails(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Int8Array([1]); var spliced = array.toSpliced(1, 0, { valueOf: function () { array[0] = 2; return 3; } }); return spliced[0] !== 2 || spliced[1] !== 3; }); // `%TypedArray%.prototype.toSpliced` method // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) { var O = aTypedArray(this); var C = getTypedArrayConstructor(O); var len = lengthOfArrayLike(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var k = 0; var insertCount, actualDeleteCount, thisIsBigIntArray, convertedItems, value, newLen, A; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); insertCount = argumentsLength - 2; if (insertCount) { convertedItems = new C(insertCount); thisIsBigIntArray = isBigIntArray(convertedItems); for (var i = 2; i < argumentsLength; i++) { value = arguments[i]; // FF30- typed arrays doesn't properly convert objects to typed array values convertedItems[i - 2] = thisIsBigIntArray ? toBigInt(value) : +value; } } } newLen = len + insertCount - actualDeleteCount; A = new C(newLen); for (; k < actualStart; k++) A[k] = O[k]; for (; k < actualStart + insertCount; k++) A[k] = convertedItems[k - actualStart]; for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; return A; }, !PROPER_ORDER); /***/ }), /***/ "1rEs": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("q0qZ"); var IE8_DOM_DEFINE = __webpack_require__("K6eN"); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__("/sOT"); var anObject = __webpack_require__("5+O3"); var toPropertyKey = __webpack_require__("+e1w"); var $TypeError = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /***/ "1uRk": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var zrUtil = __webpack_require__("/gxq"); var _clazz = __webpack_require__("BNYN"); var enableClassCheck = _clazz.enableClassCheck; /* * 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. */ // id may be function name of Object, add a prefix to avoid this problem. function generateNodeKey(id) { return '_EC_' + id; } /** * @alias module:echarts/data/Graph * @constructor * @param {boolean} directed */ var Graph = function (directed) { /** * 是否是有向图 * @type {boolean} * @private */ this._directed = directed || false; /** * @type {Array.} * @readOnly */ this.nodes = []; /** * @type {Array.} * @readOnly */ this.edges = []; /** * @type {Object.} * @private */ this._nodesMap = {}; /** * @type {Object.} * @private */ this._edgesMap = {}; /** * @type {module:echarts/data/List} * @readOnly */ this.data; /** * @type {module:echarts/data/List} * @readOnly */ this.edgeData; }; var graphProto = Graph.prototype; /** * @type {string} */ graphProto.type = 'graph'; /** * If is directed graph * @return {boolean} */ graphProto.isDirected = function () { return this._directed; }; /** * Add a new node * @param {string} id * @param {number} [dataIndex] */ graphProto.addNode = function (id, dataIndex) { id = id == null ? '' + dataIndex : '' + id; var nodesMap = this._nodesMap; if (nodesMap[generateNodeKey(id)]) { return; } var node = new Node(id, dataIndex); node.hostGraph = this; this.nodes.push(node); nodesMap[generateNodeKey(id)] = node; return node; }; /** * Get node by data index * @param {number} dataIndex * @return {module:echarts/data/Graph~Node} */ graphProto.getNodeByIndex = function (dataIndex) { var rawIdx = this.data.getRawIndex(dataIndex); return this.nodes[rawIdx]; }; /** * Get node by id * @param {string} id * @return {module:echarts/data/Graph.Node} */ graphProto.getNodeById = function (id) { return this._nodesMap[generateNodeKey(id)]; }; /** * Add a new edge * @param {number|string|module:echarts/data/Graph.Node} n1 * @param {number|string|module:echarts/data/Graph.Node} n2 * @param {number} [dataIndex=-1] * @return {module:echarts/data/Graph.Edge} */ graphProto.addEdge = function (n1, n2, dataIndex) { var nodesMap = this._nodesMap; var edgesMap = this._edgesMap; // PNEDING if (typeof n1 === 'number') { n1 = this.nodes[n1]; } if (typeof n2 === 'number') { n2 = this.nodes[n2]; } if (!Node.isInstance(n1)) { n1 = nodesMap[generateNodeKey(n1)]; } if (!Node.isInstance(n2)) { n2 = nodesMap[generateNodeKey(n2)]; } if (!n1 || !n2) { return; } var key = n1.id + '-' + n2.id; // PENDING if (edgesMap[key]) { return; } var edge = new Edge(n1, n2, dataIndex); edge.hostGraph = this; if (this._directed) { n1.outEdges.push(edge); n2.inEdges.push(edge); } n1.edges.push(edge); if (n1 !== n2) { n2.edges.push(edge); } this.edges.push(edge); edgesMap[key] = edge; return edge; }; /** * Get edge by data index * @param {number} dataIndex * @return {module:echarts/data/Graph~Node} */ graphProto.getEdgeByIndex = function (dataIndex) { var rawIdx = this.edgeData.getRawIndex(dataIndex); return this.edges[rawIdx]; }; /** * Get edge by two linked nodes * @param {module:echarts/data/Graph.Node|string} n1 * @param {module:echarts/data/Graph.Node|string} n2 * @return {module:echarts/data/Graph.Edge} */ graphProto.getEdge = function (n1, n2) { if (Node.isInstance(n1)) { n1 = n1.id; } if (Node.isInstance(n2)) { n2 = n2.id; } var edgesMap = this._edgesMap; if (this._directed) { return edgesMap[n1 + '-' + n2]; } else { return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1]; } }; /** * Iterate all nodes * @param {Function} cb * @param {*} [context] */ graphProto.eachNode = function (cb, context) { var nodes = this.nodes; var len = nodes.length; for (var i = 0; i < len; i++) { if (nodes[i].dataIndex >= 0) { cb.call(context, nodes[i], i); } } }; /** * Iterate all edges * @param {Function} cb * @param {*} [context] */ graphProto.eachEdge = function (cb, context) { var edges = this.edges; var len = edges.length; for (var i = 0; i < len; i++) { if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) { cb.call(context, edges[i], i); } } }; /** * Breadth first traverse * @param {Function} cb * @param {module:echarts/data/Graph.Node} startNode * @param {string} [direction='none'] 'none'|'in'|'out' * @param {*} [context] */ graphProto.breadthFirstTraverse = function (cb, startNode, direction, context) { if (!Node.isInstance(startNode)) { startNode = this._nodesMap[generateNodeKey(startNode)]; } if (!startNode) { return; } var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges'; for (var i = 0; i < this.nodes.length; i++) { this.nodes[i].__visited = false; } if (cb.call(context, startNode, null)) { return; } var queue = [startNode]; while (queue.length) { var currentNode = queue.shift(); var edges = currentNode[edgeType]; for (var i = 0; i < edges.length; i++) { var e = edges[i]; var otherNode = e.node1 === currentNode ? e.node2 : e.node1; if (!otherNode.__visited) { if (cb.call(context, otherNode, currentNode)) { // Stop traversing return; } queue.push(otherNode); otherNode.__visited = true; } } } }; // TODO // graphProto.depthFirstTraverse = function ( // cb, startNode, direction, context // ) { // }; // Filter update graphProto.update = function () { var data = this.data; var edgeData = this.edgeData; var nodes = this.nodes; var edges = this.edges; for (var i = 0, len = nodes.length; i < len; i++) { nodes[i].dataIndex = -1; } for (var i = 0, len = data.count(); i < len; i++) { nodes[data.getRawIndex(i)].dataIndex = i; } edgeData.filterSelf(function (idx) { var edge = edges[edgeData.getRawIndex(idx)]; return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0; }); // Update edge for (var i = 0, len = edges.length; i < len; i++) { edges[i].dataIndex = -1; } for (var i = 0, len = edgeData.count(); i < len; i++) { edges[edgeData.getRawIndex(i)].dataIndex = i; } }; /** * @return {module:echarts/data/Graph} */ graphProto.clone = function () { var graph = new Graph(this._directed); var nodes = this.nodes; var edges = this.edges; for (var i = 0; i < nodes.length; i++) { graph.addNode(nodes[i].id, nodes[i].dataIndex); } for (var i = 0; i < edges.length; i++) { var e = edges[i]; graph.addEdge(e.node1.id, e.node2.id, e.dataIndex); } return graph; }; /** * @alias module:echarts/data/Graph.Node */ function Node(id, dataIndex) { /** * @type {string} */ this.id = id == null ? '' : id; /** * @type {Array.} */ this.inEdges = []; /** * @type {Array.} */ this.outEdges = []; /** * @type {Array.} */ this.edges = []; /** * @type {module:echarts/data/Graph} */ this.hostGraph; /** * @type {number} */ this.dataIndex = dataIndex == null ? -1 : dataIndex; } Node.prototype = { constructor: Node, /** * @return {number} */ degree: function () { return this.edges.length; }, /** * @return {number} */ inDegree: function () { return this.inEdges.length; }, /** * @return {number} */ outDegree: function () { return this.outEdges.length; }, /** * @param {string} [path] * @return {module:echarts/model/Model} */ getModel: function (path) { if (this.dataIndex < 0) { return; } var graph = this.hostGraph; var itemModel = graph.data.getItemModel(this.dataIndex); return itemModel.getModel(path); } }; /** * 图边 * @alias module:echarts/data/Graph.Edge * @param {module:echarts/data/Graph.Node} n1 * @param {module:echarts/data/Graph.Node} n2 * @param {number} [dataIndex=-1] */ function Edge(n1, n2, dataIndex) { /** * 节点1,如果是有向图则为源节点 * @type {module:echarts/data/Graph.Node} */ this.node1 = n1; /** * 节点2,如果是有向图则为目标节点 * @type {module:echarts/data/Graph.Node} */ this.node2 = n2; this.dataIndex = dataIndex == null ? -1 : dataIndex; } /** * @param {string} [path] * @return {module:echarts/model/Model} */ Edge.prototype.getModel = function (path) { if (this.dataIndex < 0) { return; } var graph = this.hostGraph; var itemModel = graph.edgeData.getItemModel(this.dataIndex); return itemModel.getModel(path); }; var createGraphDataProxyMixin = function (hostName, dataName) { return { /** * @param {string=} [dimension='value'] Default 'value'. can be 'a', 'b', 'c', 'd', 'e'. * @return {number} */ getValue: function (dimension) { var data = this[hostName][dataName]; return data.get(data.getDimension(dimension || 'value'), this.dataIndex); }, /** * @param {Object|string} key * @param {*} [value] */ setVisual: function (key, value) { this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value); }, /** * @param {string} key * @return {boolean} */ getVisual: function (key, ignoreParent) { return this[hostName][dataName].getItemVisual(this.dataIndex, key, ignoreParent); }, /** * @param {Object} layout * @return {boolean} [merge=false] */ setLayout: function (layout, merge) { this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge); }, /** * @return {Object} */ getLayout: function () { return this[hostName][dataName].getItemLayout(this.dataIndex); }, /** * @return {module:zrender/Element} */ getGraphicEl: function () { return this[hostName][dataName].getItemGraphicEl(this.dataIndex); }, /** * @return {number} */ getRawIndex: function () { return this[hostName][dataName].getRawIndex(this.dataIndex); } }; }; zrUtil.mixin(Node, createGraphDataProxyMixin('hostGraph', 'data')); zrUtil.mixin(Edge, createGraphDataProxyMixin('hostGraph', 'edgeData')); Graph.Node = Node; Graph.Edge = Edge; enableClassCheck(Node); enableClassCheck(Edge); var _default = Graph; module.exports = _default; /***/ }), /***/ "1vD2": /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /***/ "1yV6": /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__("FHqv"); var ITERATOR = __webpack_require__("hgbu")('iterator'); var Iterators = __webpack_require__("yYxz"); module.exports = __webpack_require__("iANj").getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }), /***/ "2+22": /***/ (function(module, exports, __webpack_require__) { "use strict"; if (__webpack_require__("8yv5")) { var LIBRARY = __webpack_require__("G3Gk"); var global = __webpack_require__("vR0S"); var fails = __webpack_require__("HTem"); var $export = __webpack_require__("eqAp"); var $typed = __webpack_require__("Au7w"); var $buffer = __webpack_require__("Ee0C"); var ctx = __webpack_require__("wRig"); var anInstance = __webpack_require__("S5no"); var propertyDesc = __webpack_require__("D8PY"); var hide = __webpack_require__("CfIS"); var redefineAll = __webpack_require__("NmAK"); var toInteger = __webpack_require__("sxvG"); var toLength = __webpack_require__("J5DO"); var toIndex = __webpack_require__("4oJ4"); var toAbsoluteIndex = __webpack_require__("IfkE"); var toPrimitive = __webpack_require__("E2U5"); var has = __webpack_require__("3ty/"); var classof = __webpack_require__("bPSW"); var isObject = __webpack_require__("U9LJ"); var toObject = __webpack_require__("AeeY"); var isArrayIter = __webpack_require__("e1Y9"); var create = __webpack_require__("NkR5"); var getPrototypeOf = __webpack_require__("spe/"); var gOPN = __webpack_require__("XjC+").f; var getIterFn = __webpack_require__("JuSo"); var uid = __webpack_require__("guD1"); var wks = __webpack_require__("6hGG"); var createArrayMethod = __webpack_require__("Q2Ff"); var createArrayIncludes = __webpack_require__("VqU3"); var speciesConstructor = __webpack_require__("8rdt"); var ArrayIterators = __webpack_require__("K0e4"); var Iterators = __webpack_require__("xnnD"); var $iterDetect = __webpack_require__("GAJc"); var setSpecies = __webpack_require__("7QiM"); var arrayFill = __webpack_require__("T8YM"); var arrayCopyWithin = __webpack_require__("EAuC"); var $DP = __webpack_require__("rBVO"); var $GOPD = __webpack_require__("gWbE"); var dP = $DP.f; var gOPD = $GOPD.f; var RangeError = global.RangeError; var TypeError = global.TypeError; var Uint8Array = global.Uint8Array; var ARRAY_BUFFER = 'ArrayBuffer'; var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; var PROTOTYPE = 'prototype'; var ArrayProto = Array[PROTOTYPE]; var $ArrayBuffer = $buffer.ArrayBuffer; var $DataView = $buffer.DataView; var arrayForEach = createArrayMethod(0); var arrayFilter = createArrayMethod(2); var arraySome = createArrayMethod(3); var arrayEvery = createArrayMethod(4); var arrayFind = createArrayMethod(5); var arrayFindIndex = createArrayMethod(6); var arrayIncludes = createArrayIncludes(true); var arrayIndexOf = createArrayIncludes(false); var arrayValues = ArrayIterators.values; var arrayKeys = ArrayIterators.keys; var arrayEntries = ArrayIterators.entries; var arrayLastIndexOf = ArrayProto.lastIndexOf; var arrayReduce = ArrayProto.reduce; var arrayReduceRight = ArrayProto.reduceRight; var arrayJoin = ArrayProto.join; var arraySort = ArrayProto.sort; var arraySlice = ArrayProto.slice; var arrayToString = ArrayProto.toString; var arrayToLocaleString = ArrayProto.toLocaleString; var ITERATOR = wks('iterator'); var TAG = wks('toStringTag'); var TYPED_CONSTRUCTOR = uid('typed_constructor'); var DEF_CONSTRUCTOR = uid('def_constructor'); var ALL_CONSTRUCTORS = $typed.CONSTR; var TYPED_ARRAY = $typed.TYPED; var VIEW = $typed.VIEW; var WRONG_LENGTH = 'Wrong length!'; var $map = createArrayMethod(1, function (O, length) { return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); }); var LITTLE_ENDIAN = fails(function () { // eslint-disable-next-line no-undef return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; }); var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { new Uint8Array(1).set({}); }); var toOffset = function (it, BYTES) { var offset = toInteger(it); if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); return offset; }; var validate = function (it) { if (isObject(it) && TYPED_ARRAY in it) return it; throw TypeError(it + ' is not a typed array!'); }; var allocate = function (C, length) { if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { throw TypeError('It is not a typed array constructor!'); } return new C(length); }; var speciesFromList = function (O, list) { return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); }; var fromList = function (C, list) { var index = 0; var length = list.length; var result = allocate(C, length); while (length > index) result[index] = list[index++]; return result; }; var addGetter = function (it, key, internal) { dP(it, key, { get: function () { return this._d[internal]; } }); }; var $from = function from(source /* , mapfn, thisArg */) { var O = toObject(source); var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iterFn = getIterFn(O); var i, length, values, result, step, iterator; if (iterFn != undefined && !isArrayIter(iterFn)) { for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { values.push(step.value); } O = values; } if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { result[i] = mapping ? mapfn(O[i], i) : O[i]; } return result; }; var $of = function of(/* ...items */) { var index = 0; var length = arguments.length; var result = allocate(this, length); while (length > index) result[index] = arguments[index++]; return result; }; // iOS Safari 6.x fails here var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); var $toLocaleString = function toLocaleString() { return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); }; var proto = { copyWithin: function copyWithin(target, start /* , end */) { return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }, every: function every(callbackfn /* , thisArg */) { return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars return arrayFill.apply(validate(this), arguments); }, filter: function filter(callbackfn /* , thisArg */) { return speciesFromList(this, arrayFilter(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined)); }, find: function find(predicate /* , thisArg */) { return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }, findIndex: function findIndex(predicate /* , thisArg */) { return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }, forEach: function forEach(callbackfn /* , thisArg */) { arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, indexOf: function indexOf(searchElement /* , fromIndex */) { return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }, includes: function includes(searchElement /* , fromIndex */) { return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }, join: function join(separator) { // eslint-disable-line no-unused-vars return arrayJoin.apply(validate(this), arguments); }, lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars return arrayLastIndexOf.apply(validate(this), arguments); }, map: function map(mapfn /* , thisArg */) { return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); }, reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars return arrayReduce.apply(validate(this), arguments); }, reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars return arrayReduceRight.apply(validate(this), arguments); }, reverse: function reverse() { var that = this; var length = validate(that).length; var middle = Math.floor(length / 2); var index = 0; var value; while (index < middle) { value = that[index]; that[index++] = that[--length]; that[length] = value; } return that; }, some: function some(callbackfn /* , thisArg */) { return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, sort: function sort(comparefn) { return arraySort.call(validate(this), comparefn); }, subarray: function subarray(begin, end) { var O = validate(this); var length = O.length; var $begin = toAbsoluteIndex(begin, length); return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( O.buffer, O.byteOffset + $begin * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) ); } }; var $slice = function slice(start, end) { return speciesFromList(this, arraySlice.call(validate(this), start, end)); }; var $set = function set(arrayLike /* , offset */) { validate(this); var offset = toOffset(arguments[1], 1); var length = this.length; var src = toObject(arrayLike); var len = toLength(src.length); var index = 0; if (len + offset > length) throw RangeError(WRONG_LENGTH); while (index < len) this[offset + index] = src[index++]; }; var $iterators = { entries: function entries() { return arrayEntries.call(validate(this)); }, keys: function keys() { return arrayKeys.call(validate(this)); }, values: function values() { return arrayValues.call(validate(this)); } }; var isTAIndex = function (target, key) { return isObject(target) && target[TYPED_ARRAY] && typeof key != 'symbol' && key in target && String(+key) == String(key); }; var $getDesc = function getOwnPropertyDescriptor(target, key) { return isTAIndex(target, key = toPrimitive(key, true)) ? propertyDesc(2, target[key]) : gOPD(target, key); }; var $setDesc = function defineProperty(target, key, desc) { if (isTAIndex(target, key = toPrimitive(key, true)) && isObject(desc) && has(desc, 'value') && !has(desc, 'get') && !has(desc, 'set') // TODO: add validation descriptor w/o calling accessors && !desc.configurable && (!has(desc, 'writable') || desc.writable) && (!has(desc, 'enumerable') || desc.enumerable) ) { target[key] = desc.value; return target; } return dP(target, key, desc); }; if (!ALL_CONSTRUCTORS) { $GOPD.f = $getDesc; $DP.f = $setDesc; } $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { getOwnPropertyDescriptor: $getDesc, defineProperty: $setDesc }); if (fails(function () { arrayToString.call({}); })) { arrayToString = arrayToLocaleString = function toString() { return arrayJoin.call(this); }; } var $TypedArrayPrototype$ = redefineAll({}, proto); redefineAll($TypedArrayPrototype$, $iterators); hide($TypedArrayPrototype$, ITERATOR, $iterators.values); redefineAll($TypedArrayPrototype$, { slice: $slice, set: $set, constructor: function () { /* noop */ }, toString: arrayToString, toLocaleString: $toLocaleString }); addGetter($TypedArrayPrototype$, 'buffer', 'b'); addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); addGetter($TypedArrayPrototype$, 'byteLength', 'l'); addGetter($TypedArrayPrototype$, 'length', 'e'); dP($TypedArrayPrototype$, TAG, { get: function () { return this[TYPED_ARRAY]; } }); // eslint-disable-next-line max-statements module.exports = function (KEY, BYTES, wrapper, CLAMPED) { CLAMPED = !!CLAMPED; var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + KEY; var SETTER = 'set' + KEY; var TypedArray = global[NAME]; var Base = TypedArray || {}; var TAC = TypedArray && getPrototypeOf(TypedArray); var FORCED = !TypedArray || !$typed.ABV; var O = {}; var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; var getter = function (that, index) { var data = that._d; return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); }; var setter = function (that, index, value) { var data = that._d; if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); }; var addElement = function (that, index) { dP(that, index, { get: function () { return getter(this, index); }, set: function (value) { return setter(this, index, value); }, enumerable: true }); }; if (FORCED) { TypedArray = wrapper(function (that, data, $offset, $length) { anInstance(that, TypedArray, NAME, '_d'); var index = 0; var offset = 0; var buffer, byteLength, length, klass; if (!isObject(data)) { length = toIndex(data); byteLength = length * BYTES; buffer = new $ArrayBuffer(byteLength); } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { buffer = data; offset = toOffset($offset, BYTES); var $len = data.byteLength; if ($length === undefined) { if ($len % BYTES) throw RangeError(WRONG_LENGTH); byteLength = $len - offset; if (byteLength < 0) throw RangeError(WRONG_LENGTH); } else { byteLength = toLength($length) * BYTES; if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); } length = byteLength / BYTES; } else if (TYPED_ARRAY in data) { return fromList(TypedArray, data); } else { return $from.call(TypedArray, data); } hide(that, '_d', { b: buffer, o: offset, l: byteLength, e: length, v: new $DataView(buffer) }); while (index < length) addElement(that, index++); }); TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); hide(TypedArrayPrototype, 'constructor', TypedArray); } else if (!fails(function () { TypedArray(1); }) || !fails(function () { new TypedArray(-1); // eslint-disable-line no-new }) || !$iterDetect(function (iter) { new TypedArray(); // eslint-disable-line no-new new TypedArray(null); // eslint-disable-line no-new new TypedArray(1.5); // eslint-disable-line no-new new TypedArray(iter); // eslint-disable-line no-new }, true)) { TypedArray = wrapper(function (that, data, $offset, $length) { anInstance(that, TypedArray, NAME); var klass; // `ws` module bug, temporarily remove validation length for Uint8Array // https://github.com/websockets/ws/pull/645 if (!isObject(data)) return new Base(toIndex(data)); if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { return $length !== undefined ? new Base(data, toOffset($offset, BYTES), $length) : $offset !== undefined ? new Base(data, toOffset($offset, BYTES)) : new Base(data); } if (TYPED_ARRAY in data) return fromList(TypedArray, data); return $from.call(TypedArray, data); }); arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); }); TypedArray[PROTOTYPE] = TypedArrayPrototype; if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; } var $nativeIterator = TypedArrayPrototype[ITERATOR]; var CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); var $iterator = $iterators.values; hide(TypedArray, TYPED_CONSTRUCTOR, true); hide(TypedArrayPrototype, TYPED_ARRAY, NAME); hide(TypedArrayPrototype, VIEW, true); hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { dP(TypedArrayPrototype, TAG, { get: function () { return NAME; } }); } O[NAME] = TypedArray; $export($export.G + $export.W + $export.F * (TypedArray != Base), O); $export($export.S, NAME, { BYTES_PER_ELEMENT: BYTES }); $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { from: $from, of: $of }); if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); $export($export.P, NAME, proto); setSpecies(NAME); $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; $export($export.P + $export.F * fails(function () { new TypedArray(1).slice(); }), NAME, { slice: $slice }); $export($export.P + $export.F * (fails(function () { return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); }) || !fails(function () { TypedArrayPrototype.toLocaleString.call([1, 2]); })), NAME, { toLocaleString: $toLocaleString }); Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function () { /* empty */ }; /***/ }), /***/ "21It": /***/ (function(module, exports, __webpack_require__) { "use strict"; var createError = __webpack_require__("FtD3"); /** * Resolve or reject a Promise based on response status. * * @param {Function} resolve A function that resolves the promise. * @param {Function} reject A function that rejects the promise. * @param {object} response The response. */ module.exports = function settle(resolve, reject, response) { var validateStatus = response.config.validateStatus; if (!validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(createError( 'Request failed with status code ' + response.status, response.config, null, response.request, response )); } }; /***/ }), /***/ "26gs": /***/ (function(module, exports, __webpack_require__) { // 20.2.2.34 Math.trunc(x) var $export = __webpack_require__("eqAp"); $export($export.S, 'Math', { trunc: function trunc(it) { return (it > 0 ? Math.floor : Math.ceil)(it); } }); /***/ }), /***/ "28kU": /***/ (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; /***/ }), /***/ "2HHL": /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__("u4Az"); var defineBuiltIns = __webpack_require__("p0zm"); var getWeakData = __webpack_require__("0LGO").getWeakData; var anInstance = __webpack_require__("tyBP"); var anObject = __webpack_require__("5+O3"); var isNullOrUndefined = __webpack_require__("HrgD"); var isObject = __webpack_require__("HAas"); var iterate = __webpack_require__("UHV6"); var ArrayIterationModule = __webpack_require__("TRbm"); var hasOwn = __webpack_require__("M4w/"); var InternalStateModule = __webpack_require__("I1z2"); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; var find = ArrayIterationModule.find; var findIndex = ArrayIterationModule.findIndex; var splice = uncurryThis([].splice); var id = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (state) { return state.frozen || (state.frozen = new UncaughtFrozenStore()); }; var UncaughtFrozenStore = function () { this.entries = []; }; var findUncaughtFrozen = function (store, key) { return find(store.entries, function (it) { return it[0] === key; }); }; UncaughtFrozenStore.prototype = { get: function (key) { var entry = findUncaughtFrozen(this, key); if (entry) return entry[1]; }, has: function (key) { return !!findUncaughtFrozen(this, key); }, set: function (key, value) { var entry = findUncaughtFrozen(this, key); if (entry) entry[1] = value; else this.entries.push([key, value]); }, 'delete': function (key) { var index = findIndex(this.entries, function (it) { return it[0] === key; }); if (~index) splice(this.entries, index, 1); return !!~index; } }; module.exports = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function (that, iterable) { anInstance(that, Prototype); setInternalState(that, { type: CONSTRUCTOR_NAME, id: id++, frozen: undefined }); if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var data = getWeakData(anObject(key), true); if (data === true) uncaughtFrozenStore(state).set(key, value); else data[state.id] = value; return that; }; defineBuiltIns(Prototype, { // `{ WeakMap, WeakSet }.prototype.delete(key)` methods // https://tc39.es/ecma262/#sec-weakmap.prototype.delete // https://tc39.es/ecma262/#sec-weakset.prototype.delete 'delete': function (key) { var state = getInternalState(this); if (!isObject(key)) return false; var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state)['delete'](key); return data && hasOwn(data, state.id) && delete data[state.id]; }, // `{ WeakMap, WeakSet }.prototype.has(key)` methods // https://tc39.es/ecma262/#sec-weakmap.prototype.has // https://tc39.es/ecma262/#sec-weakset.prototype.has has: function has(key) { var state = getInternalState(this); if (!isObject(key)) return false; var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state).has(key); return data && hasOwn(data, state.id); } }); defineBuiltIns(Prototype, IS_MAP ? { // `WeakMap.prototype.get(key)` method // https://tc39.es/ecma262/#sec-weakmap.prototype.get get: function get(key) { var state = getInternalState(this); if (isObject(key)) { var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state).get(key); return data ? data[state.id] : undefined; } }, // `WeakMap.prototype.set(key, value)` method // https://tc39.es/ecma262/#sec-weakmap.prototype.set set: function set(key, value) { return define(this, key, value); } } : { // `WeakSet.prototype.add(value)` method // https://tc39.es/ecma262/#sec-weakset.prototype.add add: function add(value) { return define(this, value, true); } }); return Constructor; } }; /***/ }), /***/ "2HcM": /***/ (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__("/gxq"); var each = _util.each; var map = _util.map; var _number = __webpack_require__("wWR3"); var linearMap = _number.linearMap; var getPixelPrecision = _number.getPixelPrecision; var round = _number.round; var _axisTickLabelBuilder = __webpack_require__("SiPa"); var createAxisTicks = _axisTickLabelBuilder.createAxisTicks; var createAxisLabels = _axisTickLabelBuilder.createAxisLabels; var calculateCategoryInterval = _axisTickLabelBuilder.calculateCategoryInterval; /* * 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 NORMALIZED_EXTENT = [0, 1]; /** * Base class of Axis. * @constructor */ var Axis = function (dim, scale, extent) { /** * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'. * @type {string} */ this.dim = dim; /** * Axis scale * @type {module:echarts/coord/scale/*} */ this.scale = scale; /** * @type {Array.} * @private */ this._extent = extent || [0, 0]; /** * @type {boolean} */ this.inverse = false; /** * Usually true when axis has a ordinal scale * @type {boolean} */ this.onBand = false; }; Axis.prototype = { constructor: Axis, /** * If axis extent contain given coord * @param {number} coord * @return {boolean} */ contain: function (coord) { var extent = this._extent; var min = Math.min(extent[0], extent[1]); var max = Math.max(extent[0], extent[1]); return coord >= min && coord <= max; }, /** * If axis extent contain given data * @param {number} data * @return {boolean} */ containData: function (data) { return this.scale.contain(data); }, /** * Get coord extent. * @return {Array.} */ getExtent: function () { return this._extent.slice(); }, /** * Get precision used for formatting * @param {Array.} [dataExtent] * @return {number} */ getPixelPrecision: function (dataExtent) { return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent); }, /** * Set coord extent * @param {number} start * @param {number} end */ setExtent: function (start, end) { var extent = this._extent; extent[0] = start; extent[1] = end; }, /** * Convert data to coord. Data is the rank if it has an ordinal scale * @param {number} data * @param {boolean} clamp * @return {number} */ dataToCoord: function (data, clamp) { var extent = this._extent; var scale = this.scale; data = scale.normalize(data); if (this.onBand && scale.type === 'ordinal') { extent = extent.slice(); fixExtentWithBands(extent, scale.count()); } return linearMap(data, NORMALIZED_EXTENT, extent, clamp); }, /** * Convert coord to data. Data is the rank if it has an ordinal scale * @param {number} coord * @param {boolean} clamp * @return {number} */ coordToData: function (coord, clamp) { var extent = this._extent; var scale = this.scale; if (this.onBand && scale.type === 'ordinal') { extent = extent.slice(); fixExtentWithBands(extent, scale.count()); } var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp); return this.scale.scale(t); }, /** * Convert pixel point to data in axis * @param {Array.} point * @param {boolean} clamp * @return {number} data */ pointToData: function (point, clamp) {// Should be implemented in derived class if necessary. }, /** * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`, * `axis.getTicksCoords` considers `onBand`, which is used by * `boundaryGap:true` of category axis and splitLine and splitArea. * @param {Object} [opt] * @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. * @return {Array.} [{ * coord: ..., * tickValue: ... * }, ...] */ getTicksCoords: function (opt) { opt = opt || {}; var tickModel = opt.tickModel || this.getTickModel(); var result = createAxisTicks(this, tickModel); var ticks = result.ticks; var ticksCoords = map(ticks, function (tickValue) { return { coord: this.dataToCoord(tickValue), tickValue: tickValue }; }, this); var alignWithLabel = tickModel.get('alignWithLabel'); fixOnBandTicksCoords(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, * rawLabel: axis.scale.getLabel(tickValue) * tickValue: number * }, ...] */ getViewLabels: function () { return createAxisLabels(this).labels; }, /** * @return {module:echarts/coord/model/Model} */ getLabelModel: function () { return this.model.getModel('axisLabel'); }, /** * Notice here we only get the default tick model. For splitLine * or splitArea, we should pass the splitLineModel or splitAreaModel * manually when calling `getTicksCoords`. * In GL, this method may be overrided to: * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` * @return {module:echarts/coord/model/Model} */ getTickModel: function () { return this.model.getModel('axisTick'); }, /** * Get width of band * @return {number} */ getBandWidth: function () { var axisExtent = this._extent; var dataExtent = this.scale.getExtent(); var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data. len === 0 && (len = 1); var size = Math.abs(axisExtent[1] - axisExtent[0]); return Math.abs(size) / len; }, /** * @abstract * @return {boolean} Is horizontal */ isHorizontal: null, /** * @abstract * @return {number} Get axis rotate, by degree. */ getRotate: null, /** * Only be called in category axis. * Can be overrided, consider other axes like in 3D. * @return {number} Auto interval for cateogry axis tick and label */ calculateCategoryInterval: function () { return calculateCategoryInterval(this); } }; function fixExtentWithBands(extent, nTick) { var size = extent[1] - extent[0]; var len = nTick; var margin = size / len / 2; extent[0] += margin; extent[1] -= margin; } // If axis has labels [1, 2, 3, 4]. Bands on the axis are // |---1---|---2---|---3---|---4---|. // So the displayed ticks and splitLine/splitArea should between // each data item, otherwise cause misleading (e.g., split tow bars // of a single data item when there are two bar series). // Also consider if tickCategoryInterval > 0 and onBand, ticks and // splitLine/spliteArea should layout appropriately corresponding // to displayed labels. (So we should not use `getBandWidth` in this // case). function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) { var ticksLen = ticksCoords.length; if (!axis.onBand || alignWithLabel || !ticksLen) { return; } var axisExtent = axis.getExtent(); var last; var diffSize; if (ticksLen === 1) { ticksCoords[0].coord = axisExtent[0]; last = ticksCoords[1] = { coord: axisExtent[0] }; } else { var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; var shift = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; each(ticksCoords, function (ticksItem) { ticksItem.coord -= shift / 2; }); 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(); } if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) { ticksCoords.unshift({ coord: axisExtent[0] }); } if (littleThan(axisExtent[1], last.coord)) { clamp ? last.coord = axisExtent[1] : ticksCoords.pop(); } if (clamp && littleThan(last.coord, axisExtent[1])) { ticksCoords.push({ coord: axisExtent[1] }); } function littleThan(a, b) { // Avoid rounding error cause calculated tick coord different with extent. // It may cause an extra unecessary tick added. a = round(a); b = round(b); return inverse ? a > b : a < b; } } var _default = Axis; module.exports = _default; /***/ }), /***/ "2I/p": /***/ (function(module, exports, __webpack_require__) { var _util = __webpack_require__("ABnm"); 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; /***/ }), /***/ "2M5Q": /***/ (function(module, exports, __webpack_require__) { var PathProxy = __webpack_require__("moDv"); var line = __webpack_require__("u+XU"); var cubic = __webpack_require__("LICT"); var quadratic = __webpack_require__("oBGI"); var arc = __webpack_require__("2I/p"); var _util = __webpack_require__("ABnm"); var normalizeRadian = _util.normalizeRadian; var curve = __webpack_require__("AAi1"); var windingLine = __webpack_require__("QxFU"); 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; /***/ }), /***/ "2Ow2": /***/ (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 graphic = __webpack_require__("0sHC"); var ChartView = __webpack_require__("Ylhr"); /* * 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 DEFAULT_SMOOTH = 0.3; var ParallelView = ChartView.extend({ type: 'parallel', init: function () { /** * @type {module:zrender/container/Group} * @private */ this._dataGroup = new graphic.Group(); this.group.add(this._dataGroup); /** * @type {module:echarts/data/List} */ this._data; /** * @type {boolean} */ this._initialized; }, /** * @override */ render: function (seriesModel, ecModel, api, payload) { var dataGroup = this._dataGroup; var data = seriesModel.getData(); var oldData = this._data; var coordSys = seriesModel.coordinateSystem; var dimensions = coordSys.dimensions; var seriesScope = makeSeriesScope(seriesModel); data.diff(oldData).add(add).update(update).remove(remove).execute(); function add(newDataIndex) { var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys); updateElCommon(line, data, newDataIndex, seriesScope); } function update(newDataIndex, oldDataIndex) { var line = oldData.getItemGraphicEl(oldDataIndex); var points = createLinePoints(data, newDataIndex, dimensions, coordSys); data.setItemGraphicEl(newDataIndex, line); var animationModel = payload && payload.animation === false ? null : seriesModel; graphic.updateProps(line, { shape: { points: points } }, animationModel, newDataIndex); updateElCommon(line, data, newDataIndex, seriesScope); } function remove(oldDataIndex) { var line = oldData.getItemGraphicEl(oldDataIndex); dataGroup.remove(line); } // First create if (!this._initialized) { this._initialized = true; var clipPath = createGridClipShape(coordSys, seriesModel, function () { // Callback will be invoked immediately if there is no animation setTimeout(function () { dataGroup.removeClipPath(); }); }); dataGroup.setClipPath(clipPath); } this._data = data; }, incrementalPrepareRender: function (seriesModel, ecModel, api) { this._initialized = true; this._data = null; this._dataGroup.removeAll(); }, incrementalRender: function (taskParams, seriesModel, ecModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; var dimensions = coordSys.dimensions; var seriesScope = makeSeriesScope(seriesModel); for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) { var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys); line.incremental = true; updateElCommon(line, data, dataIndex, seriesScope); } }, dispose: function () {}, // _renderForProgressive: function (seriesModel) { // var dataGroup = this._dataGroup; // var data = seriesModel.getData(); // var oldData = this._data; // var coordSys = seriesModel.coordinateSystem; // var dimensions = coordSys.dimensions; // var option = seriesModel.option; // var progressive = option.progressive; // var smooth = option.smooth ? SMOOTH : null; // // In progressive animation is disabled, so use simple data diff, // // which effects performance less. // // (Typically performance for data with length 7000+ like: // // simpleDiff: 60ms, addEl: 184ms, // // in RMBP 2.4GHz intel i7, OSX 10.9 chrome 50.0.2661.102 (64-bit)) // if (simpleDiff(oldData, data, dimensions)) { // dataGroup.removeAll(); // data.each(function (dataIndex) { // addEl(data, dataGroup, dataIndex, dimensions, coordSys); // }); // } // updateElCommon(data, progressive, smooth); // // Consider switch between progressive and not. // data.__plProgressive = true; // this._data = data; // }, /** * @override */ remove: function () { this._dataGroup && this._dataGroup.removeAll(); this._data = null; } }); function createGridClipShape(coordSys, seriesModel, cb) { var parallelModel = coordSys.model; var rect = coordSys.getRect(); var rectEl = new graphic.Rect({ shape: { x: rect.x, y: rect.y, width: rect.width, height: rect.height } }); var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height'; rectEl.setShape(dim, 0); graphic.initProps(rectEl, { shape: { width: rect.width, height: rect.height } }, seriesModel, cb); return rectEl; } function createLinePoints(data, dataIndex, dimensions, coordSys) { var points = []; for (var i = 0; i < dimensions.length; i++) { var dimName = dimensions[i]; var value = data.get(data.mapDimension(dimName), dataIndex); if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) { points.push(coordSys.dataToPoint(value, dimName)); } } return points; } function addEl(data, dataGroup, dataIndex, dimensions, coordSys) { var points = createLinePoints(data, dataIndex, dimensions, coordSys); var line = new graphic.Polyline({ shape: { points: points }, silent: true, z2: 10 }); dataGroup.add(line); data.setItemGraphicEl(dataIndex, line); return line; } function makeSeriesScope(seriesModel) { var smooth = seriesModel.get('smooth', true); smooth === true && (smooth = DEFAULT_SMOOTH); return { lineStyle: seriesModel.getModel('lineStyle').getLineStyle(), smooth: smooth != null ? smooth : DEFAULT_SMOOTH }; } function updateElCommon(el, data, dataIndex, seriesScope) { var lineStyle = seriesScope.lineStyle; if (data.hasItemOption) { var lineStyleModel = data.getItemModel(dataIndex).getModel('lineStyle'); lineStyle = lineStyleModel.getLineStyle(); } el.useStyle(lineStyle); var elStyle = el.style; elStyle.fill = null; // lineStyle.color have been set to itemVisual in module:echarts/visual/seriesColor. elStyle.stroke = data.getItemVisual(dataIndex, 'color'); // lineStyle.opacity have been set to itemVisual in parallelVisual. elStyle.opacity = data.getItemVisual(dataIndex, 'opacity'); seriesScope.smooth && (el.shape.smooth = seriesScope.smooth); } // function simpleDiff(oldData, newData, dimensions) { // var oldLen; // if (!oldData // || !oldData.__plProgressive // || (oldLen = oldData.count()) !== newData.count() // ) { // return true; // } // var dimLen = dimensions.length; // for (var i = 0; i < oldLen; i++) { // for (var j = 0; j < dimLen; j++) { // if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) { // return true; // } // } // } // return false; // } // FIXME // 公用方法? function isEmptyValue(val, axisType) { return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value' } var _default = ParallelView; module.exports = _default; /***/ }), /***/ "2R19": /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from __webpack_require__("sGlJ")('Map'); /***/ }), /***/ "2S96": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var toSetLike = __webpack_require__("QZ6x"); var $union = __webpack_require__("vGez"); // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $({ target: 'Set', proto: true, real: true, forced: true }, { union: function union(other) { return call($union, this, toSetLike(other)); } }); /***/ }), /***/ "2Tep": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var thisNumberValue = __webpack_require__("g/qd"); var $repeat = __webpack_require__("8phf"); var log10 = __webpack_require__("Ln87"); var fails = __webpack_require__("r54x"); var $RangeError = RangeError; var $String = String; var $isFinite = isFinite; var abs = Math.abs; var floor = Math.floor; var pow = Math.pow; var round = Math.round; var nativeToExponential = uncurryThis(1.0.toExponential); var repeat = uncurryThis($repeat); var stringSlice = uncurryThis(''.slice); // Edge 17- var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11' // IE11- && Edge 14- && nativeToExponential(1.255, 2) === '1.25e+0' // FF86-, V8 ~ Chrome 49-50 && nativeToExponential(12345, 3) === '1.235e+4' // FF86-, V8 ~ Chrome 49-50 && nativeToExponential(25, 0) === '3e+1'; // IE8- var throwsOnInfinityFraction = function () { return fails(function () { nativeToExponential(1, Infinity); }) && fails(function () { nativeToExponential(1, -Infinity); }); }; // Safari <11 && FF <50 var properNonFiniteThisCheck = function () { return !fails(function () { nativeToExponential(Infinity, Infinity); nativeToExponential(NaN, Infinity); }); }; var FORCED = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFiniteThisCheck(); // `Number.prototype.toExponential` method // https://tc39.es/ecma262/#sec-number.prototype.toexponential $({ target: 'Number', proto: true, forced: FORCED }, { toExponential: function toExponential(fractionDigits) { var x = thisNumberValue(this); if (fractionDigits === undefined) return nativeToExponential(x); var f = toIntegerOrInfinity(fractionDigits); if (!$isFinite(x)) return String(x); // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation if (f < 0 || f > 20) throw $RangeError('Incorrect fraction digits'); if (ROUNDS_PROPERLY) return nativeToExponential(x, f); var s = ''; var m = ''; var e = 0; var c = ''; var d = ''; if (x < 0) { s = '-'; x = -x; } if (x === 0) { e = 0; m = repeat('0', f + 1); } else { // this block is based on https://gist.github.com/SheetJSDev/1100ad56b9f856c95299ed0e068eea08 // TODO: improve accuracy with big fraction digits var l = log10(x); e = floor(l); var n = 0; var w = pow(10, e - f); n = round(x / w); if (2 * x >= (2 * n + 1) * w) { n += 1; } if (n >= pow(10, f + 1)) { n /= 10; e += 1; } m = $String(n); } if (f !== 0) { m = stringSlice(m, 0, 1) + '.' + stringSlice(m, 1); } if (e === 0) { c = '+'; d = '0'; } else { c = e > 0 ? '+' : '-'; d = $String(abs(e)); } m += 'e' + c + d; return s + m; } }); /***/ }), /***/ "2UJr": /***/ (function(module, exports, __webpack_require__) { "use strict"; var collection = __webpack_require__("dliL"); var collectionWeak = __webpack_require__("2HHL"); // `WeakSet` constructor // https://tc39.es/ecma262/#sec-weakset-constructor collection('WeakSet', function (init) { return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionWeak); /***/ }), /***/ "2W4A": /***/ (function(module, exports) { /* * 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. */ function _default(ecModel) { ecModel.eachSeriesByType('map', function (seriesModel) { var colorList = seriesModel.get('color'); var itemStyleModel = seriesModel.getModel('itemStyle'); var areaColor = itemStyleModel.get('areaColor'); var color = itemStyleModel.get('color') || colorList[seriesModel.seriesIndex % colorList.length]; seriesModel.getData().setVisual({ 'areaColor': areaColor, 'color': color }); }); } module.exports = _default; /***/ }), /***/ "2XvD": /***/ (function(module, exports, __webpack_require__) { var _vector = __webpack_require__("C7PF"); 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; /***/ }), /***/ "2Zej": /***/ (function(module, exports) { module.exports = function (regExp, replace) { var replacer = replace === Object(replace) ? function (part) { return replace[part]; } : replace; return function (it) { return String(it).replace(regExp, replacer); }; }; /***/ }), /***/ "2gXL": /***/ (function(module, exports, __webpack_require__) { // 20.1.2.5 Number.isSafeInteger(number) var $export = __webpack_require__("eqAp"); var isInteger = __webpack_require__("nCxY"); var abs = Math.abs; $export($export.S, 'Number', { isSafeInteger: function isSafeInteger(number) { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); /***/ }), /***/ "2iT9": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__("XCQu"); /***/ }), /***/ "2kvA": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.isInContainer = exports.getScrollContainer = exports.isScroll = exports.getStyle = exports.once = exports.off = exports.on = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* istanbul ignore next */ exports.hasClass = hasClass; exports.addClass = addClass; exports.removeClass = removeClass; exports.setStyle = setStyle; var _vue = __webpack_require__("7+uW"); var _vue2 = _interopRequireDefault(_vue); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var isServer = _vue2.default.prototype.$isServer; var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; var MOZ_HACK_REGEXP = /^moz([A-Z])/; var ieVersion = isServer ? 0 : Number(document.documentMode); /* istanbul ignore next */ var trim = function trim(string) { return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ''); }; /* istanbul ignore next */ var camelCase = function camelCase(name) { return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) { return offset ? letter.toUpperCase() : letter; }).replace(MOZ_HACK_REGEXP, 'Moz$1'); }; /* istanbul ignore next */ var on = exports.on = function () { if (!isServer && document.addEventListener) { return function (element, event, handler) { if (element && event && handler) { element.addEventListener(event, handler, false); } }; } else { return function (element, event, handler) { if (element && event && handler) { element.attachEvent('on' + event, handler); } }; } }(); /* istanbul ignore next */ var off = exports.off = function () { if (!isServer && document.removeEventListener) { return function (element, event, handler) { if (element && event) { element.removeEventListener(event, handler, false); } }; } else { return function (element, event, handler) { if (element && event) { element.detachEvent('on' + event, handler); } }; } }(); /* istanbul ignore next */ var once = exports.once = function once(el, event, fn) { var listener = function listener() { if (fn) { fn.apply(this, arguments); } off(el, event, listener); }; on(el, event, listener); }; /* istanbul ignore next */ function hasClass(el, cls) { if (!el || !cls) return false; if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.'); if (el.classList) { return el.classList.contains(cls); } else { return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1; } }; /* istanbul ignore next */ function addClass(el, cls) { if (!el) return; var curClass = el.className; var classes = (cls || '').split(' '); for (var i = 0, j = classes.length; i < j; i++) { var clsName = classes[i]; if (!clsName) continue; if (el.classList) { el.classList.add(clsName); } else if (!hasClass(el, clsName)) { curClass += ' ' + clsName; } } if (!el.classList) { el.setAttribute('class', curClass); } }; /* istanbul ignore next */ function removeClass(el, cls) { if (!el || !cls) return; var classes = cls.split(' '); var curClass = ' ' + el.className + ' '; for (var i = 0, j = classes.length; i < j; i++) { var clsName = classes[i]; if (!clsName) continue; if (el.classList) { el.classList.remove(clsName); } else if (hasClass(el, clsName)) { curClass = curClass.replace(' ' + clsName + ' ', ' '); } } if (!el.classList) { el.setAttribute('class', trim(curClass)); } }; /* istanbul ignore next */ var getStyle = exports.getStyle = ieVersion < 9 ? function (element, styleName) { if (isServer) return; if (!element || !styleName) return null; styleName = camelCase(styleName); if (styleName === 'float') { styleName = 'styleFloat'; } try { switch (styleName) { case 'opacity': try { return element.filters.item('alpha').opacity / 100; } catch (e) { return 1.0; } default: return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null; } } catch (e) { return element.style[styleName]; } } : function (element, styleName) { if (isServer) return; if (!element || !styleName) return null; styleName = camelCase(styleName); if (styleName === 'float') { styleName = 'cssFloat'; } try { var computed = document.defaultView.getComputedStyle(element, ''); return element.style[styleName] || computed ? computed[styleName] : null; } catch (e) { return element.style[styleName]; } }; /* istanbul ignore next */ function setStyle(element, styleName, value) { if (!element || !styleName) return; if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') { for (var prop in styleName) { if (styleName.hasOwnProperty(prop)) { setStyle(element, prop, styleName[prop]); } } } else { styleName = camelCase(styleName); if (styleName === 'opacity' && ieVersion < 9) { element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')'; } else { element.style[styleName] = value; } } }; var isScroll = exports.isScroll = function isScroll(el, vertical) { if (isServer) return; var determinedDirection = vertical !== null && vertical !== undefined; var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow'); return overflow.match(/(scroll|auto|overlay)/); }; var getScrollContainer = exports.getScrollContainer = function getScrollContainer(el, vertical) { if (isServer) return; var parent = el; while (parent) { if ([window, document, document.documentElement].includes(parent)) { return window; } if (isScroll(parent, vertical)) { return parent; } parent = parent.parentNode; } return parent; }; var isInContainer = exports.isInContainer = function isInContainer(el, container) { if (isServer || !el || !container) return false; var elRect = el.getBoundingClientRect(); var containerRect = void 0; if ([window, document, document.documentElement, null, undefined].includes(container)) { containerRect = { top: 0, right: window.innerWidth, bottom: window.innerHeight, left: 0 }; } else { containerRect = container.getBoundingClientRect(); } return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right; }; /***/ }), /***/ "2m1D": /***/ (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 SeriesModel = __webpack_require__("EJsE"); var createListFromArray = __webpack_require__("ao1T"); /* * 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 _default = SeriesModel.extend({ type: 'series.__base_bar__', getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true }); }, getMarkerPosition: function (value) { var coordSys = this.coordinateSystem; if (coordSys) { // PENDING if clamp ? var pt = coordSys.dataToPoint(coordSys.clampData(value)); var data = this.getData(); var offset = data.getLayout('offset'); var size = data.getLayout('size'); var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1; pt[offsetIndex] += offset + size / 2; return pt; } return [NaN, NaN]; }, defaultOption: { zlevel: 0, // 一级层叠 z: 2, // 二级层叠 coordinateSystem: 'cartesian2d', legendHoverLink: true, // stack: null // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // 最小高度改为0 barMinHeight: 0, // 最小角度为0,仅对极坐标系下的柱状图有效 barMinAngle: 0, // cursor: null, large: false, largeThreshold: 400, progressive: 3e3, progressiveChunkMode: 'mod', // barMaxWidth: null, // In cartesian, the default value is 1. Otherwise null. // barMinWidth: null, // 默认自适应 // barWidth: null, // 柱间距离,默认为柱形宽度的30%,可设固定值 // barGap: '30%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 // barCategoryGap: '20%', // label: { // show: false // }, itemStyle: {}, emphasis: {} } }); module.exports = _default; /***/ }), /***/ "2m2c": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = __webpack_require__("DvwR"); var hiddenKeys = __webpack_require__("B5V0").concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); }; /***/ }), /***/ "2s+3": /***/ (function(module, exports) { // IEEE754 conversions based on https://github.com/feross/ieee754 var $Array = Array; var abs = Math.abs; var pow = Math.pow; var floor = Math.floor; var log = Math.log; var LN2 = Math.LN2; var pack = function (number, mantissaLength, bytes) { var buffer = $Array(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; var index = 0; var exponent, mantissa, c; number = abs(number); // eslint-disable-next-line no-self-compare -- NaN check if (number != number || number === Infinity) { // eslint-disable-next-line no-self-compare -- NaN check mantissa = number != number ? 1 : 0; exponent = eMax; } else { exponent = floor(log(number) / LN2); c = pow(2, -exponent); if (number * c < 1) { exponent--; c *= 2; } if (exponent + eBias >= 1) { number += rt / c; } else { number += rt * pow(2, 1 - eBias); } if (number * c >= 2) { exponent++; c /= 2; } if (exponent + eBias >= eMax) { mantissa = 0; exponent = eMax; } else if (exponent + eBias >= 1) { mantissa = (number * c - 1) * pow(2, mantissaLength); exponent = exponent + eBias; } else { mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); exponent = 0; } } while (mantissaLength >= 8) { buffer[index++] = mantissa & 255; mantissa /= 256; mantissaLength -= 8; } exponent = exponent << mantissaLength | mantissa; exponentLength += mantissaLength; while (exponentLength > 0) { buffer[index++] = exponent & 255; exponent /= 256; exponentLength -= 8; } buffer[--index] |= sign * 128; return buffer; }; var unpack = function (buffer, mantissaLength) { var bytes = buffer.length; var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; var nBits = exponentLength - 7; var index = bytes - 1; var sign = buffer[index--]; var exponent = sign & 127; var mantissa; sign >>= 7; while (nBits > 0) { exponent = exponent * 256 + buffer[index--]; nBits -= 8; } mantissa = exponent & (1 << -nBits) - 1; exponent >>= -nBits; nBits += mantissaLength; while (nBits > 0) { mantissa = mantissa * 256 + buffer[index--]; nBits -= 8; } if (exponent === 0) { exponent = 1 - eBias; } else if (exponent === eMax) { return mantissa ? NaN : sign ? -Infinity : Infinity; } else { mantissa = mantissa + pow(2, mantissaLength); exponent = exponent - eBias; } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); }; module.exports = { pack: pack, unpack: unpack }; /***/ }), /***/ "2tOJ": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("orv6"); __webpack_require__("vEM8"); /* * 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. */ // HINT Markpoint can't be used too much echarts.registerPreprocessor(function (opt) { // Make sure markPoint component is enabled opt.markPoint = opt.markPoint || {}; }); /***/ }), /***/ "2uoh": /***/ (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__("/gxq"); /* * 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. */ // import * as axisHelper from './axisHelper'; var _default = { /** * @param {boolean} origin * @return {number|string} min value or 'dataMin' or null/undefined (means auto) or NaN */ getMin: function (origin) { var option = this.option; var min = !origin && option.rangeStart != null ? option.rangeStart : option.min; if (this.axis && min != null && min !== 'dataMin' && typeof min !== 'function' && !zrUtil.eqNaN(min)) { min = this.axis.scale.parse(min); } return min; }, /** * @param {boolean} origin * @return {number|string} max value or 'dataMax' or null/undefined (means auto) or NaN */ getMax: function (origin) { var option = this.option; var max = !origin && option.rangeEnd != null ? option.rangeEnd : option.max; if (this.axis && max != null && max !== 'dataMax' && typeof max !== 'function' && !zrUtil.eqNaN(max)) { max = this.axis.scale.parse(max); } return max; }, /** * @return {boolean} */ getNeedCrossZero: function () { var option = this.option; return option.rangeStart != null || option.rangeEnd != null ? false : !option.scale; }, /** * Should be implemented by each axis model if necessary. * @return {module:echarts/model/Component} coordinate system model */ getCoordSysModel: zrUtil.noop, /** * @param {number} rangeStart Can only be finite number or null/undefined or NaN. * @param {number} rangeEnd Can only be finite number or null/undefined or NaN. */ setRange: function (rangeStart, rangeEnd) { this.option.rangeStart = rangeStart; this.option.rangeEnd = rangeEnd; }, /** * Reset range */ resetRange: function () { // rangeStart and rangeEnd is readonly. this.option.rangeStart = this.option.rangeEnd = null; } }; module.exports = _default; /***/ }), /***/ "2wSv": /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-string-pad-start-end var uncurryThis = __webpack_require__("u4Az"); var toLength = __webpack_require__("xDUa"); var toString = __webpack_require__("nnBu"); var $repeat = __webpack_require__("8phf"); var requireObjectCoercible = __webpack_require__("hiy0"); var repeat = uncurryThis($repeat); var stringSlice = uncurryThis(''.slice); var ceil = Math.ceil; // `String.prototype.{ padStart, padEnd }` methods implementation var createMethod = function (IS_END) { return function ($this, maxLength, fillString) { var S = toString(requireObjectCoercible($this)); var intMaxLength = toLength(maxLength); var stringLength = S.length; var fillStr = fillString === undefined ? ' ' : toString(fillString); var fillLen, stringFiller; if (intMaxLength <= stringLength || fillStr == '') return S; fillLen = intMaxLength - stringLength; stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length)); if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen); return IS_END ? S + stringFiller : stringFiller + S; }; }; module.exports = { // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart start: createMethod(false), // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend end: createMethod(true) }; /***/ }), /***/ "2wYL": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {var classof = __webpack_require__("raVe"); module.exports = typeof process != 'undefined' && classof(process) == 'process'; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("W2nU"))) /***/ }), /***/ "2zMK": /***/ (function(module, exports, __webpack_require__) { var $parseInt = __webpack_require__("vR0S").parseInt; var $trim = __webpack_require__("XOiX").trim; var ws = __webpack_require__("tBsZ"); var hex = /^[-+]?0[xX]/; module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; /***/ }), /***/ "30vf": /***/ (function(module, exports, __webpack_require__) { // most Object methods by ES6 should accept primitives var $export = __webpack_require__("Wdy1"); var core = __webpack_require__("iANj"); var fails = __webpack_require__("zyKz"); module.exports = function (KEY, exec) { var fn = (core.Object || {})[KEY] || Object[KEY]; var exp = {}; exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); }; /***/ }), /***/ "35LR": /***/ (function(module, exports, __webpack_require__) { var call = __webpack_require__("celx"); var isCallable = __webpack_require__("R09w"); var isObject = __webpack_require__("HAas"); var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw $TypeError("Can't convert object to primitive value"); }; /***/ }), /***/ "388n": /***/ (function(module, exports, __webpack_require__) { "use strict"; var apply = __webpack_require__("n561"); var call = __webpack_require__("celx"); var uncurryThis = __webpack_require__("u4Az"); var fixRegExpWellKnownSymbolLogic = __webpack_require__("ftyM"); var anObject = __webpack_require__("5+O3"); var isNullOrUndefined = __webpack_require__("HrgD"); var isRegExp = __webpack_require__("5in1"); var requireObjectCoercible = __webpack_require__("hiy0"); var speciesConstructor = __webpack_require__("Xfp1"); var advanceStringIndex = __webpack_require__("A9wm"); var toLength = __webpack_require__("xDUa"); var toString = __webpack_require__("nnBu"); var getMethod = __webpack_require__("YLw8"); var arraySlice = __webpack_require__("9i/z"); var callRegExpExec = __webpack_require__("B9ov"); var regexpExec = __webpack_require__("mtht"); var stickyHelpers = __webpack_require__("7bcd"); var fails = __webpack_require__("r54x"); var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var MAX_UINT32 = 0xFFFFFFFF; var min = Math.min; var $push = [].push; var exec = uncurryThis(/./.exec); var push = uncurryThis($push); var stringSlice = uncurryThis(''.slice); // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { // eslint-disable-next-line regexp/no-empty-group -- required for testing var re = /(?:)/; var originalExec = re.exec; re.exec = function () { return originalExec.apply(this, arguments); }; var result = 'ab'.split(re); return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; }); // @@split logic fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { var internalSplit; if ( 'abbc'.split(/(b)*/)[1] == 'c' || // eslint-disable-next-line regexp/no-empty-group -- required for testing 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing '.'.split(/()()/).length > 1 || ''.split(/.?/).length ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { var string = toString(requireObjectCoercible(this)); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (separator === undefined) return [string]; // If `separator` is not a regex, use native split if (!isRegExp(separator)) { return call(nativeSplit, string, separator, lim); } var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); var lastLastIndex = 0; // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var match, lastIndex, lastLength; while (match = call(regexpExec, separatorCopy, string)) { lastIndex = separatorCopy.lastIndex; if (lastIndex > lastLastIndex) { push(output, stringSlice(string, lastLastIndex, match.index)); if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1)); lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= lim) break; } if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop } if (lastLastIndex === string.length) { if (lastLength || !exec(separatorCopy, '')) push(output, ''); } else push(output, stringSlice(string, lastLastIndex)); return output.length > lim ? arraySlice(output, 0, lim) : output; }; // Chakra, V8 } else if ('0'.split(undefined, 0).length) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit); }; } else internalSplit = nativeSplit; return [ // `String.prototype.split` method // https://tc39.es/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible(this); var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT); return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (string, limit) { var rx = anObject(this); var S = toString(string); var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); if (res.done) return res.value; var C = speciesConstructor(rx, RegExp); var unicodeMatching = rx.unicode; var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (UNSUPPORTED_Y ? 'g' : 'y'); // ^(? + rx + ) is needed, in combination with some S slicing, to // simulate the 'y' flag. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; var p = 0; var q = 0; var A = []; while (q < S.length) { splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S); var e; if ( z === null || (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching); } else { push(A, stringSlice(S, p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { push(A, z[i]); if (A.length === lim) return A; } q = p = e; } } push(A, stringSlice(S, p)); return A; } ]; }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); /***/ }), /***/ "3CFP": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__("eqAp"); var toObject = __webpack_require__("AeeY"); var toPrimitive = __webpack_require__("E2U5"); $export($export.P + $export.F * __webpack_require__("HTem")(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; }), 'Date', { // eslint-disable-next-line no-unused-vars toJSON: function toJSON(key) { var O = toObject(this); var pv = toPrimitive(O); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); /***/ }), /***/ "3FgT": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var requireObjectCoercible = __webpack_require__("hiy0"); var toString = __webpack_require__("nnBu"); var charCodeAt = uncurryThis(''.charCodeAt); // `String.prototype.isWellFormed` method // https://github.com/tc39/proposal-is-usv-string $({ target: 'String', proto: true }, { isWellFormed: function isWellFormed() { var S = toString(requireObjectCoercible(this)); var length = S.length; for (var i = 0; i < length; i++) { var charCode = charCodeAt(S, i); // single UTF-16 code unit if ((charCode & 0xF800) != 0xD800) continue; // unpaired surrogate if (charCode >= 0xDC00 || ++i >= length || (charCodeAt(S, i) & 0xFC00) != 0xDC00) return false; } return true; } }); /***/ }), /***/ "3GnB": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var isArray = __webpack_require__("rF9q"); var nativeReverse = uncurryThis([].reverse); var test = [1, 2]; // `Array.prototype.reverse` method // https://tc39.es/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { reverse: function reverse() { // eslint-disable-next-line no-self-assign -- dirty hack if (isArray(this)) this.length = this.length; return nativeReverse(this); } }); /***/ }), /***/ "3HN9": /***/ (function(module, exports, __webpack_require__) { "use strict"; // 25.4.1.5 NewPromiseCapability(C) var aFunction = __webpack_require__("SWGL"); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /***/ "3IRH": /***/ (function(module, exports) { module.exports = function(module) { if(!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if(!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ "3InL": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove this module from `core-js@4` since it's replaced to module below __webpack_require__("atE9"); /***/ }), /***/ "3Ipg": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var toObject = __webpack_require__("EJk4"); var nativeKeys = __webpack_require__("/09a"); var fails = __webpack_require__("r54x"); var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { keys: function keys(it) { return nativeKeys(toObject(it)); } }); /***/ }), /***/ "3K1F": /***/ (function(module, exports, __webpack_require__) { // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = __webpack_require__("eqAp"); $export($export.S, 'Math', { iaddh: function iaddh(x0, x1, y0, y1) { var $x0 = x0 >>> 0; var $x1 = x1 >>> 0; var $y0 = y0 >>> 0; return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; } }); /***/ }), /***/ "3Nrx": /***/ (function(module, exports, __webpack_require__) { var isCallable = __webpack_require__("R09w"); var isObject = __webpack_require__("HAas"); var setPrototypeOf = __webpack_require__("jE8y"); // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; /***/ }), /***/ "3Qkz": /***/ (function(module, exports, __webpack_require__) { // https://github.com/benjamingr/RexExp.escape var $export = __webpack_require__("eqAp"); var $re = __webpack_require__("2Zej")(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); /***/ }), /***/ "3R7/": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var fails = __webpack_require__("r54x"); var isObject = __webpack_require__("HAas"); var classof = __webpack_require__("raVe"); var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__("XW4J"); // eslint-disable-next-line es/no-object-issealed -- safe var $isSealed = Object.isSealed; var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isSealed(1); }); // `Object.isSealed` method // https://tc39.es/ecma262/#sec-object.issealed $({ target: 'Object', stat: true, forced: FORCED }, { isSealed: function isSealed(it) { if (!isObject(it)) return true; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return true; return $isSealed ? $isSealed(it) : false; } }); /***/ }), /***/ "3SRA": /***/ (function(module, exports, __webpack_require__) { // TODO: remove from `core-js@4` var defineWellKnownSymbol = __webpack_require__("8lki"); defineWellKnownSymbol('replaceAll'); /***/ }), /***/ "3Ss1": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var toObject = __webpack_require__("EJk4"); var toAbsoluteIndex = __webpack_require__("40wi"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var setArrayLength = __webpack_require__("srEh"); var doesNotExceedSafeInteger = __webpack_require__("Qccm"); var arraySpeciesCreate = __webpack_require__("MkIS"); var createProperty = __webpack_require__("hffE"); var deletePropertyOrThrow = __webpack_require__("qDCd"); var arrayMethodHasSpeciesSupport = __webpack_require__("pVRE"); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); var max = Math.max; var min = Math.min; // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice(start, deleteCount /* , ...items */) { var O = toObject(this); var len = lengthOfArrayLike(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var insertCount, actualDeleteCount, A, k, from, to; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { insertCount = argumentsLength - 2; actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); } doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); A = arraySpeciesCreate(O, actualDeleteCount); for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; if (from in O) createProperty(A, k, O[from]); } A.length = actualDeleteCount; if (insertCount < actualDeleteCount) { for (k = actualStart; k < len - actualDeleteCount; k++) { from = k + actualDeleteCount; to = k + insertCount; if (from in O) O[to] = O[from]; else deletePropertyOrThrow(O, to); } for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1); } else if (insertCount > actualDeleteCount) { for (k = len - actualDeleteCount; k > actualStart; k--) { from = k + actualDeleteCount - 1; to = k + insertCount - 1; if (from in O) O[to] = O[from]; else deletePropertyOrThrow(O, to); } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } setArrayLength(O, len - actualDeleteCount + insertCount); return A; } }); /***/ }), /***/ "3SyC": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var ReflectMetadataModule = __webpack_require__("AmrS"); var anObject = __webpack_require__("5+O3"); var toMetadataKey = ReflectMetadataModule.toKey; var getOrCreateMetadataMap = ReflectMetadataModule.getMap; var store = ReflectMetadataModule.store; // `Reflect.deleteMetadata` method // https://github.com/rbuckton/reflect-metadata $({ target: 'Reflect', stat: true }, { deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; if (metadataMap.size) return true; var targetMetadata = store.get(target); targetMetadata['delete'](targetKey); return !!targetMetadata.size || store['delete'](target); } }); /***/ }), /***/ "3TcY": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("2+22")('Int8', 1, function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); /***/ }), /***/ "3WJ9": /***/ (function(module, exports, __webpack_require__) { // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables = __webpack_require__("HLWT"); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('flatMap'); /***/ }), /***/ "3dPm": /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__("aqbq"); var isCallable = __webpack_require__("R09w"); var isPrototypeOf = __webpack_require__("Epdv"); var USE_SYMBOL_AS_UID = __webpack_require__("TwS1"); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; /***/ }), /***/ "3eLD": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var getCompositeKeyNode = __webpack_require__("4Y+y"); var getBuiltIn = __webpack_require__("aqbq"); var apply = __webpack_require__("n561"); // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey $({ global: true, forced: true }, { compositeSymbol: function compositeSymbol() { if (arguments.length == 1 && typeof arguments[0] == 'string') return getBuiltIn('Symbol')['for'](arguments[0]); return apply(getCompositeKeyNode, null, arguments).get('symbol', getBuiltIn('Symbol')); } }); /***/ }), /***/ "3fMt": /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__("SWGL"); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /***/ "3fo+": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("YAhB"); /***/ }), /***/ "3gWO": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.15 Object.preventExtensions(O) var isObject = __webpack_require__("U9LJ"); var meta = __webpack_require__("QhHn").onFreeze; __webpack_require__("Iiwq")('preventExtensions', function ($preventExtensions) { return function preventExtensions(it) { return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); /***/ }), /***/ "3ggi": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("Ntt2")('asyncIterator'); /***/ }), /***/ "3h1/": /***/ (function(module, exports, __webpack_require__) { var BoundingRect = __webpack_require__("8b51"); var imageHelper = __webpack_require__("+Y0c"); var _util = __webpack_require__("/gxq"); 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; /***/ }), /***/ "3jLb": /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-string-pad-start-end var toLength = __webpack_require__("J5DO"); var repeat = __webpack_require__("sbdb"); var defined = __webpack_require__("VmoO"); module.exports = function (that, maxLength, fillString, left) { var S = String(defined(that)); var stringLength = S.length; var fillStr = fillString === undefined ? ' ' : String(fillString); var intMaxLength = toLength(maxLength); if (intMaxLength <= stringLength || fillStr == '') return S; var fillLen = intMaxLength - stringLength; var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); return left ? stringFiller + S : S + stringFiller; }; /***/ }), /***/ "3jvX": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var isDisjointFrom = __webpack_require__("1oQN"); var setMethodAcceptSetLike = __webpack_require__("Rb8c"); // `Set.prototype.isDisjointFrom` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, { isDisjointFrom: isDisjointFrom }); /***/ }), /***/ "3mz+": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); var DOMIterables = __webpack_require__("PedI"); var DOMTokenListPrototype = __webpack_require__("+2s9"); var ArrayIteratorMethods = __webpack_require__("a/rO"); var createNonEnumerableProperty = __webpack_require__("asqq"); var wellKnownSymbol = __webpack_require__("jAiL"); var ITERATOR = wellKnownSymbol('iterator'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { if (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[ITERATOR] !== ArrayValues) try { createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues; } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; } } } }; for (var COLLECTION_NAME in DOMIterables) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); /***/ }), /***/ "3n/B": /***/ (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. */ __webpack_require__("PBlc"); __webpack_require__("0BNI"); /***/ }), /***/ "3tLj": /***/ (function(module, exports, __webpack_require__) { // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = __webpack_require__("gWbE"); var $export = __webpack_require__("eqAp"); var anObject = __webpack_require__("PGRs"); $export($export.S, 'Reflect', { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return gOPD.f(anObject(target), propertyKey); } }); /***/ }), /***/ "3ty/": /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /***/ "3wCF": /***/ (function(module, exports, __webpack_require__) { "use strict"; // TODO: Remove from `core-js@4` var $ = __webpack_require__("i9tX"); var $group = __webpack_require__("utmi"); var arrayMethodIsStrict = __webpack_require__("KwSm"); var addToUnscopables = __webpack_require__("HLWT"); // `Array.prototype.groupBy` method // https://github.com/tc39/proposal-array-grouping // https://bugs.webkit.org/show_bug.cgi?id=236541 $({ target: 'Array', proto: true, forced: !arrayMethodIsStrict('groupBy') }, { groupBy: function groupBy(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $group(this, callbackfn, thisArg); } }); addToUnscopables('groupBy'); /***/ }), /***/ "3xUX": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); var globalIsFinite = global.isFinite; // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite // eslint-disable-next-line es/no-number-isfinite -- safe module.exports = Number.isFinite || function isFinite(it) { return typeof it == 'number' && globalIsFinite(it); }; /***/ }), /***/ "3yJd": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var zrUtil = __webpack_require__("/gxq"); var OrdinalScale = __webpack_require__("u5Nq"); var IntervalScale = __webpack_require__("tBuv"); var Scale = __webpack_require__("/+sa"); var numberUtil = __webpack_require__("wWR3"); var _barGrid = __webpack_require__("m/6y"); var prepareLayoutBarSeries = _barGrid.prepareLayoutBarSeries; var makeColumnLayout = _barGrid.makeColumnLayout; var retrieveColumnLayout = _barGrid.retrieveColumnLayout; var BoundingRect = __webpack_require__("8b51"); __webpack_require__("dDRy"); __webpack_require__("xCbH"); /* * 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. */ /** * Get axis scale extent before niced. * Item of returned array can only be number (including Infinity and NaN). */ function getScaleExtent(scale, model) { var scaleType = scale.type; var min = model.getMin(); var max = model.getMax(); var originalExtent = scale.getExtent(); var axisDataLen; var boundaryGap; var span; if (scaleType === 'ordinal') { axisDataLen = model.getCategories().length; } else { boundaryGap = model.get('boundaryGap'); if (!zrUtil.isArray(boundaryGap)) { boundaryGap = [boundaryGap || 0, boundaryGap || 0]; } if (typeof boundaryGap[0] === 'boolean') { boundaryGap = [0, 0]; } boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1); boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1); span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]); } // Notice: When min/max is not set (that is, when there are null/undefined, // which is the most common case), these cases should be ensured: // (1) For 'ordinal', show all axis.data. // (2) For others: // + `boundaryGap` is applied (if min/max set, boundaryGap is // disabled). // + If `needCrossZero`, min/max should be zero, otherwise, min/max should // be the result that originalExtent enlarged by boundaryGap. // (3) If no data, it should be ensured that `scale.setBlank` is set. // FIXME // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used? // (2) When `needCrossZero` and all data is positive/negative, should it be ensured // that the results processed by boundaryGap are positive/negative? if (min === 'dataMin') { min = originalExtent[0]; } else if (typeof min === 'function') { min = min({ min: originalExtent[0], max: originalExtent[1] }); } if (max === 'dataMax') { max = originalExtent[1]; } else if (typeof max === 'function') { max = max({ min: originalExtent[0], max: originalExtent[1] }); } 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); scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero if (model.getNeedCrossZero()) { // Axis is over zero and min is not set if (min > 0 && max > 0 && !fixMin) { min = 0; } // Axis is under zero and max is not set if (min < 0 && max < 0 && !fixMax) { max = 0; } } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis // is base axis // FIXME // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly. // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent? // Should not depend on series type `bar`? // (3) Fix that might overlap when using dataZoom. // (4) Consider other chart types using `barGrid`? // See #6728, #4862, `test/bar-overflow-time-plot.html` var ecModel = model.ecModel; if (ecModel && scaleType === 'time' /*|| scaleType === 'interval' */ ) { var barSeriesModels = prepareLayoutBarSeries('bar', ecModel); var isBaseAxisAndHasBarSeries; zrUtil.each(barSeriesModels, function (seriesModel) { isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis; }); if (isBaseAxisAndHasBarSeries) { // Calculate placement of bars on axis var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset); min = adjustedScale.min; max = adjustedScale.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) { // Get Axis Length var axisExtent = model.axis.getExtent(); var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); if (barsOnCurrentAxis === undefined) { return { min: min, max: max }; } var minOverflow = Infinity; zrUtil.each(barsOnCurrentAxis, function (item) { minOverflow = Math.min(item.offset, minOverflow); }); var maxOverflow = -Infinity; zrUtil.each(barsOnCurrentAxis, function (item) { maxOverflow = Math.max(item.offset + item.width, maxOverflow); }); minOverflow = Math.abs(minOverflow); maxOverflow = Math.abs(maxOverflow); var totalOverFlow = minOverflow + maxOverflow; // Calulate required buffer based on old range and overflow var oldRange = max - min; var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength; var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange; max += overflowBuffer * (maxOverflow / totalOverFlow); min -= overflowBuffer * (minOverflow / totalOverFlow); return { min: min, max: max }; } function niceScaleExtent(scale, model) { var extentInfo = getScaleExtent(scale, model); var extent = extentInfo.extent; var splitNumber = model.get('splitNumber'); if (scale.type === 'log') { scale.base = model.get('logBase'); } var scaleType = scale.type; scale.setExtent(extent[0], extent[1]); scale.niceExtent({ splitNumber: splitNumber, fixMin: extentInfo.fixMin, fixMax: extentInfo.fixMax, minInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('minInterval') : null, maxInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('maxInterval') : null }); // If some one specified the min, max. And the default calculated interval // is not good enough. He can specify the interval. It is often appeared // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard // to be 60. // FIXME var interval = model.get('interval'); if (interval != null) { scale.setInterval && scale.setInterval(interval); } } /** * @param {module:echarts/model/Model} model * @param {string} [axisType] Default retrieve from model.type * @return {module:echarts/scale/*} */ function createScaleByModel(model, axisType) { axisType = axisType || model.get('type'); if (axisType) { switch (axisType) { // Buildin scale case 'category': return new OrdinalScale(model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), [Infinity, -Infinity]); case 'value': return new IntervalScale(); // Extended scale, like time and log default: return (Scale.getClass(axisType) || IntervalScale).create(model); } } } /** * Check if the axis corss 0 */ function ifAxisCrossZero(axis) { var dataExtent = axis.scale.getExtent(); var min = dataExtent[0]; var max = dataExtent[1]; return !(min > 0 && max > 0 || min < 0 && max < 0); } /** * @param {module:echarts/coord/Axis} axis * @return {Function} Label formatter function. * param: {number} tickValue, * param: {number} idx, the index in all ticks. * If category axis, this param is not requied. * return: {string} label string. */ function makeLabelFormatter(axis) { var labelFormatter = axis.getLabelModel().get('formatter'); var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null; if (typeof labelFormatter === 'string') { labelFormatter = function (tpl) { return function (val) { // For category axis, get raw value; for numeric axis, // get foramtted label like '1,333,444'. val = axis.scale.getLabel(val); return tpl.replace('{value}', val != null ? val : ''); }; }(labelFormatter); // Consider empty array return labelFormatter; } else if (typeof labelFormatter === 'function') { return function (tickValue, idx) { // The original intention of `idx` is "the index of the tick in all ticks". // But the previous implementation of category axis do not consider the // `axisLabel.interval`, which cause that, for example, the `interval` is // `1`, then the ticks "name5", "name7", "name9" are displayed, where the // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep // the definition here for back compatibility. if (categoryTickStart != null) { idx = tickValue - categoryTickStart; } return labelFormatter(getAxisRawValue(axis, tickValue), idx); }; } else { return function (tick) { return axis.scale.getLabel(tick); }; } } function getAxisRawValue(axis, value) { // In category axis with data zoom, tick is not the original // index of axis.data. So tick should not be exposed to user // in category axis. return axis.type === 'category' ? axis.scale.getLabel(value) : value; } /** * @param {module:echarts/coord/Axis} axis * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels. */ function estimateLabelUnionRect(axis) { var axisModel = axis.model; var scale = axis.scale; if (!axisModel.get('axisLabel.show') || scale.isBlank()) { return; } var isCategory = axis.type === 'category'; var realNumberScaleTicks; var tickCount; var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`. if (isCategory) { tickCount = scale.count(); } else { realNumberScaleTicks = scale.getTicks(); tickCount = realNumberScaleTicks.length; } var axisLabelModel = axis.getLabelModel(); var labelFormatter = makeLabelFormatter(axis); var rect; var step = 1; // Simple optimization for large amount of labels if (tickCount > 40) { step = Math.ceil(tickCount / 40); } for (var i = 0; i < tickCount; i += step) { var tickValue = realNumberScaleTicks ? realNumberScaleTicks[i] : categoryScaleExtent[0] + i; var label = labelFormatter(tickValue); var unrotatedSingleRect = axisLabelModel.getTextRect(label); var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0); rect ? rect.union(singleRect) : rect = singleRect; } return rect; } function rotateTextRect(textRect, rotate) { var rotateRadians = rotate * Math.PI / 180; var boundingBox = textRect.plain(); var beforeWidth = boundingBox.width; var beforeHeight = boundingBox.height; var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians); var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians); var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight); 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; } exports.getScaleExtent = getScaleExtent; exports.niceScaleExtent = niceScaleExtent; exports.createScaleByModel = createScaleByModel; exports.ifAxisCrossZero = ifAxisCrossZero; exports.makeLabelFormatter = makeLabelFormatter; exports.getAxisRawValue = getAxisRawValue; exports.estimateLabelUnionRect = estimateLabelUnionRect; exports.getOptionCategoryInterval = getOptionCategoryInterval; exports.shouldShowAllLabels = shouldShowAllLabels; /***/ }), /***/ "40Lg": /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__("jgJS"); var hasOwn = __webpack_require__("M4w/"); var isNullOrUndefined = __webpack_require__("HrgD"); var wellKnownSymbol = __webpack_require__("jAiL"); var Iterators = __webpack_require__("eZ0g"); var ITERATOR = wellKnownSymbol('iterator'); var $Object = Object; module.exports = function (it) { if (isNullOrUndefined(it)) return false; var O = $Object(it); return O[ITERATOR] !== undefined || '@@iterator' in O || hasOwn(Iterators, classof(O)); }; /***/ }), /***/ "40wi": /***/ (function(module, exports, __webpack_require__) { var toIntegerOrInfinity = __webpack_require__("SXvu"); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /***/ "42YS": /***/ (function(module, exports, __webpack_require__) { var Animator = __webpack_require__("CCtz"); var logError = __webpack_require__("eZxa"); var _util = __webpack_require__("/gxq"); 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; /***/ }), /***/ "43ae": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var echarts = __webpack_require__("Icdr"); var axisPointerModelHelper = __webpack_require__("QCrJ"); /* * 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. */ /** * Base class of AxisView. */ var AxisView = echarts.extendComponentView({ type: 'axis', /** * @private */ _axisPointer: null, /** * @protected * @type {string} */ axisPointerClass: null, /** * @override */ render: function (axisModel, ecModel, api, payload) { // FIXME // This process should proformed after coordinate systems updated // (axis scale updated), and should be performed each time update. // So put it here temporarily, although it is not appropriate to // put a model-writing procedure in `view`. this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel); AxisView.superApply(this, 'render', arguments); updateAxisPointer(this, axisModel, ecModel, api, payload, true); }, /** * Action handler. * @public * @param {module:echarts/coord/cartesian/AxisModel} axisModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ updateAxisPointer: function (axisModel, ecModel, api, payload, force) { updateAxisPointer(this, axisModel, ecModel, api, payload, false); }, /** * @override */ remove: function (ecModel, api) { var axisPointer = this._axisPointer; axisPointer && axisPointer.remove(api); AxisView.superApply(this, 'remove', arguments); }, /** * @override */ dispose: function (ecModel, api) { disposeAxisPointer(this, api); AxisView.superApply(this, 'dispose', arguments); } }); function updateAxisPointer(axisView, axisModel, ecModel, api, payload, forceRender) { var Clazz = AxisView.getAxisPointerClass(axisView.axisPointerClass); if (!Clazz) { return; } var axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel); axisPointerModel ? (axisView._axisPointer || (axisView._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : disposeAxisPointer(axisView, api); } function disposeAxisPointer(axisView, ecModel, api) { var axisPointer = axisView._axisPointer; axisPointer && axisPointer.dispose(ecModel, api); axisView._axisPointer = null; } var axisPointerClazz = []; AxisView.registerAxisPointerClass = function (type, clazz) { axisPointerClazz[type] = clazz; }; AxisView.getAxisPointerClass = function (type) { return type && axisPointerClazz[type]; }; var _default = AxisView; module.exports = _default; /***/ }), /***/ "43zn": /***/ (function(module, exports, __webpack_require__) { /* global ActiveXObject -- old IE, WSH */ var anObject = __webpack_require__("5+O3"); var definePropertiesModule = __webpack_require__("o/tC"); var enumBugKeys = __webpack_require__("YveC"); var hiddenKeys = __webpack_require__("Eb96"); var html = __webpack_require__("N5RP"); var documentCreateElement = __webpack_require__("P1fK"); var sharedKey = __webpack_require__("siPu"); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create // eslint-disable-next-line es/no-object-create -- safe module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; /***/ }), /***/ "45zI": /***/ (function(module, exports, __webpack_require__) { "use strict"; // `Symbol.prototype.description` getter // https://tc39.es/ecma262/#sec-symbol.prototype.description var $ = __webpack_require__("i9tX"); var DESCRIPTORS = __webpack_require__("q0qZ"); var global = __webpack_require__("hcE8"); var uncurryThis = __webpack_require__("u4Az"); var hasOwn = __webpack_require__("M4w/"); var isCallable = __webpack_require__("R09w"); var isPrototypeOf = __webpack_require__("Epdv"); var toString = __webpack_require__("nnBu"); var defineBuiltInAccessor = __webpack_require__("5MpO"); var copyConstructorProperties = __webpack_require__("PYrI"); var NativeSymbol = global.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || // Safari 12 bug NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; // wrap Symbol constructor for correct work with undefined description var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties(SymbolWrapper, NativeSymbol); SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)'; var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = thisSymbolValue(this); if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; var string = symbolDescriptiveString(symbol); var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1'); return desc === '' ? undefined : desc; } }); $({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } /***/ }), /***/ "46HX": /***/ (function(module, exports, __webpack_require__) { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = __webpack_require__("eqAp"); $export($export.P, 'Array', { copyWithin: __webpack_require__("EAuC") }); __webpack_require__("5BZE")('copyWithin'); /***/ }), /***/ "46eW": /***/ (function(module, exports, __webpack_require__) { var Path = __webpack_require__("GxVO"); /** * 圆弧 * @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; /***/ }), /***/ "48Hh": /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__("eqAp"); var fails = __webpack_require__("HTem"); var defined = __webpack_require__("VmoO"); var quot = /"/g; // B.2.3.2.1 CreateHTML(string, tag, attribute, value) var createHTML = function (string, tag, attribute, value) { var S = String(defined(string)); var p1 = '<' + tag; if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; return p1 + '>' + S + ''; }; module.exports = function (NAME, exec) { var O = {}; O[NAME] = exec(createHTML); $export($export.P + $export.F * fails(function () { var test = ''[NAME]('"'); return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; /***/ }), /***/ "4A6G": /***/ (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 createRenderPlanner = __webpack_require__("CqCN"); /* * 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 Float32Array */ var _default = { seriesType: 'lines', plan: createRenderPlanner(), reset: function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var isPolyline = seriesModel.get('polyline'); var isLarge = seriesModel.pipelineContext.large; function progress(params, lineData) { var lineCoords = []; if (isLarge) { var points; var segCount = params.end - params.start; if (isPolyline) { var totalCoordsCount = 0; for (var i = params.start; i < params.end; i++) { totalCoordsCount += seriesModel.getLineCoordsCount(i); } points = new Float32Array(segCount + totalCoordsCount * 2); } else { points = new Float32Array(segCount * 4); } var offset = 0; var pt = []; for (var i = params.start; i < params.end; i++) { var len = seriesModel.getLineCoords(i, lineCoords); if (isPolyline) { points[offset++] = len; } for (var k = 0; k < len; k++) { pt = coordSys.dataToPoint(lineCoords[k], false, pt); points[offset++] = pt[0]; points[offset++] = pt[1]; } } lineData.setLayout('linesPoints', points); } else { for (var i = params.start; i < params.end; i++) { var itemModel = lineData.getItemModel(i); var len = seriesModel.getLineCoords(i, lineCoords); var pts = []; if (isPolyline) { for (var j = 0; j < len; j++) { pts.push(coordSys.dataToPoint(lineCoords[j])); } } else { pts[0] = coordSys.dataToPoint(lineCoords[0]); pts[1] = coordSys.dataToPoint(lineCoords[1]); var curveness = itemModel.get('lineStyle.curveness'); if (+curveness) { pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness]; } } lineData.setItemLayout(i, pts); } } } return { progress: progress }; } }; module.exports = _default; /***/ }), /***/ "4C0Y": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); var bind = __webpack_require__("rlzA"); var anObject = __webpack_require__("5+O3"); var isNullOrUndefined = __webpack_require__("HrgD"); var getMethod = __webpack_require__("YLw8"); var wellKnownSymbol = __webpack_require__("jAiL"); var ASYNC_DISPOSE = wellKnownSymbol('asyncDispose'); var DISPOSE = wellKnownSymbol('dispose'); var push = uncurryThis([].push); var getDisposeMethod = function (V, hint) { if (hint == 'async-dispose') { return getMethod(V, ASYNC_DISPOSE) || getMethod(V, DISPOSE); } return getMethod(V, DISPOSE); }; // `CreateDisposableResource` abstract operation // https://tc39.es/proposal-explicit-resource-management/#sec-createdisposableresource var createDisposableResource = function (V, hint, method) { return bind(method || getDisposeMethod(V, hint), V); }; // `AddDisposableResource` abstract operation // https://tc39.es/proposal-explicit-resource-management/#sec-adddisposableresource-disposable-v-hint-disposemethod module.exports = function (disposable, V, hint, method) { var resource; if (!method) { if (isNullOrUndefined(V)) return; resource = createDisposableResource(anObject(V), hint); } else { resource = createDisposableResource(undefined, hint, method); } push(disposable.stack, resource); }; /***/ }), /***/ "4DQ7": /***/ (function(module, exports, __webpack_require__) { exports.f = __webpack_require__("hgbu"); /***/ }), /***/ "4GK7": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Number.MAX_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.max_safe_integer $({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF }); /***/ }), /***/ "4Nz2": /***/ (function(module, exports, __webpack_require__) { /* 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 if (typeof window !== 'undefined') { dev = window.__DEV__; } // In node else if (typeof global !== 'undefined') { dev = global.__DEV__; } if (typeof dev === 'undefined') { dev = true; } var __DEV__ = dev; exports.__DEV__ = __DEV__; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("DuR2"))) /***/ }), /***/ "4RQY": /***/ (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__("/gxq"); var each = _util.each; var _simpleLayoutHelper = __webpack_require__("rbn0"); var simpleLayout = _simpleLayoutHelper.simpleLayout; var simpleLayoutEdge = _simpleLayoutHelper.simpleLayoutEdge; /* * 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 _default(ecModel, api) { ecModel.eachSeriesByType('graph', function (seriesModel) { var layout = seriesModel.get('layout'); var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { var data = seriesModel.getData(); var dimensions = []; each(coordSys.dimensions, function (coordDim) { dimensions = dimensions.concat(data.mapDimension(coordDim, true)); }); for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { var value = []; var hasValue = false; for (var i = 0; i < dimensions.length; i++) { var val = data.get(dimensions[i], dataIndex); if (!isNaN(val)) { hasValue = true; } value.push(val); } if (hasValue) { data.setItemLayout(dataIndex, coordSys.dataToPoint(value)); } else { // Also {Array.}, not undefined to avoid if...else... statement data.setItemLayout(dataIndex, [NaN, NaN]); } } simpleLayoutEdge(data.graph); } else if (!layout || layout === 'none') { simpleLayout(seriesModel); } }); } module.exports = _default; /***/ }), /***/ "4S0F": /***/ (function(module, exports) { module.exports = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; /***/ }), /***/ "4SGL": /***/ (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 _number = __webpack_require__("wWR3"); var parsePercent = _number.parsePercent; var zrUtil = __webpack_require__("/gxq"); /* * 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 PI2 = Math.PI * 2; var RADIAN = Math.PI / 180; function _default(seriesType, ecModel, api, payload) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { var center = seriesModel.get('center'); var radius = seriesModel.get('radius'); if (!zrUtil.isArray(radius)) { radius = [0, radius]; } if (!zrUtil.isArray(center)) { center = [center, center]; } var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent(center[0], width); var cy = parsePercent(center[1], height); var r0 = parsePercent(radius[0], size / 2); var r = parsePercent(radius[1], size / 2); var startAngle = -seriesModel.get('startAngle') * RADIAN; var minAngle = seriesModel.get('minAngle') * RADIAN; var virtualRoot = seriesModel.getData().tree.root; var treeRoot = seriesModel.getViewRoot(); var rootDepth = treeRoot.depth; var sort = seriesModel.get('sort'); if (sort != null) { initChildren(treeRoot, sort); } var validDataCount = 0; zrUtil.each(treeRoot.children, function (child) { !isNaN(child.getValue()) && validDataCount++; }); var sum = treeRoot.getValue(); // Sum may be 0 var unitRadian = Math.PI / (sum || validDataCount) * 2; var renderRollupNode = treeRoot.depth > 0; var levels = treeRoot.height - (renderRollupNode ? -1 : 1); var rPerLevel = (r - r0) / (levels || 1); var clockwise = seriesModel.get('clockwise'); 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; /** * Render a tree * @return increased angle */ var renderNode = function (node, startAngle) { if (!node) { return; } var endAngle = startAngle; // Render self if (node !== virtualRoot) { // Tree node is virtual, so it doesn't need to be drawn var value = node.getValue(); var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; if (angle < minAngle) { angle = minAngle; // restAngle -= minAngle; } // else { // valueSumLargerThanMinAngle += value; // } endAngle = startAngle + dir * angle; var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1); var rStart = r0 + rPerLevel * depth; var rEnd = r0 + rPerLevel * (depth + 1); var itemModel = node.getModel(); if (itemModel.get('r0') != null) { rStart = parsePercent(itemModel.get('r0'), size / 2); } if (itemModel.get('r') != null) { rEnd = parsePercent(itemModel.get('r'), size / 2); } node.setLayout({ angle: angle, startAngle: startAngle, endAngle: endAngle, clockwise: clockwise, cx: cx, cy: cy, r0: rStart, r: rEnd }); } // Render children if (node.children && node.children.length) { // currentAngle = startAngle; var siblingAngle = 0; zrUtil.each(node.children, function (node) { siblingAngle += renderNode(node, startAngle + siblingAngle); }); } return endAngle - startAngle; }; // Virtual root node for roll up if (renderRollupNode) { var rStart = r0; var rEnd = r0 + rPerLevel; var angle = Math.PI * 2; virtualRoot.setLayout({ angle: angle, startAngle: startAngle, endAngle: startAngle + angle, clockwise: clockwise, cx: cx, cy: cy, r0: rStart, r: rEnd }); } renderNode(treeRoot, startAngle); }); } /** * Init node children by order and update visual * * @param {TreeNode} node root node * @param {boolean} isAsc if is in ascendant order */ function initChildren(node, isAsc) { var children = node.children || []; node.children = sort(children, isAsc); // Init children recursively if (children.length) { zrUtil.each(node.children, function (child) { initChildren(child, isAsc); }); } } /** * Sort children nodes * * @param {TreeNode[]} children children of node to be sorted * @param {string | function | null} sort sort method * See SunburstSeries.js for details. */ function sort(children, sortOrder) { if (typeof sortOrder === 'function') { return children.sort(sortOrder); } else { var isAsc = sortOrder === 'asc'; return children.sort(function (a, b) { var diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : -1); return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1) : diff; }); } } module.exports = _default; /***/ }), /***/ "4SW2": /***/ (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 echarts = __webpack_require__("Icdr"); var preprocessor = __webpack_require__("DZTl"); __webpack_require__("Osoq"); __webpack_require__("w2H/"); __webpack_require__("OlnU"); __webpack_require__("gZam"); __webpack_require__("H4Wn"); /* * 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 */ echarts.registerPreprocessor(preprocessor); /***/ }), /***/ "4TB0": /***/ (function(module, exports, __webpack_require__) { // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask var $export = __webpack_require__("eqAp"); var microtask = __webpack_require__("E3yU")(); var process = __webpack_require__("vR0S").process; var isNode = __webpack_require__("1vD2")(process) == 'process'; $export($export.G, { asap: function asap(fn) { var domain = isNode && process.domain; microtask(domain ? domain.bind(fn) : fn); } }); /***/ }), /***/ "4UDB": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("jMTz"); __webpack_require__("cO/Q"); var visualSymbol = __webpack_require__("AjK0"); var layoutPoints = __webpack_require__("1Nix"); var dataSample = __webpack_require__("PWa9"); __webpack_require__("UkNE"); /* * 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. */ // In case developer forget to include grid component echarts.registerVisual(visualSymbol('line', 'circle', 'line')); echarts.registerLayout(layoutPoints('line')); // Down sample after filter echarts.registerProcessor(echarts.PRIORITY.PROCESSOR.STATISTIC, dataSample('line')); /***/ }), /***/ "4UvJ": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var from = __webpack_require__("n2L5"); // `WeakMap.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from $({ target: 'WeakMap', stat: true, forced: true }, { from: from }); /***/ }), /***/ "4V7L": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("ghha"); __webpack_require__("oqQy"); __webpack_require__("rwkR"); __webpack_require__("AKXb"); __webpack_require__("+bS+"); /* * 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. */ echarts.extendComponentView({ type: 'single' }); /***/ }), /***/ "4VfM": /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__("1rEs").f; module.exports = function (Target, Source, key) { key in Target || defineProperty(Target, key, { configurable: true, get: function () { return Source[key]; }, set: function (it) { Source[key] = it; } }); }; /***/ }), /***/ "4WJq": /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__("PGRs"); var isObject = __webpack_require__("U9LJ"); var newPromiseCapability = __webpack_require__("07De"); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; /***/ }), /***/ "4XAj": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Number.isNaN` method // https://tc39.es/ecma262/#sec-number.isnan $({ target: 'Number', stat: true }, { isNaN: function isNaN(number) { // eslint-disable-next-line no-self-compare -- NaN check return number != number; } }); /***/ }), /***/ "4Y+y": /***/ (function(module, exports, __webpack_require__) { // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` __webpack_require__("waNl"); __webpack_require__("0K9+"); var getBuiltIn = __webpack_require__("aqbq"); var create = __webpack_require__("43zn"); var isObject = __webpack_require__("HAas"); var $Object = Object; var $TypeError = TypeError; var Map = getBuiltIn('Map'); var WeakMap = getBuiltIn('WeakMap'); var Node = function () { // keys this.object = null; this.symbol = null; // child nodes this.primitives = null; this.objectsByIndex = create(null); }; Node.prototype.get = function (key, initializer) { return this[key] || (this[key] = initializer()); }; Node.prototype.next = function (i, it, IS_OBJECT) { var store = IS_OBJECT ? this.objectsByIndex[i] || (this.objectsByIndex[i] = new WeakMap()) : this.primitives || (this.primitives = new Map()); var entry = store.get(it); if (!entry) store.set(it, entry = new Node()); return entry; }; var root = new Node(); module.exports = function () { var active = root; var length = arguments.length; var i, it; // for prevent leaking, start from objects for (i = 0; i < length; i++) { if (isObject(it = arguments[i])) active = active.next(i, it, true); } if (this === $Object && active === root) throw $TypeError('Composite keys must contain a non-primitive component'); for (i = 0; i < length; i++) { if (!isObject(it = arguments[i])) active = active.next(i, it, false); } return active; }; /***/ }), /***/ "4c9a": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var toSetLike = __webpack_require__("QZ6x"); var $isDisjointFrom = __webpack_require__("1oQN"); // `Set.prototype.isDisjointFrom` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $({ target: 'Set', proto: true, real: true, forced: true }, { isDisjointFrom: function isDisjointFrom(other) { return call($isDisjointFrom, this, toSetLike(other)); } }); /***/ }), /***/ "4dmN": /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__("c8Kh"); var $export = __webpack_require__("Wdy1"); var redefine = __webpack_require__("1RnF"); var hide = __webpack_require__("aLzV"); var Iterators = __webpack_require__("yYxz"); var $iterCreate = __webpack_require__("I7B8"); var setToStringTag = __webpack_require__("LhDF"); var getPrototypeOf = __webpack_require__("VD8v"); var ITERATOR = __webpack_require__("hgbu")('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }), /***/ "4fWj": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var $forEach = __webpack_require__("GSXe").forEach; // `AsyncIterator.prototype.forEach` method // https://github.com/tc39/proposal-async-iterator-helpers $({ target: 'AsyncIterator', proto: true, real: true }, { forEach: function forEach(fn) { return $forEach(this, fn); } }); /***/ }), /***/ "4gJe": /***/ (function(module, exports) { var Queue = function () { this.head = null; this.tail = null; }; Queue.prototype = { add: function (item) { var entry = { item: item, next: null }; var tail = this.tail; if (tail) tail.next = entry; else this.head = entry; this.tail = entry; }, get: function () { var entry = this.head; if (entry) { var next = this.head = entry.next; if (next === null) this.tail = null; return entry.item; } } }; module.exports = Queue; /***/ }), /***/ "4gN1": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("2+22")('Float64', 8, function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); /***/ }), /***/ "4oJ4": /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/ecma262/#sec-toindex var toInteger = __webpack_require__("sxvG"); var toLength = __webpack_require__("J5DO"); module.exports = function (it) { if (it === undefined) return 0; var number = toInteger(it); var length = toLength(number); if (number !== length) throw RangeError('Wrong length!'); return length; }; /***/ }), /***/ "4oYY": /***/ (function(module, exports) { /* * 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. */ var contrastColor = '#eee'; var axisCommon = function () { return { axisLine: { lineStyle: { color: contrastColor } }, axisTick: { lineStyle: { color: contrastColor } }, axisLabel: { textStyle: { color: contrastColor } }, splitLine: { lineStyle: { type: 'dashed', color: '#aaa' } }, splitArea: { areaStyle: { color: contrastColor } } }; }; var colorPalette = ['#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42']; var theme = { color: colorPalette, backgroundColor: '#333', tooltip: { axisPointer: { lineStyle: { color: contrastColor }, crossStyle: { color: contrastColor }, label: { color: '#000' } } }, legend: { textStyle: { color: contrastColor } }, textStyle: { color: contrastColor }, title: { textStyle: { color: contrastColor } }, toolbox: { iconStyle: { normal: { borderColor: contrastColor } } }, dataZoom: { textStyle: { color: contrastColor } }, visualMap: { textStyle: { color: contrastColor } }, timeline: { lineStyle: { color: contrastColor }, itemStyle: { normal: { color: colorPalette[1] } }, label: { normal: { textStyle: { color: contrastColor } } }, controlStyle: { normal: { color: contrastColor, borderColor: contrastColor } } }, timeAxis: axisCommon(), logAxis: axisCommon(), valueAxis: axisCommon(), categoryAxis: axisCommon(), line: { symbol: 'circle' }, graph: { color: colorPalette }, gauge: { title: { textStyle: { color: contrastColor } } }, candlestick: { itemStyle: { normal: { color: '#FD1050', color0: '#0CF49B', borderColor: '#FD1050', borderColor0: '#0CF49B' } } } }; theme.categoryAxis.splitLine.show = false; var _default = theme; module.exports = _default; /***/ }), /***/ "4pM6": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); var createIteratorProxy = __webpack_require__("97So"); var callWithSafeIterationClosing = __webpack_require__("f1+4"); var IteratorProxy = createIteratorProxy(function () { var iterator = this.iterator; var predicate = this.predicate; var next = this.next; var result, done, value; while (true) { result = anObject(call(next, iterator)); done = this.done = !!result.done; if (done) return; value = result.value; if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value; } }); // `Iterator.prototype.filter` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { filter: function filter(predicate) { anObject(this); aCallable(predicate); return new IteratorProxy(getIteratorDirect(this), { predicate: predicate }); } }); /***/ }), /***/ "4w1v": /***/ (function(module, exports, __webpack_require__) { var _core = __webpack_require__("VewU"); var createElement = _core.createElement; var PathProxy = __webpack_require__("moDv"); var BoundingRect = __webpack_require__("8b51"); var matrix = __webpack_require__("dOVI"); var textContain = __webpack_require__("3h1/"); var textHelper = __webpack_require__("qjrH"); var Text = __webpack_require__("/86O"); // TODO // 1. shadow // 2. Image: sx, sy, sw, sh var CMD = PathProxy.CMD; var arrayJoin = Array.prototype.join; var NONE = 'none'; var mathRound = Math.round; var mathSin = Math.sin; var mathCos = Math.cos; var PI = Math.PI; var PI2 = Math.PI * 2; var degree = 180 / PI; var EPSILON = 1e-4; function round4(val) { return mathRound(val * 1e4) / 1e4; } function isAroundZero(val) { return val < EPSILON && val > -EPSILON; } function pathHasFill(style, isText) { var fill = isText ? style.textFill : style.fill; return fill != null && fill !== NONE; } function pathHasStroke(style, isText) { var stroke = isText ? style.textStroke : style.stroke; return stroke != null && stroke !== NONE; } function setTransform(svgEl, m) { if (m) { attr(svgEl, 'transform', 'matrix(' + arrayJoin.call(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 el.setAttribute(key, val); } } function attrXLink(el, key, val) { el.setAttributeNS('http://www.w3.org/1999/xlink', key, val); } function bindStyle(svgEl, style, isText, el) { if (pathHasFill(style, isText)) { var fill = isText ? style.textFill : style.fill; fill = fill === 'transparent' ? NONE : fill; attr(svgEl, 'fill', fill); attr(svgEl, 'fill-opacity', style.fillOpacity != null ? style.fillOpacity * style.opacity : style.opacity); } else { attr(svgEl, 'fill', NONE); } if (pathHasStroke(style, isText)) { var stroke = isText ? style.textStroke : style.stroke; stroke = stroke === 'transparent' ? NONE : stroke; attr(svgEl, 'stroke', stroke); var strokeWidth = isText ? style.textStrokeWidth : style.lineWidth; var strokeScale = !isText && style.strokeNoScale ? el.getLineScale() : 1; attr(svgEl, 'stroke-width', strokeWidth / strokeScale); // stroke then fill for text; fill then stroke for others attr(svgEl, 'paint-order', isText ? 'stroke' : 'fill'); attr(svgEl, 'stroke-opacity', style.strokeOpacity != null ? style.strokeOpacity : style.opacity); var lineDash = style.lineDash; if (lineDash) { attr(svgEl, 'stroke-dasharray', style.lineDash.join(',')); attr(svgEl, 'stroke-dashoffset', mathRound(style.lineDashOffset || 0)); } else { attr(svgEl, 'stroke-dasharray', ''); } // PENDING style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap); style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin); style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit); } else { attr(svgEl, 'stroke', NONE); } } /*************************************************** * PATH **************************************************/ function pathDataToString(path) { var str = []; var data = path.data; var dataLength = path.len(); for (var i = 0; i < dataLength;) { var cmd = data[i++]; var cmdStr = ''; var nData = 0; switch (cmd) { case CMD.M: cmdStr = 'M'; nData = 2; break; case CMD.L: cmdStr = 'L'; nData = 2; break; case CMD.Q: cmdStr = 'Q'; nData = 4; break; case CMD.C: cmdStr = 'C'; nData = 6; break; case CMD.A: var cx = data[i++]; var cy = data[i++]; var rx = data[i++]; var ry = data[i++]; var theta = data[i++]; var dTheta = data[i++]; var psi = data[i++]; var clockwise = data[i++]; var dThetaPositive = Math.abs(dTheta); var isCircle = isAroundZero(dThetaPositive - PI2) || (clockwise ? dTheta >= PI2 : -dTheta >= PI2); // Mapping to 0~2PI var unifiedTheta = dTheta > 0 ? dTheta % PI2 : dTheta % PI2 + PI2; var large = false; if (isCircle) { large = true; } else if (isAroundZero(dThetaPositive)) { large = false; } else { large = unifiedTheta >= PI === !!clockwise; } var x0 = round4(cx + rx * mathCos(theta)); var y0 = round4(cy + ry * mathSin(theta)); // It will not draw if start point and end point are exactly the same // We need to shift the end point with a small value // FIXME A better way to draw circle ? if (isCircle) { if (clockwise) { dTheta = PI2 - 1e-4; } else { dTheta = -PI2 + 1e-4; } large = true; if (i === 9) { // Move to (x0, y0) only when CMD.A comes at the // first position of a shape. // For instance, when drawing a ring, CMD.A comes // after CMD.M, so it's unnecessary to move to // (x0, y0). str.push('M', x0, y0); } } var x = round4(cx + rx * mathCos(theta + dTheta)); var y = round4(cy + ry * mathSin(theta + dTheta)); // FIXME Ellipse str.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y); break; case CMD.Z: cmdStr = 'Z'; break; case CMD.R: var x = round4(data[i++]); var y = round4(data[i++]); var w = round4(data[i++]); var h = round4(data[i++]); str.push('M', x, y, 'L', x + w, y, 'L', x + w, y + h, 'L', x, y + h, 'L', x, y); break; } cmdStr && str.push(cmdStr); for (var j = 0; j < nData; j++) { // PENDING With scale str.push(round4(data[i++])); } } return str.join(' '); } var svgPath = {}; svgPath.brush = function (el) { var style = el.style; var svgEl = el.__svgEl; if (!svgEl) { svgEl = createElement('path'); el.__svgEl = svgEl; } if (!el.path) { el.createPathProxy(); } var path = el.path; if (el.__dirtyPath) { path.beginPath(); path.subPixelOptimize = false; el.buildPath(path, el.shape); el.__dirtyPath = false; var pathStr = pathDataToString(path); if (pathStr.indexOf('NaN') < 0) { // Ignore illegal path, which may happen such in out-of-range // data in Calendar series. attr(svgEl, 'd', pathStr); } } bindStyle(svgEl, style, false, el); setTransform(svgEl, el.transform); if (style.text != null) { svgTextDrawRectText(el, el.getBoundingRect()); } else { removeOldTextNode(el); } }; /*************************************************** * IMAGE **************************************************/ var svgImage = {}; svgImage.brush = function (el) { var style = el.style; var image = style.image; if (image instanceof HTMLImageElement) { var src = image.src; image = src; } if (!image) { return; } var x = style.x || 0; var y = style.y || 0; var dw = style.width; var dh = style.height; var svgEl = el.__svgEl; if (!svgEl) { svgEl = createElement('image'); el.__svgEl = svgEl; } if (image !== el.__imageSrc) { attrXLink(svgEl, 'href', image); // Caching image src el.__imageSrc = image; } attr(svgEl, 'width', dw); attr(svgEl, 'height', dh); attr(svgEl, 'x', x); attr(svgEl, 'y', y); setTransform(svgEl, el.transform); if (style.text != null) { svgTextDrawRectText(el, el.getBoundingRect()); } else { removeOldTextNode(el); } }; /*************************************************** * TEXT **************************************************/ var svgText = {}; var _tmpTextHostRect = new BoundingRect(); var _tmpTextBoxPos = {}; var _tmpTextTransform = []; var TEXT_ALIGN_TO_ANCHRO = { left: 'start', right: 'end', center: 'middle', middle: 'middle' }; /** * @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 && textHelper.normalizeTextStyle(style, true); var text = style.text; // Convert to string text != null && (text += ''); if (!textHelper.needDrawText(text, style)) { return; } // 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) { textSvgEl = createElement('text'); el.__textSvgEl = textSvgEl; } // style.font has been normalized by `normalizeTextStyle`. var textSvgElStyle = textSvgEl.style; var font = style.font || textContain.DEFAULT_FONT; 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 textPadding = style.textPadding; var textLineHeight = style.textLineHeight; var contentBlock = el.__textCotentBlock; if (!contentBlock || el.__dirtyText) { contentBlock = el.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate); } var outerHeight = contentBlock.outerHeight; var lineHeight = contentBlock.lineHeight; textHelper.getBoxPosition(_tmpTextBoxPos, el, style, hostRect); var baseX = _tmpTextBoxPos.baseX; var baseY = _tmpTextBoxPos.baseY; var textAlign = _tmpTextBoxPos.textAlign || 'left'; var textVerticalAlign = _tmpTextBoxPos.textVerticalAlign; setTextTransform(textSvgEl, needTransformTextByHostEl, elTransform, style, hostRect, baseX, baseY); var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign); var textX = baseX; var textY = boxY; // TODO needDrawBg if (textPadding) { textX = getTextXForPadding(baseX, textAlign, textPadding); textY += textPadding[0]; } // `textBaseline` is set as 'middle'. textY += lineHeight / 2; bindStyle(textSvgEl, style, true, el); // FIXME // Add a in svg, where nodeName is 'style', // CSS classes is defined globally wherever the style tags are declared. if (nodeName === 'defs') { // define flag this._isDefine = true; } else if (nodeName === 'text') { this._isText = true; } var el; if (this._isDefine) { var parser = defineParsers[nodeName]; if (parser) { var def = parser.call(this, xmlNode); var id = xmlNode.getAttribute('id'); if (id) { this._defs[id] = def; } } } else { var parser = nodeParsers[nodeName]; if (parser) { el = parser.call(this, xmlNode, parentGroup); parentGroup.add(el); } } var child = xmlNode.firstChild; while (child) { if (child.nodeType === 1) { this._parseNode(child, el); } // Is text if (child.nodeType === 3 && this._isText) { this._parseText(child, el); } child = child.nextSibling; } // Quit define if (nodeName === 'defs') { this._isDefine = false; } else if (nodeName === 'text') { this._isText = false; } }; SVGParser.prototype._parseText = function (xmlNode, parentGroup) { if (xmlNode.nodeType === 1) { var dx = xmlNode.getAttribute('dx') || 0; var dy = xmlNode.getAttribute('dy') || 0; this._textX += parseFloat(dx); this._textY += parseFloat(dy); } var text = new Text({ style: { text: xmlNode.textContent, transformText: true }, position: [this._textX || 0, this._textY || 0] }); inheritStyle(parentGroup, text); parseAttributes(xmlNode, text, this._defs); var fontSize = text.style.fontSize; if (fontSize && fontSize < 9) { // PENDING text.style.fontSize = 9; text.scale = text.scale || [1, 1]; text.scale[0] *= fontSize / 9; text.scale[1] *= fontSize / 9; } var rect = text.getBoundingRect(); this._textX += rect.width; parentGroup.add(text); return text; }; var nodeParsers = { 'g': function (xmlNode, parentGroup) { var g = new Group(); inheritStyle(parentGroup, g); parseAttributes(xmlNode, g, this._defs); return g; }, 'rect': function (xmlNode, parentGroup) { var rect = new Rect(); inheritStyle(parentGroup, rect); parseAttributes(xmlNode, rect, this._defs); rect.setShape({ x: parseFloat(xmlNode.getAttribute('x') || 0), y: parseFloat(xmlNode.getAttribute('y') || 0), width: parseFloat(xmlNode.getAttribute('width') || 0), height: parseFloat(xmlNode.getAttribute('height') || 0) }); // console.log(xmlNode.getAttribute('transform')); // console.log(rect.transform); return rect; }, 'circle': function (xmlNode, parentGroup) { var circle = new Circle(); inheritStyle(parentGroup, circle); parseAttributes(xmlNode, circle, this._defs); circle.setShape({ cx: parseFloat(xmlNode.getAttribute('cx') || 0), cy: parseFloat(xmlNode.getAttribute('cy') || 0), r: parseFloat(xmlNode.getAttribute('r') || 0) }); return circle; }, 'line': function (xmlNode, parentGroup) { var line = new Line(); inheritStyle(parentGroup, line); parseAttributes(xmlNode, line, this._defs); line.setShape({ x1: parseFloat(xmlNode.getAttribute('x1') || 0), y1: parseFloat(xmlNode.getAttribute('y1') || 0), x2: parseFloat(xmlNode.getAttribute('x2') || 0), y2: parseFloat(xmlNode.getAttribute('y2') || 0) }); return line; }, 'ellipse': function (xmlNode, parentGroup) { var ellipse = new Ellipse(); inheritStyle(parentGroup, ellipse); parseAttributes(xmlNode, ellipse, this._defs); ellipse.setShape({ cx: parseFloat(xmlNode.getAttribute('cx') || 0), cy: parseFloat(xmlNode.getAttribute('cy') || 0), rx: parseFloat(xmlNode.getAttribute('rx') || 0), ry: parseFloat(xmlNode.getAttribute('ry') || 0) }); return ellipse; }, 'polygon': function (xmlNode, parentGroup) { var points = xmlNode.getAttribute('points'); if (points) { points = parsePoints(points); } var polygon = new Polygon({ shape: { points: points || [] } }); inheritStyle(parentGroup, polygon); parseAttributes(xmlNode, polygon, this._defs); return polygon; }, 'polyline': function (xmlNode, parentGroup) { var path = new Path(); inheritStyle(parentGroup, path); parseAttributes(xmlNode, path, this._defs); var points = xmlNode.getAttribute('points'); if (points) { points = parsePoints(points); } var polyline = new Polyline({ shape: { points: points || [] } }); return polyline; }, 'image': function (xmlNode, parentGroup) { var img = new ZImage(); inheritStyle(parentGroup, img); parseAttributes(xmlNode, img, this._defs); img.setStyle({ image: xmlNode.getAttribute('xlink:href'), x: xmlNode.getAttribute('x'), y: xmlNode.getAttribute('y'), width: xmlNode.getAttribute('width'), height: xmlNode.getAttribute('height') }); return img; }, 'text': function (xmlNode, parentGroup) { var x = xmlNode.getAttribute('x') || 0; var y = xmlNode.getAttribute('y') || 0; var dx = xmlNode.getAttribute('dx') || 0; var dy = xmlNode.getAttribute('dy') || 0; this._textX = parseFloat(x) + parseFloat(dx); this._textY = parseFloat(y) + parseFloat(dy); var g = new Group(); inheritStyle(parentGroup, g); parseAttributes(xmlNode, g, this._defs); return g; }, 'tspan': function (xmlNode, parentGroup) { var x = xmlNode.getAttribute('x'); var y = xmlNode.getAttribute('y'); if (x != null) { // new offset x this._textX = parseFloat(x); } if (y != null) { // new offset y this._textY = parseFloat(y); } var dx = xmlNode.getAttribute('dx') || 0; var dy = xmlNode.getAttribute('dy') || 0; var g = new Group(); inheritStyle(parentGroup, g); parseAttributes(xmlNode, g, this._defs); this._textX += dx; this._textY += dy; return g; }, 'path': function (xmlNode, parentGroup) { // TODO svg fill rule // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule // path.style.globalCompositeOperation = 'xor'; var d = xmlNode.getAttribute('d') || ''; // Performance sensitive. var path = createFromString(d); inheritStyle(parentGroup, path); parseAttributes(xmlNode, path, this._defs); return path; } }; var defineParsers = { '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); _parseGradientColorStops(xmlNode, gradient); return gradient; }, 'radialgradient': function (xmlNode) {} }; function _parseGradientColorStops(xmlNode, gradient) { var stop = xmlNode.firstChild; while (stop) { if (stop.nodeType === 1) { var offset = stop.getAttribute('offset'); if (offset.indexOf('%') > 0) { // percentage offset = parseInt(offset, 10) / 100; } else if (offset) { // number from 0 to 1 offset = parseFloat(offset); } else { offset = 0; } var stopColor = stop.getAttribute('stop-color') || '#000000'; gradient.addColorStop(offset, stopColor); } stop = stop.nextSibling; } } function inheritStyle(parent, child) { if (parent && parent.__inheritedStyle) { if (!child.__inheritedStyle) { child.__inheritedStyle = {}; } defaults(child.__inheritedStyle, parent.__inheritedStyle); } } function parsePoints(pointsString) { var list = trim(pointsString).split(DILIMITER_REG); var points = []; for (var i = 0; i < list.length; i += 2) { var x = parseFloat(list[i]); var y = parseFloat(list[i + 1]); points.push([x, y]); } return points; } var attributesMap = { 'fill': 'fill', 'stroke': 'stroke', 'stroke-width': 'lineWidth', 'opacity': 'opacity', 'fill-opacity': 'fillOpacity', 'stroke-opacity': 'strokeOpacity', 'stroke-dasharray': 'lineDash', 'stroke-dashoffset': 'lineDashOffset', 'stroke-linecap': 'lineCap', 'stroke-linejoin': 'lineJoin', 'stroke-miterlimit': 'miterLimit', 'font-family': 'fontFamily', 'font-size': 'fontSize', 'font-style': 'fontStyle', 'font-weight': 'fontWeight', 'text-align': 'textAlign', 'alignment-baseline': 'textBaseline' }; function parseAttributes(xmlNode, el, defs, onlyInlineStyle) { var zrStyle = el.__inheritedStyle || {}; var isTextEl = el.type === 'text'; // TODO Shadow if (xmlNode.nodeType === 1) { parseTransformAttribute(xmlNode, el); extend(zrStyle, parseStyleAttribute(xmlNode)); if (!onlyInlineStyle) { for (var svgAttrName in attributesMap) { if (attributesMap.hasOwnProperty(svgAttrName)) { var attrValue = xmlNode.getAttribute(svgAttrName); if (attrValue != null) { zrStyle[attributesMap[svgAttrName]] = attrValue; } } } } } var elFillProp = isTextEl ? 'textFill' : 'fill'; var elStrokeProp = isTextEl ? 'textStroke' : 'stroke'; el.style = el.style || new Style(); var elStyle = el.style; zrStyle.fill != null && elStyle.set(elFillProp, getPaint(zrStyle.fill, defs)); zrStyle.stroke != null && elStyle.set(elStrokeProp, getPaint(zrStyle.stroke, defs)); each(['lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'], function (propName) { var elPropName = propName === 'lineWidth' && isTextEl ? 'textStrokeWidth' : propName; zrStyle[propName] != null && elStyle.set(elPropName, parseFloat(zrStyle[propName])); }); if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') { zrStyle.textBaseline = 'alphabetic'; } if (zrStyle.textBaseline === 'alphabetic') { zrStyle.textBaseline = 'bottom'; } if (zrStyle.textAlign === 'start') { zrStyle.textAlign = 'left'; } if (zrStyle.textAlign === 'end') { zrStyle.textAlign = 'right'; } each(['lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'], function (propName) { zrStyle[propName] != null && elStyle.set(propName, zrStyle[propName]); }); if (zrStyle.lineDash) { el.style.lineDash = trim(zrStyle.lineDash).split(DILIMITER_REG); } if (elStyle[elStrokeProp] && elStyle[elStrokeProp] !== 'none') { // enable stroke el[elStrokeProp] = true; } el.__inheritedStyle = zrStyle; } var urlRegex = /url\(\s*#(.*?)\)/; function getPaint(str, defs) { // if (str === 'none') { // return; // } var urlMatch = defs && str && str.match(urlRegex); if (urlMatch) { var url = trim(urlMatch[1]); var def = defs[url]; return def; } return str; } var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g; function parseTransformAttribute(xmlNode, node) { var transform = xmlNode.getAttribute('transform'); if (transform) { transform = transform.replace(/,/g, ' '); var m = null; var transformOps = []; transform.replace(transformRegex, function (str, type, value) { transformOps.push(type, value); }); for (var i = transformOps.length - 1; i > 0; i -= 2) { var value = transformOps[i]; var type = transformOps[i - 1]; m = m || matrix.create(); switch (type) { case 'translate': value = trim(value).split(DILIMITER_REG); matrix.translate(m, m, [parseFloat(value[0]), parseFloat(value[1] || 0)]); break; case 'scale': value = trim(value).split(DILIMITER_REG); matrix.scale(m, m, [parseFloat(value[0]), parseFloat(value[1] || value[0])]); break; case 'rotate': value = trim(value).split(DILIMITER_REG); matrix.rotate(m, m, parseFloat(value[0])); break; case 'skew': value = trim(value).split(DILIMITER_REG); console.warn('Skew transform is not supported yet'); break; case 'matrix': var value = trim(value).split(DILIMITER_REG); m[0] = parseFloat(value[0]); m[1] = parseFloat(value[1]); m[2] = parseFloat(value[2]); m[3] = parseFloat(value[3]); m[4] = parseFloat(value[4]); m[5] = parseFloat(value[5]); break; } } node.setLocalTransform(m); } } // Value may contain space. var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g; function parseStyleAttribute(xmlNode) { var style = xmlNode.getAttribute('style'); var result = {}; if (!style) { return result; } var styleList = {}; styleRegex.lastIndex = 0; var styleRegResult; while ((styleRegResult = styleRegex.exec(style)) != null) { styleList[styleRegResult[1]] = styleRegResult[2]; } for (var svgAttrName in attributesMap) { if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) { result[attributesMap[svgAttrName]] = styleList[svgAttrName]; } } return result; } /** * @param {Array.} viewBoxRect * @param {number} width * @param {number} height * @return {Object} {scale, position} */ function makeViewBoxTransform(viewBoxRect, width, height) { var scaleX = width / viewBoxRect.width; var scaleY = height / viewBoxRect.height; var scale = Math.min(scaleX, scaleY); // preserveAspectRatio 'xMidYMid' var viewBoxScale = [scale, scale]; var viewBoxPosition = [-(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2, -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2]; return { scale: viewBoxScale, position: viewBoxPosition }; } /** * @param {string|XMLElement} xml * @param {Object} [opt] * @param {number} [opt.width] Default width if svg width not specified or is a percent value. * @param {number} [opt.height] Default height if svg height not specified or is a percent value. * @param {boolean} [opt.ignoreViewBox] * @param {boolean} [opt.ignoreRootClip] * @return {Object} result: * { * root: Group, The root of the the result tree of zrender shapes, * width: number, the viewport width of the SVG, * height: number, the viewport height of the SVG, * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists, * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists. * } */ function parseSVG(xml, opt) { var parser = new SVGParser(); return parser.parse(xml, opt); } exports.parseXML = parseXML; exports.makeViewBoxTransform = makeViewBoxTransform; exports.parseSVG = parseSVG; /***/ }), /***/ "jE8y": /***/ (function(module, exports, __webpack_require__) { /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = __webpack_require__("lgy4"); var anObject = __webpack_require__("5+O3"); var aPossiblePrototype = __webpack_require__("oEhq"); // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); /***/ }), /***/ "jHiU": /***/ (function(module, exports, __webpack_require__) { var zrUtil = __webpack_require__("/gxq"); var Gradient = __webpack_require__("wRzc"); /** * 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; /***/ }), /***/ "jJrn": /***/ (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__("/gxq"); var IndicatorAxis = __webpack_require__("JFJR"); var IntervalScale = __webpack_require__("tBuv"); var numberUtil = __webpack_require__("wWR3"); var _axisHelper = __webpack_require__("3yJd"); var getScaleExtent = _axisHelper.getScaleExtent; var niceScaleExtent = _axisHelper.niceScaleExtent; var CoordinateSystem = __webpack_require__("rctg"); var LogScale = __webpack_require__("xCbH"); /* * 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 clockwise function Radar(radarModel, ecModel, api) { this._model = radarModel; /** * Radar dimensions * @type {Array.} */ this.dimensions = []; this._indicatorAxes = zrUtil.map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { var dim = 'indicator_' + idx; 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; indicatorModel.axis = indicatorAxis; this.dimensions.push(dim); return indicatorAxis; }, this); this.resize(radarModel, api); /** * @type {number} * @readOnly */ this.cx; /** * @type {number} * @readOnly */ this.cy; /** * @type {number} * @readOnly */ this.r; /** * @type {number} * @readOnly */ this.r0; /** * @type {number} * @readOnly */ this.startAngle; } Radar.prototype.getIndicatorAxes = function () { return this._indicatorAxes; }; Radar.prototype.dataToPoint = function (value, indicatorIndex) { var indicatorAxis = this._indicatorAxes[indicatorIndex]; return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex); }; Radar.prototype.coordToPoint = function (coord, indicatorIndex) { var indicatorAxis = this._indicatorAxes[indicatorIndex]; var angle = indicatorAxis.angle; var x = this.cx + coord * Math.cos(angle); var y = this.cy - coord * Math.sin(angle); return [x, y]; }; Radar.prototype.pointToData = function (pt) { var dx = pt[0] - this.cx; var dy = pt[1] - this.cy; var radius = Math.sqrt(dx * dx + dy * dy); dx /= radius; dy /= radius; var radian = Math.atan2(-dy, dx); // Find the closest angle // FIXME index can calculated directly var minRadianDiff = Infinity; var closestAxis; var closestAxisIdx = -1; for (var i = 0; i < this._indicatorAxes.length; i++) { var indicatorAxis = this._indicatorAxes[i]; var diff = Math.abs(radian - indicatorAxis.angle); if (diff < minRadianDiff) { closestAxis = indicatorAxis; closestAxisIdx = i; minRadianDiff = diff; } } return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))]; }; Radar.prototype.resize = function (radarModel, api) { var center = radarModel.get('center'); var viewWidth = api.getWidth(); var viewHeight = api.getHeight(); var viewSize = Math.min(viewWidth, viewHeight) / 2; this.cx = numberUtil.parsePercent(center[0], viewWidth); this.cy = numberUtil.parsePercent(center[1], viewHeight); this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']` var radius = radarModel.get('radius'); if (typeof radius === 'string' || typeof radius === 'number') { radius = [0, radius]; } this.r0 = numberUtil.parsePercent(radius[0], viewSize); this.r = numberUtil.parsePercent(radius[1], viewSize); zrUtil.each(this._indicatorAxes, function (indicatorAxis, idx) { indicatorAxis.setExtent(this.r0, this.r); var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI] angle = Math.atan2(Math.sin(angle), Math.cos(angle)); indicatorAxis.angle = angle; }, this); }; Radar.prototype.update = function (ecModel, api) { var indicatorAxes = this._indicatorAxes; var radarModel = this._model; zrUtil.each(indicatorAxes, function (indicatorAxis) { indicatorAxis.scale.setExtent(Infinity, -Infinity); }); ecModel.eachSeriesByType('radar', function (radarSeries, idx) { if (radarSeries.get('coordinateSystem') !== 'radar' || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) { return; } var data = radarSeries.getData(); zrUtil.each(indicatorAxes, function (indicatorAxis) { indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim)); }); }, this); var splitNumber = radarModel.get('splitNumber'); function increaseInterval(interval) { var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10)); // Increase interval var f = interval / exp10; if (f === 2) { f = 5; } else { // f is 2 or 5 f *= 2; } return f * exp10; } // Force all the axis fixing the maxSplitNumber. zrUtil.each(indicatorAxes, function (indicatorAxis, idx) { var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent; niceScaleExtent(indicatorAxis.scale, indicatorAxis.model); var axisModel = indicatorAxis.model; var scale = indicatorAxis.scale; var fixedMin = axisModel.getMin(); 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); scale.setInterval((fixedMax - fixedMin) / splitNumber); } else if (fixedMin != null) { var max; // User set min, expand extent on the other side do { max = fixedMin + interval * splitNumber; scale.setExtent(+fixedMin, max); // Interval must been set after extent // FIXME scale.setInterval(interval); interval = increaseInterval(interval); } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])); } else if (fixedMax != null) { var min; // User set min, expand extent on the other side do { min = fixedMax - interval * splitNumber; scale.setExtent(min, +fixedMax); scale.setInterval(interval); interval = increaseInterval(interval); } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])); } else { var nicedSplitNumber = scale.getTicks().length - 1; if (nicedSplitNumber > splitNumber) { interval = increaseInterval(interval); } // TODO var max = Math.ceil(rawExtent[1] / interval) * interval; var min = numberUtil.round(max - interval * splitNumber); scale.setExtent(min, max); scale.setInterval(interval); } }); }; /** * Radar dimensions is based on the data * @type {Array} */ Radar.dimensions = []; Radar.create = function (ecModel, api) { var radarList = []; ecModel.eachComponent('radar', function (radarModel) { var radar = new Radar(radarModel, ecModel, api); radarList.push(radar); radarModel.coordinateSystem = radar; }); ecModel.eachSeriesByType('radar', function (radarSeries) { if (radarSeries.get('coordinateSystem') === 'radar') { // Inject coordinate system radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0]; } }); return radarList; }; CoordinateSystem.register('radar', Radar); var _default = Radar; module.exports = _default; /***/ }), /***/ "jLAN": /***/ (function(module, exports, __webpack_require__) { "use strict"; var at = __webpack_require__("bFIN")(true); // `AdvanceStringIndex` abstract operation // https://tc39.github.io/ecma262/#sec-advancestringindex module.exports = function (S, index, unicode) { return index + (unicode ? at(S, index).length : 1); }; /***/ }), /***/ "jLFK": /***/ (function(module, exports, __webpack_require__) { var createNonEnumerableProperty = __webpack_require__("asqq"); var clearErrorStack = __webpack_require__("focP"); var ERROR_STACK_INSTALLABLE = __webpack_require__("QXoR"); // non-standard V8 var captureStackTrace = Error.captureStackTrace; module.exports = function (error, C, stack, dropEntries) { if (ERROR_STACK_INSTALLABLE) { if (captureStackTrace) captureStackTrace(error, C); else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries)); } }; /***/ }), /***/ "jLnL": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("4w1v"); var _zrender = __webpack_require__("hv2j"); var registerPainter = _zrender.registerPainter; var Painter = __webpack_require__("Q5xN"); registerPainter('svg', Painter); /***/ }), /***/ "jMTz": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var createListFromArray = __webpack_require__("ao1T"); var SeriesModel = __webpack_require__("EJsE"); /* * 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 _default = SeriesModel.extend({ type: 'series.line', dependencies: ['grid', 'polar'], getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true }); }, defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'cartesian2d', legendHoverLink: true, hoverAnimation: true, // stack: null // xAxisIndex: 0, // yAxisIndex: 0, // polarIndex: 0, // If clip the overflow value clip: true, // cursor: null, label: { position: 'top' }, // itemStyle: { // }, lineStyle: { width: 2, type: 'solid' }, // areaStyle: { // origin of areaStyle. Valid values: // `'auto'/null/undefined`: from axisLine to data // `'start'`: from min to data // `'end'`: from data to max // origin: 'auto' // }, // false, 'start', 'end', 'middle' step: false, // Disabled if step is true smooth: false, smoothMonotone: null, symbol: 'emptyCircle', symbolSize: 4, symbolRotate: null, showSymbol: true, // `false`: follow the label interval strategy. // `true`: show all symbols. // `'auto'`: If possible, show all symbols, otherwise // follow the label interval strategy. showAllSymbol: 'auto', // Whether to connect break point. connectNulls: false, // Sampling for large data. Can be: 'average', 'max', 'min', 'sum'. sampling: 'none', animationEasing: 'linear', // Disable progressive progressive: 0, hoverLayerThreshold: Infinity } }); module.exports = _default; /***/ }), /***/ "jQ5B": /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__("rlzA"); var uncurryThis = __webpack_require__("u4Az"); var toObject = __webpack_require__("EJk4"); var isConstructor = __webpack_require__("iuII"); var getAsyncIterator = __webpack_require__("I1Pq"); var getIterator = __webpack_require__("1nw6"); var getIteratorDirect = __webpack_require__("tcso"); var getIteratorMethod = __webpack_require__("URKv"); var getMethod = __webpack_require__("YLw8"); var getVirtual = __webpack_require__("V4Qi"); var getBuiltIn = __webpack_require__("aqbq"); var wellKnownSymbol = __webpack_require__("jAiL"); var AsyncFromSyncIterator = __webpack_require__("INdP"); var toArray = __webpack_require__("GSXe").toArray; var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator'); var arrayIterator = uncurryThis(getVirtual('Array').values); var arrayIteratorNext = uncurryThis(arrayIterator([]).next); var safeArrayIterator = function () { return new SafeArrayIterator(this); }; var SafeArrayIterator = function (O) { this.iterator = arrayIterator(O); }; SafeArrayIterator.prototype.next = function () { return arrayIteratorNext(this.iterator); }; // `Array.fromAsync` method implementation // https://github.com/tc39/proposal-array-from-async module.exports = function fromAsync(asyncItems /* , mapfn = undefined, thisArg = undefined */) { var C = this; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var thisArg = argumentsLength > 2 ? arguments[2] : undefined; return new (getBuiltIn('Promise'))(function (resolve) { var O = toObject(asyncItems); if (mapfn !== undefined) mapfn = bind(mapfn, thisArg); var usingAsyncIterator = getMethod(O, ASYNC_ITERATOR); var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod(O) || safeArrayIterator; var A = isConstructor(C) ? new C() : []; var iterator = usingAsyncIterator ? getAsyncIterator(O, usingAsyncIterator) : new AsyncFromSyncIterator(getIteratorDirect(getIterator(O, usingSyncIterator))); resolve(toArray(iterator, mapfn, A)); }); }; /***/ }), /***/ "jSR0": /***/ (function(module, exports, __webpack_require__) { var UA = __webpack_require__("KdgD"); module.exports = /MSIE|Trident/.test(UA); /***/ }), /***/ "jYoD": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__("eqAp"); var $reduce = __webpack_require__("PBY2"); $export($export.P + $export.F * !__webpack_require__("+qBm")([].reduceRight, true), 'Array', { // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); /***/ }), /***/ "jfqE": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 Object.getOwnPropertyNames(O) __webpack_require__("Iiwq")('getOwnPropertyNames', function () { return __webpack_require__("xH/3").f; }); /***/ }), /***/ "jgJS": /***/ (function(module, exports, __webpack_require__) { var TO_STRING_TAG_SUPPORT = __webpack_require__("VpuQ"); var isCallable = __webpack_require__("R09w"); var classofRaw = __webpack_require__("raVe"); var wellKnownSymbol = __webpack_require__("jAiL"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; /***/ }), /***/ "jmaC": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = function (target) { for (var i = 1, j = arguments.length; i < j; i++) { var source = arguments[i] || {}; for (var prop in source) { if (source.hasOwnProperty(prop)) { var value = source[prop]; if (value !== undefined) { target[prop] = value; } } } } return target; }; ; /***/ }), /***/ "jpt2": /***/ (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 MapDraw = __webpack_require__("LBXi"); var echarts = __webpack_require__("Icdr"); /* * 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 _default = echarts.extendComponentView({ type: 'geo', init: function (ecModel, api) { var mapDraw = new MapDraw(api, true); this._mapDraw = mapDraw; this.group.add(mapDraw.group); }, 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 mapDraw = this._mapDraw; if (geoModel.get('show')) { mapDraw.draw(geoModel, ecModel, api, this, payload); } else { this._mapDraw.group.removeAll(); } this.group.silent = geoModel.get('silent'); }, dispose: function () { this._mapDraw && this._mapDraw.remove(); } }); module.exports = _default; /***/ }), /***/ "jq8k": /***/ (function(module, exports, __webpack_require__) { var defineWellKnownSymbol = __webpack_require__("8lki"); // `Symbol.isConcatSpreadable` well-known symbol // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable defineWellKnownSymbol('isConcatSpreadable'); /***/ }), /***/ "jwfv": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/extends.js var helpers_extends = __webpack_require__("Dd8w"); var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends); // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/typeof.js var helpers_typeof = __webpack_require__("pFYg"); var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof); // CONCATENATED MODULE: ./node_modules/async-validator/es/util.js var formatRegExp = /%[sdj%]/g; var warning = function warning() {}; // don't print warning message when in production env or node runtime if (false) { warning = function warning(type, errors) { if (typeof console !== 'undefined' && console.warn) { if (errors.every(function (e) { return typeof e === 'string'; })) { console.warn(type, errors); } } }; } function format() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var i = 1; var f = args[0]; var len = args.length; if (typeof f === 'function') { return f.apply(null, args.slice(1)); } if (typeof f === 'string') { var str = String(f).replace(formatRegExp, function (x) { if (x === '%%') { return '%'; } if (i >= len) { return x; } switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } break; default: return x; } }); for (var arg = args[i]; i < len; arg = args[++i]) { str += ' ' + arg; } return str; } return f; } function isNativeStringType(type) { return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern'; } function isEmptyValue(value, type) { if (value === undefined || value === null) { return true; } if (type === 'array' && Array.isArray(value) && !value.length) { return true; } if (isNativeStringType(type) && typeof value === 'string' && !value) { return true; } return false; } function isEmptyObject(obj) { return Object.keys(obj).length === 0; } function asyncParallelArray(arr, func, callback) { var results = []; var total = 0; var arrLength = arr.length; function count(errors) { results.push.apply(results, errors); total++; if (total === arrLength) { callback(results); } } arr.forEach(function (a) { func(a, count); }); } function asyncSerialArray(arr, func, callback) { var index = 0; var arrLength = arr.length; function next(errors) { if (errors && errors.length) { callback(errors); return; } var original = index; index = index + 1; if (original < arrLength) { func(arr[original], next); } else { callback([]); } } next([]); } function flattenObjArr(objArr) { var ret = []; Object.keys(objArr).forEach(function (k) { ret.push.apply(ret, objArr[k]); }); return ret; } function asyncMap(objArr, option, func, callback) { if (option.first) { var flattenArr = flattenObjArr(objArr); return asyncSerialArray(flattenArr, func, callback); } var firstFields = option.firstFields || []; if (firstFields === true) { firstFields = Object.keys(objArr); } var objArrKeys = Object.keys(objArr); var objArrLength = objArrKeys.length; var total = 0; var results = []; var next = function next(errors) { results.push.apply(results, errors); total++; if (total === objArrLength) { callback(results); } }; objArrKeys.forEach(function (key) { var arr = objArr[key]; if (firstFields.indexOf(key) !== -1) { asyncSerialArray(arr, func, next); } else { asyncParallelArray(arr, func, next); } }); } function complementError(rule) { return function (oe) { if (oe && oe.message) { oe.field = oe.field || rule.fullField; return oe; } return { message: oe, field: oe.field || rule.fullField }; }; } function deepMerge(target, source) { if (source) { for (var s in source) { if (source.hasOwnProperty(s)) { var value = source[s]; if ((typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) === 'object' && typeof_default()(target[s]) === 'object') { target[s] = extends_default()({}, target[s], value); } else { target[s] = value; } } } } return target; } // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/required.js /** * Rule for validating required fields. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param source The source object being validated. * @param errors An array of errors that this rule may add * validation errors to. * @param options The validation options. * @param options.messages The validation messages. */ function required(rule, value, source, errors, options, type) { if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) { errors.push(format(options.messages.required, rule.fullField)); } } /* harmony default export */ var rule_required = (required); // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/whitespace.js /** * Rule for validating whitespace. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param source The source object being validated. * @param errors An array of errors that this rule may add * validation errors to. * @param options The validation options. * @param options.messages The validation messages. */ function whitespace(rule, value, source, errors, options) { if (/^\s+$/.test(value) || value === '') { errors.push(format(options.messages.whitespace, rule.fullField)); } } /* harmony default export */ var rule_whitespace = (whitespace); // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/type.js /* eslint max-len:0 */ var pattern = { // http://emailregex.com/ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, url: new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i'), hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i }; var types = { integer: function integer(value) { return types.number(value) && parseInt(value, 10) === value; }, float: function float(value) { return types.number(value) && !types.integer(value); }, array: function array(value) { return Array.isArray(value); }, regexp: function regexp(value) { if (value instanceof RegExp) { return true; } try { return !!new RegExp(value); } catch (e) { return false; } }, date: function date(value) { return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function'; }, number: function number(value) { if (isNaN(value)) { return false; } return typeof value === 'number'; }, object: function object(value) { return (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) === 'object' && !types.array(value); }, method: function method(value) { return typeof value === 'function'; }, email: function email(value) { return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255; }, url: function url(value) { return typeof value === 'string' && !!value.match(pattern.url); }, hex: function hex(value) { return typeof value === 'string' && !!value.match(pattern.hex); } }; /** * Rule for validating the type of a value. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param source The source object being validated. * @param errors An array of errors that this rule may add * validation errors to. * @param options The validation options. * @param options.messages The validation messages. */ function type_type(rule, value, source, errors, options) { if (rule.required && value === undefined) { rule_required(rule, value, source, errors, options); return; } var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex']; var ruleType = rule.type; if (custom.indexOf(ruleType) > -1) { if (!types[ruleType](value)) { errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); } // straight typeof check } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) !== rule.type) { errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); } } /* harmony default export */ var rule_type = (type_type); // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/range.js /** * Rule for validating minimum and maximum allowed values. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param source The source object being validated. * @param errors An array of errors that this rule may add * validation errors to. * @param options The validation options. * @param options.messages The validation messages. */ function range(rule, value, source, errors, options) { var len = typeof rule.len === 'number'; var min = typeof rule.min === 'number'; var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane) var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; var val = value; var key = null; var num = typeof value === 'number'; var str = typeof value === 'string'; var arr = Array.isArray(value); if (num) { key = 'number'; } else if (str) { key = 'string'; } else if (arr) { key = 'array'; } // if the value is not of a supported type for range validation // the validation rule rule should use the // type property to also test for a particular type if (!key) { return false; } if (arr) { val = value.length; } if (str) { // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3 val = value.replace(spRegexp, '_').length; } if (len) { if (val !== rule.len) { errors.push(format(options.messages[key].len, rule.fullField, rule.len)); } } else if (min && !max && val < rule.min) { errors.push(format(options.messages[key].min, rule.fullField, rule.min)); } else if (max && !min && val > rule.max) { errors.push(format(options.messages[key].max, rule.fullField, rule.max)); } else if (min && max && (val < rule.min || val > rule.max)) { errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max)); } } /* harmony default export */ var rule_range = (range); // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/enum.js var ENUM = 'enum'; /** * Rule for validating a value exists in an enumerable list. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param source The source object being validated. * @param errors An array of errors that this rule may add * validation errors to. * @param options The validation options. * @param options.messages The validation messages. */ function enumerable(rule, value, source, errors, options) { rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : []; if (rule[ENUM].indexOf(value) === -1) { errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', '))); } } /* harmony default export */ var rule_enum = (enumerable); // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/pattern.js /** * Rule for validating a regular expression pattern. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param source The source object being validated. * @param errors An array of errors that this rule may add * validation errors to. * @param options The validation options. * @param options.messages The validation messages. */ function pattern_pattern(rule, value, source, errors, options) { if (rule.pattern) { if (rule.pattern instanceof RegExp) { // if a RegExp instance is passed, reset `lastIndex` in case its `global` // flag is accidentally set to `true`, which in a validation scenario // is not necessary and the result might be misleading rule.pattern.lastIndex = 0; if (!rule.pattern.test(value)) { errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); } } else if (typeof rule.pattern === 'string') { var _pattern = new RegExp(rule.pattern); if (!_pattern.test(value)) { errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); } } } } /* harmony default export */ var rule_pattern = (pattern_pattern); // CONCATENATED MODULE: ./node_modules/async-validator/es/rule/index.js /* harmony default export */ var es_rule = ({ required: rule_required, whitespace: rule_whitespace, type: rule_type, range: rule_range, 'enum': rule_enum, pattern: rule_pattern }); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/string.js /** * Performs validation for string types. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function string(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, 'string') && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options, 'string'); if (!isEmptyValue(value, 'string')) { es_rule.type(rule, value, source, errors, options); es_rule.range(rule, value, source, errors, options); es_rule.pattern(rule, value, source, errors, options); if (rule.whitespace === true) { es_rule.whitespace(rule, value, source, errors, options); } } } callback(errors); } /* harmony default export */ var validator_string = (string); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/method.js /** * Validates a function. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function method(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value !== undefined) { es_rule.type(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_method = (method); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/number.js /** * Validates a number. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function number(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value !== undefined) { es_rule.type(rule, value, source, errors, options); es_rule.range(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_number = (number); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/boolean.js /** * Validates a boolean. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function boolean_boolean(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value !== undefined) { es_rule.type(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_boolean = (boolean_boolean); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/regexp.js /** * Validates the regular expression type. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function regexp(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (!isEmptyValue(value)) { es_rule.type(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_regexp = (regexp); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/integer.js /** * Validates a number is an integer. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function integer(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value !== undefined) { es_rule.type(rule, value, source, errors, options); es_rule.range(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_integer = (integer); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/float.js /** * Validates a number is a floating point number. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function floatFn(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value !== undefined) { es_rule.type(rule, value, source, errors, options); es_rule.range(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_float = (floatFn); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/array.js /** * Validates an array. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function array(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, 'array') && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options, 'array'); if (!isEmptyValue(value, 'array')) { es_rule.type(rule, value, source, errors, options); es_rule.range(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_array = (array); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/object.js /** * Validates an object. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function object_object(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value !== undefined) { es_rule.type(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_object = (object_object); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/enum.js var enum_ENUM = 'enum'; /** * Validates an enumerable list. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function enum_enumerable(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value) { es_rule[enum_ENUM](rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_enum = (enum_enumerable); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/pattern.js /** * Validates a regular expression pattern. * * Performs validation when a rule only contains * a pattern property but is not declared as a string type. * * @param rule The validation rule. * @param value The value of the field on the source object. * @param callback The callback function. * @param source The source object being validated. * @param options The validation options. * @param options.messages The validation messages. */ function validator_pattern_pattern(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, 'string') && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (!isEmptyValue(value, 'string')) { es_rule.pattern(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_pattern = (validator_pattern_pattern); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/date.js function date(rule, value, callback, source, options) { // console.log('integer rule called %j', rule); var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); // console.log('validate on %s value', value); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (!isEmptyValue(value)) { var dateObject = void 0; if (typeof value === 'number') { dateObject = new Date(value); } else { dateObject = value; } es_rule.type(rule, dateObject, source, errors, options); if (dateObject) { es_rule.range(rule, dateObject.getTime(), source, errors, options); } } } callback(errors); } /* harmony default export */ var validator_date = (date); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/required.js function required_required(rule, value, callback, source, options) { var errors = []; var type = Array.isArray(value) ? 'array' : typeof value === 'undefined' ? 'undefined' : typeof_default()(value); es_rule.required(rule, value, source, errors, options, type); callback(errors); } /* harmony default export */ var validator_required = (required_required); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/type.js function validator_type_type(rule, value, callback, source, options) { var ruleType = rule.type; var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, ruleType) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options, ruleType); if (!isEmptyValue(value, ruleType)) { es_rule.type(rule, value, source, errors, options); } } callback(errors); } /* harmony default export */ var validator_type = (validator_type_type); // CONCATENATED MODULE: ./node_modules/async-validator/es/validator/index.js /* harmony default export */ var es_validator = ({ string: validator_string, method: validator_method, number: validator_number, boolean: validator_boolean, regexp: validator_regexp, integer: validator_integer, float: validator_float, array: validator_array, object: validator_object, 'enum': validator_enum, pattern: validator_pattern, date: validator_date, url: validator_type, hex: validator_type, email: validator_type, required: validator_required }); // CONCATENATED MODULE: ./node_modules/async-validator/es/messages.js function newMessages() { return { 'default': 'Validation error on field %s', required: '%s is required', 'enum': '%s must be one of %s', whitespace: '%s cannot be empty', date: { format: '%s date %s is invalid for format %s', parse: '%s date could not be parsed, %s is invalid ', invalid: '%s date %s is invalid' }, types: { string: '%s is not a %s', method: '%s is not a %s (function)', array: '%s is not an %s', object: '%s is not an %s', number: '%s is not a %s', date: '%s is not a %s', boolean: '%s is not a %s', integer: '%s is not an %s', float: '%s is not a %s', regexp: '%s is not a valid %s', email: '%s is not a valid %s', url: '%s is not a valid %s', hex: '%s is not a valid %s' }, string: { len: '%s must be exactly %s characters', min: '%s must be at least %s characters', max: '%s cannot be longer than %s characters', range: '%s must be between %s and %s characters' }, number: { len: '%s must equal %s', min: '%s cannot be less than %s', max: '%s cannot be greater than %s', range: '%s must be between %s and %s' }, array: { len: '%s must be exactly %s in length', min: '%s cannot be less than %s in length', max: '%s cannot be greater than %s in length', range: '%s must be between %s and %s in length' }, pattern: { mismatch: '%s value %s does not match pattern %s' }, clone: function clone() { var cloned = JSON.parse(JSON.stringify(this)); cloned.clone = this.clone; return cloned; } }; } var messages_messages = newMessages(); // CONCATENATED MODULE: ./node_modules/async-validator/es/index.js /** * Encapsulates a validation schema. * * @param descriptor An object declaring validation rules * for this schema. */ function Schema(descriptor) { this.rules = null; this._messages = messages_messages; this.define(descriptor); } Schema.prototype = { messages: function messages(_messages) { if (_messages) { this._messages = deepMerge(newMessages(), _messages); } return this._messages; }, define: function define(rules) { if (!rules) { throw new Error('Cannot configure a schema with no rules'); } if ((typeof rules === 'undefined' ? 'undefined' : typeof_default()(rules)) !== 'object' || Array.isArray(rules)) { throw new Error('Rules must be an object'); } this.rules = {}; var z = void 0; var item = void 0; for (z in rules) { if (rules.hasOwnProperty(z)) { item = rules[z]; this.rules[z] = Array.isArray(item) ? item : [item]; } } }, validate: function validate(source_) { var _this = this; var o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var oc = arguments[2]; var source = source_; var options = o; var callback = oc; if (typeof options === 'function') { callback = options; options = {}; } if (!this.rules || Object.keys(this.rules).length === 0) { if (callback) { callback(); } return; } function complete(results) { var i = void 0; var field = void 0; var errors = []; var fields = {}; function add(e) { if (Array.isArray(e)) { errors = errors.concat.apply(errors, e); } else { errors.push(e); } } for (i = 0; i < results.length; i++) { add(results[i]); } if (!errors.length) { errors = null; fields = null; } else { for (i = 0; i < errors.length; i++) { field = errors[i].field; fields[field] = fields[field] || []; fields[field].push(errors[i]); } } callback(errors, fields); } if (options.messages) { var messages = this.messages(); if (messages === messages_messages) { messages = newMessages(); } deepMerge(messages, options.messages); options.messages = messages; } else { options.messages = this.messages(); } var arr = void 0; var value = void 0; var series = {}; var keys = options.keys || Object.keys(this.rules); keys.forEach(function (z) { arr = _this.rules[z]; value = source[z]; arr.forEach(function (r) { var rule = r; if (typeof rule.transform === 'function') { if (source === source_) { source = extends_default()({}, source); } value = source[z] = rule.transform(value); } if (typeof rule === 'function') { rule = { validator: rule }; } else { rule = extends_default()({}, rule); } rule.validator = _this.getValidationMethod(rule); rule.field = z; rule.fullField = rule.fullField || z; rule.type = _this.getType(rule); if (!rule.validator) { return; } series[z] = series[z] || []; series[z].push({ rule: rule, value: value, source: source, field: z }); }); }); var errorFields = {}; asyncMap(series, options, function (data, doIt) { var rule = data.rule; var deep = (rule.type === 'object' || rule.type === 'array') && (typeof_default()(rule.fields) === 'object' || typeof_default()(rule.defaultField) === 'object'); deep = deep && (rule.required || !rule.required && data.value); rule.field = data.field; function addFullfield(key, schema) { return extends_default()({}, schema, { fullField: rule.fullField + '.' + key }); } function cb() { var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var errors = e; if (!Array.isArray(errors)) { errors = [errors]; } if (errors.length) { warning('async-validator:', errors); } if (errors.length && rule.message) { errors = [].concat(rule.message); } errors = errors.map(complementError(rule)); if (options.first && errors.length) { errorFields[rule.field] = 1; return doIt(errors); } if (!deep) { doIt(errors); } else { // if rule is required but the target object // does not exist fail at the rule level and don't // go deeper if (rule.required && !data.value) { if (rule.message) { errors = [].concat(rule.message).map(complementError(rule)); } else if (options.error) { errors = [options.error(rule, format(options.messages.required, rule.field))]; } else { errors = []; } return doIt(errors); } var fieldsSchema = {}; if (rule.defaultField) { for (var k in data.value) { if (data.value.hasOwnProperty(k)) { fieldsSchema[k] = rule.defaultField; } } } fieldsSchema = extends_default()({}, fieldsSchema, data.rule.fields); for (var f in fieldsSchema) { if (fieldsSchema.hasOwnProperty(f)) { var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]]; fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f)); } } var schema = new Schema(fieldsSchema); schema.messages(options.messages); if (data.rule.options) { data.rule.options.messages = options.messages; data.rule.options.error = options.error; } schema.validate(data.value, data.rule.options || options, function (errs) { doIt(errs && errs.length ? errors.concat(errs) : errs); }); } } var res = rule.validator(rule, data.value, cb, data.source, options); if (res && res.then) { res.then(function () { return cb(); }, function (e) { return cb(e); }); } }, function (results) { complete(results); }); }, getType: function getType(rule) { if (rule.type === undefined && rule.pattern instanceof RegExp) { rule.type = 'pattern'; } if (typeof rule.validator !== 'function' && rule.type && !es_validator.hasOwnProperty(rule.type)) { throw new Error(format('Unknown rule type %s', rule.type)); } return rule.type || 'string'; }, getValidationMethod: function getValidationMethod(rule) { if (typeof rule.validator === 'function') { return rule.validator; } var keys = Object.keys(rule); var messageIndex = keys.indexOf('message'); if (messageIndex !== -1) { keys.splice(messageIndex, 1); } if (keys.length === 1 && keys[0] === 'required') { return es_validator.required; } return es_validator[this.getType(rule)] || false; } }; Schema.register = function register(type, validator) { if (typeof validator !== 'function') { throw new Error('Cannot register a validator by type, validator is not a function'); } es_validator[type] = validator; }; Schema.messages = messages_messages; /* harmony default export */ var es = __webpack_exports__["default"] = (Schema); /***/ }), /***/ "jx/E": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var DatePrototype = Date.prototype; var thisTimeValue = uncurryThis(DatePrototype.getTime); var setFullYear = uncurryThis(DatePrototype.setFullYear); // `Date.prototype.setYear` method // https://tc39.es/ecma262/#sec-date.prototype.setyear $({ target: 'Date', proto: true }, { setYear: function setYear(year) { // validate thisTimeValue(this); var yi = toIntegerOrInfinity(year); var yyyy = 0 <= yi && yi <= 99 ? yi + 1900 : yi; return setFullYear(this, yyyy); } }); /***/ }), /***/ "jyal": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("r54x"); module.exports = !fails(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); /***/ }), /***/ "k/L8": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); var notANaN = __webpack_require__("v86+"); var toPositiveInteger = __webpack_require__("PHrF"); var createAsyncIteratorProxy = __webpack_require__("M9Xa"); var createIterResultObject = __webpack_require__("l+3Q"); var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) { var state = this; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { state.done = true; reject(error); }; var loop = function () { try { Promise.resolve(anObject(call(state.next, state.iterator))).then(function (step) { try { if (anObject(step).done) { state.done = true; resolve(createIterResultObject(undefined, true)); } else if (state.remaining) { state.remaining--; loop(); } else resolve(createIterResultObject(step.value, false)); } catch (err) { doneAndReject(err); } }, doneAndReject); } catch (error) { doneAndReject(error); } }; loop(); }); }); // `AsyncIterator.prototype.drop` method // https://github.com/tc39/proposal-async-iterator-helpers $({ target: 'AsyncIterator', proto: true, real: true }, { drop: function drop(limit) { anObject(this); var remaining = toPositiveInteger(notANaN(+limit)); return new AsyncIteratorProxy(getIteratorDirect(this), { remaining: remaining }); } }); /***/ }), /***/ "k3DE": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var fails = __webpack_require__("r54x"); var toObject = __webpack_require__("EJk4"); var toPrimitive = __webpack_require__("whWw"); var FORCED = fails(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; }); // `Date.prototype.toJSON` method // https://tc39.es/ecma262/#sec-date.prototype.tojson $({ target: 'Date', proto: true, arity: 1, forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` toJSON: function toJSON(key) { var O = toObject(this); var pv = toPrimitive(O, 'number'); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); /***/ }), /***/ "k7nC": /***/ (function(module, exports) { /* * 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. */ // Fix for 钓鱼岛 // var Region = require('../Region'); // var zrUtil = require('zrender/src/core/util'); // var geoCoord = [126, 25]; var points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]]; function _default(mapType, region) { if (mapType === 'china' && region.name === '台湾') { region.geometries.push({ type: 'polygon', exterior: points[0] }); } } module.exports = _default; /***/ }), /***/ "k7no": /***/ (function(module, exports, __webpack_require__) { var lengthOfArrayLike = __webpack_require__("H8Gx"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var $RangeError = RangeError; // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with module.exports = function (O, C, index, value) { var len = lengthOfArrayLike(O); var relativeIndex = toIntegerOrInfinity(index); var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; if (actualIndex >= len || actualIndex < 0) throw $RangeError('Incorrect index'); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = k === actualIndex ? value : O[k]; return A; }; /***/ }), /***/ "k9Bd": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("P7Q7"); __webpack_require__("Y3kp"); var visualSymbol = __webpack_require__("AjK0"); var layoutPoints = __webpack_require__("1Nix"); /* * 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. */ echarts.registerVisual(visualSymbol('effectScatter', 'circle')); echarts.registerLayout(layoutPoints('effectScatter')); /***/ }), /***/ "kK7q": /***/ (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__("/gxq"); var graphic = __webpack_require__("0sHC"); var BoundingRect = __webpack_require__("8b51"); var _text = __webpack_require__("3h1/"); 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; /***/ }), /***/ "kKiV": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.17 Object.seal(O) var isObject = __webpack_require__("U9LJ"); var meta = __webpack_require__("QhHn").onFreeze; __webpack_require__("Iiwq")('seal', function ($seal) { return function seal(it) { return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); /***/ }), /***/ "kLED": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("8yv5"); var getKeys = __webpack_require__("/dY/"); var toIObject = __webpack_require__("xpmJ"); var isEnum = __webpack_require__("dWWz").f; module.exports = function (isEntries) { return function (it) { var O = toIObject(it); var keys = getKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS || isEnum.call(O, key)) { result.push(isEntries ? [key, O[key]] : O[key]); } } return result; }; }; /***/ }), /***/ "kNJA": /***/ (function(module, exports, __webpack_require__) { module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 61); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 15: /***/ (function(module, exports) { module.exports = __webpack_require__("fEB+"); /***/ }), /***/ 18: /***/ (function(module, exports) { module.exports = __webpack_require__("EKTV"); /***/ }), /***/ 21: /***/ (function(module, exports) { module.exports = __webpack_require__("E/in"); /***/ }), /***/ 26: /***/ (function(module, exports) { module.exports = __webpack_require__("nvbp"); /***/ }), /***/ 3: /***/ (function(module, exports) { module.exports = __webpack_require__("ylDJ"); /***/ }), /***/ 31: /***/ (function(module, exports) { module.exports = __webpack_require__("zTCi"); /***/ }), /***/ 41: /***/ (function(module, exports) { module.exports = __webpack_require__("hyEB"); /***/ }), /***/ 52: /***/ (function(module, exports) { module.exports = __webpack_require__("RDoK"); /***/ }), /***/ 6: /***/ (function(module, exports) { module.exports = __webpack_require__("y+7x"); /***/ }), /***/ 61: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=34932346& var cascader_panelvue_type_template_id_34932346_render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { class: ["el-cascader-panel", _vm.border && "is-bordered"], on: { keydown: _vm.handleKeyDown } }, _vm._l(_vm.menus, function(menu, index) { return _c("cascader-menu", { key: index, ref: "menu", refInFor: true, attrs: { index: index, nodes: menu } }) }), 1 ) } var staticRenderFns = [] cascader_panelvue_type_template_id_34932346_render._withStripped = true // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=34932346& // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props" var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(26); var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_); // EXTERNAL MODULE: external "element-ui/lib/scrollbar" var scrollbar_ = __webpack_require__(15); var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_); // EXTERNAL MODULE: external "element-ui/lib/checkbox" var checkbox_ = __webpack_require__(18); var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_); // EXTERNAL MODULE: external "element-ui/lib/radio" var radio_ = __webpack_require__(52); var radio_default = /*#__PURE__*/__webpack_require__.n(radio_); // EXTERNAL MODULE: external "element-ui/lib/utils/util" var util_ = __webpack_require__(3); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js& var stopPropagation = function stopPropagation(e) { return e.stopPropagation(); }; /* harmony default export */ var cascader_nodevue_type_script_lang_js_ = ({ inject: ['panel'], components: { ElCheckbox: checkbox_default.a, ElRadio: radio_default.a }, props: { node: { required: true }, nodeId: String }, computed: { config: function config() { return this.panel.config; }, isLeaf: function isLeaf() { return this.node.isLeaf; }, isDisabled: function isDisabled() { return this.node.isDisabled; }, checkedValue: function checkedValue() { return this.panel.checkedValue; }, isChecked: function isChecked() { return this.node.isSameNode(this.checkedValue); }, inActivePath: function inActivePath() { return this.isInPath(this.panel.activePath); }, inCheckedPath: function inCheckedPath() { var _this = this; if (!this.config.checkStrictly) return false; return this.panel.checkedNodePaths.some(function (checkedPath) { return _this.isInPath(checkedPath); }); }, value: function value() { return this.node.getValueByOption(); } }, methods: { handleExpand: function handleExpand() { var _this2 = this; var panel = this.panel, node = this.node, isDisabled = this.isDisabled, config = this.config; var multiple = config.multiple, checkStrictly = config.checkStrictly; if (!checkStrictly && isDisabled || node.loading) return; if (config.lazy && !node.loaded) { panel.lazyLoad(node, function () { // do not use cached leaf value here, invoke this.isLeaf to get new value. var isLeaf = _this2.isLeaf; if (!isLeaf) _this2.handleExpand(); if (multiple) { // if leaf sync checked state, else clear checked state var checked = isLeaf ? node.checked : false; _this2.handleMultiCheckChange(checked); } }); } else { panel.handleExpand(node); } }, handleCheckChange: function handleCheckChange() { var panel = this.panel, value = this.value, node = this.node; panel.handleCheckChange(value); panel.handleExpand(node); }, handleMultiCheckChange: function handleMultiCheckChange(checked) { this.node.doCheck(checked); this.panel.calculateMultiCheckedValue(); }, isInPath: function isInPath(pathNodes) { var node = this.node; var selectedPathNode = pathNodes[node.level - 1] || {}; return selectedPathNode.uid === node.uid; }, renderPrefix: function renderPrefix(h) { var isLeaf = this.isLeaf, isChecked = this.isChecked, config = this.config; var checkStrictly = config.checkStrictly, multiple = config.multiple; if (multiple) { return this.renderCheckbox(h); } else if (checkStrictly) { return this.renderRadio(h); } else if (isLeaf && isChecked) { return this.renderCheckIcon(h); } return null; }, renderPostfix: function renderPostfix(h) { var node = this.node, isLeaf = this.isLeaf; if (node.loading) { return this.renderLoadingIcon(h); } else if (!isLeaf) { return this.renderExpandIcon(h); } return null; }, renderCheckbox: function renderCheckbox(h) { var node = this.node, config = this.config, isDisabled = this.isDisabled; var events = { on: { change: this.handleMultiCheckChange }, nativeOn: {} }; if (config.checkStrictly) { // when every node is selectable, click event should not trigger expand event. events.nativeOn.click = stopPropagation; } return h('el-checkbox', external_babel_helper_vue_jsx_merge_props_default()([{ attrs: { value: node.checked, indeterminate: node.indeterminate, disabled: isDisabled } }, events])); }, renderRadio: function renderRadio(h) { var checkedValue = this.checkedValue, value = this.value, isDisabled = this.isDisabled; // to keep same reference if value cause radio's checked state is calculated by reference comparision; if (Object(util_["isEqual"])(value, checkedValue)) { value = checkedValue; } return h( 'el-radio', { attrs: { value: checkedValue, label: value, disabled: isDisabled }, on: { 'change': this.handleCheckChange }, nativeOn: { 'click': stopPropagation } }, [h('span')] ); }, renderCheckIcon: function renderCheckIcon(h) { return h('i', { 'class': 'el-icon-check el-cascader-node__prefix' }); }, renderLoadingIcon: function renderLoadingIcon(h) { return h('i', { 'class': 'el-icon-loading el-cascader-node__postfix' }); }, renderExpandIcon: function renderExpandIcon(h) { return h('i', { 'class': 'el-icon-arrow-right el-cascader-node__postfix' }); }, renderContent: function renderContent(h) { var panel = this.panel, node = this.node; var render = panel.renderLabelFn; var vnode = render ? render({ node: node, data: node.data }) : null; return h( 'span', { 'class': 'el-cascader-node__label' }, [vnode || node.label] ); } }, render: function render(h) { var _this3 = this; var inActivePath = this.inActivePath, inCheckedPath = this.inCheckedPath, isChecked = this.isChecked, isLeaf = this.isLeaf, isDisabled = this.isDisabled, config = this.config, nodeId = this.nodeId; var expandTrigger = config.expandTrigger, checkStrictly = config.checkStrictly, multiple = config.multiple; var disabled = !checkStrictly && isDisabled; var events = { on: {} }; if (expandTrigger === 'click') { events.on.click = this.handleExpand; } else { events.on.mouseenter = function (e) { _this3.handleExpand(); _this3.$emit('expand', e); }; events.on.focus = function (e) { _this3.handleExpand(); _this3.$emit('expand', e); }; } if (isLeaf && !isDisabled && !checkStrictly && !multiple) { events.on.click = this.handleCheckChange; } return h( 'li', external_babel_helper_vue_jsx_merge_props_default()([{ attrs: { role: 'menuitem', id: nodeId, 'aria-expanded': inActivePath, tabindex: disabled ? null : -1 }, 'class': { 'el-cascader-node': true, 'is-selectable': checkStrictly, 'in-active-path': inActivePath, 'in-checked-path': inCheckedPath, 'is-active': isChecked, 'is-disabled': disabled } }, events]), [this.renderPrefix(h), this.renderContent(h), this.renderPostfix(h)] ); } }); // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js& /* harmony default export */ var src_cascader_nodevue_type_script_lang_js_ = (cascader_nodevue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(0); // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue var cascader_node_render, cascader_node_staticRenderFns /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_cascader_nodevue_type_script_lang_js_, cascader_node_render, cascader_node_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/cascader-panel/src/cascader-node.vue" /* harmony default export */ var cascader_node = (component.exports); // EXTERNAL MODULE: external "element-ui/lib/mixins/locale" var locale_ = __webpack_require__(6); var locale_default = /*#__PURE__*/__webpack_require__.n(locale_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js& /* harmony default export */ var cascader_menuvue_type_script_lang_js_ = ({ name: 'ElCascaderMenu', mixins: [locale_default.a], inject: ['panel'], components: { ElScrollbar: scrollbar_default.a, CascaderNode: cascader_node }, props: { nodes: { type: Array, required: true }, index: Number }, data: function data() { return { activeNode: null, hoverTimer: null, id: Object(util_["generateId"])() }; }, computed: { isEmpty: function isEmpty() { return !this.nodes.length; }, menuId: function menuId() { return 'cascader-menu-' + this.id + '-' + this.index; } }, methods: { handleExpand: function handleExpand(e) { this.activeNode = e.target; }, handleMouseMove: function handleMouseMove(e) { var activeNode = this.activeNode, hoverTimer = this.hoverTimer; var hoverZone = this.$refs.hoverZone; if (!activeNode || !hoverZone) return; if (activeNode.contains(e.target)) { clearTimeout(hoverTimer); var _$el$getBoundingClien = this.$el.getBoundingClientRect(), left = _$el$getBoundingClien.left; var startX = e.clientX - left; var _$el = this.$el, offsetWidth = _$el.offsetWidth, offsetHeight = _$el.offsetHeight; var top = activeNode.offsetTop; var bottom = top + activeNode.offsetHeight; hoverZone.innerHTML = '\n \n \n '; } else if (!hoverTimer) { this.hoverTimer = setTimeout(this.clearHoverZone, this.panel.config.hoverThreshold); } }, clearHoverZone: function clearHoverZone() { var hoverZone = this.$refs.hoverZone; if (!hoverZone) return; hoverZone.innerHTML = ''; }, renderEmptyText: function renderEmptyText(h) { return h( 'div', { 'class': 'el-cascader-menu__empty-text' }, [this.t('el.cascader.noData')] ); }, renderNodeList: function renderNodeList(h) { var menuId = this.menuId; var isHoverMenu = this.panel.isHoverMenu; var events = { on: {} }; if (isHoverMenu) { events.on.expand = this.handleExpand; } var nodes = this.nodes.map(function (node, index) { var hasChildren = node.hasChildren; return h('cascader-node', external_babel_helper_vue_jsx_merge_props_default()([{ key: node.uid, attrs: { node: node, 'node-id': menuId + '-' + index, 'aria-haspopup': hasChildren, 'aria-owns': hasChildren ? menuId : null } }, events])); }); return [].concat(nodes, [isHoverMenu ? h('svg', { ref: 'hoverZone', 'class': 'el-cascader-menu__hover-zone' }) : null]); } }, render: function render(h) { var isEmpty = this.isEmpty, menuId = this.menuId; var events = { nativeOn: {} }; // optimize hover to expand experience (#8010) if (this.panel.isHoverMenu) { events.nativeOn.mousemove = this.handleMouseMove; // events.nativeOn.mouseleave = this.clearHoverZone; } return h( 'el-scrollbar', external_babel_helper_vue_jsx_merge_props_default()([{ attrs: { tag: 'ul', role: 'menu', id: menuId, 'wrap-class': 'el-cascader-menu__wrap', 'view-class': { 'el-cascader-menu__list': true, 'is-empty': isEmpty } }, 'class': 'el-cascader-menu' }, events]), [isEmpty ? this.renderEmptyText(h) : this.renderNodeList(h)] ); } }); // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js& /* harmony default export */ var src_cascader_menuvue_type_script_lang_js_ = (cascader_menuvue_type_script_lang_js_); // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue var cascader_menu_render, cascader_menu_staticRenderFns /* normalize component */ var cascader_menu_component = Object(componentNormalizer["a" /* default */])( src_cascader_menuvue_type_script_lang_js_, cascader_menu_render, cascader_menu_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var cascader_menu_api; } cascader_menu_component.options.__file = "packages/cascader-panel/src/cascader-menu.vue" /* harmony default export */ var cascader_menu = (cascader_menu_component.exports); // EXTERNAL MODULE: external "element-ui/lib/utils/shared" var shared_ = __webpack_require__(21); // CONCATENATED MODULE: ./packages/cascader-panel/src/node.js var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var uid = 0; var node_Node = function () { function Node(data, config, parentNode) { _classCallCheck(this, Node); this.data = data; this.config = config; this.parent = parentNode || null; this.level = !this.parent ? 1 : this.parent.level + 1; this.uid = uid++; this.initState(); this.initChildren(); } Node.prototype.initState = function initState() { var _config = this.config, valueKey = _config.value, labelKey = _config.label; this.value = this.data[valueKey]; this.label = this.data[labelKey]; this.pathNodes = this.calculatePathNodes(); this.path = this.pathNodes.map(function (node) { return node.value; }); this.pathLabels = this.pathNodes.map(function (node) { return node.label; }); // lazy load this.loading = false; this.loaded = false; }; Node.prototype.initChildren = function initChildren() { var _this = this; var config = this.config; var childrenKey = config.children; var childrenData = this.data[childrenKey]; this.hasChildren = Array.isArray(childrenData); this.children = (childrenData || []).map(function (child) { return new Node(child, config, _this); }); }; Node.prototype.calculatePathNodes = function calculatePathNodes() { var nodes = [this]; var parent = this.parent; while (parent) { nodes.unshift(parent); parent = parent.parent; } return nodes; }; Node.prototype.getPath = function getPath() { return this.path; }; Node.prototype.getValue = function getValue() { return this.value; }; Node.prototype.getValueByOption = function getValueByOption() { return this.config.emitPath ? this.getPath() : this.getValue(); }; Node.prototype.getText = function getText(allLevels, separator) { return allLevels ? this.pathLabels.join(separator) : this.label; }; Node.prototype.isSameNode = function isSameNode(checkedValue) { var value = this.getValueByOption(); return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) { return Object(util_["isEqual"])(val, value); }) : Object(util_["isEqual"])(checkedValue, value); }; Node.prototype.broadcast = function broadcast(event) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var handlerName = 'onParent' + Object(util_["capitalize"])(event); this.children.forEach(function (child) { if (child) { // bottom up child.broadcast.apply(child, [event].concat(args)); child[handlerName] && child[handlerName].apply(child, args); } }); }; Node.prototype.emit = function emit(event) { var parent = this.parent; var handlerName = 'onChild' + Object(util_["capitalize"])(event); if (parent) { for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } parent[handlerName] && parent[handlerName].apply(parent, args); parent.emit.apply(parent, [event].concat(args)); } }; Node.prototype.onParentCheck = function onParentCheck(checked) { if (!this.isDisabled) { this.setCheckState(checked); } }; Node.prototype.onChildCheck = function onChildCheck() { var children = this.children; var validChildren = children.filter(function (child) { return !child.isDisabled; }); var checked = validChildren.length ? validChildren.every(function (child) { return child.checked; }) : false; this.setCheckState(checked); }; Node.prototype.setCheckState = function setCheckState(checked) { var totalNum = this.children.length; var checkedNum = this.children.reduce(function (c, p) { var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0; return c + num; }, 0); this.checked = checked; this.indeterminate = checkedNum !== totalNum && checkedNum > 0; }; Node.prototype.syncCheckState = function syncCheckState(checkedValue) { var value = this.getValueByOption(); var checked = this.isSameNode(checkedValue, value); this.doCheck(checked); }; Node.prototype.doCheck = function doCheck(checked) { if (this.checked !== checked) { if (this.config.checkStrictly) { this.checked = checked; } else { // bottom up to unify the calculation of the indeterminate state this.broadcast('check', checked); this.setCheckState(checked); this.emit('check'); } } }; _createClass(Node, [{ key: 'isDisabled', get: function get() { var data = this.data, parent = this.parent, config = this.config; var disabledKey = config.disabled; var checkStrictly = config.checkStrictly; return data[disabledKey] || !checkStrictly && parent && parent.isDisabled; } }, { key: 'isLeaf', get: function get() { var data = this.data, loaded = this.loaded, hasChildren = this.hasChildren, children = this.children; var _config2 = this.config, lazy = _config2.lazy, leafKey = _config2.leaf; if (lazy) { var isLeaf = Object(shared_["isDef"])(data[leafKey]) ? data[leafKey] : loaded ? !children.length : false; this.hasChildren = !isLeaf; return isLeaf; } return !hasChildren; } }]); return Node; }(); /* harmony default export */ var src_node = (node_Node); // CONCATENATED MODULE: ./packages/cascader-panel/src/store.js function store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var flatNodes = function flatNodes(data, leafOnly) { return data.reduce(function (res, node) { if (node.isLeaf) { res.push(node); } else { !leafOnly && res.push(node); res = res.concat(flatNodes(node.children, leafOnly)); } return res; }, []); }; var store_Store = function () { function Store(data, config) { store_classCallCheck(this, Store); this.config = config; this.initNodes(data); } Store.prototype.initNodes = function initNodes(data) { var _this = this; data = Object(util_["coerceTruthyValueToArray"])(data); this.nodes = data.map(function (nodeData) { return new src_node(nodeData, _this.config); }); this.flattedNodes = this.getFlattedNodes(false, false); this.leafNodes = this.getFlattedNodes(true, false); }; Store.prototype.appendNode = function appendNode(nodeData, parentNode) { var node = new src_node(nodeData, this.config, parentNode); var children = parentNode ? parentNode.children : this.nodes; children.push(node); }; Store.prototype.appendNodes = function appendNodes(nodeDataList, parentNode) { var _this2 = this; nodeDataList = Object(util_["coerceTruthyValueToArray"])(nodeDataList); nodeDataList.forEach(function (nodeData) { return _this2.appendNode(nodeData, parentNode); }); }; Store.prototype.getNodes = function getNodes() { return this.nodes; }; Store.prototype.getFlattedNodes = function getFlattedNodes(leafOnly) { var cached = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var cachedNodes = leafOnly ? this.leafNodes : this.flattedNodes; return cached ? cachedNodes : flatNodes(this.nodes, leafOnly); }; Store.prototype.getNodeByValue = function getNodeByValue(value) { var nodes = this.getFlattedNodes(false, !this.config.lazy).filter(function (node) { return Object(util_["valueEquals"])(node.path, value) || node.value === value; }); return nodes && nodes.length ? nodes[0] : null; }; return Store; }(); /* harmony default export */ var src_store = (store_Store); // EXTERNAL MODULE: external "element-ui/lib/utils/merge" var merge_ = __webpack_require__(9); var merge_default = /*#__PURE__*/__webpack_require__.n(merge_); // EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils" var aria_utils_ = __webpack_require__(41); var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_); // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view" var scroll_into_view_ = __webpack_require__(31); var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js& var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // // // // // // // // // // // // // // // // var KeyCode = aria_utils_default.a.keys; var DefaultProps = { expandTrigger: 'click', // or hover multiple: false, checkStrictly: false, // whether all nodes can be selected emitPath: true, // wether to emit an array of all levels value in which node is located lazy: false, lazyLoad: util_["noop"], value: 'value', label: 'label', children: 'children', leaf: 'leaf', disabled: 'disabled', hoverThreshold: 500 }; var cascader_panelvue_type_script_lang_js_isLeaf = function isLeaf(el) { return !el.getAttribute('aria-owns'); }; var getSibling = function getSibling(el, distance) { var parentNode = el.parentNode; if (parentNode) { var siblings = parentNode.querySelectorAll('.el-cascader-node[tabindex="-1"]'); var index = Array.prototype.indexOf.call(siblings, el); return siblings[index + distance] || null; } return null; }; var getMenuIndex = function getMenuIndex(el, distance) { if (!el) return; var pieces = el.id.split('-'); return Number(pieces[pieces.length - 2]); }; var focusNode = function focusNode(el) { if (!el) return; el.focus(); !cascader_panelvue_type_script_lang_js_isLeaf(el) && el.click(); }; var checkNode = function checkNode(el) { if (!el) return; var input = el.querySelector('input'); if (input) { input.click(); } else if (cascader_panelvue_type_script_lang_js_isLeaf(el)) { el.click(); } }; /* harmony default export */ var cascader_panelvue_type_script_lang_js_ = ({ name: 'ElCascaderPanel', components: { CascaderMenu: cascader_menu }, props: { value: {}, options: Array, props: Object, border: { type: Boolean, default: true }, renderLabel: Function }, provide: function provide() { return { panel: this }; }, data: function data() { return { checkedValue: null, checkedNodePaths: [], store: [], menus: [], activePath: [], loadCount: 0 }; }, computed: { config: function config() { return merge_default()(_extends({}, DefaultProps), this.props || {}); }, multiple: function multiple() { return this.config.multiple; }, checkStrictly: function checkStrictly() { return this.config.checkStrictly; }, leafOnly: function leafOnly() { return !this.checkStrictly; }, isHoverMenu: function isHoverMenu() { return this.config.expandTrigger === 'hover'; }, renderLabelFn: function renderLabelFn() { return this.renderLabel || this.$scopedSlots.default; } }, watch: { value: function value() { this.syncCheckedValue(); this.checkStrictly && this.calculateCheckedNodePaths(); }, options: { handler: function handler() { this.initStore(); }, immediate: true, deep: true }, checkedValue: function checkedValue(val) { if (!Object(util_["isEqual"])(val, this.value)) { this.checkStrictly && this.calculateCheckedNodePaths(); this.$emit('input', val); this.$emit('change', val); } } }, mounted: function mounted() { if (!this.isEmptyValue(this.value)) { this.syncCheckedValue(); } }, methods: { initStore: function initStore() { var config = this.config, options = this.options; if (config.lazy && Object(util_["isEmpty"])(options)) { this.lazyLoad(); } else { this.store = new src_store(options, config); this.menus = [this.store.getNodes()]; this.syncMenuState(); } }, syncCheckedValue: function syncCheckedValue() { var value = this.value, checkedValue = this.checkedValue; if (!Object(util_["isEqual"])(value, checkedValue)) { this.activePath = []; this.checkedValue = value; this.syncMenuState(); } }, syncMenuState: function syncMenuState() { var multiple = this.multiple, checkStrictly = this.checkStrictly; this.syncActivePath(); multiple && this.syncMultiCheckState(); checkStrictly && this.calculateCheckedNodePaths(); this.$nextTick(this.scrollIntoView); }, syncMultiCheckState: function syncMultiCheckState() { var _this = this; var nodes = this.getFlattedNodes(this.leafOnly); nodes.forEach(function (node) { node.syncCheckState(_this.checkedValue); }); }, isEmptyValue: function isEmptyValue(val) { var multiple = this.multiple, config = this.config; var emitPath = config.emitPath; if (multiple || emitPath) { return Object(util_["isEmpty"])(val); } return false; }, syncActivePath: function syncActivePath() { var _this2 = this; var store = this.store, multiple = this.multiple, activePath = this.activePath, checkedValue = this.checkedValue; if (!Object(util_["isEmpty"])(activePath)) { var nodes = activePath.map(function (node) { return _this2.getNodeByValue(node.getValue()); }); this.expandNodes(nodes); } else if (!this.isEmptyValue(checkedValue)) { var value = multiple ? checkedValue[0] : checkedValue; var checkedNode = this.getNodeByValue(value) || {}; var _nodes = (checkedNode.pathNodes || []).slice(0, -1); this.expandNodes(_nodes); } else { this.activePath = []; this.menus = [store.getNodes()]; } }, expandNodes: function expandNodes(nodes) { var _this3 = this; nodes.forEach(function (node) { return _this3.handleExpand(node, true /* silent */); }); }, calculateCheckedNodePaths: function calculateCheckedNodePaths() { var _this4 = this; var checkedValue = this.checkedValue, multiple = this.multiple; var checkedValues = multiple ? Object(util_["coerceTruthyValueToArray"])(checkedValue) : [checkedValue]; this.checkedNodePaths = checkedValues.map(function (v) { var checkedNode = _this4.getNodeByValue(v); return checkedNode ? checkedNode.pathNodes : []; }); }, handleKeyDown: function handleKeyDown(e) { var target = e.target, keyCode = e.keyCode; switch (keyCode) { case KeyCode.up: var prev = getSibling(target, -1); focusNode(prev); break; case KeyCode.down: var next = getSibling(target, 1); focusNode(next); break; case KeyCode.left: var preMenu = this.$refs.menu[getMenuIndex(target) - 1]; if (preMenu) { var expandedNode = preMenu.$el.querySelector('.el-cascader-node[aria-expanded="true"]'); focusNode(expandedNode); } break; case KeyCode.right: var nextMenu = this.$refs.menu[getMenuIndex(target) + 1]; if (nextMenu) { var firstNode = nextMenu.$el.querySelector('.el-cascader-node[tabindex="-1"]'); focusNode(firstNode); } break; case KeyCode.enter: checkNode(target); break; case KeyCode.esc: case KeyCode.tab: this.$emit('close'); break; default: return; } }, handleExpand: function handleExpand(node, silent) { var activePath = this.activePath; var level = node.level; var path = activePath.slice(0, level - 1); var menus = this.menus.slice(0, level); if (!node.isLeaf) { path.push(node); menus.push(node.children); } this.activePath = path; this.menus = menus; if (!silent) { var pathValues = path.map(function (node) { return node.getValue(); }); var activePathValues = activePath.map(function (node) { return node.getValue(); }); if (!Object(util_["valueEquals"])(pathValues, activePathValues)) { this.$emit('active-item-change', pathValues); // Deprecated this.$emit('expand-change', pathValues); } } }, handleCheckChange: function handleCheckChange(value) { this.checkedValue = value; }, lazyLoad: function lazyLoad(node, onFullfiled) { var _this5 = this; var config = this.config; if (!node) { node = node || { root: true, level: 0 }; this.store = new src_store([], config); this.menus = [this.store.getNodes()]; } node.loading = true; var resolve = function resolve(dataList) { var parent = node.root ? null : node; dataList && dataList.length && _this5.store.appendNodes(dataList, parent); node.loading = false; node.loaded = true; // dispose default value on lazy load mode if (Array.isArray(_this5.checkedValue)) { var nodeValue = _this5.checkedValue[_this5.loadCount++]; var valueKey = _this5.config.value; var leafKey = _this5.config.leaf; if (Array.isArray(dataList) && dataList.filter(function (item) { return item[valueKey] === nodeValue; }).length > 0) { var checkedNode = _this5.store.getNodeByValue(nodeValue); if (!checkedNode.data[leafKey]) { _this5.lazyLoad(checkedNode, function () { _this5.handleExpand(checkedNode); }); } if (_this5.loadCount === _this5.checkedValue.length) { _this5.$parent.computePresentText(); } } } onFullfiled && onFullfiled(dataList); }; config.lazyLoad(node, resolve); }, /** * public methods */ calculateMultiCheckedValue: function calculateMultiCheckedValue() { this.checkedValue = this.getCheckedNodes(this.leafOnly).map(function (node) { return node.getValueByOption(); }); }, scrollIntoView: function scrollIntoView() { if (this.$isServer) return; var menus = this.$refs.menu || []; menus.forEach(function (menu) { var menuElement = menu.$el; if (menuElement) { var container = menuElement.querySelector('.el-scrollbar__wrap'); var activeNode = menuElement.querySelector('.el-cascader-node.is-active') || menuElement.querySelector('.el-cascader-node.in-active-path'); scroll_into_view_default()(container, activeNode); } }); }, getNodeByValue: function getNodeByValue(val) { return this.store.getNodeByValue(val); }, getFlattedNodes: function getFlattedNodes(leafOnly) { var cached = !this.config.lazy; return this.store.getFlattedNodes(leafOnly, cached); }, getCheckedNodes: function getCheckedNodes(leafOnly) { var checkedValue = this.checkedValue, multiple = this.multiple; if (multiple) { var nodes = this.getFlattedNodes(leafOnly); return nodes.filter(function (node) { return node.checked; }); } else { return this.isEmptyValue(checkedValue) ? [] : [this.getNodeByValue(checkedValue)]; } }, clearCheckedNodes: function clearCheckedNodes() { var config = this.config, leafOnly = this.leafOnly; var multiple = config.multiple, emitPath = config.emitPath; if (multiple) { this.getCheckedNodes(leafOnly).filter(function (node) { return !node.isDisabled; }).forEach(function (node) { return node.doCheck(false); }); this.calculateMultiCheckedValue(); } else { this.checkedValue = emitPath ? [] : null; } } } }); // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js& /* harmony default export */ var src_cascader_panelvue_type_script_lang_js_ = (cascader_panelvue_type_script_lang_js_); // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue /* normalize component */ var cascader_panel_component = Object(componentNormalizer["a" /* default */])( src_cascader_panelvue_type_script_lang_js_, cascader_panelvue_type_template_id_34932346_render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var cascader_panel_api; } cascader_panel_component.options.__file = "packages/cascader-panel/src/cascader-panel.vue" /* harmony default export */ var cascader_panel = (cascader_panel_component.exports); // CONCATENATED MODULE: ./packages/cascader-panel/index.js /* istanbul ignore next */ cascader_panel.install = function (Vue) { Vue.component(cascader_panel.name, cascader_panel); }; /* harmony default export */ var packages_cascader_panel = __webpack_exports__["default"] = (cascader_panel); /***/ }), /***/ 9: /***/ (function(module, exports) { module.exports = __webpack_require__("jmaC"); /***/ }) /******/ }); /***/ }), /***/ "kQD9": /***/ (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__("/gxq"); /* * 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. */ /** * Data selectable mixin for chart series. * To eanble data select, option of series must have `selectedMode`. * And each data item will use `selected` to toggle itself selected status */ var _default = { /** * @param {Array.} targetList [{name, value, selected}, ...] * If targetList is an array, it should like [{name: ..., value: ...}, ...]. * If targetList is a "List", it must have coordDim: 'value' dimension and name. */ updateSelectedMap: function (targetList) { this._targetList = zrUtil.isArray(targetList) ? targetList.slice() : []; this._selectTargetMap = zrUtil.reduce(targetList || [], function (targetMap, target) { targetMap.set(target.name, target); return targetMap; }, zrUtil.createHashMap()); }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ // PENGING If selectedMode is null ? select: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); var selectedMode = this.get('selectedMode'); if (selectedMode === 'single') { this._selectTargetMap.each(function (target) { target.selected = false; }); } target && (target.selected = true); }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ unSelect: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); // var selectedMode = this.get('selectedMode'); // selectedMode !== 'single' && target && (target.selected = false); target && (target.selected = false); }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ toggleSelected: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); if (target != null) { this[target.selected ? 'unSelect' : 'select'](name, id); return target.selected; } }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ isSelected: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); return target && target.selected; } }; module.exports = _default; /***/ }), /***/ "kRoP": /***/ (function(module, exports) { // `SameValue` abstract operation // https://tc39.es/ecma262/#sec-samevalue // eslint-disable-next-line es/no-object-is -- safe module.exports = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare -- NaN check return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; /***/ }), /***/ "kdOt": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var _model = __webpack_require__("vXqC"); var makeInner = _model.makeInner; var getDataItemValue = _model.getDataItemValue; var _util = __webpack_require__("/gxq"); 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__("rrAD"); var _sourceType = __webpack_require__("+2Ke"); 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; /***/ }), /***/ "kfMr": /***/ (function(module, exports, __webpack_require__) { "use strict"; var anObject = __webpack_require__("PGRs"); var sameValue = __webpack_require__("wNcl"); var regExpExec = __webpack_require__("Zn18"); // @@search logic __webpack_require__("UIZt")('search', 1, function (defined, SEARCH, $search, maybeCallNative) { return [ // `String.prototype.search` method // https://tc39.github.io/ecma262/#sec-string.prototype.search function search(regexp) { var O = defined(this); var fn = regexp == undefined ? undefined : regexp[SEARCH]; return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search function (regexp) { var res = maybeCallNative($search, regexp, this); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var previousLastIndex = rx.lastIndex; if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; var result = regExpExec(rx, S); if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; return result === null ? -1 : result.index; } ]; }); /***/ }), /***/ "kkvn": /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__("3fMt"); var invoke = __webpack_require__("eg8w"); var html = __webpack_require__("+iDZ"); var cel = __webpack_require__("PY1i"); var global = __webpack_require__("YjQv"); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func invoke(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (__webpack_require__("NZra")(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(ctx(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { defer = function (id) { global.postMessage(id + '', '*'); }; global.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in cel('script')) { defer = function (id) { html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; /***/ }), /***/ "km6+": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var fails = __webpack_require__("r54x"); var toObject = __webpack_require__("EJk4"); var nativeGetPrototypeOf = __webpack_require__("wzd1"); var CORRECT_PROTOTYPE_GETTER = __webpack_require__("HVdB"); var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); }); // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { getPrototypeOf: function getPrototypeOf(it) { return nativeGetPrototypeOf(toObject(it)); } }); /***/ }), /***/ "kruC": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__("eqAp"); var toObject = __webpack_require__("AeeY"); var aFunction = __webpack_require__("B63G"); var $defineProperty = __webpack_require__("rBVO"); // B.2.2.2 Object.prototype.__defineGetter__(P, getter) __webpack_require__("8yv5") && $export($export.P + __webpack_require__("danu"), 'Object', { __defineGetter__: function __defineGetter__(P, getter) { $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); } }); /***/ }), /***/ "ksFB": /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__("wiaE"); var defined = __webpack_require__("+MZ2"); module.exports = function (it) { return IObject(defined(it)); }; /***/ }), /***/ "kyeA": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("n2n7"); var getOwnPropertyDescriptor = __webpack_require__("He3V").f; var toLength = __webpack_require__("xDUa"); var toString = __webpack_require__("nnBu"); var notARegExp = __webpack_require__("tqEa"); var requireObjectCoercible = __webpack_require__("hiy0"); var correctIsRegExpLogic = __webpack_require__("CTE+"); var IS_PURE = __webpack_require__("pzR0"); // eslint-disable-next-line es/no-string-prototype-endswith -- safe var nativeEndsWith = uncurryThis(''.endsWith); var slice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); // https://github.com/zloirock/core-js/pull/702 var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.endsWith` method // https://tc39.es/ecma262/#sec-string.prototype.endswith $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = that.length; var end = endPosition === undefined ? len : min(toLength(endPosition), len); var search = toString(searchString); return nativeEndsWith ? nativeEndsWith(that, search, end) : slice(that, end - search.length, end) === search; } }); /***/ }), /***/ "l+3Q": /***/ (function(module, exports) { // `CreateIterResultObject` abstract operation // https://tc39.es/ecma262/#sec-createiterresultobject module.exports = function (value, done) { return { value: value, done: done }; }; /***/ }), /***/ "l2wH": /***/ (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. */ __webpack_require__("cuL/"); __webpack_require__("sJ4e"); __webpack_require__("ilLo"); __webpack_require__("r9WW"); __webpack_require__("WO3U"); __webpack_require__("b/SY"); __webpack_require__("KAfT"); /***/ }), /***/ "l3mU": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("+3lO"); __webpack_require__("tz60"); module.exports = __webpack_require__("Dl99"); /***/ }), /***/ "l4Op": /***/ (function(module, exports) { /* * 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. */ function _default(seriesType) { return { seriesType: seriesType, reset: function (seriesModel, ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (!legendModels || !legendModels.length) { return; } var data = seriesModel.getData(); data.filterSelf(function (idx) { var name = data.getName(idx); // If in any legend component the status is not selected. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(name)) { return false; } } return true; }); } }; } module.exports = _default; /***/ }), /***/ "lAmK": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var toSetLike = __webpack_require__("QZ6x"); var $symmetricDifference = __webpack_require__("LECd"); // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $({ target: 'Set', proto: true, real: true, forced: true }, { symmetricDifference: function symmetricDifference(other) { return call($symmetricDifference, this, toSetLike(other)); } }); /***/ }), /***/ "lCha": /***/ (function(module, exports, __webpack_require__) { // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = __webpack_require__("eqAp"); var aFunction = __webpack_require__("B63G"); var anObject = __webpack_require__("PGRs"); var rApply = (__webpack_require__("vR0S").Reflect || {}).apply; var fApply = Function.apply; // MS Edge argumentsList argument is optional $export($export.S + $export.F * !__webpack_require__("HTem")(function () { rApply(function () { /* empty */ }); }), 'Reflect', { apply: function apply(target, thisArgument, argumentsList) { var T = aFunction(target); var L = anObject(argumentsList); return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); } }); /***/ }), /***/ "lFkc": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ExecutionEnvironment */ /*jslint evil: true */ var canUseDOM = !!( typeof window !== 'undefined' && window.document && window.document.createElement ); /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; /***/ }), /***/ "lHtY": /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__("eqAp"); var $parseFloat = __webpack_require__("RXyq"); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); /***/ }), /***/ "lICU": /***/ (function(module, exports, __webpack_require__) { var createTypedArrayConstructor = __webpack_require__("alCT"); // `Uint8ClampedArray` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Uint8', function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }, true); /***/ }), /***/ "lMbK": /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__("u4Az"); var aCallable = __webpack_require__("eZJ6"); module.exports = function demethodize() { return uncurryThis(aCallable(this)); }; /***/ }), /***/ "lND5": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var log10 = __webpack_require__("Ln87"); // `Math.log10` method // https://tc39.es/ecma262/#sec-math.log10 $({ target: 'Math', stat: true }, { log10: log10 }); /***/ }), /***/ "lPz5": /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__("G3Gk"); var $export = __webpack_require__("eqAp"); var redefine = __webpack_require__("au66"); var hide = __webpack_require__("CfIS"); var Iterators = __webpack_require__("xnnD"); var $iterCreate = __webpack_require__("m1wx"); var setToStringTag = __webpack_require__("W97E"); var getPrototypeOf = __webpack_require__("spe/"); var ITERATOR = __webpack_require__("6hGG")('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }), /***/ "lQLA": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var DESCRIPTORS = __webpack_require__("q0qZ"); var FORCED = __webpack_require__("ZAmB"); var aCallable = __webpack_require__("eZJ6"); var toObject = __webpack_require__("EJk4"); var definePropertyModule = __webpack_require__("1rEs"); // `Object.prototype.__defineGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__ if (DESCRIPTORS) { $({ target: 'Object', proto: true, forced: FORCED }, { __defineGetter__: function __defineGetter__(P, getter) { definePropertyModule.f(toObject(this), P, { get: aCallable(getter), enumerable: true, configurable: true }); } }); } /***/ }), /***/ "lVde": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var echarts = __webpack_require__("Icdr"); var zrUtil = __webpack_require__("/gxq"); var AxisBuilder = __webpack_require__("vjPX"); var graphic = __webpack_require__("0sHC"); /* * 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 _default = echarts.extendComponentView({ type: 'radar', render: function (radarModel, ecModel, api) { var group = this.group; group.removeAll(); this._buildAxes(radarModel); this._buildSplitLineAndArea(radarModel); }, _buildAxes: function (radarModel) { var radar = radarModel.coordinateSystem; var indicatorAxes = radar.getIndicatorAxes(); var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) { var axisBuilder = new AxisBuilder(indicatorAxis.model, { position: [radar.cx, radar.cy], rotation: indicatorAxis.angle, labelDirection: -1, tickDirection: -1, nameDirection: 1 }); return axisBuilder; }); zrUtil.each(axisBuilders, function (axisBuilder) { zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder); this.group.add(axisBuilder.getGroup()); }, this); }, _buildSplitLineAndArea: function (radarModel) { var radar = radarModel.coordinateSystem; var indicatorAxes = radar.getIndicatorAxes(); if (!indicatorAxes.length) { return; } var shape = radarModel.get('shape'); var splitLineModel = radarModel.getModel('splitLine'); var splitAreaModel = radarModel.getModel('splitArea'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var areaStyleModel = splitAreaModel.getModel('areaStyle'); var showSplitLine = splitLineModel.get('show'); var showSplitArea = splitAreaModel.get('show'); var splitLineColors = lineStyleModel.get('color'); var splitAreaColors = areaStyleModel.get('color'); splitLineColors = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors]; splitAreaColors = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors]; var splitLines = []; var splitAreas = []; function getColorIndex(areaOrLine, areaOrLineColorList, idx) { var colorIndex = idx % areaOrLineColorList.length; areaOrLine[colorIndex] = areaOrLine[colorIndex] || []; return colorIndex; } if (shape === 'circle') { var ticksRadius = indicatorAxes[0].getTicksCoords(); var cx = radar.cx; var cy = radar.cy; for (var i = 0; i < ticksRadius.length; i++) { if (showSplitLine) { var colorIndex = getColorIndex(splitLines, splitLineColors, i); splitLines[colorIndex].push(new graphic.Circle({ shape: { cx: cx, cy: cy, r: ticksRadius[i].coord } })); } if (showSplitArea && i < ticksRadius.length - 1) { var colorIndex = getColorIndex(splitAreas, splitAreaColors, i); splitAreas[colorIndex].push(new graphic.Ring({ shape: { cx: cx, cy: cy, r0: ticksRadius[i].coord, r: ticksRadius[i + 1].coord } })); } } } // Polyyon else { var realSplitNumber; var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) { var ticksCoords = indicatorAxis.getTicksCoords(); realSplitNumber = realSplitNumber == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber); return zrUtil.map(ticksCoords, function (tickCoord) { return radar.coordToPoint(tickCoord.coord, idx); }); }); var prevPoints = []; for (var i = 0; i <= realSplitNumber; i++) { var points = []; for (var j = 0; j < indicatorAxes.length; j++) { points.push(axesTicksPoints[j][i]); } // Close if (points[0]) { points.push(points[0].slice()); } else {} if (showSplitLine) { var colorIndex = getColorIndex(splitLines, splitLineColors, i); splitLines[colorIndex].push(new graphic.Polyline({ shape: { points: points } })); } if (showSplitArea && prevPoints) { var colorIndex = getColorIndex(splitAreas, splitAreaColors, i - 1); splitAreas[colorIndex].push(new graphic.Polygon({ shape: { points: points.concat(prevPoints) } })); } prevPoints = points.slice().reverse(); } } var lineStyle = lineStyleModel.getLineStyle(); var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine zrUtil.each(splitAreas, function (splitAreas, idx) { this.group.add(graphic.mergePath(splitAreas, { style: zrUtil.defaults({ stroke: 'none', fill: splitAreaColors[idx % splitAreaColors.length] }, areaStyle), silent: true })); }, this); zrUtil.each(splitLines, function (splitLines, idx) { this.group.add(graphic.mergePath(splitLines, { style: zrUtil.defaults({ fill: 'none', stroke: splitLineColors[idx % splitLineColors.length] }, lineStyle), silent: true })); }, this); } }); module.exports = _default; /***/ }), /***/ "lW0t": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("AaIv"); __webpack_require__("45zI"); __webpack_require__("OHLg"); __webpack_require__("tRuv"); __webpack_require__("jq8k"); __webpack_require__("hE1C"); __webpack_require__("fRlm"); __webpack_require__("ZfDs"); __webpack_require__("hKsM"); __webpack_require__("8MKS"); __webpack_require__("Gor1"); __webpack_require__("Kglm"); __webpack_require__("nhXg"); __webpack_require__("Tpsd"); __webpack_require__("yzTm"); __webpack_require__("enaP"); __webpack_require__("ybUX"); __webpack_require__("E9dB"); __webpack_require__("AdXs"); __webpack_require__("xsZq"); __webpack_require__("wiMi"); __webpack_require__("9n7C"); __webpack_require__("EbBy"); __webpack_require__("GFHg"); __webpack_require__("j3Ef"); __webpack_require__("qnda"); __webpack_require__("vQY2"); __webpack_require__("mTCb"); __webpack_require__("LCJJ"); __webpack_require__("ccvN"); __webpack_require__("RbNe"); __webpack_require__("7EEF"); __webpack_require__("COu/"); __webpack_require__("RiZp"); __webpack_require__("XvIX"); __webpack_require__("MCzM"); __webpack_require__("a/rO"); __webpack_require__("oLfA"); __webpack_require__("IPMZ"); __webpack_require__("/TzG"); __webpack_require__("inJy"); __webpack_require__("qpxo"); __webpack_require__("Rz/f"); __webpack_require__("VY9i"); __webpack_require__("3GnB"); __webpack_require__("96V2"); __webpack_require__("Er5D"); __webpack_require__("QQAp"); __webpack_require__("TqQX"); __webpack_require__("3Ss1"); __webpack_require__("XCQu"); __webpack_require__("WXVa"); __webpack_require__("A9pP"); __webpack_require__("8Yqo"); __webpack_require__("3WJ9"); __webpack_require__("Pv1b"); __webpack_require__("ABwa"); __webpack_require__("gOPh"); __webpack_require__("x1N0"); __webpack_require__("TbJu"); __webpack_require__("cl1g"); __webpack_require__("Jx/U"); __webpack_require__("nkxs"); __webpack_require__("jx/E"); __webpack_require__("qanJ"); __webpack_require__("MAvv"); __webpack_require__("k3DE"); __webpack_require__("iEtb"); __webpack_require__("V2bx"); __webpack_require__("wzc9"); __webpack_require__("MGxP"); __webpack_require__("m5c+"); __webpack_require__("YY9M"); __webpack_require__("QIXN"); __webpack_require__("1LXj"); __webpack_require__("EU5/"); __webpack_require__("waNl"); __webpack_require__("m1VS"); __webpack_require__("M7p8"); __webpack_require__("t8Wf"); __webpack_require__("b7et"); __webpack_require__("93Ev"); __webpack_require__("dlek"); __webpack_require__("AeW8"); __webpack_require__("WBBM"); __webpack_require__("lfgO"); __webpack_require__("ROVa"); __webpack_require__("lND5"); __webpack_require__("/JgL"); __webpack_require__("KCuq"); __webpack_require__("8ELa"); __webpack_require__("JfJ9"); __webpack_require__("FQM2"); __webpack_require__("wkAD"); __webpack_require__("z4Bw"); __webpack_require__("ZKpu"); __webpack_require__("KCOl"); __webpack_require__("76xA"); __webpack_require__("cgBf"); __webpack_require__("4XAj"); __webpack_require__("zL46"); __webpack_require__("4GK7"); __webpack_require__("Qlmv"); __webpack_require__("K8uT"); __webpack_require__("/mti"); __webpack_require__("2Tep"); __webpack_require__("9P18"); __webpack_require__("wiaT"); __webpack_require__("f9UU"); __webpack_require__("gBoX"); __webpack_require__("lQLA"); __webpack_require__("oDrn"); __webpack_require__("alQ7"); __webpack_require__("A8T0"); __webpack_require__("CClo"); __webpack_require__("wkvu"); __webpack_require__("+yxk"); __webpack_require__("mizm"); __webpack_require__("pkSX"); __webpack_require__("f0gX"); __webpack_require__("km6+"); __webpack_require__("TUpD"); __webpack_require__("n94B"); __webpack_require__("NxBI"); __webpack_require__("6XQh"); __webpack_require__("3R7/"); __webpack_require__("3Ipg"); __webpack_require__("n8VM"); __webpack_require__("wGIc"); __webpack_require__("Gv3S"); __webpack_require__("U9uQ"); __webpack_require__("/Gyr"); __webpack_require__("io0v"); __webpack_require__("vw/H"); __webpack_require__("Irak"); __webpack_require__("6Dhb"); __webpack_require__("6WZY"); __webpack_require__("5fJT"); __webpack_require__("Pjea"); __webpack_require__("YPgT"); __webpack_require__("8gDI"); __webpack_require__("q3/e"); __webpack_require__("aojj"); __webpack_require__("VxO8"); __webpack_require__("wFfV"); __webpack_require__("a+c2"); __webpack_require__("zCI4"); __webpack_require__("I/Tr"); __webpack_require__("/cVT"); __webpack_require__("fxFB"); __webpack_require__("CNcR"); __webpack_require__("X1Ha"); __webpack_require__("xyMf"); __webpack_require__("cXV3"); __webpack_require__("eZaJ"); __webpack_require__("I/QC"); __webpack_require__("fS9R"); __webpack_require__("XEfP"); __webpack_require__("9VWb"); __webpack_require__("nE53"); __webpack_require__("BQbq"); __webpack_require__("q4B+"); __webpack_require__("8/eq"); __webpack_require__("ZqZW"); __webpack_require__("mXn6"); __webpack_require__("kyeA"); __webpack_require__("Vi1o"); __webpack_require__("Wse9"); __webpack_require__("GPcm"); __webpack_require__("LBAN"); __webpack_require__("o6lL"); __webpack_require__("jATA"); __webpack_require__("eVxf"); __webpack_require__("W422"); __webpack_require__("pXic"); __webpack_require__("ocEJ"); __webpack_require__("Rdrp"); __webpack_require__("r4+w"); __webpack_require__("388n"); __webpack_require__("nbYV"); __webpack_require__("p7Sz"); __webpack_require__("DCb3"); __webpack_require__("bhLt"); __webpack_require__("5tXp"); __webpack_require__("UUvd"); __webpack_require__("LVgp"); __webpack_require__("uZUu"); __webpack_require__("BNTH"); __webpack_require__("wFRE"); __webpack_require__("hXsn"); __webpack_require__("srE4"); __webpack_require__("UpHT"); __webpack_require__("6Nmp"); __webpack_require__("spfu"); __webpack_require__("BgrD"); __webpack_require__("HafM"); __webpack_require__("CKmK"); __webpack_require__("T5sg"); __webpack_require__("glyB"); __webpack_require__("C0ZC"); __webpack_require__("LUjw"); __webpack_require__("wC4c"); __webpack_require__("yXbq"); __webpack_require__("lICU"); __webpack_require__("JH3y"); __webpack_require__("KV6X"); __webpack_require__("TY8L"); __webpack_require__("e5cl"); __webpack_require__("ZooD"); __webpack_require__("xbcU"); __webpack_require__("j/Uz"); __webpack_require__("I3h3"); __webpack_require__("ZBpF"); __webpack_require__("ZOCd"); __webpack_require__("zOPQ"); __webpack_require__("77pa"); __webpack_require__("GHix"); __webpack_require__("0Amz"); __webpack_require__("vX3U"); __webpack_require__("ft2D"); __webpack_require__("15gP"); __webpack_require__("9Uek"); __webpack_require__("XlQ/"); __webpack_require__("JL6g"); __webpack_require__("tgoH"); __webpack_require__("jBhg"); __webpack_require__("Epc+"); __webpack_require__("+ZEg"); __webpack_require__("GY59"); __webpack_require__("hVdr"); __webpack_require__("Y7GH"); __webpack_require__("HROK"); __webpack_require__("GVSC"); __webpack_require__("AvFv"); __webpack_require__("5tSj"); __webpack_require__("HPGx"); __webpack_require__("P2WH"); __webpack_require__("pGdH"); __webpack_require__("0K9+"); __webpack_require__("0aoy"); __webpack_require__("OFY2"); __webpack_require__("+r76"); __webpack_require__("Vl05"); __webpack_require__("h2hn"); __webpack_require__("6o8+"); __webpack_require__("CxxO"); __webpack_require__("XSLR"); __webpack_require__("eP9d"); __webpack_require__("cA5m"); __webpack_require__("3wCF"); __webpack_require__("Y8eq"); __webpack_require__("YRdk"); __webpack_require__("+5dC"); __webpack_require__("SjyN"); __webpack_require__("muhc"); __webpack_require__("2iT9"); __webpack_require__("DErX"); __webpack_require__("CBEV"); __webpack_require__("PKHs"); __webpack_require__("x84j"); __webpack_require__("B838"); __webpack_require__("/Zs0"); __webpack_require__("XI5o"); __webpack_require__("BKwE"); __webpack_require__("L1tB"); __webpack_require__("ZlnQ"); __webpack_require__("QaJM"); __webpack_require__("k/L8"); __webpack_require__("7/dY"); __webpack_require__("mVCd"); __webpack_require__("FqQZ"); __webpack_require__("6p8v"); __webpack_require__("4fWj"); __webpack_require__("A9TR"); __webpack_require__("FkQ2"); __webpack_require__("m8g7"); __webpack_require__("W8Yd"); __webpack_require__("dw03"); __webpack_require__("1nVW"); __webpack_require__("hkUQ"); __webpack_require__("Bo8s"); __webpack_require__("bS94"); __webpack_require__("3eLD"); __webpack_require__("bNaW"); __webpack_require__("rO/R"); __webpack_require__("AThm"); __webpack_require__("lW38"); __webpack_require__("rZYS"); __webpack_require__("vn+p"); __webpack_require__("7l6D"); __webpack_require__("dUWh"); __webpack_require__("yI33"); __webpack_require__("8Da4"); __webpack_require__("+6E9"); __webpack_require__("4pM6"); __webpack_require__("dwe8"); __webpack_require__("T9RJ"); __webpack_require__("1kQw"); __webpack_require__("anKm"); __webpack_require__("E3Fq"); __webpack_require__("P5fA"); __webpack_require__("Iz9X"); __webpack_require__("pnd5"); __webpack_require__("pTD4"); __webpack_require__("uXzC"); __webpack_require__("+7iT"); __webpack_require__("9xM6"); __webpack_require__("YiO5"); __webpack_require__("Nge7"); __webpack_require__("M3oF"); __webpack_require__("t5gC"); __webpack_require__("tN6d"); __webpack_require__("Oc5x"); __webpack_require__("XszO"); __webpack_require__("6MJ3"); __webpack_require__("Q+t8"); __webpack_require__("vlTG"); __webpack_require__("B1Xl"); __webpack_require__("Zczq"); __webpack_require__("uS+O"); __webpack_require__("5qjo"); __webpack_require__("YeaM"); __webpack_require__("Sh04"); __webpack_require__("A7EC"); __webpack_require__("INOt"); __webpack_require__("zciC"); __webpack_require__("ejM/"); __webpack_require__("nb/R"); __webpack_require__("uSPk"); __webpack_require__("XqD1"); __webpack_require__("Cw2p"); __webpack_require__("O1Yy"); __webpack_require__("8SdR"); __webpack_require__("N/tL"); __webpack_require__("eZoW"); __webpack_require__("dVGB"); __webpack_require__("+rQu"); __webpack_require__("p6Ym"); __webpack_require__("Qg3l"); __webpack_require__("v+z1"); __webpack_require__("somc"); __webpack_require__("iwhg"); __webpack_require__("oFQo"); __webpack_require__("K+Xy"); __webpack_require__("HUW6"); __webpack_require__("s0qo"); __webpack_require__("qwCV"); __webpack_require__("DVJ+"); __webpack_require__("TbEg"); __webpack_require__("A6MJ"); __webpack_require__("+TtN"); __webpack_require__("+vtj"); __webpack_require__("HmqW"); __webpack_require__("HD+Y"); __webpack_require__("3SyC"); __webpack_require__("5O47"); __webpack_require__("hpHl"); __webpack_require__("nTES"); __webpack_require__("S9VE"); __webpack_require__("KjDf"); __webpack_require__("0MCs"); __webpack_require__("v7zf"); __webpack_require__("9VpW"); __webpack_require__("XZwo"); __webpack_require__("MgB1"); __webpack_require__("7Qw4"); __webpack_require__("HpvJ"); __webpack_require__("RsNe"); __webpack_require__("cjLM"); __webpack_require__("qbRp"); __webpack_require__("S6Lp"); __webpack_require__("Qun8"); __webpack_require__("3jvX"); __webpack_require__("4c9a"); __webpack_require__("qXbz"); __webpack_require__("VWUc"); __webpack_require__("mP9h"); __webpack_require__("FK7w"); __webpack_require__("Vlko"); __webpack_require__("mt/P"); __webpack_require__("5d6Q"); __webpack_require__("TNZR"); __webpack_require__("Vxs6"); __webpack_require__("Ojsd"); __webpack_require__("lAmK"); __webpack_require__("gZpS"); __webpack_require__("2S96"); __webpack_require__("aWpu"); __webpack_require__("g+r5"); __webpack_require__("hm2Q"); __webpack_require__("R9V0"); __webpack_require__("3FgT"); __webpack_require__("yUbm"); __webpack_require__("gtCY"); __webpack_require__("gLVo"); __webpack_require__("bhsW"); __webpack_require__("Rgwr"); __webpack_require__("H3ae"); __webpack_require__("0Ns7"); __webpack_require__("mfqn"); __webpack_require__("04uI"); __webpack_require__("KthU"); __webpack_require__("g+rL"); __webpack_require__("tAQF"); __webpack_require__("3SRA"); __webpack_require__("aWyW"); __webpack_require__("5oNL"); __webpack_require__("0HNz"); __webpack_require__("Nfv2"); __webpack_require__("6kBm"); __webpack_require__("0dhg"); __webpack_require__("wkWF"); __webpack_require__("/YkF"); __webpack_require__("8keu"); __webpack_require__("1pTL"); __webpack_require__("Uezo"); __webpack_require__("fDmL"); __webpack_require__("M4a0"); __webpack_require__("4UvJ"); __webpack_require__("ciE+"); __webpack_require__("IUas"); __webpack_require__("Koqr"); __webpack_require__("wWoY"); __webpack_require__("5bam"); __webpack_require__("zphy"); __webpack_require__("gCvq"); __webpack_require__("FdGu"); __webpack_require__("dQ/J"); __webpack_require__("J5eo"); __webpack_require__("3mz+"); __webpack_require__("1cbZ"); __webpack_require__("Wla8"); __webpack_require__("8HTd"); __webpack_require__("dich"); __webpack_require__("BPmK"); __webpack_require__("wm0R"); __webpack_require__("Mxqo"); __webpack_require__("v8VU"); __webpack_require__("3InL"); __webpack_require__("baPu"); __webpack_require__("ZzDe"); __webpack_require__("JCXx"); __webpack_require__("rZj8"); module.exports = __webpack_require__("odTk"); /***/ }), /***/ "lW38": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var isConstructor = __webpack_require__("iuII"); // `Function.isConstructor` method // https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md $({ target: 'Function', stat: true, forced: true }, { isConstructor: isConstructor }); /***/ }), /***/ "lbHh": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! * JavaScript Cookie v2.2.0 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */ ;(function (factory) { var registeredInModuleLoader = false; if (true) { !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); registeredInModuleLoader = true; } if (true) { module.exports = factory(); registeredInModuleLoader = true; } if (!registeredInModuleLoader) { var OldCookies = window.Cookies; var api = window.Cookies = factory(); api.noConflict = function () { window.Cookies = OldCookies; return api; }; } }(function () { function extend () { var i = 0; var result = {}; for (; i < arguments.length; i++) { var attributes = arguments[ i ]; for (var key in attributes) { result[key] = attributes[key]; } } return result; } function init (converter) { function api (key, value, attributes) { var result; if (typeof document === 'undefined') { return; } // Write if (arguments.length > 1) { attributes = extend({ path: '/' }, api.defaults, attributes); if (typeof attributes.expires === 'number') { var expires = new Date(); expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); attributes.expires = expires; } // We're using "expires" because "max-age" is not supported by IE attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; try { result = JSON.stringify(value); if (/^[\{\[]/.test(result)) { value = result; } } catch (e) {} if (!converter.write) { value = encodeURIComponent(String(value)) .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); } else { value = converter.write(value, key); } key = encodeURIComponent(String(key)); key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); key = key.replace(/[\(\)]/g, escape); var stringifiedAttributes = ''; for (var attributeName in attributes) { if (!attributes[attributeName]) { continue; } stringifiedAttributes += '; ' + attributeName; if (attributes[attributeName] === true) { continue; } stringifiedAttributes += '=' + attributes[attributeName]; } return (document.cookie = key + '=' + value + stringifiedAttributes); } // Read if (!key) { result = {}; } // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling "get()" var cookies = document.cookie ? document.cookie.split('; ') : []; var rdecode = /(%[0-9A-Z]{2})+/g; var i = 0; for (; i < cookies.length; i++) { var parts = cookies[i].split('='); var cookie = parts.slice(1).join('='); if (!this.json && cookie.charAt(0) === '"') { cookie = cookie.slice(1, -1); } try { var name = parts[0].replace(rdecode, decodeURIComponent); cookie = converter.read ? converter.read(cookie, name) : converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent); if (this.json) { try { cookie = JSON.parse(cookie); } catch (e) {} } if (key === name) { result = cookie; break; } if (!key) { result[name] = cookie; } } catch (e) {} } return result; } api.set = api; api.get = function (key) { return api.call(api, key); }; api.getJSON = function () { return api.apply({ json: true }, [].slice.call(arguments)); }; api.defaults = {}; api.remove = function (key, attributes) { api(key, '', extend(attributes, { expires: -1 })); }; api.withConverter = init; return api; } return init(function () {}); })); /***/ }), /***/ "lfgO": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // eslint-disable-next-line es/no-math-hypot -- required for testing var $hypot = Math.hypot; var abs = Math.abs; var sqrt = Math.sqrt; // Chrome 77 bug // https://bugs.chromium.org/p/v8/issues/detail?id=9546 var FORCED = !!$hypot && $hypot(Infinity, NaN) !== Infinity; // `Math.hypot` method // https://tc39.es/ecma262/#sec-math.hypot $({ target: 'Math', stat: true, arity: 2, forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` hypot: function hypot(value1, value2) { var sum = 0; var i = 0; var aLen = arguments.length; var larg = 0; var arg, div; while (i < aLen) { arg = abs(arguments[i++]); if (larg < arg) { div = larg / arg; sum = sum * div * div + 1; larg = arg; } else if (arg > 0) { div = arg / larg; sum += div * div; } else sum += arg; } return larg === Infinity ? Infinity : larg * sqrt(sum); } }); /***/ }), /***/ "lgy4": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); var aCallable = __webpack_require__("eZJ6"); module.exports = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; /***/ }), /***/ "lj6Z": /***/ (function(module, exports, __webpack_require__) { var util = __webpack_require__("/gxq"); var vec2 = __webpack_require__("C7PF"); var Draggable = __webpack_require__("TIfeS"); var Eventful = __webpack_require__("qjvV"); var eventTool = __webpack_require__("UAiw"); var GestureMgr = __webpack_require__("JMnz"); /** * [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) { return { type: eveType, event: event, // target can only be an element that is not silent. target: targetInfo.target, // topTarget can be a silent element. topTarget: targetInfo.topTarget, cancelBubble: false, offsetX: event.zrX, offsetY: event.zrY, gestureEvent: event.gestureEvent, pinchX: event.pinchX, pinchY: event.pinchY, pinchScale: event.pinchScale, wheelDelta: event.zrDelta, zrByTouch: event.zrByTouch, which: event.which, stop: stopEvent }; } function stopEvent() { eventTool.stop(this.event); } function EmptyProxy() {} EmptyProxy.prototype.dispose = function () {}; var handlerNames = ['click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu']; /** * @alias module:zrender/Handler * @constructor * @extends module:zrender/mixin/Eventful * @param {module:zrender/Storage} storage Storage instance. * @param {module:zrender/Painter} painter Painter instance. * @param {module:zrender/dom/HandlerProxy} proxy HandlerProxy instance. * @param {HTMLElement} painterRoot painter.root (not painter.getViewportRoot()). */ var Handler = function (storage, painter, proxy, painterRoot) { Eventful.call(this); this.storage = storage; this.painter = painter; this.painterRoot = painterRoot; proxy = proxy || new EmptyProxy(); /** * Proxy of event. can be Dom, WebGLSurface, etc. */ this.proxy = null; /** * {target, topTarget, x, y} * @private * @type {Object} */ this._hovered = {}; /** * @private * @type {Date} */ this._lastTouchMoment; /** * @private * @type {number} */ this._lastX; /** * @private * @type {number} */ this._lastY; /** * @private * @type {module:zrender/core/GestureMgr} */ this._gestureMgr; Draggable.call(this); this.setHandlerProxy(proxy); }; Handler.prototype = { constructor: Handler, setHandlerProxy: function (proxy) { if (this.proxy) { this.proxy.dispose(); } if (proxy) { util.each(handlerNames, function (name) { proxy.on && proxy.on(name, this[name], this); }, this); // Attach handler proxy.handler = this; } this.proxy = proxy; }, mousemove: function (event) { var x = event.zrX; var y = event.zrY; var isOutside = isOutsideBoundary(this, x, y); var lastHovered = this._hovered; var lastHoveredTarget = lastHovered.target; // If lastHoveredTarget is removed from zr (detected by '__zr') by some API call // (like 'setOption' or 'dispatchAction') in event handlers, we should find // lastHovered again here. Otherwise 'mouseout' can not be triggered normally. // See #6198. if (lastHoveredTarget && !lastHoveredTarget.__zr) { lastHovered = this.findHover(lastHovered.x, lastHovered.y); lastHoveredTarget = lastHovered.target; } var hovered = this._hovered = isOutside ? { x: x, y: y } : this.findHover(x, y); var hoveredTarget = hovered.target; var proxy = this.proxy; proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default'); // Mouse out on previous hovered element if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) { this.dispatchToElement(lastHovered, 'mouseout', event); } // Mouse moving on one element this.dispatchToElement(hovered, 'mousemove', event); // Mouse over on a new element if (hoveredTarget && hoveredTarget !== lastHoveredTarget) { this.dispatchToElement(hovered, 'mouseover', event); } }, mouseout: function (event) { var eventControl = event.zrEventControl; var zrIsToLocalDOM = event.zrIsToLocalDOM; if (eventControl !== 'only_globalout') { this.dispatchToElement(this._hovered, 'mouseout', 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 }); } }, /** * Resize */ resize: function (event) { this._hovered = {}; }, /** * Dispatch event * @param {string} eventName * @param {event=} eventArgs */ dispatch: function (eventName, eventArgs) { var handler = this[eventName]; handler && handler.call(this, eventArgs); }, /** * Dispose */ dispose: function () { this.proxy.dispose(); this.storage = this.proxy = this.painter = null; }, /** * 设置默认的cursor style * @param {string} [cursorStyle='default'] 例如 crosshair */ setCursorStyle: function (cursorStyle) { var proxy = this.proxy; proxy.setCursor && proxy.setCursor(cursorStyle); }, /** * 事件分发代理 * * @private * @param {Object} targetInfo {target, topTarget} 目标图形元素 * @param {string} eventName 事件名称 * @param {Object} event 事件对象 */ dispatchToElement: function (targetInfo, eventName, event) { targetInfo = targetInfo || {}; var el = targetInfo.target; if (el && el.silent) { return; } var eventHandler = 'on' + eventName; var eventPacket = makeEventPacket(eventName, targetInfo, event); while (el) { el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler].call(el, eventPacket)); el.trigger(eventName, eventPacket); el = el.parent; if (eventPacket.cancelBubble) { break; } } if (!eventPacket.cancelBubble) { // 冒泡到顶级 zrender 对象 this.trigger(eventName, eventPacket); // 分发事件到用户自定义层 // 用户有可能在全局 click 事件中 dispose,所以需要判断下 painter 是否存在 this.painter && this.painter.eachOtherLayer(function (layer) { if (typeof layer[eventHandler] === 'function') { layer[eventHandler].call(layer, eventPacket); } if (layer.trigger) { layer.trigger(eventName, eventPacket); } }); } }, /** * @private * @param {number} x * @param {number} y * @param {module:zrender/graphic/Displayable} exclude * @return {model:zrender/Element} * @method */ 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--) { var hoverCheckResult; if (list[i] !== exclude // getDisplayList may include ignored item in VML mode && !list[i].ignore && (hoverCheckResult = isHover(list[i], x, y))) { !out.topTarget && (out.topTarget = list[i]); if (hoverCheckResult !== SILENT) { out.target = list[i]; break; } } } 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 util.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { Handler.prototype[name] = function (event) { 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; this._downPoint = [event.zrX, event.zrY]; // In case click triggered before mouseup this._upEl = hoveredTarget; } else if (name === 'mouseup') { this._upEl = hoveredTarget; } else if (name === 'click') { if (this._downEl !== this._upEl // Original click event is triggered on the whole canvas element, // including the case that `mousedown` - `mousemove` - `mouseup`, // which should be filtered, otherwise it will bring trouble to // pan and zoom. || !this._downPoint // Arbitrary value || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) { return; } this._downPoint = null; } this.dispatchToElement(hovered, name, event); }; }); function isHover(displayable, x, y) { if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) { var el = displayable; var isSilent; while (el) { // 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)) { return false; } if (el.silent) { isSilent = true; } el = el.parent; } return isSilent ? SILENT : true; } 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(); } util.mixin(Handler, Eventful); util.mixin(Handler, Draggable); var _default = Handler; module.exports = _default; /***/ }), /***/ "lkrK": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("2+22")('Int16', 2, function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); /***/ }), /***/ "lwXq": /***/ (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__("/gxq"); /* * 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 _default(ecModel) { ecModel.eachSeriesByType('radar', function (seriesModel) { var data = seriesModel.getData(); var points = []; var coordSys = seriesModel.coordinateSystem; if (!coordSys) { return; } var axes = coordSys.getIndicatorAxes(); zrUtil.each(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) { // 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 = zrUtil.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]; } module.exports = _default; /***/ }), /***/ "lwhV": /***/ (function(module, exports, __webpack_require__) { // 7.2.2 IsArray(argument) var cof = __webpack_require__("1vD2"); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; /***/ }), /***/ "m/6y": /***/ (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__("/gxq"); var _number = __webpack_require__("wWR3"); var parsePercent = _number.parsePercent; var _dataStackHelper = __webpack_require__("qVJQ"); var isDimensionStacked = _dataStackHelper.isDimensionStacked; var createRenderPlanner = __webpack_require__("CqCN"); /* * 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 Float32Array */ var STACK_PREFIX = '__ec_stack_'; var LARGE_BAR_MIN_WIDTH = 0.5; var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array; function getSeriesStackId(seriesModel) { return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex; } function getAxisKey(axis) { return axis.dim + axis.index; } /** * @param {Object} opt * @param {module:echarts/coord/Axis} opt.axis Only support category axis currently. * @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. */ function getLayoutOnAxis(opt) { var params = []; var baseAxis = opt.axis; var axisKey = 'axis0'; if (baseAxis.type !== 'category') { return; } var bandWidth = baseAxis.getBandWidth(); for (var i = 0; i < opt.count || 0; i++) { params.push(zrUtil.defaults({ bandWidth: bandWidth, axisKey: axisKey, stackId: STACK_PREFIX + i }, opt)); } var widthAndOffsets = doCalBarWidthAndOffset(params); var result = []; for (var i = 0; i < opt.count; i++) { var item = widthAndOffsets[axisKey][STACK_PREFIX + i]; item.offsetCenter = item.offset + item.width / 2; result.push(item); } return result; } function prepareLayoutBarSeries(seriesType, ecModel) { var seriesModels = []; ecModel.eachSeriesByType(seriesType, function (seriesModel) { // Check series coordinate, do layout for cartesian2d only if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) { seriesModels.push(seriesModel); } }); 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 = {}; zrUtil.each(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 = []; zrUtil.each(barSeries, function (seriesModel) { var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var axisExtent = baseAxis.getExtent(); 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(seriesModel.get('barWidth'), bandWidth); var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth); var barMinWidth = parsePercent( // 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'); seriesInfoList.push({ bandWidth: bandWidth, barWidth: barWidth, barMaxWidth: barMaxWidth, barMinWidth: barMinWidth, barGap: barGap, barCategoryGap: barCategoryGap, axisKey: getAxisKey(baseAxis), stackId: getSeriesStackId(seriesModel) }); }); return doCalBarWidthAndOffset(seriesInfoList); } function doCalBarWidthAndOffset(seriesInfoList) { // Columns info on each category axis. Key is cartesian name var columnsMap = {}; zrUtil.each(seriesInfoList, function (seriesInfo, idx) { var axisKey = seriesInfo.axisKey; var bandWidth = seriesInfo.bandWidth; var columnsOnAxis = columnsMap[axisKey] || { bandWidth: bandWidth, remainedWidth: bandWidth, autoWidthCount: 0, categoryGap: '20%', gap: '30%', stacks: {} }; var stacks = columnsOnAxis.stacks; columnsMap[axisKey] = columnsOnAxis; var stackId = seriesInfo.stackId; if (!stacks[stackId]) { columnsOnAxis.autoWidthCount++; } stacks[stackId] = stacks[stackId] || { width: 0, maxWidth: 0 }; // Caution: In a single coordinate system, these barGrid attributes // will be shared by series. Consider that they have default values, // only the attributes set on the last series will work. // Do not change this fact unless there will be a break change. var barWidth = seriesInfo.barWidth; if (barWidth && !stacks[stackId].width) { // See #6312, do not restrict width. stacks[stackId].width = barWidth; barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); columnsOnAxis.remainedWidth -= barWidth; } 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; barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); }); var result = {}; zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) { result[coordSysName] = {}; var stacks = columnsOnAxis.stacks; var bandWidth = columnsOnAxis.bandWidth; var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth); var barGapPercent = parsePercent(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 zrUtil.each(stacks, function (column) { var maxWidth = column.maxWidth; var minWidth = column.minWidth; if (!column.width) { var finalWidth = autoWidth; if (maxWidth && maxWidth < finalWidth) { finalWidth = Math.min(maxWidth, remainedWidth); } // `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--; } }); // Recalculate width again autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); var widthSum = 0; var lastColumn; zrUtil.each(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; zrUtil.each(stacks, function (column, stackId) { result[coordSysName][stackId] = result[coordSysName][stackId] || { bandWidth: bandWidth, offset: offset, width: column.width }; offset += column.width * (1 + barGapPercent); }); }); return result; } /** * @param {Object} barWidthAndOffset The result of makeColumnLayout * @param {module:echarts/coord/Axis} axis * @param {module:echarts/model/Series} [seriesModel] If not provided, return all. * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided. */ function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) { if (barWidthAndOffset && axis) { var result = barWidthAndOffset[getAxisKey(axis)]; if (result != null && seriesModel != null) { result = result[getSeriesStackId(seriesModel)]; } return result; } } /** * @param {string} seriesType * @param {module:echarts/model/Global} ecModel */ function layout(seriesType, ecModel) { var seriesModels = prepareLayoutBarSeries(seriesType, ecModel); var barWidthAndOffset = makeColumnLayout(seriesModels); var lastStackCoords = {}; var lastStackCoordsOrigin = {}; zrUtil.each(seriesModels, function (seriesModel) { var data = seriesModel.getData(); var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var stackId = getSeriesStackId(seriesModel); var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId]; var columnOffset = columnLayoutInfo.offset; var columnWidth = columnLayoutInfo.width; var valueAxis = cartesian.getOtherAxis(baseAxis); var barMinHeight = seriesModel.get('barMinHeight') || 0; lastStackCoords[stackId] = lastStackCoords[stackId] || []; lastStackCoordsOrigin[stackId] = lastStackCoordsOrigin[stackId] || []; // Fix #4243 data.setLayout({ bandWidth: columnLayoutInfo.bandWidth, offset: columnOffset, size: columnWidth }); var valueDim = data.mapDimension(valueAxis.dim); var baseDim = data.mapDimension(baseAxis.dim); var stacked = isDimensionStacked(data, valueDim /*, baseDim*/ ); var isValueAxisH = valueAxis.isHorizontal(); var valueAxisStart = getValueAxisStart(baseAxis, valueAxis, stacked); for (var idx = 0, len = data.count(); idx < len; idx++) { var value = data.get(valueDim, idx); var baseValue = data.get(baseDim, idx); var sign = value >= 0 ? 'p' : 'n'; var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in // stackResultDimension directly. if (stacked) { // Only ordinal axis can be 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 x; var y; var width; var height; if (isValueAxisH) { var coord = cartesian.dataToPoint([value, baseValue]); x = baseCoord; y = coord[1] + columnOffset; width = coord[0] - valueAxisStart; height = columnWidth; if (Math.abs(width) < barMinHeight) { width = (width < 0 ? -1 : 1) * barMinHeight; } // Ignore stack from NaN value if (!isNaN(width)) { stacked && (lastStackCoords[stackId][baseValue][sign] += width); } } else { var coord = cartesian.dataToPoint([baseValue, value]); x = coord[0] + columnOffset; y = baseCoord; width = columnWidth; height = coord[1] - valueAxisStart; if (Math.abs(height) < barMinHeight) { // Include zero to has a positive bar height = (height <= 0 ? -1 : 1) * barMinHeight; } // Ignore stack from NaN value if (!isNaN(height)) { stacked && (lastStackCoords[stackId][baseValue][sign] += height); } } data.setItemLayout(idx, { x: x, y: y, width: width, height: height }); } }, this); } // TODO: Do not support stack in large mode yet. var largeLayout = { seriesType: 'bar', plan: createRenderPlanner(), reset: function (seriesModel) { if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) { return; } 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); var baseDim = data.mapDimension(baseAxis.dim); var valueAxisHorizontal = valueAxis.isHorizontal(); var valueDimIdx = valueAxisHorizontal ? 0 : 1; var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width; if (!(barWidth > LARGE_BAR_MIN_WIDTH)) { // jshint ignore:line barWidth = LARGE_BAR_MIN_WIDTH; } return { progress: progress }; function progress(params, data) { 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 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); // 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 }); } } }; function isOnCartesian(seriesModel) { return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d'; } 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 valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0)); } exports.getLayoutOnAxis = getLayoutOnAxis; exports.prepareLayoutBarSeries = prepareLayoutBarSeries; exports.makeColumnLayout = makeColumnLayout; exports.retrieveColumnLayout = retrieveColumnLayout; exports.layout = layout; exports.largeLayout = largeLayout; /***/ }), /***/ "m1VS": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var log1p = __webpack_require__("sMRE"); // eslint-disable-next-line es/no-math-acosh -- required for testing var $acosh = Math.acosh; var log = Math.log; var sqrt = Math.sqrt; var LN2 = Math.LN2; var FORCED = !$acosh // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 || Math.floor($acosh(Number.MAX_VALUE)) != 710 // Tor Browser bug: Math.acosh(Infinity) -> NaN || $acosh(Infinity) != Infinity; // `Math.acosh` method // https://tc39.es/ecma262/#sec-math.acosh $({ target: 'Math', stat: true, forced: FORCED }, { acosh: function acosh(x) { var n = +x; return n < 1 ? NaN : n > 94906265.62425156 ? log(n) + LN2 : log1p(n - 1 + sqrt(n - 1) * sqrt(n + 1)); } }); /***/ }), /***/ "m1WI": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); var defineGlobalProperty = __webpack_require__("ybeR"); var SHARED = '__core-js_shared__'; var store = global[SHARED] || defineGlobalProperty(SHARED, {}); module.exports = store; /***/ }), /***/ "m1wx": /***/ (function(module, exports, __webpack_require__) { "use strict"; var create = __webpack_require__("NkR5"); var descriptor = __webpack_require__("D8PY"); var setToStringTag = __webpack_require__("W97E"); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__("CfIS")(IteratorPrototype, __webpack_require__("6hGG")('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; /***/ }), /***/ "m5c+": /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__("R09w"); var isObject = __webpack_require__("HAas"); var definePropertyModule = __webpack_require__("1rEs"); var getPrototypeOf = __webpack_require__("wzd1"); var wellKnownSymbol = __webpack_require__("jAiL"); var makeBuiltIn = __webpack_require__("1jpT"); var HAS_INSTANCE = wellKnownSymbol('hasInstance'); var FunctionPrototype = Function.prototype; // `Function.prototype[@@hasInstance]` method // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance if (!(HAS_INSTANCE in FunctionPrototype)) { definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) { if (!isCallable(this) || !isObject(O)) return false; var P = this.prototype; if (!isObject(P)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf(O)) if (P === O) return true; return false; }, HAS_INSTANCE) }); } /***/ }), /***/ "m5oG": /***/ (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 echarts = __webpack_require__("Icdr"); var zrUtil = __webpack_require__("/gxq"); var graphic = __webpack_require__("0sHC"); var _symbol = __webpack_require__("kK7q"); var createSymbol = _symbol.createSymbol; var _number = __webpack_require__("wWR3"); var parsePercent = _number.parsePercent; var isNumeric = _number.isNumeric; var _helper = __webpack_require__("dzlV"); var setLabel = _helper.setLabel; /* * 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', 'borderWidth']; // index: +isHorizontal var LAYOUT_ATTRS = [{ xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right'] }, { xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom'] }]; var pathForLineWidth = new graphic.Circle(); var BarView = echarts.extendChartView({ type: 'pictorialBar', render: function (seriesModel, ecModel, api) { var group = this.group; var data = seriesModel.getData(); var oldData = this._data; var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var isHorizontal = !!baseAxis.isHorizontal(); var coordSysRect = cartesian.grid.getRect(); var opt = { ecSize: { width: api.getWidth(), height: api.getHeight() }, seriesModel: seriesModel, coordSys: cartesian, coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]], isHorizontal: isHorizontal, valueDim: LAYOUT_ATTRS[+isHorizontal], categoryDim: LAYOUT_ATTRS[1 - isHorizontal] }; data.diff(oldData).add(function (dataIndex) { if (!data.hasValue(dataIndex)) { return; } var itemModel = getItemModel(data, dataIndex); var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt); var bar = createBar(data, opt, symbolMeta); data.setItemGraphicEl(dataIndex, bar); group.add(bar); updateCommon(bar, opt, symbolMeta); }).update(function (newIndex, oldIndex) { var bar = oldData.getItemGraphicEl(oldIndex); if (!data.hasValue(newIndex)) { group.remove(bar); return; } var itemModel = getItemModel(data, newIndex); var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt); var pictorialShapeStr = getShapeStr(data, symbolMeta); if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) { group.remove(bar); data.setItemGraphicEl(newIndex, null); bar = null; } if (bar) { updateBar(bar, opt, symbolMeta); } else { bar = createBar(data, opt, symbolMeta, true); } data.setItemGraphicEl(newIndex, bar); bar.__pictorialSymbolMeta = symbolMeta; // Add back group.add(bar); updateCommon(bar, opt, symbolMeta); }).remove(function (dataIndex) { var bar = oldData.getItemGraphicEl(dataIndex); bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); }).execute(); this._data = data; return this.group; }, dispose: zrUtil.noop, remove: function (ecModel, api) { var group = this.group; var data = this._data; if (ecModel.get('animation')) { if (data) { data.eachItemGraphicEl(function (bar) { removeBar(data, bar.dataIndex, ecModel, bar); }); } } else { group.removeAll(); } } }); // Set or calculate default value about symbol, and calculate layout info. function getSymbolMeta(data, dataIndex, itemModel, opt) { var layout = data.getItemLayout(dataIndex); var symbolRepeat = itemModel.get('symbolRepeat'); var symbolClip = itemModel.get('symbolClip'); var symbolPosition = itemModel.get('symbolPosition') || 'start'; var symbolRotate = itemModel.get('symbolRotate'); var rotation = (symbolRotate || 0) * Math.PI / 180 || 0; var symbolPatternSize = itemModel.get('symbolPatternSize') || 2; var isAnimationEnabled = itemModel.isAnimationEnabled(); var symbolMeta = { dataIndex: dataIndex, layout: layout, itemModel: itemModel, symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle', color: data.getItemVisual(dataIndex, 'color'), symbolClip: symbolClip, symbolRepeat: symbolRepeat, symbolRepeatDirection: itemModel.get('symbolRepeatDirection'), symbolPatternSize: symbolPatternSize, rotation: rotation, animationModel: isAnimationEnabled ? itemModel : null, hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'), z2: itemModel.getShallow('z', true) || 0 }; prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta); prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta); var symbolSize = symbolMeta.symbolSize; var symbolOffset = itemModel.get('symbolOffset'); if (zrUtil.isArray(symbolOffset)) { symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])]; } prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta); return symbolMeta; } // bar length can be negative. function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) { var valueDim = opt.valueDim; var symbolBoundingData = itemModel.get('symbolBoundingData'); var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()); var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)); var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0); var boundingLength; if (zrUtil.isArray(symbolBoundingData)) { var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx]; symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse(); boundingLength = symbolBoundingExtent[pxSignIdx]; } else if (symbolBoundingData != null) { boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx; } else if (symbolRepeat) { boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx; } else { boundingLength = layout[valueDim.wh]; } output.boundingLength = boundingLength; if (symbolRepeat) { output.repeatCutLength = layout[valueDim.wh]; } output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0; } function convertToCoordOnAxis(axis, value) { return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value))); } // Support ['100%', '100%'] function prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, output) { var valueDim = opt.valueDim; var categoryDim = opt.categoryDim; var categorySize = Math.abs(layout[categoryDim.wh]); var symbolSize = data.getItemVisual(dataIndex, 'symbolSize'); if (zrUtil.isArray(symbolSize)) { symbolSize = symbolSize.slice(); } else { if (symbolSize == null) { symbolSize = '100%'; } symbolSize = [symbolSize, symbolSize]; } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is // to complicated to calculate real percent value if considering scaled lineWidth. // So the actual size will bigger than layout size if lineWidth is bigger than zero, // which can be tolerated in pictorial chart. symbolSize[categoryDim.index] = parsePercent(symbolSize[categoryDim.index], categorySize); symbolSize[valueDim.index] = parsePercent(symbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength)); output.symbolSize = symbolSize; // If x or y is less than zero, show reversed shape. var symbolScale = output.symbolScale = [symbolSize[0] / symbolPatternSize, symbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale. symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign; } function prepareLineWidth(itemModel, symbolScale, rotation, opt, output) { // In symbols are drawn with scale, so do not need to care about the case that width // or height are too small. But symbol use strokeNoScale, where acture lineWidth should // be calculated. var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; if (valueLineWidth) { pathForLineWidth.attr({ scale: symbolScale.slice(), rotation: rotation }); pathForLineWidth.updateTransform(); valueLineWidth /= pathForLineWidth.getLineScale(); valueLineWidth *= symbolScale[opt.valueDim.index]; } output.valueLineWidth = valueLineWidth; } function prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, output) { var categoryDim = opt.categoryDim; var valueDim = opt.valueDim; var pxSign = output.pxSign; var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0); var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may // want symbols to rotate on its center, which should not be translated // when rotating. if (symbolRepeat) { var absBoundingLength = Math.abs(boundingLength); var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + ''; var hasEndGap = false; if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) { hasEndGap = true; symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); } symbolMargin = parsePercent(symbolMargin, symbolSize[valueDim.index]); var uLenWithMargin = Math.max(unitLength + symbolMargin * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted // to ensure that all of the symbols will not be overflow the given area. var endFix = hasEndGap ? 0 : symbolMargin * 2; // Both final repeatTimes and final symbolMargin area calculated based on // boundingLength. var repeatSpecified = isNumeric(symbolRepeat); var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed // entirely in the given layout area. var mDiff = absBoundingLength - repeatTimes * unitLength; symbolMargin = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1); uLenWithMargin = unitLength + symbolMargin * 2; endFix = hasEndGap ? 0 : symbolMargin * 2; // Update repeatTimes when not all symbol will be shown. if (!repeatSpecified && symbolRepeat !== 'fixed') { repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0; } pathLen = repeatTimes * uLenWithMargin - endFix; output.repeatTimes = repeatTimes; output.symbolMargin = symbolMargin; } var sizeFix = pxSign * (pathLen / 2); var pathPosition = output.pathPosition = []; pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2; pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center' if (symbolOffset) { pathPosition[0] += symbolOffset[0]; pathPosition[1] += symbolOffset[1]; } var bundlePosition = output.bundlePosition = []; bundlePosition[categoryDim.index] = layout[categoryDim.xy]; bundlePosition[valueDim.index] = layout[valueDim.xy]; var barRectShape = output.barRectShape = zrUtil.extend({}, layout); barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix)); barRectShape[categoryDim.wh] = layout[categoryDim.wh]; var clipShape = output.clipShape = {}; // Consider that symbol may be overflow layout rect. clipShape[categoryDim.xy] = -layout[categoryDim.xy]; clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh]; clipShape[valueDim.xy] = 0; clipShape[valueDim.wh] = layout[valueDim.wh]; } function createPath(symbolMeta) { var symbolPatternSize = symbolMeta.symbolPatternSize; var path = createSymbol( // Consider texture img, make a big size. symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize, symbolMeta.color); path.attr({ culling: true }); path.type !== 'image' && path.setStyle({ strokeNoScale: true }); return path; } function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) { var bundle = bar.__pictorialBundle; var symbolSize = symbolMeta.symbolSize; var valueLineWidth = symbolMeta.valueLineWidth; var pathPosition = symbolMeta.pathPosition; var valueDim = opt.valueDim; var repeatTimes = symbolMeta.repeatTimes || 0; var index = 0; var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2; eachPath(bar, function (path) { path.__pictorialAnimationIndex = index; path.__pictorialRepeatTimes = repeatTimes; if (index < repeatTimes) { updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate); } else { updateAttr(path, null, { scale: [0, 0] }, symbolMeta, isUpdate, function () { bundle.remove(path); }); } updateHoverAnimation(path, symbolMeta); index++; }); for (; index < repeatTimes; index++) { var path = createPath(symbolMeta); path.__pictorialAnimationIndex = index; path.__pictorialRepeatTimes = repeatTimes; bundle.add(path); var target = makeTarget(index); updateAttr(path, { position: target.position, scale: [0, 0] }, { scale: target.scale, rotation: target.rotation }, symbolMeta, isUpdate); // FIXME // If all emphasis/normal through action. path.on('mouseover', onMouseOver).on('mouseout', onMouseOut); updateHoverAnimation(path, symbolMeta); } function makeTarget(index) { var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index // Otherwise: i = index; var pxSign = symbolMeta.pxSign; var i = index; if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) { i = repeatTimes - 1 - index; } position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index]; return { position: position, scale: symbolMeta.symbolScale.slice(), rotation: symbolMeta.rotation }; } function onMouseOver() { eachPath(bar, function (path) { path.trigger('emphasis'); }); } function onMouseOut() { eachPath(bar, function (path) { path.trigger('normal'); }); } } function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) { var bundle = bar.__pictorialBundle; var mainPath = bar.__pictorialMainPath; if (!mainPath) { mainPath = bar.__pictorialMainPath = createPath(symbolMeta); bundle.add(mainPath); updateAttr(mainPath, { position: symbolMeta.pathPosition.slice(), scale: [0, 0], rotation: symbolMeta.rotation }, { scale: symbolMeta.symbolScale.slice() }, symbolMeta, isUpdate); mainPath.on('mouseover', onMouseOver).on('mouseout', onMouseOut); } else { updateAttr(mainPath, null, { position: symbolMeta.pathPosition.slice(), scale: symbolMeta.symbolScale.slice(), rotation: symbolMeta.rotation }, symbolMeta, isUpdate); } updateHoverAnimation(mainPath, symbolMeta); function onMouseOver() { this.trigger('emphasis'); } function onMouseOut() { this.trigger('normal'); } } // bar rect is used for label. function createOrUpdateBarRect(bar, symbolMeta, isUpdate) { var rectShape = zrUtil.extend({}, symbolMeta.barRectShape); var barRect = bar.__pictorialBarRect; if (!barRect) { barRect = bar.__pictorialBarRect = new graphic.Rect({ z2: 2, shape: rectShape, silent: true, style: { stroke: 'transparent', fill: 'transparent', lineWidth: 0 } }); bar.add(barRect); } else { updateAttr(barRect, null, { shape: rectShape }, symbolMeta, isUpdate); } } function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) { // If not clip, symbol will be remove and rebuilt. if (symbolMeta.symbolClip) { var clipPath = bar.__pictorialClipPath; var clipShape = zrUtil.extend({}, symbolMeta.clipShape); var valueDim = opt.valueDim; var animationModel = symbolMeta.animationModel; var dataIndex = symbolMeta.dataIndex; if (clipPath) { graphic.updateProps(clipPath, { shape: clipShape }, animationModel, dataIndex); } else { clipShape[valueDim.wh] = 0; clipPath = new graphic.Rect({ shape: clipShape }); bar.__pictorialBundle.setClipPath(clipPath); bar.__pictorialClipPath = clipPath; var target = {}; target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh]; graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { shape: target }, animationModel, dataIndex); } } } function getItemModel(data, dataIndex) { var itemModel = data.getItemModel(dataIndex); itemModel.getAnimationDelayParams = getAnimationDelayParams; itemModel.isAnimationEnabled = isAnimationEnabled; return itemModel; } function getAnimationDelayParams(path) { // The order is the same as the z-order, see `symbolRepeatDiretion`. return { index: path.__pictorialAnimationIndex, count: path.__pictorialRepeatTimes }; } function isAnimationEnabled() { // `animation` prop can be set on itemModel in pictorial bar chart. return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation'); } function updateHoverAnimation(path, symbolMeta) { path.off('emphasis').off('normal'); var scale = symbolMeta.symbolScale.slice(); symbolMeta.hoverAnimation && path.on('emphasis', function () { this.animateTo({ scale: [scale[0] * 1.1, scale[1] * 1.1] }, 400, 'elasticOut'); }).on('normal', function () { this.animateTo({ scale: scale.slice() }, 400, 'elasticOut'); }); } function createBar(data, opt, symbolMeta, isUpdate) { // bar is the main element for each data. var bar = new graphic.Group(); // bundle is used for location and clip. var bundle = new graphic.Group(); bar.add(bundle); bar.__pictorialBundle = bundle; bundle.attr('position', symbolMeta.bundlePosition.slice()); if (symbolMeta.symbolRepeat) { createOrUpdateRepeatSymbols(bar, opt, symbolMeta); } else { createOrUpdateSingleSymbol(bar, opt, symbolMeta); } createOrUpdateBarRect(bar, symbolMeta, isUpdate); createOrUpdateClip(bar, opt, symbolMeta, isUpdate); bar.__pictorialShapeStr = getShapeStr(data, symbolMeta); bar.__pictorialSymbolMeta = symbolMeta; return bar; } function updateBar(bar, opt, symbolMeta) { var animationModel = symbolMeta.animationModel; var dataIndex = symbolMeta.dataIndex; var bundle = bar.__pictorialBundle; graphic.updateProps(bundle, { position: symbolMeta.bundlePosition.slice() }, animationModel, dataIndex); if (symbolMeta.symbolRepeat) { createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true); } else { createOrUpdateSingleSymbol(bar, opt, symbolMeta, true); } createOrUpdateBarRect(bar, symbolMeta, true); createOrUpdateClip(bar, opt, symbolMeta, true); } function removeBar(data, dataIndex, animationModel, bar) { // Not show text when animating var labelRect = bar.__pictorialBarRect; labelRect && (labelRect.style.text = null); var pathes = []; eachPath(bar, function (path) { pathes.push(path); }); bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet. bar.__pictorialClipPath && (animationModel = null); zrUtil.each(pathes, function (path) { graphic.updateProps(path, { scale: [0, 0] }, animationModel, dataIndex, function () { bar.parent && bar.parent.remove(bar); }); }); data.setItemGraphicEl(dataIndex, null); } function getShapeStr(data, symbolMeta) { return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':'); } function eachPath(bar, cb, context) { // Do not use Group#eachChild, because it do not support remove. zrUtil.each(bar.__pictorialBundle.children(), function (el) { el !== bar.__pictorialBarRect && cb.call(context, el); }); } function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) { immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect. if (symbolMeta.symbolClip && !isUpdate) { animationAttrs && el.attr(animationAttrs); } else { animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb); } } function updateCommon(bar, opt, symbolMeta) { var color = symbolMeta.color; var dataIndex = symbolMeta.dataIndex; var itemModel = symbolMeta.itemModel; // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke var normalStyle = itemModel.getModel('itemStyle').getItemStyle(['color']); var hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); var cursorStyle = itemModel.getShallow('cursor'); eachPath(bar, function (path) { // PENDING setColor should be before setStyle!!! path.setColor(color); path.setStyle(zrUtil.defaults({ fill: color, opacity: symbolMeta.opacity }, normalStyle)); graphic.setHoverStyle(path, hoverStyle); cursorStyle && (path.cursor = cursorStyle); path.z2 = symbolMeta.z2; }); var barRectHoverStyle = {}; var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; var barRect = bar.__pictorialBarRect; setLabel(barRect.style, barRectHoverStyle, itemModel, color, opt.seriesModel, dataIndex, barPositionOutside); graphic.setHoverStyle(barRect, barRectHoverStyle); } function toIntTimes(times) { var roundedTimes = Math.round(times); // Escapse accurate error return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times); } var _default = BarView; module.exports = _default; /***/ }), /***/ "m8g7": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var map = __webpack_require__("GgPE"); // `AsyncIterator.prototype.map` method // https://github.com/tc39/proposal-async-iterator-helpers $({ target: 'AsyncIterator', proto: true, real: true }, { map: map }); /***/ }), /***/ "mDmg": /***/ (function(module, exports, __webpack_require__) { /* eslint-disable no-new -- required for testing */ var global = __webpack_require__("hcE8"); var fails = __webpack_require__("r54x"); var checkCorrectnessOfIteration = __webpack_require__("Kbrx"); var NATIVE_ARRAY_BUFFER_VIEWS = __webpack_require__("fduV").NATIVE_ARRAY_BUFFER_VIEWS; var ArrayBuffer = global.ArrayBuffer; var Int8Array = global.Int8Array; module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { Int8Array(1); }) || !fails(function () { new Int8Array(-1); }) || !checkCorrectnessOfIteration(function (iterable) { new Int8Array(); new Int8Array(null); new Int8Array(1.5); new Int8Array(iterable); }, true) || fails(function () { // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; }); /***/ }), /***/ "mK6O": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("2+22")('Uint8', 1, function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); /***/ }), /***/ "mLyJ": /***/ (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__("/gxq"); var _number = __webpack_require__("wWR3"); var parsePercent = _number.parsePercent; var _dataStackHelper = __webpack_require__("qVJQ"); var isDimensionStacked = _dataStackHelper.isDimensionStacked; /* * 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 getSeriesStackId(seriesModel) { return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex; } function getAxisKey(polar, axis) { return axis.dim + polar.model.componentIndex; } /** * @param {string} seriesType * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ function barLayoutPolar(seriesType, ecModel, api) { var lastStackCoords = {}; var barWidthAndOffset = calRadialBar(zrUtil.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 axisKey = getAxisKey(polar, baseAxis); var stackId = getSeriesStackId(seriesModel); var columnLayoutInfo = barWidthAndOffset[axisKey][stackId]; var columnOffset = columnLayoutInfo.offset; var columnWidth = columnLayoutInfo.width; var valueAxis = polar.getOtherAxis(baseAxis); var cx = seriesModel.coordinateSystem.cx; var cy = seriesModel.coordinateSystem.cy; 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 clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true); 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); 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); if (Math.abs(radiusSpan) < barMinHeight) { radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; } r0 = baseCoord; r = baseCoord + radiusSpan; startAngle = angle - columnOffset; endAngle = startAngle - columnWidth; stacked && (lastStackCoords[stackId][baseValue][sign] = r); } // tangential sector else { var angleSpan = valueAxis.dataToAngle(value, clampLayout) - valueAxisStart; var radius = baseAxis.dataToRadius(baseValue); if (Math.abs(angleSpan) < barMinAngle) { angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; } r0 = radius + columnOffset; r = r0 + columnWidth; startAngle = baseCoord; endAngle = baseCoord + angleSpan; // 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); } 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 }); } }, 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 = {}; zrUtil.each(barSeries, function (seriesModel, idx) { var data = seriesModel.getData(); var polar = seriesModel.coordinateSystem; var baseAxis = polar.getBaseAxis(); var axisKey = getAxisKey(polar, baseAxis); var axisExtent = baseAxis.getExtent(); var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); var columnsOnAxis = columnsMap[axisKey] || { bandWidth: bandWidth, remainedWidth: bandWidth, autoWidthCount: 0, categoryGap: '20%', gap: '30%', stacks: {} }; var stacks = columnsOnAxis.stacks; columnsMap[axisKey] = columnsOnAxis; var stackId = getSeriesStackId(seriesModel); if (!stacks[stackId]) { columnsOnAxis.autoWidthCount++; } stacks[stackId] = stacks[stackId] || { width: 0, maxWidth: 0 }; var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth); var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth); var barGap = seriesModel.get('barGap'); var barCategoryGap = seriesModel.get('barCategoryGap'); if (barWidth && !stacks[stackId].width) { barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); stacks[stackId].width = barWidth; columnsOnAxis.remainedWidth -= barWidth; } barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); barGap != null && (columnsOnAxis.gap = barGap); barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); }); var result = {}; zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) { result[coordSysName] = {}; var stacks = columnsOnAxis.stacks; var bandWidth = columnsOnAxis.bandWidth; var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth); var barGapPercent = parsePercent(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 zrUtil.each(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; zrUtil.each(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; zrUtil.each(stacks, function (column, stackId) { result[coordSysName][stackId] = result[coordSysName][stackId] || { offset: offset, width: column.width }; offset += column.width * (1 + barGapPercent); }); }); return result; } var _default = barLayoutPolar; module.exports = _default; /***/ }), /***/ "mM94": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__vue_particles_vue__ = __webpack_require__("+708"); /* eslint-disable */ const VueParticles = { install (Vue, options) { Vue.component('vue-particles', __WEBPACK_IMPORTED_MODULE_0__vue_particles_vue__["a" /* default */]) } } /* harmony default export */ __webpack_exports__["a"] = (VueParticles); /* eslint-disable */ /***/ }), /***/ "mP9h": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var isSupersetOf = __webpack_require__("8mB8"); var setMethodAcceptSetLike = __webpack_require__("Rb8c"); // `Set.prototype.isSupersetOf` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, { isSupersetOf: isSupersetOf }); /***/ }), /***/ "mRdL": /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__("jAiL"); exports.f = wellKnownSymbol; /***/ }), /***/ "mTCb": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var $findLast = __webpack_require__("YVgs").findLast; var addToUnscopables = __webpack_require__("HLWT"); // `Array.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last $({ target: 'Array', proto: true }, { findLast: function findLast(callbackfn /* , that = undefined */) { return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables('findLast'); /***/ }), /***/ "mVCd": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var isObject = __webpack_require__("HAas"); var getIteratorDirect = __webpack_require__("tcso"); var createAsyncIteratorProxy = __webpack_require__("M9Xa"); var createIterResultObject = __webpack_require__("l+3Q"); var closeAsyncIteration = __webpack_require__("R72U"); var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) { var state = this; var iterator = state.iterator; var predicate = state.predicate; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { state.done = true; reject(error); }; var ifAbruptCloseAsyncIterator = function (error) { closeAsyncIteration(iterator, doneAndReject, error, doneAndReject); }; var loop = function () { try { Promise.resolve(anObject(call(state.next, iterator))).then(function (step) { try { if (anObject(step).done) { state.done = true; resolve(createIterResultObject(undefined, true)); } else { var value = step.value; try { var result = predicate(value, state.counter++); var handler = function (selected) { selected ? resolve(createIterResultObject(value, false)) : loop(); }; if (isObject(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); else handler(result); } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } catch (error2) { doneAndReject(error2); } }, doneAndReject); } catch (error) { doneAndReject(error); } }; loop(); }); }); // `AsyncIterator.prototype.filter` method // https://github.com/tc39/proposal-async-iterator-helpers $({ target: 'AsyncIterator', proto: true, real: true }, { filter: function filter(predicate) { anObject(this); aCallable(predicate); return new AsyncIteratorProxy(getIteratorDirect(this), { predicate: predicate }); } }); /***/ }), /***/ "mXn6": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var codeAt = __webpack_require__("A6BG").codeAt; // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat $({ target: 'String', proto: true }, { codePointAt: function codePointAt(pos) { return codeAt(this, pos); } }); /***/ }), /***/ "mXza": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__("eqAp"); var $indexOf = __webpack_require__("VqU3")(false); var $native = [].indexOf; var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__("+qBm")($native)), 'Array', { // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO // convert -0 to +0 ? $native.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments[1]); } }); /***/ }), /***/ "mcsk": /***/ (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 echarts = __webpack_require__("Icdr"); /* * 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 ATTR = '\0_ec_interaction_mutex'; function take(zr, resourceKey, userKey) { var store = getStore(zr); store[resourceKey] = userKey; } function release(zr, resourceKey, userKey) { var store = getStore(zr); var uKey = store[resourceKey]; if (uKey === userKey) { store[resourceKey] = null; } } function isTaken(zr, resourceKey) { return !!getStore(zr)[resourceKey]; } function getStore(zr) { return zr[ATTR] || (zr[ATTR] = {}); } /** * payload: { * type: 'takeGlobalCursor', * key: 'dataZoomSelect', or 'brush', or ..., * If no userKey, release global cursor. * } */ echarts.registerAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () {}); exports.take = take; exports.release = release; exports.isTaken = isTaken; /***/ }), /***/ "me52": /***/ (function(module, exports, __webpack_require__) { var Path = __webpack_require__("GxVO"); // 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; /***/ }), /***/ "mfqn": /***/ (function(module, exports, __webpack_require__) { var defineWellKnownSymbol = __webpack_require__("8lki"); // `Symbol.matcher` well-known symbol // https://github.com/tc39/proposal-pattern-matching defineWellKnownSymbol('matcher'); /***/ }), /***/ "mgCp": /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__("c8Kh"); var global = __webpack_require__("YjQv"); var ctx = __webpack_require__("3fMt"); var classof = __webpack_require__("FHqv"); var $export = __webpack_require__("Wdy1"); var isObject = __webpack_require__("8ANE"); var aFunction = __webpack_require__("SWGL"); var anInstance = __webpack_require__("4S0F"); var forOf = __webpack_require__("dudK"); var speciesConstructor = __webpack_require__("BfX3"); var task = __webpack_require__("kkvn").set; var microtask = __webpack_require__("LKnP")(); var newPromiseCapabilityModule = __webpack_require__("3HN9"); var perform = __webpack_require__("AgWD"); var userAgent = __webpack_require__("ht0Q"); var promiseResolve = __webpack_require__("qC2Z"); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; var versions = process && process.versions; var v8 = versions && versions.v8 || ''; var $Promise = global[PROMISE]; var isNode = classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[__webpack_require__("hgbu")('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(global, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = perform(function () { if (isNode) { process.emit('unhandledRejection', value, promise); } else if (handler = global.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(global, function () { var handler; if (isNode) { process.emit('rejectionHandled', promise); } else if (handler = global.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = __webpack_require__("nJ75")($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); __webpack_require__("LhDF")($Promise, PROMISE); __webpack_require__("EFoD")(PROMISE); Wrapper = __webpack_require__("iANj")[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__("wWcv")(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); /***/ }), /***/ "miEh": /***/ (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__("/gxq"); var echarts = __webpack_require__("Icdr"); var graphic = __webpack_require__("0sHC"); var _layout = __webpack_require__("1Xuh"); var getLayoutRect = _layout.getLayoutRect; var _format = __webpack_require__("HHfb"); var windowOpen = _format.windowOpen; /* * 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 echarts.extendComponentModel({ type: 'title', layoutMode: { type: 'box', ignoreSize: true }, defaultOption: { // 一级层叠 zlevel: 0, // 二级层叠 z: 6, show: true, text: '', // 超链接跳转 // link: null, // 仅支持self | blank target: 'blank', subtext: '', // 超链接跳转 // sublink: null, // 仅支持self | blank subtarget: 'blank', // 'center' ¦ 'left' ¦ 'right' // ¦ {number}(x坐标,单位px) left: 0, // 'top' ¦ 'bottom' ¦ 'center' // ¦ {number}(y坐标,单位px) top: 0, // 水平对齐 // 'auto' | 'left' | 'right' | 'center' // 默认根据 left 的位置判断是左对齐还是右对齐 // textAlign: null // // 垂直对齐 // 'auto' | 'top' | 'bottom' | 'middle' // 默认根据 top 位置判断是上对齐还是下对齐 // textVerticalAlign: null // textBaseline: null // The same as textVerticalAlign. backgroundColor: 'rgba(0,0,0,0)', // 标题边框颜色 borderColor: '#ccc', // 标题边框线宽,单位px,默认为0(无边框) borderWidth: 0, // 标题内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css padding: 5, // 主副标题纵向间隔,单位px,默认为10, itemGap: 10, textStyle: { fontSize: 18, fontWeight: 'bolder', color: '#333' }, subtextStyle: { color: '#aaa' } } }); // View echarts.extendComponentView({ type: 'title', render: function (titleModel, ecModel, api) { this.group.removeAll(); if (!titleModel.get('show')) { return; } var group = this.group; var textStyleModel = titleModel.getModel('textStyle'); var subtextStyleModel = titleModel.getModel('subtextStyle'); var textAlign = titleModel.get('textAlign'); var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign')); var textEl = new graphic.Text({ style: graphic.setTextStyle({}, textStyleModel, { text: titleModel.get('text'), textFill: textStyleModel.getTextColor() }, { disableBox: true }), z2: 10 }); var textRect = textEl.getBoundingRect(); var subText = titleModel.get('subtext'); var subTextEl = new graphic.Text({ style: graphic.setTextStyle({}, subtextStyleModel, { text: subText, textFill: subtextStyleModel.getTextColor(), y: textRect.height + titleModel.get('itemGap'), textVerticalAlign: 'top' }, { disableBox: true }), z2: 10 }); var link = titleModel.get('link'); var sublink = titleModel.get('sublink'); var triggerEvent = titleModel.get('triggerEvent', true); textEl.silent = !link && !triggerEvent; subTextEl.silent = !sublink && !triggerEvent; if (link) { textEl.on('click', function () { windowOpen(link, '_' + titleModel.get('target')); }); } if (sublink) { subTextEl.on('click', function () { windowOpen(link, '_' + titleModel.get('subtarget')); }); } textEl.eventData = subTextEl.eventData = triggerEvent ? { componentType: 'title', componentIndex: titleModel.componentIndex } : null; group.add(textEl); subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line. 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; } textVerticalAlign = textVerticalAlign || 'top'; } group.attr('position', [layoutRect.x, layoutRect.y]); var alignStyle = { textAlign: textAlign, textVerticalAlign: textVerticalAlign }; 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 graphic.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 }); group.add(rect); } }); /***/ }), /***/ "mizm": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var fails = __webpack_require__("r54x"); var toIndexedObject = __webpack_require__("9mDF"); var nativeGetOwnPropertyDescriptor = __webpack_require__("He3V").f; var DESCRIPTORS = __webpack_require__("q0qZ"); var FORCED = !DESCRIPTORS || fails(function () { nativeGetOwnPropertyDescriptor(1); }); // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); } }); /***/ }), /***/ "mlES": /***/ (function(module, exports, __webpack_require__) { var aCallable = __webpack_require__("eZJ6"); var toObject = __webpack_require__("EJk4"); var IndexedObject = __webpack_require__("fkET"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var $TypeError = TypeError; // `Array.prototype.{ reduce, reduceRight }` methods implementation var createMethod = function (IS_RIGHT) { return function (that, callbackfn, argumentsLength, memo) { aCallable(callbackfn); var O = toObject(that); var self = IndexedObject(O); var length = lengthOfArrayLike(O); var index = IS_RIGHT ? length - 1 : 0; var i = IS_RIGHT ? -1 : 1; if (argumentsLength < 2) while (true) { if (index in self) { memo = self[index]; index += i; break; } index += i; if (IS_RIGHT ? index < 0 : length <= index) { throw $TypeError('Reduce of empty array with no initial value'); } } for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { memo = callbackfn(memo, self[index], index, O); } return memo; }; }; module.exports = { // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce left: createMethod(false), // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright right: createMethod(true) }; /***/ }), /***/ "mlpt": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var zrUtil = __webpack_require__("/gxq"); var VisualMapModel = __webpack_require__("wH4Y"); var VisualMapping = __webpack_require__("HGSA"); var visualDefault = __webpack_require__("B123"); var _number = __webpack_require__("wWR3"); var reformIntervals = _number.reformIntervals; /* * 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 = zrUtil.clone(categories); } else { mappingOption.dataExtent = this.getExtent(); mappingOption.mappingMethod = 'piecewise'; mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) { var piece = zrUtil.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(); zrUtil.each(option.pieces, function (piece) { zrUtil.each(visualTypes, function (visualType) { if (piece.hasOwnProperty(visualType)) { visualTypesInPieces[visualType] = 1; } }); }); zrUtil.each(visualTypesInPieces, function (v, visualType) { var exists = 0; zrUtil.each(this.stateList, function (state) { exists |= has(option, state, visualType) || has(option.target, state, visualType); }, this); !exists && zrUtil.each(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] && (zrUtil.isObject(obj[state]) ? obj[state].hasOwnProperty(visualType) : obj[state] === visualType // e.g., inRange: 'symbol' ); } 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. zrUtil.each(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; zrUtil.each(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'; }, /** * @public * @override */ setSelected: function (selected) { this.option.selected = zrUtil.clone(selected); }, /** * @public * @override */ getValueState: function (value) { var index = VisualMapping.findPieceIndex(value, this._pieceList); 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 { 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; zrUtil.each(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); return { stops: stops, outerColors: outerColors }; } }); /** * Key is this._mode * @type {Object} * @this {module:echarts/component/viusalMap/PiecewiseMode} */ var resetMethods = { 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; var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { precision++; } thisOption.precision = precision; splitStep = +splitStep.toFixed(precision); if (thisOption.minOpen) { pieceList.push({ interval: [-Infinity, dataExtent[0]], close: [0, 0] }); } for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) { var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep; pieceList.push({ interval: [curr, max], close: [1, 1] }); } if (thisOption.maxOpen) { pieceList.push({ interval: [dataExtent[1], Infinity], close: [0, 0] }); } reformIntervals(pieceList); zrUtil.each(pieceList, function (piece, index) { piece.index = index; piece.text = this.formatValueText(piece.interval); }, this); }, categories: function () { var thisOption = this.option; zrUtil.each(thisOption.categories, function (cate) { // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 // 是否改一致。 this._pieceList.push({ text: this.formatValueText(cate, true), value: cate }); }, this); // See "Order Rule". normalizeReverse(thisOption, this._pieceList); }, pieces: function () { var thisOption = this.option; var pieceList = this._pieceList; zrUtil.each(thisOption.pieces, function (pieceListItem, index) { if (!zrUtil.isObject(pieceListItem)) { pieceListItem = { value: pieceListItem }; } var item = { text: '', index: index }; if (pieceListItem.label != null) { item.text = pieceListItem.label; } 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 (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); zrUtil.each(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(); } } var _default = PiecewiseModel; module.exports = _default; /***/ }), /***/ "moDv": /***/ (function(module, exports, __webpack_require__) { var curve = __webpack_require__("AAi1"); var vec2 = __webpack_require__("C7PF"); var bbox = __webpack_require__("wUOi"); var BoundingRect = __webpack_require__("8b51"); var _config = __webpack_require__("g+yZ"); 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; /***/ }), /***/ "mt/P": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var bind = __webpack_require__("rlzA"); var aSet = __webpack_require__("egot"); var SetHelpers = __webpack_require__("QdM8"); var iterate = __webpack_require__("XLIz"); var Set = SetHelpers.Set; var add = SetHelpers.add; // `Set.prototype.map` method // https://github.com/tc39/proposal-collection-methods $({ target: 'Set', proto: true, real: true, forced: true }, { map: function map(callbackfn /* , thisArg */) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set(); iterate(set, function (value) { add(newSet, boundFunction(value, value, set)); }); return newSet; } }); /***/ }), /***/ "mtWM": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("tIFN"); /***/ }), /***/ "mtht": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ /* eslint-disable regexp/no-useless-quantifier -- testing */ var call = __webpack_require__("celx"); var uncurryThis = __webpack_require__("u4Az"); var toString = __webpack_require__("nnBu"); var regexpFlags = __webpack_require__("Rx3A"); var stickyHelpers = __webpack_require__("7bcd"); var shared = __webpack_require__("izte"); var create = __webpack_require__("43zn"); var getInternalState = __webpack_require__("I1z2").get; var UNSUPPORTED_DOT_ALL = __webpack_require__("sKi9"); var UNSUPPORTED_NCG = __webpack_require__("zKl2"); var nativeReplace = shared('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; var charAt = uncurryThis(''.charAt); var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; var re2 = /b*/g; call(nativeExec, re1, 'a'); call(nativeExec, re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; })(); var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; // nonparticipating capturing group, copied from es5-shim's String#split patch. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; if (PATCH) { patchedExec = function exec(string) { var re = this; var state = getInternalState(re); var str = toString(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; if (raw) { raw.lastIndex = re.lastIndex; result = call(patchedExec, raw, str); re.lastIndex = raw.lastIndex; return result; } var groups = state.groups; var sticky = UNSUPPORTED_Y && re.sticky; var flags = call(regexpFlags, re); var source = re.source; var charsAdded = 0; var strCopy = str; if (sticky) { flags = replace(flags, 'y', ''); if (indexOf(flags, 'g') === -1) { flags += 'g'; } strCopy = stringSlice(str, re.lastIndex); // Support anchored sticky behavior. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; } // ^(? + rx + ) is needed, in combination with some str slicing, to // simulate the 'y' flag. reCopy = new RegExp('^(?:' + source + ')', flags); } if (NPCG_INCLUDED) { reCopy = new RegExp('^' + source + '$(?!\\s)', flags); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; match = call(nativeExec, sticky ? reCopy : re, strCopy); if (sticky) { if (match) { match.input = stringSlice(match.input, charsAdded); match[0] = stringSlice(match[0], charsAdded); match.index = re.lastIndex; re.lastIndex += match[0].length; } else re.lastIndex = 0; } else if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/ call(nativeReplace, match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } if (match && groups) { match.groups = object = create(null); for (i = 0; i < groups.length; i++) { group = groups[i]; object[group[0]] = match[group[1]]; } } return match; }; } module.exports = patchedExec; /***/ }), /***/ "mtrD": /***/ (function(module, exports) { module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 96); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 96: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=ca859fb4& var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "button", { staticClass: "el-button", class: [ _vm.type ? "el-button--" + _vm.type : "", _vm.buttonSize ? "el-button--" + _vm.buttonSize : "", { "is-disabled": _vm.buttonDisabled, "is-loading": _vm.loading, "is-plain": _vm.plain, "is-round": _vm.round, "is-circle": _vm.circle } ], attrs: { disabled: _vm.buttonDisabled || _vm.loading, autofocus: _vm.autofocus, type: _vm.nativeType }, on: { click: _vm.handleClick } }, [ _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(), _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(), _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e() ] ) } var staticRenderFns = [] render._withStripped = true // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4& // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var buttonvue_type_script_lang_js_ = ({ name: 'ElButton', inject: { elForm: { default: '' }, elFormItem: { default: '' } }, props: { type: { type: String, default: 'default' }, size: String, icon: { type: String, default: '' }, nativeType: { type: String, default: 'button' }, loading: Boolean, disabled: Boolean, plain: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean }, computed: { _elFormItemSize: function _elFormItemSize() { return (this.elFormItem || {}).elFormItemSize; }, buttonSize: function buttonSize() { return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size; }, buttonDisabled: function buttonDisabled() { return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled; } }, methods: { handleClick: function handleClick(evt) { this.$emit('click', evt); } } }); // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js& /* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(0); // CONCATENATED MODULE: ./packages/button/src/button.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_buttonvue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/button/src/button.vue" /* harmony default export */ var src_button = (component.exports); // CONCATENATED MODULE: ./packages/button/index.js /* istanbul ignore next */ src_button.install = function (Vue) { Vue.component(src_button.name, src_button); }; /* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button); /***/ }) /******/ }); /***/ }), /***/ "muhc": /***/ (function(module, exports, __webpack_require__) { "use strict"; // TODO: Remove from `core-js@4` var DESCRIPTORS = __webpack_require__("q0qZ"); var addToUnscopables = __webpack_require__("HLWT"); var toObject = __webpack_require__("EJk4"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var defineBuiltInAccessor = __webpack_require__("5MpO"); // `Array.prototype.lastIndex` accessor // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS) { defineBuiltInAccessor(Array.prototype, 'lastItem', { configurable: true, get: function lastItem() { var O = toObject(this); var len = lengthOfArrayLike(O); return len == 0 ? undefined : O[len - 1]; }, set: function lastItem(value) { var O = toObject(this); var len = lengthOfArrayLike(O); return O[len == 0 ? 0 : len - 1] = value; } }); addToUnscopables('lastItem'); } /***/ }), /***/ "mvCM": /***/ (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__("/gxq"); var each = _util.each; var createHashMap = _util.createHashMap; var assert = _util.assert; var _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; /* * 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`. var userOutput = summary.userOutput = { dimensionNames: data.dimensions.slice(), encode: {} }; each(data.dimensions, function (dimName) { var dimItem = data.getDimensionInfo(dimName); var coordDim = dimItem.coordDim; 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. 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; } 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; /***/ }), /***/ "mvkK": /***/ (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 _parseSVG = __webpack_require__("jDhh"); var parseSVG = _parseSVG.parseSVG; var makeViewBoxTransform = _parseSVG.makeViewBoxTransform; var Group = __webpack_require__("AlhT"); var Rect = __webpack_require__("PD67"); var _util = __webpack_require__("/gxq"); var assert = _util.assert; var createHashMap = _util.createHashMap; var BoundingRect = __webpack_require__("8b51"); var _model = __webpack_require__("vXqC"); var makeInner = _model.makeInner; /* * 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 inner = makeInner(); var _default = { /** * @param {string} mapName * @param {Object} mapRecord {specialAreas, geoJSON} * @return {Object} {root, boundingRect} */ load: function (mapName, mapRecord) { var originRoot = inner(mapRecord).originRoot; if (originRoot) { return { root: originRoot, boundingRect: inner(mapRecord).boundingRect }; } var graphic = buildGraphic(mapRecord); inner(mapRecord).originRoot = graphic.root; inner(mapRecord).boundingRect = graphic.boundingRect; return graphic; }, makeGraphic: function (mapName, mapRecord, hostKey) { // For performance consideration (in large SVG), graphic only maked // when necessary and reuse them according to hostKey. var field = inner(mapRecord); var rootMap = field.rootMap || (field.rootMap = createHashMap()); var root = rootMap.get(hostKey); if (root) { return root; } var originRoot = field.originRoot; var boundingRect = field.boundingRect; // For performance, if originRoot is not used by a view, // assign it to a view, but not reproduce graphic elements. if (!field.originRootHostKey) { field.originRootHostKey = hostKey; root = originRoot; } else { root = buildGraphic(mapRecord, boundingRect).root; } return rootMap.set(hostKey, root); }, removeGraphic: function (mapName, mapRecord, hostKey) { var field = inner(mapRecord); var rootMap = field.rootMap; rootMap && rootMap.removeKey(hostKey); if (hostKey === field.originRootHostKey) { field.originRootHostKey = null; } } }; function buildGraphic(mapRecord, boundingRect) { var svgXML = mapRecord.svgXML; var result; var root; try { result = svgXML && parseSVG(svgXML, { ignoreViewBox: true, ignoreRootClip: true }) || {}; root = result.root; assert(root != null); } catch (e) { throw new Error('Invalid svg format\n' + e.message); } var svgWidth = result.width; var svgHeight = result.height; var viewBoxRect = result.viewBoxRect; if (!boundingRect) { boundingRect = svgWidth == null || svgHeight == null ? // If svg width / height not specified, calculate // bounding rect as the width / height root.getBoundingRect() : new BoundingRect(0, 0, 0, 0); if (svgWidth != null) { boundingRect.width = svgWidth; } if (svgHeight != null) { boundingRect.height = svgHeight; } } if (viewBoxRect) { var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect.width, boundingRect.height); var elRoot = root; root = new Group(); root.add(elRoot); elRoot.scale = viewBoxTransform.scale; elRoot.position = viewBoxTransform.position; } root.setClipPath(new Rect({ shape: boundingRect.plain() })); return { root: root, boundingRect: boundingRect }; } module.exports = _default; /***/ }), /***/ "n/n4": /***/ (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__("/gxq"); /* * 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 dataToCoordSize(dataSize, dataItem) { // dataItem is necessary in log axis. dataItem = dataItem || [0, 0]; return zrUtil.map(['x', 'y'], function (dim, dimIdx) { var axis = this.getAxis(dim); var val = dataItem[dimIdx]; var halfSize = dataSize[dimIdx] / 2; return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); }, this); } function _default(coordSys) { var rect = coordSys.grid.getRect(); return { coordSys: { // The name exposed to user is always 'cartesian2d' but not 'grid'. type: 'cartesian2d', x: rect.x, y: rect.y, width: rect.width, height: rect.height }, api: { coord: function (data) { // do not provide "out" param return coordSys.dataToPoint(data); }, size: zrUtil.bind(dataToCoordSize, coordSys) } }; } module.exports = _default; /***/ }), /***/ "n1Fu": /***/ (function(module, exports, __webpack_require__) { // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = __webpack_require__("eqAp"); $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); /***/ }), /***/ "n2L5": /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.github.io/proposal-setmap-offrom/ var bind = __webpack_require__("rlzA"); var call = __webpack_require__("celx"); var aCallable = __webpack_require__("eZJ6"); var aConstructor = __webpack_require__("XuKe"); var isNullOrUndefined = __webpack_require__("HrgD"); var iterate = __webpack_require__("UHV6"); var push = [].push; module.exports = function from(source /* , mapFn, thisArg */) { var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping, array, n, boundFunction; aConstructor(this); mapping = mapFn !== undefined; if (mapping) aCallable(mapFn); if (isNullOrUndefined(source)) return new this(); array = []; if (mapping) { n = 0; boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined); iterate(source, function (nextItem) { call(push, array, boundFunction(nextItem, n++)); }); } else { iterate(source, push, { that: array }); } return new this(array); }; /***/ }), /***/ "n2n7": /***/ (function(module, exports, __webpack_require__) { var classofRaw = __webpack_require__("raVe"); var uncurryThis = __webpack_require__("u4Az"); module.exports = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; /***/ }), /***/ "n3NR": /***/ (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 echarts = __webpack_require__("Icdr"); var zrUtil = __webpack_require__("/gxq"); var BoundingRect = __webpack_require__("8b51"); var visualSolution = __webpack_require__("NUWb"); var selector = __webpack_require__("zlsk"); var throttleUtil = __webpack_require__("QD+P"); var BrushTargetManager = __webpack_require__("XCrL"); /* * 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 STATE_LIST = ['inBrush', 'outOfBrush']; var DISPATCH_METHOD = '__ecBrushSelect'; var DISPATCH_FLAG = '__ecInBrushSelectEvent'; var PRIORITY_BRUSH = echarts.PRIORITY.VISUAL.BRUSH; /** * Layout for visual, the priority higher than other layout, and before brush visual. */ echarts.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); }); function layoutCovers(ecModel) { ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) { var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); brushTargetManager.setInputRanges(brushModel.areas, ecModel); }); } /** * Register the visual encoding if this modules required. */ echarts.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: zrUtil.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; if (!brushIndex) { // Only the first throttle setting works. throttleType = brushOption.throttleType; throttleDelay = brushOption.throttleDelay; } // Add boundingRect and selectors to range. var areas = zrUtil.map(brushModel.areas, function (area) { return bindSelector(zrUtil.defaults({ boundingRect: boundingRectBuilders[area.brushType](area) }, area)); }); var visualMappings = visualSolution.createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) { mappingOption.mappingMethod = 'fixed'; }); zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) { linkedSeriesMap[seriesIndex] = 1; }); 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; } /** * 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. */ // Step A ecModel.eachSeries(function (seriesModel, seriesIndex) { var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex, rangeInfoList) : stepAOthers(seriesModel, seriesIndex, rangeInfoList); }); function stepAParallel(seriesModel, seriesIndex) { var coordSys = seriesModel.coordinateSystem; hasBrushExists |= coordSys.hasAxisBrushed(); linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) { activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); }); } function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { var selectorsByBrushType = getSelectorsByBrushType(seriesModel); if (!selectorsByBrushType || brushModelNotControll(brushModel, seriesIndex)) { return; } zrUtil.each(areas, function (area) { selectorsByBrushType[area.brushType] && brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel) && rangeInfoList.push(area); hasBrushExists |= brushed(rangeInfoList); }); if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { var data = seriesModel.getData(); data.each(function (dataIndex) { if (checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex)) { selectedDataIndexForLink[dataIndex] = 1; } }); } } // 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)) && visualSolution.applyVisual(STATE_LIST, visualMappings, data, getValueState); }); }); 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; } var fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); fn(api, brushSelected); } 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; } } 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; } } } function getSelectorsByBrushType(seriesModel) { var brushSelector = seriesModel.brushSelector; if (zrUtil.isString(brushSelector)) { var sels = []; zrUtil.each(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 (zrUtil.isFunction(brushSelector)) { var bSelector = {}; zrUtil.each(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' && (zrUtil.isArray(seriesIndices) ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices); } function bindSelector(area) { var selectors = area.selectors = {}; zrUtil.each(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: zrUtil.noop, lineY: zrUtil.noop, rect: function (area) { return getBoundingRectFromMinMax(area.range); }, polygon: function (area) { var minMax; var range = area.range; 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]); } return minMax && getBoundingRectFromMinMax(minMax); } }; function getBoundingRectFromMinMax(minMax) { return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]); } exports.layoutCovers = layoutCovers; /***/ }), /***/ "n561": /***/ (function(module, exports, __webpack_require__) { var NATIVE_BIND = __webpack_require__("jyal"); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; var call = FunctionPrototype.call; // eslint-disable-next-line es/no-reflect -- safe module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); /***/ }), /***/ "n5nI": /***/ (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 Gradient = __webpack_require__("wRzc"); var _util = __webpack_require__("/gxq"); var isFunction = _util.isFunction; /* * 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 _default = { createOnAllSeries: true, performRawSeries: true, reset: function (seriesModel, ecModel) { var data = seriesModel.getData(); var colorAccessPath = (seriesModel.visualColorAccessPath || 'itemStyle.color').split('.'); // Set in itemStyle var color = seriesModel.get(colorAccessPath); var colorCallback = isFunction(color) && !(color instanceof Gradient) ? color : null; // Default color if (!color || colorCallback) { color = seriesModel.getColorFromPalette( // TODO series count changed. seriesModel.name, null, ecModel.getSeriesCount()); } 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 (colorCallback) { data.each(function (idx) { data.setItemVisual(idx, 'color', colorCallback(seriesModel.getDataParams(idx))); }); } // itemStyle in each data item 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 }; } } }; module.exports = _default; /***/ }), /***/ "n8VM": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var DESCRIPTORS = __webpack_require__("q0qZ"); var FORCED = __webpack_require__("ZAmB"); var toObject = __webpack_require__("EJk4"); var toPropertyKey = __webpack_require__("+e1w"); var getPrototypeOf = __webpack_require__("wzd1"); var getOwnPropertyDescriptor = __webpack_require__("He3V").f; // `Object.prototype.__lookupGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__ if (DESCRIPTORS) { $({ target: 'Object', proto: true, forced: FORCED }, { __lookupGetter__: function __lookupGetter__(P) { var O = toObject(this); var key = toPropertyKey(P); var desc; do { if (desc = getOwnPropertyDescriptor(O, key)) return desc.get; } while (O = getPrototypeOf(O)); } }); } /***/ }), /***/ "n94B": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var is = __webpack_require__("kRoP"); // `Object.is` method // https://tc39.es/ecma262/#sec-object.is $({ target: 'Object', stat: true }, { is: is }); /***/ }), /***/ "nCxY": /***/ (function(module, exports, __webpack_require__) { // 20.1.2.3 Number.isInteger(number) var isObject = __webpack_require__("U9LJ"); var floor = Math.floor; module.exports = function isInteger(it) { return !isObject(it) && isFinite(it) && floor(it) === it; }; /***/ }), /***/ "nE53": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("q0qZ"); var MISSED_STICKY = __webpack_require__("7bcd").MISSED_STICKY; var classof = __webpack_require__("raVe"); var defineBuiltInAccessor = __webpack_require__("5MpO"); var getInternalState = __webpack_require__("I1z2").get; var RegExpPrototype = RegExp.prototype; var $TypeError = TypeError; // `RegExp.prototype.sticky` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky if (DESCRIPTORS && MISSED_STICKY) { defineBuiltInAccessor(RegExpPrototype, 'sticky', { configurable: true, get: function sticky() { if (this === RegExpPrototype) return; // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. if (classof(this) === 'RegExp') { return !!getInternalState(this).sticky; } throw $TypeError('Incompatible receiver, RegExp required'); } }); } /***/ }), /***/ "nErl": /***/ (function(module, exports) { /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */ module.exports = __webpack_amd_options__; /* WEBPACK VAR INJECTION */}.call(exports, {})) /***/ }), /***/ "nFL/": /***/ (function(module, exports, __webpack_require__) { // 20.2.2.33 Math.tanh(x) var $export = __webpack_require__("eqAp"); var expm1 = __webpack_require__("T9ir"); var exp = Math.exp; $export($export.S, 'Math', { tanh: function tanh(x) { var a = expm1(x = +x); var b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); /***/ }), /***/ "nJ75": /***/ (function(module, exports, __webpack_require__) { var hide = __webpack_require__("aLzV"); module.exports = function (target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key]; else hide(target, key, src[key]); } return target; }; /***/ }), /***/ "nQkE": /***/ (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__("/gxq"); var numberUtil = __webpack_require__("wWR3"); /* * 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 _default(ecModel, api) { ecModel.eachSeriesByType('themeRiver', function (seriesModel) { var data = seriesModel.getData(); var single = seriesModel.coordinateSystem; var layoutInfo = {}; // use the axis boundingRect for view var rect = single.getRect(); layoutInfo.rect = rect; var boundaryGap = seriesModel.get('boundaryGap'); var axis = single.getAxis(); layoutInfo.boundaryGap = boundaryGap; if (axis.orient === 'horizontal') { boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height); boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height); var height = rect.height - boundaryGap[0] - boundaryGap[1]; themeRiverLayout(data, seriesModel, height); } else { boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width); boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width); var width = rect.width - boundaryGap[0] - boundaryGap[1]; themeRiverLayout(data, seriesModel, width); } data.setLayout('layoutInfo', layoutInfo); }); } /** * The layout information about themeriver * * @param {module:echarts/data/List} data data in the series * @param {module:echarts/model/Series} seriesModel the model object of themeRiver series * @param {number} height value used to compute every series height */ function themeRiverLayout(data, seriesModel, height) { if (!data.count()) { return; } var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series. var layerSeries = seriesModel.getLayerSeries(); // the points in each layer. var timeDim = data.mapDimension('single'); var valueDim = data.mapDimension('value'); var layerPoints = zrUtil.map(layerSeries, function (singleLayer) { return zrUtil.map(singleLayer.indices, function (idx) { var pt = coordSys.dataToPoint(data.get(timeDim, idx)); pt[1] = data.get(valueDim, idx); return pt; }); }); var base = computeBaseline(layerPoints); var baseLine = base.y0; var ky = height / base.max; // set layout information for each item. var n = layerSeries.length; var m = layerSeries[0].indices.length; var baseY0; for (var j = 0; j < m; ++j) { baseY0 = baseLine[j] * ky; data.setItemLayout(layerSeries[0].indices[j], { layerIndex: 0, x: layerPoints[0][j][0], y0: baseY0, y: layerPoints[0][j][1] * ky }); for (var i = 1; i < n; ++i) { baseY0 += layerPoints[i - 1][j][1] * ky; data.setItemLayout(layerSeries[i].indices[j], { layerIndex: i, x: layerPoints[i][j][0], y0: baseY0, y: layerPoints[i][j][1] * ky }); } } } /** * Compute the baseLine of the rawdata * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics * * @param {Array.} data the points in each layer * @return {Object} */ function computeBaseline(data) { var layerNum = data.length; var pointNum = data[0].length; var sums = []; var y0 = []; var max = 0; var temp; var base = {}; for (var i = 0; i < pointNum; ++i) { for (var j = 0, temp = 0; j < layerNum; ++j) { temp += data[j][i][1]; } if (temp > max) { max = temp; } sums.push(temp); } for (var k = 0; k < pointNum; ++k) { y0[k] = (max - sums[k]) / 2; } max = 0; for (var l = 0; l < pointNum; ++l) { var sum = sums[l] + y0[l]; if (sum > max) { max = sum; } } base.y0 = y0; base.max = max; return base; } module.exports = _default; /***/ }), /***/ "nTES": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` var $ = __webpack_require__("i9tX"); var ReflectMetadataModule = __webpack_require__("AmrS"); var anObject = __webpack_require__("5+O3"); var ordinaryGetOwnMetadata = ReflectMetadataModule.get; var toMetadataKey = ReflectMetadataModule.toKey; // `Reflect.getOwnMetadata` method // https://github.com/rbuckton/reflect-metadata $({ target: 'Reflect', stat: true }, { getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); return ordinaryGetOwnMetadata(metadataKey, anObject(target), targetKey); } }); /***/ }), /***/ "nUSl": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("OvrE"); __webpack_require__("PdL8"); __webpack_require__("FvdC"); __webpack_require__("srbS"); var mapSymbolLayout = __webpack_require__("QZ7o"); var mapVisual = __webpack_require__("2W4A"); var mapDataStatistic = __webpack_require__("vIe4"); var backwardCompat = __webpack_require__("Z2m1"); var createDataSelectAction = __webpack_require__("XRkS"); /* * 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. */ echarts.registerLayout(mapSymbolLayout); echarts.registerVisual(mapVisual); echarts.registerProcessor(echarts.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); echarts.registerPreprocessor(backwardCompat); createDataSelectAction('map', [{ type: 'mapToggleSelect', event: 'mapselectchanged', method: 'toggleSelected' }, { type: 'mapSelect', event: 'mapselected', method: 'select' }, { type: 'mapUnSelect', event: 'mapunselected', method: 'unSelect' }]); /***/ }), /***/ "nV/6": /***/ (function(module, exports) { /* * 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. */ function normalize(a) { if (!(a instanceof Array)) { a = [a, a]; } return a; } var opacityQuery = 'lineStyle.opacity'.split('.'); var _default = { seriesType: 'lines', reset: function (seriesModel, ecModel, api) { var symbolType = normalize(seriesModel.get('symbol')); var symbolSize = normalize(seriesModel.get('symbolSize')); var data = seriesModel.getData(); data.setVisual('fromSymbol', symbolType && symbolType[0]); data.setVisual('toSymbol', symbolType && symbolType[1]); data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); data.setVisual('toSymbolSize', symbolSize && symbolSize[1]); data.setVisual('opacity', seriesModel.get(opacityQuery)); function dataEach(data, idx) { var itemModel = data.getItemModel(idx); var symbolType = normalize(itemModel.getShallow('symbol', true)); var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); var opacity = itemModel.get(opacityQuery); symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]); symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]); symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]); symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]); data.setItemVisual(idx, 'opacity', opacity); } return { dataEach: data.hasItemOption ? dataEach : null }; } }; module.exports = _default; /***/ }), /***/ "nb/R": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var aCallable = __webpack_require__("eZJ6"); var aMap = __webpack_require__("5OAf"); var MapHelpers = __webpack_require__("9Bn4"); var $TypeError = TypeError; var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; // `Map.prototype.update` method // https://github.com/tc39/proposal-collection-methods $({ target: 'Map', proto: true, real: true, forced: true }, { update: function update(key, callback /* , thunk */) { var map = aMap(this); var length = arguments.length; aCallable(callback); var isPresentInMap = has(map, key); if (!isPresentInMap && length < 3) { throw $TypeError('Updating absent value'); } var value = isPresentInMap ? get(map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map); set(map, key, callback(value, key, map)); return map; } }); /***/ }), /***/ "nbAL": /***/ (function(module, exports, __webpack_require__) { exports.f = __webpack_require__("6hGG"); /***/ }), /***/ "nbYV": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("n2n7"); var getOwnPropertyDescriptor = __webpack_require__("He3V").f; var toLength = __webpack_require__("xDUa"); var toString = __webpack_require__("nnBu"); var notARegExp = __webpack_require__("tqEa"); var requireObjectCoercible = __webpack_require__("hiy0"); var correctIsRegExpLogic = __webpack_require__("CTE+"); var IS_PURE = __webpack_require__("pzR0"); // eslint-disable-next-line es/no-string-prototype-startswith -- safe var nativeStartsWith = uncurryThis(''.startsWith); var stringSlice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); // https://github.com/zloirock/core-js/pull/702 var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.startsWith` method // https://tc39.es/ecma262/#sec-string.prototype.startswith $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { startsWith: function startsWith(searchString /* , position = 0 */) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = toString(searchString); return nativeStartsWith ? nativeStartsWith(that, search, index) : stringSlice(that, index, index + search.length) === search; } }); /***/ }), /***/ "nbe/": /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__("u4Az"); var aCallable = __webpack_require__("eZJ6"); var isNullOrUndefined = __webpack_require__("HrgD"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var toObject = __webpack_require__("EJk4"); var MapHelpers = __webpack_require__("9Bn4"); var iterate = __webpack_require__("P6C+"); var Map = MapHelpers.Map; var mapHas = MapHelpers.has; var mapSet = MapHelpers.set; var push = uncurryThis([].push); // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique module.exports = function uniqueBy(resolver) { var that = toObject(this); var length = lengthOfArrayLike(that); var result = []; var map = new Map(); var resolverFunction = !isNullOrUndefined(resolver) ? aCallable(resolver) : function (value) { return value; }; var index, item, key; for (index = 0; index < length; index++) { item = that[index]; key = resolverFunction(item); if (!mapHas(map, key)) mapSet(map, key, item); } iterate(map, function (value) { push(result, value); }); return result; }; /***/ }), /***/ "nhXg": /***/ (function(module, exports, __webpack_require__) { var defineWellKnownSymbol = __webpack_require__("8lki"); var defineSymbolToPrimitive = __webpack_require__("7/sy"); // `Symbol.toPrimitive` well-known symbol // https://tc39.es/ecma262/#sec-symbol.toprimitive defineWellKnownSymbol('toPrimitive'); // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive defineSymbolToPrimitive(); /***/ }), /***/ "nixg": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("U9LJ"); var document = __webpack_require__("vR0S").document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; /***/ }), /***/ "nkxs": /***/ (function(module, exports, __webpack_require__) { // TODO: Remove from `core-js@4` var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var $Date = Date; var thisTimeValue = uncurryThis($Date.prototype.getTime); // `Date.now` method // https://tc39.es/ecma262/#sec-date.now $({ target: 'Date', stat: true }, { now: function now() { return thisTimeValue(new $Date()); } }); /***/ }), /***/ "nnBu": /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__("jgJS"); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; /***/ }), /***/ "noA0": /***/ (function(module, exports, __webpack_require__) { // 20.2.2.30 Math.sinh(x) var $export = __webpack_require__("eqAp"); var expm1 = __webpack_require__("T9ir"); var exp = Math.exp; // V8 near Chromium 38 has a problem with very small numbers $export($export.S + $export.F * __webpack_require__("HTem")(function () { return !Math.sinh(-2e-17) != -2e-17; }), 'Math', { sinh: function sinh(x) { return Math.abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); /***/ }), /***/ "nvbp": /***/ (function(module, exports) { var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/ module.exports = function mergeJSXProps (objs) { return objs.reduce(function (a, b) { var aa, bb, key, nestedKey, temp for (key in b) { aa = a[key] bb = b[key] if (aa && nestRE.test(key)) { // normalize class if (key === 'class') { if (typeof aa === 'string') { temp = aa a[key] = aa = {} aa[temp] = true } if (typeof bb === 'string') { temp = bb b[key] = bb = {} bb[temp] = true } } if (key === 'on' || key === 'nativeOn' || key === 'hook') { // merge functions for (nestedKey in bb) { aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey]) } } else if (Array.isArray(aa)) { a[key] = aa.concat(bb) } else if (Array.isArray(bb)) { a[key] = [aa].concat(bb) } else { for (nestedKey in bb) { aa[nestedKey] = bb[nestedKey] } } } else { a[key] = b[key] } } return a }, {}) } function mergeFn (a, b) { return function () { a && a.apply(this, arguments) b && b.apply(this, arguments) } } /***/ }), /***/ "o/tC": /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__("q0qZ"); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__("/sOT"); var definePropertyModule = __webpack_require__("1rEs"); var anObject = __webpack_require__("5+O3"); var toIndexedObject = __webpack_require__("9mDF"); var objectKeys = __webpack_require__("/09a"); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); return O; }; /***/ }), /***/ "o0k+": /***/ (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. */ __webpack_require__("cN90"); __webpack_require__("OcRu"); /***/ }), /***/ "o6lL": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable es/no-string-prototype-matchall -- safe */ var $ = __webpack_require__("i9tX"); var call = __webpack_require__("celx"); var uncurryThis = __webpack_require__("n2n7"); var createIteratorConstructor = __webpack_require__("Svt7"); var createIterResultObject = __webpack_require__("l+3Q"); var requireObjectCoercible = __webpack_require__("hiy0"); var toLength = __webpack_require__("xDUa"); var toString = __webpack_require__("nnBu"); var anObject = __webpack_require__("5+O3"); var isNullOrUndefined = __webpack_require__("HrgD"); var classof = __webpack_require__("raVe"); var isRegExp = __webpack_require__("5in1"); var getRegExpFlags = __webpack_require__("UqxR"); var getMethod = __webpack_require__("YLw8"); var defineBuiltIn = __webpack_require__("gakl"); var fails = __webpack_require__("r54x"); var wellKnownSymbol = __webpack_require__("jAiL"); var speciesConstructor = __webpack_require__("Xfp1"); var advanceStringIndex = __webpack_require__("A9wm"); var regExpExec = __webpack_require__("B9ov"); var InternalStateModule = __webpack_require__("I1z2"); var IS_PURE = __webpack_require__("pzR0"); var MATCH_ALL = wellKnownSymbol('matchAll'); var REGEXP_STRING = 'RegExp String'; var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR); var RegExpPrototype = RegExp.prototype; var $TypeError = TypeError; var stringIndexOf = uncurryThis(''.indexOf); var nativeMatchAll = uncurryThis(''.matchAll); var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function () { nativeMatchAll('a', /./); }); var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) { setInternalState(this, { type: REGEXP_STRING_ITERATOR, regexp: regexp, string: string, global: $global, unicode: fullUnicode, done: false }); }, REGEXP_STRING, function next() { var state = getInternalState(this); if (state.done) return createIterResultObject(undefined, true); var R = state.regexp; var S = state.string; var match = regExpExec(R, S); if (match === null) { state.done = true; return createIterResultObject(undefined, true); } if (state.global) { if (toString(match[0]) === '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode); return createIterResultObject(match, false); } state.done = true; return createIterResultObject(match, false); }); var $matchAll = function (string) { var R = anObject(this); var S = toString(string); var C = speciesConstructor(R, RegExp); var flags = toString(getRegExpFlags(R)); var matcher, $global, fullUnicode; matcher = new C(C === RegExp ? R.source : R, flags); $global = !!~stringIndexOf(flags, 'g'); fullUnicode = !!~stringIndexOf(flags, 'u'); matcher.lastIndex = toLength(R.lastIndex); return new $RegExpStringIterator(matcher, S, $global, fullUnicode); }; // `String.prototype.matchAll` method // https://tc39.es/ecma262/#sec-string.prototype.matchall $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { matchAll: function matchAll(regexp) { var O = requireObjectCoercible(this); var flags, S, matcher, rx; if (!isNullOrUndefined(regexp)) { if (isRegExp(regexp)) { flags = toString(requireObjectCoercible(getRegExpFlags(regexp))); if (!~stringIndexOf(flags, 'g')) throw $TypeError('`.matchAll` does not allow non-global regexes'); } if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); matcher = getMethod(regexp, MATCH_ALL); if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll; if (matcher) return call(matcher, regexp, O); } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); S = toString(O); rx = new RegExp(regexp, 'g'); return IS_PURE ? call($matchAll, rx, S) : rx[MATCH_ALL](S); } }); IS_PURE || MATCH_ALL in RegExpPrototype || defineBuiltIn(RegExpPrototype, MATCH_ALL, $matchAll); /***/ }), /***/ "oBGI": /***/ (function(module, exports, __webpack_require__) { var _curve = __webpack_require__("AAi1"); 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; /***/ }), /***/ "oDOe": /***/ (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 _config = __webpack_require__("4Nz2"); var __DEV__ = _config.__DEV__; var zrUtil = __webpack_require__("/gxq"); var Eventful = __webpack_require__("qjvV"); var graphic = __webpack_require__("0sHC"); var interactionMutex = __webpack_require__("mcsk"); var DataDiffer = __webpack_require__("1Hui"); /* * 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 curry = zrUtil.curry; var each = zrUtil.each; var map = zrUtil.map; var mathMin = Math.min; var mathMax = Math.max; var mathPow = Math.pow; var COVER_Z = 10000; var UNSELECT_THRESHOLD = 6; var MIN_RESIZE_LINE_WIDTH = 6; var MUTEX_RESOURCE_KEY = 'globalPan'; var DIRECTION_MAP = { w: [0, 0], e: [0, 1], n: [1, 0], s: [1, 1] }; var CURSOR_MAP = { w: 'ew', e: 'ew', n: 'ns', s: 'ns', ne: 'nesw', sw: 'nesw', nw: 'nwse', se: 'nwse' }; var DEFAULT_BRUSH_OPT = { brushStyle: { lineWidth: 2, stroke: 'rgba(0,0,0,0.3)', fill: 'rgba(0,0,0,0.1)' }, transformable: true, brushMode: 'single', removeOnClick: false }; var baseUID = 0; /** * @alias module:echarts/component/helper/BrushController * @constructor * @mixin {module:zrender/mixin/Eventful} * @event module:echarts/component/helper/BrushController#brush * params: * areas: Array., coord relates to container group, * If no container specified, to global. * opt { * isEnd: boolean, * removeOnClick: boolean * } * * @param {module:zrender/zrender~ZRender} zr */ function BrushController(zr) { Eventful.call(this); /** * @type {module:zrender/zrender~ZRender} * @private */ this._zr = zr; /** * @type {module:zrender/container/Group} * @readOnly */ this.group = new graphic.Group(); /** * Only for drawing (after enabledBrush). * 'line', 'rect', 'polygon' or false * If passing false/null/undefined, disable brush. * If passing 'auto', determined by panel.defaultBrushType * @private * @type {string} */ this._brushType; /** * Only for drawing (after enabledBrush). * * @private * @type {Object} */ this._brushOption; /** * @private * @type {Object} */ this._panels; /** * @private * @type {Array.} */ this._track = []; /** * @private * @type {boolean} */ this._dragging; /** * @private * @type {Array} */ this._covers = []; /** * @private * @type {moudule:zrender/container/Group} */ this._creatingCover; /** * `true` means global panel * @private * @type {module:zrender/container/Group|boolean} */ this._creatingPanel; /** * @private * @type {boolean} */ this._enableGlobalPan; /** * @private * @type {boolean} */ /** * @private * @type {string} */ this._uid = 'brushController_' + baseUID++; /** * @private * @type {Object} */ this._handlers = {}; each(pointerHandlers, function (handler, eventName) { this._handlers[eventName] = zrUtil.bind(handler, this); }, this); } BrushController.prototype = { constructor: BrushController, /** * If set to null/undefined/false, select disabled. * @param {Object} brushOption * @param {string|boolean} brushOption.brushType 'line', 'rect', 'polygon' or false * If passing false/null/undefined, disable brush. * If passing 'auto', determined by panel.defaultBrushType. * ('auto' can not be used in global panel) * @param {number} [brushOption.brushMode='single'] 'single' or 'multiple' * @param {boolean} [brushOption.transformable=true] * @param {boolean} [brushOption.removeOnClick=false] * @param {Object} [brushOption.brushStyle] * @param {number} [brushOption.brushStyle.width] * @param {number} [brushOption.brushStyle.lineWidth] * @param {string} [brushOption.brushStyle.stroke] * @param {string} [brushOption.brushStyle.fill] * @param {number} [brushOption.z] */ enableBrush: function (brushOption) { this._brushType && doDisableBrush(this); brushOption.brushType && doEnableBrush(this, brushOption); return this; }, /** * @param {Array.} panelOpts If not pass, it is global brush. * Each items: { * panelId, // mandatory. * clipPath, // mandatory. function. * isTargetByCursor, // mandatory. function. * defaultBrushType, // optional, only used when brushType is 'auto'. * getLinearBrushOtherExtent, // optional. function. * } */ setPanels: function (panelOpts) { if (panelOpts && panelOpts.length) { var panels = this._panels = {}; zrUtil.each(panelOpts, function (panelOpts) { panels[panelOpts.panelId] = zrUtil.clone(panelOpts); }); } else { this._panels = null; } return this; }, /** * @param {Object} [opt] * @return {boolean} [opt.enableGlobalPan=false] */ mount: function (opt) { opt = opt || {}; this._enableGlobalPan = opt.enableGlobalPan; var thisGroup = this.group; this._zr.add(thisGroup); thisGroup.attr({ position: opt.position || [0, 0], rotation: opt.rotation || 0, scale: opt.scale || [1, 1] }); this._transform = thisGroup.getLocalTransform(); return this; }, eachCover: function (cb, context) { each(this._covers, cb, context); }, /** * Update covers. * @param {Array.} brushOptionList Like: * [ * {id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable}, * {id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]}, * ... * ] * `brushType` is required in each cover info. (can not be 'auto') * `id` is not mandatory. * `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default. * If brushOptionList is null/undefined, all covers removed. */ updateCovers: function (brushOptionList) { brushOptionList = zrUtil.map(brushOptionList, function (brushOption) { return zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true); }); var tmpIdPrefix = '\0-brush-index-'; var oldCovers = this._covers; var newCovers = this._covers = []; var controller = this; var creatingCover = this._creatingCover; new DataDiffer(oldCovers, brushOptionList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute(); return this; function getKey(brushOption, index) { return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType; } function oldGetKey(cover, index) { return getKey(cover.__brushOption, index); } function addOrUpdate(newIndex, oldIndex) { var newBrushOption = brushOptionList[newIndex]; // Consider setOption in event listener of brushSelect, // where updating cover when creating should be forbiden. if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { newCovers[newIndex] = oldCovers[oldIndex]; } else { var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushOption, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushOption)); updateCoverAfterCreation(controller, cover); } } function remove(oldIndex) { if (oldCovers[oldIndex] !== creatingCover) { controller.group.remove(oldCovers[oldIndex]); } } }, unmount: function () { this.enableBrush(false); // container may 'removeAll' outside. clearCovers(this); this._zr.remove(this.group); return this; }, dispose: function () { this.unmount(); this.off(); } }; zrUtil.mixin(BrushController, Eventful); function doEnableBrush(controller, brushOption) { var zr = controller._zr; // Consider roam, which takes globalPan too. if (!controller._enableGlobalPan) { interactionMutex.take(zr, MUTEX_RESOURCE_KEY, controller._uid); } mountHandlers(zr, controller._handlers); controller._brushType = brushOption.brushType; controller._brushOption = zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true); } function doDisableBrush(controller) { var zr = controller._zr; interactionMutex.release(zr, MUTEX_RESOURCE_KEY, controller._uid); unmountHandlers(zr, controller._handlers); controller._brushType = controller._brushOption = null; } function mountHandlers(zr, handlers) { each(handlers, function (handler, eventName) { zr.on(eventName, handler); }); } function unmountHandlers(zr, handlers) { each(handlers, function (handler, eventName) { zr.off(eventName, handler); }); } function createCover(controller, brushOption) { var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); cover.__brushOption = brushOption; updateZ(cover, brushOption); controller.group.add(cover); return cover; } function endCreating(controller, creatingCover) { var coverRenderer = getCoverRenderer(creatingCover); if (coverRenderer.endCreating) { coverRenderer.endCreating(controller, creatingCover); updateZ(creatingCover, creatingCover.__brushOption); } return creatingCover; } function updateCoverShape(controller, cover) { var brushOption = cover.__brushOption; getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption); } function updateZ(cover, brushOption) { var z = brushOption.z; z == null && (z = COVER_Z); cover.traverse(function (el) { el.z = z; el.z2 = z; // Consider in given container. }); } function updateCoverAfterCreation(controller, cover) { getCoverRenderer(cover).updateCommon(controller, cover); updateCoverShape(controller, cover); } function getCoverRenderer(cover) { return coverRenderers[cover.__brushOption.brushType]; } // return target panel or `true` (means global panel) function getPanelByPoint(controller, e, localCursorPoint) { var panels = controller._panels; if (!panels) { return true; // Global panel } var panel; var transform = controller._transform; each(panels, function (pn) { pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn); }); return panel; } // Return a panel or true function getPanelByCover(controller, cover) { var panels = controller._panels; if (!panels) { return true; // Global panel } var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info, // which is then treated as global panel. return panelId != null ? panels[panelId] : true; } function clearCovers(controller) { var covers = controller._covers; var originalLength = covers.length; each(covers, function (cover) { controller.group.remove(cover); }, controller); covers.length = 0; return !!originalLength; } function trigger(controller, opt) { var areas = map(controller._covers, function (cover) { var brushOption = cover.__brushOption; var range = zrUtil.clone(brushOption.range); return { brushType: brushOption.brushType, panelId: brushOption.panelId, range: range }; }); controller.trigger('brush', areas, { isEnd: !!opt.isEnd, removeOnClick: !!opt.removeOnClick }); } function shouldShowCover(controller) { var track = controller._track; if (!track.length) { return false; } var p2 = track[track.length - 1]; var p1 = track[0]; var dx = p2[0] - p1[0]; var dy = p2[1] - p1[1]; var dist = mathPow(dx * dx + dy * dy, 0.5); return dist > UNSELECT_THRESHOLD; } function getTrackEnds(track) { var tail = track.length - 1; tail < 0 && (tail = 0); return [track[0], track[tail]]; } function createBaseRectCover(doDrift, controller, brushOption, edgeNames) { var cover = new graphic.Group(); cover.add(new graphic.Rect({ name: 'main', style: makeStyle(brushOption), silent: true, draggable: true, cursor: 'move', drift: curry(doDrift, controller, cover, 'nswe'), ondragend: curry(trigger, controller, { isEnd: true }) })); each(edgeNames, function (name) { cover.add(new graphic.Rect({ name: name, style: { opacity: 0 }, draggable: true, silent: true, invisible: true, drift: curry(doDrift, controller, cover, name), ondragend: curry(trigger, controller, { isEnd: true }) })); }); return cover; } function updateBaseRect(controller, cover, localRange, brushOption) { var lineWidth = brushOption.brushStyle.lineWidth || 0; var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH); var x = localRange[0][0]; var y = localRange[1][0]; var xa = x - lineWidth / 2; var ya = y - lineWidth / 2; var x2 = localRange[0][1]; var y2 = localRange[1][1]; var x2a = x2 - handleSize + lineWidth / 2; var y2a = y2 - handleSize + lineWidth / 2; var width = x2 - x; var height = y2 - y; var widtha = width + lineWidth; var heighta = height + lineWidth; updateRectShape(controller, cover, 'main', x, y, width, height); if (brushOption.transformable) { updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta); updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta); updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize); updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize); updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize); updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize); updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize); updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize); } } function updateCommon(controller, cover) { var brushOption = cover.__brushOption; var transformable = brushOption.transformable; var mainEl = cover.childAt(0); mainEl.useStyle(makeStyle(brushOption)); mainEl.attr({ silent: !transformable, cursor: transformable ? 'move' : 'default' }); each(['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'], function (name) { var el = cover.childOfName(name); var globalDir = getGlobalDirection(controller, name); el && el.attr({ silent: !transformable, invisible: !transformable, cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null }); }); } function updateRectShape(controller, cover, name, x, y, w, h) { var el = cover.childOfName(name); el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]]))); } function makeStyle(brushOption) { return zrUtil.defaults({ strokeNoScale: true }, brushOption.brushStyle); } function formatRectRange(x, y, x2, y2) { var min = [mathMin(x, x2), mathMin(y, y2)]; var max = [mathMax(x, x2), mathMax(y, y2)]; return [[min[0], max[0]], // x range [min[1], max[1]] // y range ]; } function getTransform(controller) { return graphic.getTransform(controller.group); } function getGlobalDirection(controller, localDirection) { if (localDirection.length > 1) { localDirection = localDirection.split(''); var globalDir = [getGlobalDirection(controller, localDirection[0]), getGlobalDirection(controller, localDirection[1])]; (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse(); return globalDir.join(''); } else { var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' }; var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' }; var globalDir = graphic.transformDirection(map[localDirection], getTransform(controller)); return inverseMap[globalDir]; } } function driftRect(toRectRange, fromRectRange, controller, cover, name, dx, dy, e) { var brushOption = cover.__brushOption; var rectRange = toRectRange(brushOption.range); var localDelta = toLocalDelta(controller, dx, dy); each(name.split(''), function (namePart) { var ind = DIRECTION_MAP[namePart]; rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; }); brushOption.range = fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1])); updateCoverAfterCreation(controller, cover); trigger(controller, { isEnd: false }); } function driftPolygon(controller, cover, dx, dy, e) { var range = cover.__brushOption.range; var localDelta = toLocalDelta(controller, dx, dy); each(range, function (point) { point[0] += localDelta[0]; point[1] += localDelta[1]; }); updateCoverAfterCreation(controller, cover); trigger(controller, { isEnd: false }); } function toLocalDelta(controller, dx, dy) { var thisGroup = controller.group; var localD = thisGroup.transformCoordToLocal(dx, dy); var localZero = thisGroup.transformCoordToLocal(0, 0); return [localD[0] - localZero[0], localD[1] - localZero[1]]; } function clipByPanel(controller, cover, data) { var panel = getPanelByCover(controller, cover); return panel && panel !== true ? panel.clipPath(data, controller._transform) : zrUtil.clone(data); } function pointsToRect(points) { var xmin = mathMin(points[0][0], points[1][0]); var ymin = mathMin(points[0][1], points[1][1]); var xmax = mathMax(points[0][0], points[1][0]); var ymax = mathMax(points[0][1], points[1][1]); return { x: xmin, y: ymin, width: xmax - xmin, height: ymax - ymin }; } function resetCursor(controller, e, localCursorPoint) { 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; } var zr = controller._zr; var covers = controller._covers; var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers. if (!controller._dragging) { for (var i = 0; i < covers.length; i++) { var brushOption = covers[i].__brushOption; if (currPanel && (currPanel === true || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) { // Use cursor style set on cover. return; } } } currPanel && zr.setCursorStyle('crosshair'); } function preventDefault(e) { var rawE = e.event; rawE.preventDefault && rawE.preventDefault(); } function mainShapeContain(cover, x, y) { return cover.childOfName('main').contain(x, y); } function updateCoverByMouse(controller, e, localCursorPoint, isEnd) { var creatingCover = controller._creatingCover; var panel = controller._creatingPanel; var thisBrushOption = controller._brushOption; var eventParams; controller._track.push(localCursorPoint.slice()); if (shouldShowCover(controller) || creatingCover) { if (panel && !creatingCover) { thisBrushOption.brushMode === 'single' && clearCovers(controller); var brushOption = zrUtil.clone(thisBrushOption); brushOption.brushType = determineBrushType(brushOption.brushType, panel); brushOption.panelId = panel === true ? null : panel.panelId; creatingCover = controller._creatingCover = createCover(controller, brushOption); controller._covers.push(creatingCover); } if (creatingCover) { var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)]; var coverBrushOption = creatingCover.__brushOption; coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track)); if (isEnd) { endCreating(controller, creatingCover); coverRenderer.updateCommon(controller, creatingCover); } updateCoverShape(controller, creatingCover); eventParams = { isEnd: isEnd }; } } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) { // Help user to remove covers easily, only by a tiny drag, in 'single' mode. // But a single click do not clear covers, because user may have casual // clicks (for example, click on other component and do not expect covers // disappear). // Only some cover removed, trigger action, but not every click trigger action. if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) { eventParams = { isEnd: isEnd, removeOnClick: true }; } } return eventParams; } function determineBrushType(brushType, panel) { if (brushType === 'auto') { return panel.defaultBrushType; } return brushType; } var pointerHandlers = { mousedown: function (e) { if (this._dragging) { // In case some browser do not support globalOut, // and release mose out side the browser. handleDragEnd(this, e); } else if (!e.target || !e.target.draggable) { preventDefault(e); var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); this._creatingCover = null; var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint); if (panel) { this._dragging = true; this._track = [localCursorPoint.slice()]; } } }, mousemove: function (e) { 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(this, eventParams); } }, mouseup: function (e) { handleDragEnd(this, e); } }; function handleDragEnd(controller, e) { if (controller._dragging) { preventDefault(e); var x = e.offsetX; var y = e.offsetY; 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(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} */ var coverRenderers = { lineX: getLineRenderer(0), lineY: getLineRenderer(1), rect: { createCover: function (controller, brushOption) { return createBaseRectCover(curry(driftRect, function (range) { return range; }, function (range) { return range; }), controller, brushOption, ['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw']); }, getCreatingRange: function (localTrack) { var ends = getTrackEnds(localTrack); return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]); }, updateCoverShape: function (controller, cover, localRange, brushOption) { updateBaseRect(controller, cover, localRange, brushOption); }, updateCommon: updateCommon, contain: mainShapeContain }, polygon: { createCover: function (controller, brushOption) { var cover = new graphic.Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the // border of the shape when drawing, which is a better experience for user. cover.add(new graphic.Polyline({ name: 'main', style: makeStyle(brushOption), silent: true })); return cover; }, getCreatingRange: function (localTrack) { return localTrack; }, endCreating: function (controller, cover) { cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape. cover.add(new graphic.Polygon({ name: 'main', draggable: true, drift: curry(driftPolygon, controller, cover), ondragend: curry(trigger, controller, { isEnd: true }) })); }, updateCoverShape: function (controller, cover, localRange, brushOption) { cover.childAt(0).setShape({ points: clipByPanel(controller, cover, localRange) }); }, updateCommon: updateCommon, contain: mainShapeContain } }; function getLineRenderer(xyIndex) { return { createCover: function (controller, brushOption) { return createBaseRectCover(curry(driftRect, function (range) { var rectRange = [range, [0, 100]]; xyIndex && rectRange.reverse(); return rectRange; }, function (rectRange) { return rectRange[xyIndex]; }), controller, brushOption, [['w', 'e'], ['n', 's']][xyIndex]); }, getCreatingRange: function (localTrack) { var ends = getTrackEnds(localTrack); var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]); var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]); return [min, max]; }, updateCoverShape: function (controller, cover, localRange, brushOption) { var otherExtent; // If brushWidth not specified, fit the panel. var panel = getPanelByCover(controller, cover); if (panel !== true && panel.getLinearBrushOtherExtent) { otherExtent = panel.getLinearBrushOtherExtent(xyIndex, controller._transform); } else { var zr = controller._zr; otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]]; } var rectRange = [localRange, otherExtent]; xyIndex && rectRange.reverse(); updateBaseRect(controller, cover, rectRange, brushOption); }, updateCommon: updateCommon, contain: mainShapeContain }; } var _default = BrushController; module.exports = _default; /***/ }), /***/ "oDrn": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var DESCRIPTORS = __webpack_require__("q0qZ"); var defineProperties = __webpack_require__("o/tC").f; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe $({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, { defineProperties: defineProperties }); /***/ }), /***/ "oEhq": /***/ (function(module, exports, __webpack_require__) { var isCallable = __webpack_require__("R09w"); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (typeof argument == 'object' || isCallable(argument)) return argument; throw $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; /***/ }), /***/ "oFQo": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Math.umulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $({ target: 'Math', stat: true, forced: true }, { umulh: function umulh(u, v) { var UINT16 = 0xFFFF; var $u = +u; var $v = +v; var u0 = $u & UINT16; var v0 = $v & UINT16; var u1 = $u >>> 16; var v1 = $v >>> 16; var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } }); /***/ }), /***/ "oJlE": /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim __webpack_require__("XOiX")('trimLeft', function ($trim) { return function trimLeft() { return $trim(this, 1); }; }, 'trimStart'); /***/ }), /***/ "oJlt": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("cGG2"); // Headers whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers var ignoreDuplicateOf = [ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]; /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} headers Headers needing to be parsed * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { var parsed = {}; var key; var val; var i; if (!headers) { return parsed; } utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); if (key) { if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { return; } if (key === 'set-cookie') { parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } } }); return parsed; }; /***/ }), /***/ "oJvE": /***/ (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__("/gxq"); var Text = __webpack_require__("/86O"); /* * 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. */ // import Group from 'zrender/src/container/Group'; /** * @alias module:echarts/component/tooltip/TooltipRichContent * @constructor */ function TooltipRichContent(api) { this._zr = api.getZr(); this._show = false; /** * @private */ this._hideTimeout; } TooltipRichContent.prototype = { constructor: TooltipRichContent, /** * @private * @type {boolean} */ _enterable: true, /** * Update when tooltip is rendered */ update: function () {// noop }, show: function (tooltipModel) { if (this._hideTimeout) { clearTimeout(this._hideTimeout); } 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 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] }; } text = text.substr(endId + 1); startId = text.indexOf('{marker'); } 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; }); }, setEnterable: function (enterable) { this._enterable = enterable; }, 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]); } }, hide: function () { if (this.el) { this.el.hide(); } 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(zrUtil.bind(this.hide, this), time); } else { this.hide(); } } }, isShow: function () { return this._show; }, getOuterSize: function () { var size = this.getSize(); return { width: size[0], height: size[1] }; } }; var _default = TooltipRichContent; module.exports = _default; /***/ }), /***/ "oLfA": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var IndexedObject = __webpack_require__("fkET"); var toIndexedObject = __webpack_require__("9mDF"); var arrayMethodIsStrict = __webpack_require__("KwSm"); var nativeJoin = uncurryThis([].join); var ES3_STRINGS = IndexedObject != Object; var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ','); // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join $({ target: 'Array', proto: true, forced: FORCED }, { join: function join(separator) { return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator); } }); /***/ }), /***/ "oSrZ": /***/ (function(module, exports, __webpack_require__) { // 20.2.2.9 Math.cbrt(x) var $export = __webpack_require__("eqAp"); var sign = __webpack_require__("iIAy"); $export($export.S, 'Math', { cbrt: function cbrt(x) { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); /***/ }), /***/ "oY0/": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("+3lO"); __webpack_require__("tz60"); module.exports = __webpack_require__("St71"); /***/ }), /***/ "oYIf": /***/ (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__("/gxq"); var BoundingRect = __webpack_require__("8b51"); var matrix = __webpack_require__("dOVI"); var graphic = __webpack_require__("0sHC"); var layout = __webpack_require__("1Xuh"); var TimelineView = __webpack_require__("Gp87"); var TimelineAxis = __webpack_require__("Pwgp"); var _symbol = __webpack_require__("kK7q"); var createSymbol = _symbol.createSymbol; var axisHelper = __webpack_require__("3yJd"); var numberUtil = __webpack_require__("wWR3"); var _format = __webpack_require__("HHfb"); var encodeHTML = _format.encodeHTML; /* * 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 bind = zrUtil.bind; var each = zrUtil.each; var PI = Math.PI; var _default = TimelineView.extend({ type: 'timeline.slider', init: function (ecModel, api) { this.api = api; /** * @private * @type {module:echarts/component/timeline/TimelineAxis} */ this._axis; /** * @private * @type {module:zrender/core/BoundingRect} */ this._viewRect; /** * @type {number} */ this._timer; /** * @type {module:zrender/Element} */ this._currentPointer; /** * @type {module:zrender/container/Group} */ this._mainGroup; /** * @type {module:zrender/container/Group} */ this._labelGroup; }, /** * @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'); /** * @private * @type {module:echarts/component/timeline/TimelineAxis} */ var axis = this._axis = this._createAxis(layoutInfo, timelineModel); timelineModel.formatTooltip = function (dataIndex) { return encodeHTML(axis.scale.getLabel(dataIndex)); }; each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) { this['_render' + name](layoutInfo, mainGroup, axis, timelineModel); }, this); this._renderAxisLabel(layoutInfo, labelGroup, axis, timelineModel); this._position(layoutInfo, timelineModel); } this._doPlayStop(); }, /** * @override */ remove: function () { this._clearTimer(); this.group.removeAll(); }, /** * @override */ dispose: function () { this._clearTimer(); }, _layout: function (timelineModel, api) { var labelPosOpt = timelineModel.get('label.position'); var orient = timelineModel.get('orient'); var viewRect = getViewRect(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' }; var labelBaselineMap = { horizontal: labelPosOpt >= 0 || labelPosOpt === '+' ? 'top' : 'bottom', vertical: 'middle' }; var rotationMap = { horizontal: 0, vertical: PI / 2 }; // Position var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; 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; // Special label rotate. var labelRotation = timelineModel.get('label.rotate') || 0; labelRotation = labelRotation * PI / 180; // To radian. 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; // 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]; if (timelineModel.get('inverse')) { axisExtent.reverse(); } 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 }; }, _position: function (layoutInfo, timelineModel) { // Position is be called finally, because bounding rect is needed for // adapt content to fill viewRect (auto adapt offset). // 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 mainGroup = this._mainGroup; var labelGroup = this._labelGroup; var viewRect = layoutInfo.viewRect; if (layoutInfo.orient === 'vertical') { // transform to horizontal, inverse rotate by left-top point. var m = matrix.create(); var rotateOriginX = viewRect.x; var rotateOriginY = viewRect.y + viewRect.height; matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]); matrix.rotate(m, m, -PI / 2); matrix.translate(m, m, [rotateOriginX, rotateOriginY]); viewRect = viewRect.clone(); viewRect.applyTransform(m); } var viewBound = getBound(viewRect); var mainBound = getBound(mainGroup.getBoundingRect()); var labelBound = getBound(labelGroup.getBoundingRect()); var mainPosition = mainGroup.position; var labelsPosition = labelGroup.position; labelsPosition[0] = mainPosition[0] = viewBound[0][0]; var labelPosOpt = layoutInfo.labelPosOpt; 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; } mainGroup.attr('position', mainPosition); labelGroup.attr('position', labelsPosition); mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; setOrigin(mainGroup); setOrigin(labelGroup); function setOrigin(targetGroup) { var pos = targetGroup.position; targetGroup.origin = [viewBound[0][0] - pos[0], viewBound[1][0] - pos[1]]; } function getBound(rect) { // [[xmin, xmax], [ymin, ymax]] return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]]; } function toBound(fromPos, from, to, dimIdx, boundIdx) { fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; } }, _createAxis: function (layoutInfo, timelineModel) { var data = timelineModel.getData(); var axisType = timelineModel.get('axisType'); var scale = axisHelper.createScaleByModel(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`. scale.getTicks = function () { return data.mapArray(['value'], function (value) { return value; }); }; var dataExtent = data.getDataExtent('value'); scale.setExtent(dataExtent[0], dataExtent[1]); scale.niceTicks(); var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); axis.model = timelineModel; return axis; }, _createGroup: function (name) { var newGroup = this['_' + name] = new graphic.Group(); this.group.add(newGroup); return newGroup; }, _renderAxisLine: function (layoutInfo, group, axis, timelineModel) { var axisExtent = axis.getExtent(); if (!timelineModel.get('lineStyle.show')) { return; } group.add(new graphic.Line({ shape: { x1: axisExtent[0], y1: 0, x2: axisExtent[1], y2: 0 }, style: zrUtil.extend({ lineCap: 'round' }, timelineModel.getModel('lineStyle').getLineStyle()), silent: true, z2: 1 })); }, /** * @private */ _renderAxisTick: function (layoutInfo, group, axis, timelineModel) { var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy. var ticks = axis.scale.getTicks(); // The value is dataIndex, see the costomized scale. each(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(this._changeTimeline, this, value) }; var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); graphic.setHoverStyle(el, hoverStyleModel.getItemStyle()); if (itemModel.get('tooltip')) { el.dataIndex = value; el.dataModel = timelineModel; } else { el.dataIndex = el.dataModel = null; } }, this); }, /** * @private */ _renderAxisLabel: function (layoutInfo, group, axis, timelineModel) { var labelModel = axis.getLabelModel(); if (!labelModel.get('show')) { return; } var data = timelineModel.getData(); var labels = axis.getViewLabels(); each(labels, function (labelItem) { // The tickValue is dataIndex, see the costomized scale. var dataIndex = labelItem.tickValue; 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 graphic.Text({ position: [tickCoord, 0], rotation: layoutInfo.labelRotation - layoutInfo.rotation, onclick: bind(this._changeTimeline, this, dataIndex), silent: false }); graphic.setTextStyle(textEl.style, normalLabelModel, { text: labelItem.formattedLabel, textAlign: layoutInfo.labelAlign, textVerticalAlign: layoutInfo.labelBaseline }); group.add(textEl); graphic.setHoverStyle(textEl, graphic.setTextStyle({}, hoverLabelModel)); }, this); }, /** * @private */ _renderControl: function (layoutInfo, group, axis, timelineModel) { var controlSize = layoutInfo.controlSize; var rotation = layoutInfo.rotation; 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); makeBtn(layoutInfo.nextBtnPosition, 'controlStyle.nextIcon', bind(this._changeTimeline, this, inverse ? '-' : '+')); makeBtn(layoutInfo.prevBtnPosition, 'controlStyle.prevIcon', bind(this._changeTimeline, this, inverse ? '+' : '-')); makeBtn(layoutInfo.playPosition, 'controlStyle.' + (playState ? 'stopIcon' : 'playIcon'), bind(this._handlePlayClick, this, !playState), true); 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); graphic.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; var callback = { onCreate: function (pointer) { pointer.draggable = true; pointer.drift = bind(me._handlePointerDrag, me); pointer.ondragend = bind(me._handlePointerDragend, me); pointerMoveTo(pointer, currentIndex, axis, timelineModel, true); }, onUpdate: function (pointer) { pointerMoveTo(pointer, currentIndex, axis, timelineModel); } }; // Reuse when exists, for animation and drag. this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback); }, _handlePlayClick: function (nextState) { this._clearTimer(); this.api.dispatchAction({ type: 'timelinePlayChange', playState: nextState, from: this.uid }); }, _handlePointerDrag: function (dx, dy, e) { this._clearTimer(); this._pointerChangeTimeline([e.offsetX, e.offsetY]); }, _handlePointerDragend: function (e) { this._pointerChangeTimeline([e.offsetX, e.offsetY], true); }, _pointerChangeTimeline: function (mousePos, trigger) { var toCoord = this._toAxisCoord(mousePos)[0]; var axis = this._axis; var axisExtent = numberUtil.asc(axis.getExtent().slice()); toCoord > axisExtent[1] && (toCoord = axisExtent[1]); toCoord < axisExtent[0] && (toCoord = axisExtent[0]); this._currentPointer.position[0] = toCoord; this._currentPointer.dirty(); var targetDataIndex = this._findNearestTick(toCoord); var timelineModel = this.model; if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) { this._changeTimeline(targetDataIndex); } }, _doPlayStop: function () { this._clearTimer(); if (this.model.getPlayState()) { this._timer = setTimeout(bind(handleFrame, this), this.model.get('playInterval')); } function handleFrame() { // Do not cache var timelineModel = this.model; this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1)); } }, _toAxisCoord: function (vertex) { var trans = this._mainGroup.getLocalTransform(); return graphic.applyTransform(vertex, trans, true); }, _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; } }); return targetDataIndex; }, _clearTimer: function () { if (this._timer) { clearTimeout(this._timer); this._timer = null; } }, _changeTimeline: function (nextIndex) { var currentIndex = this.model.getCurrentIndex(); if (nextIndex === '+') { nextIndex = currentIndex + 1; } else if (nextIndex === '-') { nextIndex = currentIndex - 1; } this.api.dispatchAction({ type: 'timelineChange', currentIndex: nextIndex, from: this.uid }); } }); function getViewRect(model, api) { return layout.getLayoutRect(model.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() }, model.get('padding')); } function makeIcon(timelineModel, objPath, rect, opts) { var icon = graphic.makePath(timelineModel.get(objPath).replace(/^path:\/\//, ''), zrUtil.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); } // Style var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']); symbol.setStyle(itemStyle); // Transform and events. opt = zrUtil.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] += numberUtil.parsePercent(symbolOffset[0], symbolSize[0]); pos[1] += numberUtil.parsePercent(symbolOffset[1], symbolSize[1]); } var symbolRotate = hostModel.get('symbolRotate'); opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; symbol.attr(opt); // 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(); return symbol; } function pointerMoveTo(pointer, dataIndex, axis, timelineModel, noAnimation) { if (pointer.dragging) { return; } 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)); } } module.exports = _default; /***/ }), /***/ "oZJn": /***/ (function(module, exports, __webpack_require__) { __webpack_require__("xU4Q")('asyncIterator'); /***/ }), /***/ "ocEJ": /***/ (function(module, exports, __webpack_require__) { "use strict"; var apply = __webpack_require__("n561"); var call = __webpack_require__("celx"); var uncurryThis = __webpack_require__("u4Az"); var fixRegExpWellKnownSymbolLogic = __webpack_require__("ftyM"); var fails = __webpack_require__("r54x"); var anObject = __webpack_require__("5+O3"); var isCallable = __webpack_require__("R09w"); var isNullOrUndefined = __webpack_require__("HrgD"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var toLength = __webpack_require__("xDUa"); var toString = __webpack_require__("nnBu"); var requireObjectCoercible = __webpack_require__("hiy0"); var advanceStringIndex = __webpack_require__("A9wm"); var getMethod = __webpack_require__("YLw8"); var getSubstitution = __webpack_require__("EAGd"); var regExpExec = __webpack_require__("B9ov"); var wellKnownSymbol = __webpack_require__("jAiL"); var REPLACE = wellKnownSymbol('replace'); var max = Math.max; var min = Math.min; var concat = uncurryThis([].concat); var push = uncurryThis([].push); var stringIndexOf = uncurryThis(''.indexOf); var stringSlice = uncurryThis(''.slice); var maybeToString = function (it) { return it === undefined ? it : String(it); }; // IE <= 11 replaces $0 with the whole match, as if it was $& // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 var REPLACE_KEEPS_$0 = (function () { // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing return 'a'.replace(/./, '$0') === '$0'; })(); // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { if (/./[REPLACE]) { return /./[REPLACE]('a', '$0') === ''; } return false; })(); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive return ''.replace(re, '$') !== '7'; }); // @@replace logic fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; return [ // `String.prototype.replace` method // https://tc39.es/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE); return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { var rx = anObject(this); var S = toString(string); if ( typeof replaceValue == 'string' && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, '$<') === -1 ) { var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } var functionalReplace = isCallable(replaceValue); if (!functionalReplace) replaceValue = toString(replaceValue); var global = rx.global; if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; while (true) { var result = regExpExec(rx, S); if (result === null) break; push(results, result); if (!global) break; var matchStr = toString(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = toString(result[0]); var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); var captures = []; // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = concat([matched], captures, position, S); if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); var replacement = toString(apply(replaceValue, undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + stringSlice(S, nextSourcePosition); } ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); /***/ }), /***/ "od06": /***/ (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 Component = __webpack_require__("Y5nL"); /* * 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. */ Component.registerSubTypeDefaulter('timeline', function () { // Only slider now. return 'slider'; }); /***/ }), /***/ "odTk": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); module.exports = global; /***/ }), /***/ "og9+": /***/ (function(module, exports) { /* * 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. */ /** * Calculate slider move result. * Usage: * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`. * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`. * * @param {number} delta Move length. * @param {Array.} handleEnds handleEnds[0] can be bigger then handleEnds[1]. * 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. * @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 * the minSpan. * @param {number} [maxSpan] The range of dataZoom can not be larger than that. * @return {Array.} The input handleEnds. */ function _default(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) { delta = delta || 0; var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined. if (minSpan != null) { minSpan = restrict(minSpan, [0, extentSpan]); } if (maxSpan != null) { maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); } if (handleIndex === 'all') { var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]); handleSpan = restrict(handleSpan, [0, extentSpan]); minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]); handleIndex = 0; } handleEnds[0] = restrict(handleEnds[0], extent); handleEnds[1] = restrict(handleEnds[1], extent); var originalDistSign = getSpanSign(handleEnds, handleIndex); handleEnds[handleIndex] += delta; // Restrict in extent. var extentMinSpan = minSpan || 0; var realExtent = extent.slice(); originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan; handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); // Expand span. var currDistSign = getSpanSign(handleEnds, handleIndex); if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) { // If minSpan exists, 'cross' is forbidden. handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; } // Shrink span. var currDistSign = getSpanSign(handleEnds, handleIndex); if (maxSpan != null && currDistSign.span > maxSpan) { handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan; } return handleEnds; } function getSpanSign(handleEnds, handleIndex) { var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0] // is at left of handleEnds[1] for non-cross case. return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 }; } function restrict(value, extend) { return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value)); } module.exports = _default; /***/ }), /***/ "ogtz": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); var isCallable = __webpack_require__("R09w"); var WeakMap = global.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ }), /***/ "oqQy": /***/ (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__("/gxq"); var AxisBuilder = __webpack_require__("vjPX"); var graphic = __webpack_require__("0sHC"); var singleAxisHelper = __webpack_require__("fzS+"); var AxisView = __webpack_require__("43ae"); var _axisSplitHelper = __webpack_require__("LKZ0"); var rectCoordAxisBuildSplitArea = _axisSplitHelper.rectCoordAxisBuildSplitArea; var rectCoordAxisHandleRemove = _axisSplitHelper.rectCoordAxisHandleRemove; /* * 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']; var SingleAxisView = AxisView.extend({ type: 'singleAxis', axisPointerClass: 'SingleAxisPointer', render: function (axisModel, ecModel, api, payload) { var group = this.group; group.removeAll(); var oldAxisGroup = this._axisGroup; this._axisGroup = new graphic.Group(); var layout = singleAxisHelper.layout(axisModel); var axisBuilder = new AxisBuilder(axisModel, layout); zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder); group.add(this._axisGroup); group.add(axisBuilder.getGroup()); zrUtil.each(selfBuilderAttrs, function (name) { if (axisModel.get(name + '.show')) { this['_' + name](axisModel); } }, this); graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel); SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); }, remove: function () { rectCoordAxisHandleRemove(this); }, _splitLine: function (axisModel) { var axis = axisModel.axis; if (axis.scale.isBlank()) { return; } var splitLineModel = axisModel.getModel('splitLine'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var lineWidth = lineStyleModel.get('width'); var lineColors = lineStyleModel.get('color'); lineColors = lineColors instanceof Array ? lineColors : [lineColors]; var gridRect = axisModel.coordinateSystem.getRect(); var isHorizontal = axis.isHorizontal(); var splitLines = []; var lineCount = 0; var ticksCoords = axis.getTicksCoords({ tickModel: splitLineModel }); var p1 = []; var p2 = []; for (var i = 0; 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 colorIndex = lineCount++ % lineColors.length; splitLines[colorIndex] = splitLines[colorIndex] || []; splitLines[colorIndex].push(new graphic.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) { this.group.add(graphic.mergePath(splitLines[i], { style: { stroke: lineColors[i % lineColors.length], lineDash: lineStyleModel.getLineDash(lineWidth), lineWidth: lineWidth }, silent: true })); } }, _splitArea: function (axisModel) { rectCoordAxisBuildSplitArea(this, this._axisGroup, axisModel, axisModel); } }); var _default = SingleAxisView; module.exports = _default; /***/ }), /***/ "orbS": /***/ (function(module, exports) { module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 132); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 132: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tag/src/tag.vue?vue&type=script&lang=js& /* harmony default export */ var tagvue_type_script_lang_js_ = ({ name: 'ElTag', props: { text: String, closable: Boolean, type: String, hit: Boolean, disableTransitions: Boolean, color: String, size: String, effect: { type: String, default: 'light', validator: function validator(val) { return ['dark', 'light', 'plain'].indexOf(val) !== -1; } } }, methods: { handleClose: function handleClose(event) { event.stopPropagation(); this.$emit('close', event); }, handleClick: function handleClick(event) { this.$emit('click', event); } }, computed: { tagSize: function tagSize() { return this.size || (this.$ELEMENT || {}).size; } }, render: function render(h) { var type = this.type, tagSize = this.tagSize, hit = this.hit, effect = this.effect; var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit']; var tagEl = h( 'span', { 'class': classes, style: { backgroundColor: this.color }, on: { 'click': this.handleClick } }, [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: { 'click': this.handleClose } })] ); return this.disableTransitions ? tagEl : h( 'transition', { attrs: { name: 'el-zoom-in-center' } }, [tagEl] ); } }); // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js& /* harmony default export */ var src_tagvue_type_script_lang_js_ = (tagvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(0); // CONCATENATED MODULE: ./packages/tag/src/tag.vue var render, staticRenderFns /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_tagvue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/tag/src/tag.vue" /* harmony default export */ var tag = (component.exports); // CONCATENATED MODULE: ./packages/tag/index.js /* istanbul ignore next */ tag.install = function (Vue) { Vue.component(tag.name, tag); }; /* harmony default export */ var packages_tag = __webpack_exports__["default"] = (tag); /***/ }) /******/ }); /***/ }), /***/ "orv6": /***/ (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 MarkerModel = __webpack_require__("Mlni"); /* * 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 _default = MarkerModel.extend({ type: 'markPoint', 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 } } } }); module.exports = _default; /***/ }), /***/ "p0zm": /***/ (function(module, exports, __webpack_require__) { var defineBuiltIn = __webpack_require__("gakl"); module.exports = function (target, src, options) { for (var key in src) defineBuiltIn(target, key, src[key], options); return target; }; /***/ }), /***/ "p1Ck": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("TTCf"); __webpack_require__("ARaV"); /* * 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. */ echarts.registerPreprocessor(function (opt) { // Make sure markLine component is enabled opt.markLine = opt.markLine || {}; }); /***/ }), /***/ "p1b6": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("cGG2"); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie (function standardBrowserEnv() { return { write: function write(name, value, expires, path, domain, secure) { var cookie = []; cookie.push(name + '=' + encodeURIComponent(value)); if (utils.isNumber(expires)) { cookie.push('expires=' + new Date(expires).toGMTString()); } if (utils.isString(path)) { cookie.push('path=' + path); } if (utils.isString(domain)) { cookie.push('domain=' + domain); } if (secure === true) { cookie.push('secure'); } document.cookie = cookie.join('; '); }, read: function read(name) { var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove: function remove(name) { this.write(name, '', Date.now() - 86400000); } }; })() : // Non standard browser env (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return { write: function write() {}, read: function read() { return null; }, remove: function remove() {} }; })() ); /***/ }), /***/ "p6Ym": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Math.RAD_PER_DEG` constant // https://rwaldron.github.io/proposal-math-extensions/ $({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { RAD_PER_DEG: 180 / Math.PI }); /***/ }), /***/ "p7Sz": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var requireObjectCoercible = __webpack_require__("hiy0"); var toIntegerOrInfinity = __webpack_require__("SXvu"); var toString = __webpack_require__("nnBu"); var stringSlice = uncurryThis(''.slice); var max = Math.max; var min = Math.min; // eslint-disable-next-line unicorn/prefer-string-slice -- required for testing var FORCED = !''.substr || 'ab'.substr(-1) !== 'b'; // `String.prototype.substr` method // https://tc39.es/ecma262/#sec-string.prototype.substr $({ target: 'String', proto: true, forced: FORCED }, { substr: function substr(start, length) { var that = toString(requireObjectCoercible(this)); var size = that.length; var intStart = toIntegerOrInfinity(start); var intLength, intEnd; if (intStart === Infinity) intStart = 0; if (intStart < 0) intStart = max(size + intStart, 0); intLength = length === undefined ? size : toIntegerOrInfinity(length); if (intLength <= 0 || intLength === Infinity) return ''; intEnd = min(intStart + intLength, size); return intStart >= intEnd ? '' : stringSlice(that, intStart, intEnd); } }); /***/ }), /***/ "pBtG": /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; /***/ }), /***/ "pEGt": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__("DvwR"); var enumBugKeys = __webpack_require__("B5V0"); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /***/ "pFYg": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _iterator = __webpack_require__("Zzip"); var _iterator2 = _interopRequireDefault(_iterator); var _symbol = __webpack_require__("5QVw"); var _symbol2 = _interopRequireDefault(_symbol); var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof(obj); } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); }; /***/ }), /***/ "pGdH": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var uncurryThis = __webpack_require__("u4Az"); var toString = __webpack_require__("nnBu"); var fromCharCode = String.fromCharCode; var charAt = uncurryThis(''.charAt); var exec = uncurryThis(/./.exec); var stringSlice = uncurryThis(''.slice); var hex2 = /^[\da-f]{2}$/i; var hex4 = /^[\da-f]{4}$/i; // `unescape` method // https://tc39.es/ecma262/#sec-unescape-string $({ global: true }, { unescape: function unescape(string) { var str = toString(string); var result = ''; var length = str.length; var index = 0; var chr, part; while (index < length) { chr = charAt(str, index++); if (chr === '%') { if (charAt(str, index) === 'u') { part = stringSlice(str, index + 1, index + 5); if (exec(hex4, part)) { result += fromCharCode(parseInt(part, 16)); index += 5; continue; } } else { part = stringSlice(str, index, index + 2); if (exec(hex2, part)) { result += fromCharCode(parseInt(part, 16)); index += 2; continue; } } } result += chr; } return result; } }); /***/ }), /***/ "pSwa": /***/ (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__("/gxq"); var graphic = __webpack_require__("0sHC"); /* * 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 NodeHighlightPolicy = { NONE: 'none', // not downplay others DESCENDANT: 'descendant', ANCESTOR: 'ancestor', SELF: 'self' }; var DEFAULT_SECTOR_Z = 2; var DEFAULT_TEXT_Z = 4; /** * Sunburstce of Sunburst including Sector, Label, LabelLine * @constructor * @extends {module:zrender/graphic/Group} */ function SunburstPiece(node, seriesModel, ecModel) { graphic.Group.call(this); var sector = new graphic.Sector({ z2: DEFAULT_SECTOR_Z }); sector.seriesIndex = seriesModel.seriesIndex; var text = new graphic.Text({ z2: DEFAULT_TEXT_Z, silent: node.getModel('label').get('silent') }); this.add(sector); this.add(text); this.updateData(true, node, 'normal', seriesModel, ecModel); // Hover to change label and labelLine function onEmphasis() { text.ignore = text.hoverIgnore; } function onNormal() { text.ignore = text.normalIgnore; } this.on('emphasis', onEmphasis).on('normal', onNormal).on('mouseover', onEmphasis).on('mouseout', onNormal); } var SunburstPieceProto = SunburstPiece.prototype; SunburstPieceProto.updateData = function (firstCreate, node, state, seriesModel, ecModel) { this.node = node; node.piece = this; seriesModel = seriesModel || this._seriesModel; ecModel = ecModel || this._ecModel; var sector = this.childAt(0); sector.dataIndex = node.dataIndex; var itemModel = node.getModel(); var layout = node.getLayout(); // if (!layout) { // console.log(node.getLayout()); // } var sectorShape = zrUtil.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') { style = normalStyle; } else { var stateStyle = itemModel.getModel(state + '.itemStyle').getItemStyle(); style = zrUtil.merge(stateStyle, normalStyle); } style = zrUtil.defaults({ lineJoin: 'bevel', fill: style.fill || visualColor }, style); if (firstCreate) { sector.setShape(sectorShape); sector.shape.r = layout.r0; graphic.updateProps(sector, { shape: { r: layout.r } }, seriesModel, node.dataIndex); sector.useStyle(style); } else if (typeof style.fill === 'object' && style.fill.type || typeof sector.style.fill === 'object' && sector.style.fill.type) { // Disable animation for gradient since no interpolation method // is supported for gradient graphic.updateProps(sector, { shape: sectorShape }, seriesModel); sector.useStyle(style); } else { graphic.updateProps(sector, { shape: sectorShape, style: style }, seriesModel); } this._updateLabel(seriesModel, visualColor, state); var cursorStyle = itemModel.getShallow('cursor'); cursorStyle && sector.attr('cursor', cursorStyle); if (firstCreate) { var highlightPolicy = seriesModel.getShallow('highlightPolicy'); this._initEvents(sector, node, seriesModel, highlightPolicy); } this._seriesModel = seriesModel || this._seriesModel; this._ecModel = ecModel || this._ecModel; graphic.setHoverStyle(this); }; SunburstPieceProto.onEmphasis = function (highlightPolicy) { var that = this; this.node.hostTree.root.eachNode(function (n) { if (n.piece) { if (that.node === n) { n.piece.updateData(false, n, 'emphasis'); } else if (isNodeHighlighted(n, that.node, highlightPolicy)) { n.piece.childAt(0).trigger('highlight'); } else if (highlightPolicy !== NodeHighlightPolicy.NONE) { n.piece.childAt(0).trigger('downplay'); } } }); }; SunburstPieceProto.onNormal = function () { this.node.hostTree.root.eachNode(function (n) { if (n.piece) { n.piece.updateData(false, n, 'normal'); } }); }; SunburstPieceProto.onHighlight = function () { this.updateData(false, this.node, 'highlight'); }; SunburstPieceProto.onDownplay = function () { this.updateData(false, this.node, 'downplay'); }; SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) { var itemModel = this.node.getModel(); var normalModel = itemModel.getModel('label'); var labelModel = state === 'normal' || state === 'emphasis' ? normalModel : itemModel.getModel(state + '.label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var text = zrUtil.retrieve(seriesModel.getFormattedLabel(this.node.dataIndex, state, null, null, 'label'), this.node.name); if (getLabelAttr('show') === false) { text = ''; } var layout = this.node.getLayout(); var labelMinAngle = labelModel.get('minAngle'); if (labelMinAngle == null) { labelMinAngle = normalModel.get('minAngle'); } labelMinAngle = labelMinAngle / 180 * Math.PI; var angle = layout.endAngle - layout.startAngle; if (labelMinAngle != null && Math.abs(angle) < labelMinAngle) { // Not displaying text when angle is too small text = ''; } var label = this.childAt(1); graphic.setLabelStyle(label.style, label.hoverStyle || {}, normalModel, labelHoverModel, { defaultText: labelModel.getShallow('show') ? text : null, autoColor: visualColor, useInsideStyle: true }); var midAngle = (layout.startAngle + layout.endAngle) / 2; var dx = Math.cos(midAngle); var dy = Math.sin(midAngle); var r; var labelPosition = getLabelAttr('position'); var labelPadding = getLabelAttr('distance') || 0; var textAlign = getLabelAttr('align'); if (labelPosition === 'outside') { r = layout.r + labelPadding; textAlign = midAngle > Math.PI / 2 ? 'right' : 'left'; } else { if (!textAlign || textAlign === 'center') { r = (layout.r + layout.r0) / 2; textAlign = 'center'; } else if (textAlign === 'left') { r = layout.r0 + labelPadding; if (midAngle > Math.PI / 2) { textAlign = 'right'; } } else if (textAlign === 'right') { r = layout.r - labelPadding; if (midAngle > Math.PI / 2) { textAlign = 'left'; } } } label.attr('style', { text: text, textAlign: textAlign, textVerticalAlign: getLabelAttr('verticalAlign') || 'middle', opacity: getLabelAttr('opacity') }); var textX = r * dx + layout.cx; var textY = r * dy + layout.cy; label.attr('position', [textX, textY]); var rotateType = getLabelAttr('rotate'); var rotate = 0; if (rotateType === 'radial') { rotate = -midAngle; if (rotate < -Math.PI / 2) { rotate += Math.PI; } } else if (rotateType === 'tangential') { rotate = Math.PI / 2 - midAngle; if (rotate > Math.PI / 2) { rotate -= Math.PI; } else if (rotate < -Math.PI / 2) { rotate += Math.PI; } } else if (typeof rotateType === 'number') { rotate = rotateType * Math.PI / 180; } label.attr('rotation', rotate); function getLabelAttr(name) { var stateAttr = labelModel.get(name); if (stateAttr == null) { return normalModel.get(name); } else { return stateAttr; } } }; SunburstPieceProto._initEvents = function (sector, node, seriesModel, highlightPolicy) { sector.off('mouseover').off('mouseout').off('emphasis').off('normal'); var that = this; var onEmphasis = function () { that.onEmphasis(highlightPolicy); }; var onNormal = function () { that.onNormal(); }; var onDownplay = function () { that.onDownplay(); }; var onHighlight = function () { that.onHighlight(); }; if (seriesModel.isAnimationEnabled()) { sector.on('mouseover', onEmphasis).on('mouseout', onNormal).on('emphasis', onEmphasis).on('normal', onNormal).on('downplay', onDownplay).on('highlight', onHighlight); } }; zrUtil.inherits(SunburstPiece, graphic.Group); var _default = SunburstPiece; /** * Get node color * * @param {TreeNode} node the node to get color * @param {module:echarts/model/Series} seriesModel series * @param {module:echarts/model/Global} ecModel echarts defaults */ function getNodeColor(node, seriesModel, ecModel) { // Color from visualMap var visualColor = node.getVisual('color'); var visualMetaList = node.getVisual('visualMeta'); if (!visualMetaList || visualMetaList.length === 0) { // Use first-generation color if has no visualMap visualColor = null; } // Self color or level color var color = node.getModel('itemStyle').get('color'); if (color) { return color; } else if (visualColor) { // Color mapping return visualColor; } else if (node.depth === 0) { // Virtual root node return ecModel.option.color[0]; } else { // First-generation color var length = ecModel.option.color.length; color = ecModel.option.color[getRootId(node) % length]; } return color; } /** * Get index of root in sorted order * * @param {TreeNode} node current node * @return {number} index in root */ function getRootId(node) { var ancestor = node; while (ancestor.depth > 1) { ancestor = ancestor.parentNode; } var virtualRoot = node.getAncestors()[0]; return zrUtil.indexOf(virtualRoot.children, ancestor); } function isNodeHighlighted(node, activeNode, policy) { if (policy === NodeHighlightPolicy.NONE) { return false; } else if (policy === NodeHighlightPolicy.SELF) { return node === activeNode; } else if (policy === NodeHighlightPolicy.ANCESTOR) { return node === activeNode || node.isAncestorOf(activeNode); } else { return node === activeNode || node.isDescendantOf(activeNode); } } // 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); } module.exports = _default; /***/ }), /***/ "pTD4": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var iterate = __webpack_require__("UHV6"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); // `Iterator.prototype.some` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { some: function some(predicate) { anObject(this); aCallable(predicate); var record = getIteratorDirect(this); var counter = 0; return iterate(record, function (value, stop) { if (predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); /***/ }), /***/ "pTfb": /***/ (function(module, exports, __webpack_require__) { var NativePromiseConstructor = __webpack_require__("aeRj"); var checkCorrectnessOfIteration = __webpack_require__("Kbrx"); var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__("EFI1").CONSTRUCTOR; module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) { NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ }); }); /***/ }), /***/ "pVRE": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("r54x"); var wellKnownSymbol = __webpack_require__("jAiL"); var V8_VERSION = __webpack_require__("AXMl"); var SPECIES = wellKnownSymbol('species'); module.exports = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 return V8_VERSION >= 51 || !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; /***/ }), /***/ "pVWM": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("r54x"); // check the existence of a method, lowercase // of a tag and escaping quotes in arguments module.exports = function (METHOD_NAME) { return fails(function () { var test = ''[METHOD_NAME]('"'); return test !== test.toLowerCase() || test.split('"').length > 3; }); }; /***/ }), /***/ "pXic": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var repeat = __webpack_require__("8phf"); // `String.prototype.repeat` method // https://tc39.es/ecma262/#sec-string.prototype.repeat $({ target: 'String', proto: true }, { repeat: repeat }); /***/ }), /***/ "pkSX": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var DESCRIPTORS = __webpack_require__("q0qZ"); var ownKeys = __webpack_require__("aske"); var toIndexedObject = __webpack_require__("9mDF"); var getOwnPropertyDescriptorModule = __webpack_require__("He3V"); var createProperty = __webpack_require__("hffE"); // `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject(object); var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var keys = ownKeys(O); var result = {}; var index = 0; var key, descriptor; while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); if (descriptor !== undefined) createProperty(result, key, descriptor); } return result; } }); /***/ }), /***/ "pmSR": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); var shared = __webpack_require__("m1WI"); var isCallable = __webpack_require__("R09w"); var create = __webpack_require__("43zn"); var getPrototypeOf = __webpack_require__("wzd1"); var defineBuiltIn = __webpack_require__("gakl"); var wellKnownSymbol = __webpack_require__("jAiL"); var IS_PURE = __webpack_require__("pzR0"); var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR'; var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator'); var AsyncIterator = global.AsyncIterator; var PassedAsyncIteratorPrototype = shared.AsyncIteratorPrototype; var AsyncIteratorPrototype, prototype; if (PassedAsyncIteratorPrototype) { AsyncIteratorPrototype = PassedAsyncIteratorPrototype; } else if (isCallable(AsyncIterator)) { AsyncIteratorPrototype = AsyncIterator.prototype; } else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) { try { // eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function('return async function*(){}()')()))); if (getPrototypeOf(prototype) === Object.prototype) AsyncIteratorPrototype = prototype; } catch (error) { /* empty */ } } if (!AsyncIteratorPrototype) AsyncIteratorPrototype = {}; else if (IS_PURE) AsyncIteratorPrototype = create(AsyncIteratorPrototype); if (!isCallable(AsyncIteratorPrototype[ASYNC_ITERATOR])) { defineBuiltIn(AsyncIteratorPrototype, ASYNC_ITERATOR, function () { return this; }); } module.exports = AsyncIteratorPrototype; /***/ }), /***/ "pmYM": /***/ (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 createListFromArray = __webpack_require__("ao1T"); var SeriesModel = __webpack_require__("EJsE"); /* * 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 _default = SeriesModel.extend({ type: 'series.scatter', dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'], getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true }); }, brushSelector: 'point', getProgressive: function () { var progressive = this.option.progressive; if (progressive == null) { // PENDING return this.option.large ? 5e3 : this.get('progressive'); } return progressive; }, getProgressiveThreshold: function () { var progressiveThreshold = this.option.progressiveThreshold; if (progressiveThreshold == null) { // PENDING return this.option.large ? 1e4 : this.get('progressiveThreshold'); } return progressiveThreshold; }, defaultOption: { coordinateSystem: 'cartesian2d', zlevel: 0, z: 2, legendHoverLink: true, hoverAnimation: true, // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // Polar coordinate system // polarIndex: 0, // Geo coordinate system // geoIndex: 0, // symbol: null, // 图形类型 symbolSize: 10, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 // symbolRotate: null, // 图形旋转控制 large: false, // Available when large is true largeThreshold: 2000, // cursor: null, // label: { // show: false // distance: 5, // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // 默认使用全局文本样式,详见TEXTSTYLE // }, itemStyle: { opacity: 0.8 // color: 各异 }, // If clip the overflow graphics // Works on cartesian / polar series clip: true // progressive: null } }); module.exports = _default; /***/ }), /***/ "pnd5": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var iterate = __webpack_require__("UHV6"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var getIteratorDirect = __webpack_require__("tcso"); var $TypeError = TypeError; // `Iterator.prototype.reduce` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { anObject(this); aCallable(reducer); var record = getIteratorDirect(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; var counter = 0; iterate(record, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = reducer(accumulator, value, counter); } counter++; }, { IS_RECORD: true }); if (noInitial) throw $TypeError('Reduce of empty iterator with no initial value'); return accumulator; } }); /***/ }), /***/ "pqvg": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("U9LJ"); var isArray = __webpack_require__("lwhV"); var SPECIES = __webpack_require__("6hGG")('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; /***/ }), /***/ "psjt": /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__("VpOn"); var anObject = __webpack_require__("PGRs"); var ordinaryOwnMetadataKeys = metadata.keys; var toMetaKey = metadata.key; metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); } }); /***/ }), /***/ "pwAa": /***/ (function(module, exports, __webpack_require__) { var userAgent = __webpack_require__("KdgD"); var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); module.exports = !!webkit && +webkit[1]; /***/ }), /***/ "pxG4": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * @returns {Function} */ module.exports = function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; }; /***/ }), /***/ "pyRA": /***/ (function(module, exports, __webpack_require__) { // adapted from https://github.com/jridgewell/string-dedent var getBuiltIn = __webpack_require__("aqbq"); var uncurryThis = __webpack_require__("u4Az"); var fromCharCode = String.fromCharCode; var fromCodePoint = getBuiltIn('String', 'fromCodePoint'); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var stringIndexOf = uncurryThis(''.indexOf); var stringSlice = uncurryThis(''.slice); var ZERO_CODE = 48; var NINE_CODE = 57; var LOWER_A_CODE = 97; var LOWER_F_CODE = 102; var UPPER_A_CODE = 65; var UPPER_F_CODE = 70; var isDigit = function (str, index) { var c = charCodeAt(str, index); return c >= ZERO_CODE && c <= NINE_CODE; }; var parseHex = function (str, index, end) { if (end >= str.length) return -1; var n = 0; for (; index < end; index++) { var c = hexToInt(charCodeAt(str, index)); if (c === -1) return -1; n = n * 16 + c; } return n; }; var hexToInt = function (c) { if (c >= ZERO_CODE && c <= NINE_CODE) return c - ZERO_CODE; if (c >= LOWER_A_CODE && c <= LOWER_F_CODE) return c - LOWER_A_CODE + 10; if (c >= UPPER_A_CODE && c <= UPPER_F_CODE) return c - UPPER_A_CODE + 10; return -1; }; module.exports = function (raw) { var out = ''; var start = 0; // We need to find every backslash escape sequence, and cook the escape into a real char. var i = 0; var n; while ((i = stringIndexOf(raw, '\\', i)) > -1) { out += stringSlice(raw, start, i); // If the backslash is the last char of the string, then it was an invalid sequence. // This can't actually happen in a tagged template literal, but could happen if you manually // invoked the tag with an array. if (++i === raw.length) return; var next = charAt(raw, i++); switch (next) { // Escaped control codes need to be individually processed. case 'b': out += '\b'; break; case 't': out += '\t'; break; case 'n': out += '\n'; break; case 'v': out += '\v'; break; case 'f': out += '\f'; break; case 'r': out += '\r'; break; // Escaped line terminators just skip the char. case '\r': // Treat `\r\n` as a single terminator. if (i < raw.length && charAt(raw, i) === '\n') ++i; // break omitted case '\n': case '\u2028': case '\u2029': break; // `\0` is a null control char, but `\0` followed by another digit is an illegal octal escape. case '0': if (isDigit(raw, i)) return; out += '\0'; break; // Hex escapes must contain 2 hex chars. case 'x': n = parseHex(raw, i, i + 2); if (n === -1) return; i += 2; out += fromCharCode(n); break; // Unicode escapes contain either 4 chars, or an unlimited number between `{` and `}`. // The hex value must not overflow 0x10FFFF. case 'u': if (i < raw.length && charAt(raw, i) === '{') { var end = stringIndexOf(raw, '}', ++i); if (end === -1) return; n = parseHex(raw, i, end); i = end + 1; } else { n = parseHex(raw, i, i + 4); i += 4; } if (n === -1 || n > 0x10FFFF) return; out += fromCodePoint(n); break; default: if (isDigit(next, 0)) return; out += next; } start = i; } return out + stringSlice(raw, start); }; /***/ }), /***/ "pzOI": /***/ (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 _forceHelper = __webpack_require__("ITiI"); var forceLayout = _forceHelper.forceLayout; var _simpleLayoutHelper = __webpack_require__("rbn0"); var simpleLayout = _simpleLayoutHelper.simpleLayout; var _circularLayoutHelper = __webpack_require__("LRsb"); var circularLayout = _circularLayoutHelper.circularLayout; var _number = __webpack_require__("wWR3"); var linearMap = _number.linearMap; var vec2 = __webpack_require__("C7PF"); var zrUtil = __webpack_require__("/gxq"); /* * 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 _default(ecModel) { ecModel.eachSeriesByType('graph', function (graphSeries) { var coordSys = graphSeries.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } if (graphSeries.get('layout') === 'force') { var preservedPoints = graphSeries.preservedPoints || {}; var graph = graphSeries.getGraph(); var nodeData = graph.data; var edgeData = graph.edgeData; var forceModel = graphSeries.getModel('force'); var initLayout = forceModel.get('initLayout'); if (graphSeries.preservedPoints) { nodeData.each(function (idx) { var id = nodeData.getId(idx); nodeData.setItemLayout(idx, preservedPoints[id] || [NaN, NaN]); }); } else if (!initLayout || initLayout === 'none') { simpleLayout(graphSeries); } else if (initLayout === 'circular') { circularLayout(graphSeries, 'value'); } var nodeDataExtent = nodeData.getDataExtent('value'); var edgeDataExtent = edgeData.getDataExtent('value'); // var edgeDataExtent = edgeData.getDataExtent('value'); var repulsion = forceModel.get('repulsion'); var edgeLength = forceModel.get('edgeLength'); if (!zrUtil.isArray(repulsion)) { repulsion = [repulsion, repulsion]; } if (!zrUtil.isArray(edgeLength)) { edgeLength = [edgeLength, edgeLength]; } // Larger value has smaller length edgeLength = [edgeLength[1], edgeLength[0]]; var nodes = nodeData.mapArray('value', function (value, idx) { var point = nodeData.getItemLayout(idx); var rep = linearMap(value, nodeDataExtent, repulsion); if (isNaN(rep)) { rep = (repulsion[0] + repulsion[1]) / 2; } return { w: rep, rep: rep, fixed: nodeData.getItemModel(idx).get('fixed'), p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point }; }); var edges = edgeData.mapArray('value', function (value, idx) { var edge = graph.getEdgeByIndex(idx); var d = linearMap(value, edgeDataExtent, edgeLength); 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: edgeModel.get('lineStyle.curveness') || 0, ignoreForceLayout: edgeModel.get('ignoreForceLayout') }; }); var coordSys = graphSeries.coordinateSystem; var rect = coordSys.getBoundingRect(); var forceInstance = forceLayout(nodes, edges, { rect: rect, gravity: forceModel.get('gravity'), friction: forceModel.get('friction') }); var oldStep = forceInstance.step; forceInstance.step = function (cb) { for (var i = 0, l = nodes.length; i < l; i++) { if (nodes[i].fixed) { // Write back to layout instance vec2.copy(nodes[i].p, graph.getNodeByIndex(i).getLayout()); } } oldStep(function (nodes, edges, stopped) { for (var i = 0, l = nodes.length; i < l; i++) { if (!nodes[i].fixed) { graph.getNodeByIndex(i).setLayout(nodes[i].p); } preservedPoints[nodeData.getId(i)] = nodes[i].p; } for (var i = 0, l = edges.length; i < l; i++) { var e = edges[i]; var edge = graph.getEdgeByIndex(i); var p1 = e.n1.p; var p2 = e.n2.p; var points = edge.getLayout(); points = points ? points.slice() : []; points[0] = points[0] || []; points[1] = points[1] || []; vec2.copy(points[0], p1); vec2.copy(points[1], p2); if (+e.curveness) { points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness]; } edge.setLayout(points); } // Update layout cb && cb(stopped); }); }; graphSeries.forceLayout = forceInstance; graphSeries.preservedPoints = preservedPoints; // Step to get the layout forceInstance.step(); } else { // Remove prev injected forceLayout instance graphSeries.forceLayout = null; } }); } module.exports = _default; /***/ }), /***/ "pzR0": /***/ (function(module, exports) { module.exports = false; /***/ }), /***/ "q0qZ": /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__("r54x"); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); /***/ }), /***/ "q3/e": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var functionApply = __webpack_require__("n561"); var aCallable = __webpack_require__("eZJ6"); var anObject = __webpack_require__("5+O3"); var fails = __webpack_require__("r54x"); // MS Edge argumentsList argument is optional var OPTIONAL_ARGUMENTS_LIST = !fails(function () { // eslint-disable-next-line es/no-reflect -- required for testing Reflect.apply(function () { /* empty */ }); }); // `Reflect.apply` method // https://tc39.es/ecma262/#sec-reflect.apply $({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { apply: function apply(target, thisArgument, argumentsList) { return functionApply(aCallable(target), thisArgument, anObject(argumentsList)); } }); /***/ }), /***/ "q4B+": /***/ (function(module, exports, __webpack_require__) { "use strict"; var PROPER_FUNCTION_NAME = __webpack_require__("iUXx").PROPER; var defineBuiltIn = __webpack_require__("gakl"); var anObject = __webpack_require__("5+O3"); var $toString = __webpack_require__("nnBu"); var fails = __webpack_require__("r54x"); var getRegExpFlags = __webpack_require__("UqxR"); var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { defineBuiltIn(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); var pattern = $toString(R.source); var flags = $toString(getRegExpFlags(R)); return '/' + pattern + '/' + flags; }, { unsafe: true }); } /***/ }), /***/ "q90C": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("U9LJ"); module.exports = function (it, TYPE) { if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); return it; }; /***/ }), /***/ "qBny": /***/ (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__("/gxq"); var SeriesModel = __webpack_require__("EJsE"); var Tree = __webpack_require__("+jMe"); var _treeHelper = __webpack_require__("gOx9"); var wrapTreePathInfo = _treeHelper.wrapTreePathInfo; /* * 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 _default = SeriesModel.extend({ type: 'series.sunburst', /** * @type {module:echarts/data/Tree~Node} */ _viewRoot: null, getInitialData: function (option, ecModel) { // Create a virtual root. var root = { name: option.name, children: option.data }; completeTreeValue(root); var levels = option.levels || []; // levels = option.levels = setDefault(levels, ecModel); var treeOption = {}; treeOption.levels = levels; // 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; }, optionUpdated: function () { this.resetViewRoot(); }, /* * @override */ getDataParams: function (dataIndex) { var params = SeriesModel.prototype.getDataParams.apply(this, arguments); var node = this.getData().tree.getNodeByDataIndex(dataIndex); params.treePathInfo = wrapTreePathInfo(node, this); return params; }, defaultOption: { zlevel: 0, z: 2, // 默认全局居中 center: ['50%', '50%'], radius: [0, '75%'], // 默认顺时针 clockwise: true, startAngle: 90, // 最小角度改为0 minAngle: 0, percentPrecision: 2, // If still show when all data zero. stillShowZeroSum: true, // Policy of highlighting pieces when hover on one // Valid values: 'none' (for not downplay others), 'descendant', // 'ancestor', 'self' highlightPolicy: 'descendant', // 'rootToNode', 'link', or false nodeClick: 'rootToNode', renderLabelForZeroData: false, label: { // could be: 'radial', 'tangential', or 'none' rotate: 'radial', show: true, opacity: 1, // 'left' is for inner side of inside, and 'right' is for outter // side for inside align: 'center', position: 'inside', distance: 5, silent: true }, itemStyle: { borderWidth: 1, borderColor: 'white', 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 }, label: { opacity: 0.6 } }, // Animation type canbe expansion, scale animationType: 'expansion', animationDuration: 1000, animationDurationUpdate: 500, animationEasing: 'cubicOut', data: [], levels: [], /** * Sort order. * * Valid values: 'desc', 'asc', null, or callback function. * 'desc' and 'asc' for descend and ascendant order; * null for not sorting; * example of callback function: * function(nodeA, nodeB) { * return nodeA.getValue() - nodeB.getValue(); * } */ sort: 'desc' }, getViewRoot: function () { return this._viewRoot; }, /** * @param {module:echarts/data/Tree~Node} [viewRoot] */ resetViewRoot: function (viewRoot) { viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; var root = this.getRawData().tree.root; if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { this._viewRoot = root; } } }); /** * @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; zrUtil.each(dataNode.children, function (child) { completeTreeValue(child); var childValue = child.value; zrUtil.isArray(childValue) && (childValue = childValue[0]); sum += childValue; }); var thisValue = dataNode.value; if (zrUtil.isArray(thisValue)) { thisValue = thisValue[0]; } if (thisValue == null || isNaN(thisValue)) { thisValue = sum; } // Value should not less than 0. if (thisValue < 0) { thisValue = 0; } zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; } module.exports = _default; /***/ }), /***/ "qC2Z": /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__("FKWp"); var isObject = __webpack_require__("8ANE"); var newPromiseCapability = __webpack_require__("3HN9"); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; /***/ }), /***/ "qDCd": /***/ (function(module, exports, __webpack_require__) { "use strict"; var tryToString = __webpack_require__("Ut8H"); var $TypeError = TypeError; module.exports = function (O, P) { if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); }; /***/ }), /***/ "qHaP": /***/ (function(module, exports, __webpack_require__) { "use strict"; var ctx = __webpack_require__("wRig"); var $export = __webpack_require__("eqAp"); var toObject = __webpack_require__("AeeY"); var call = __webpack_require__("dkfP"); var isArrayIter = __webpack_require__("e1Y9"); var toLength = __webpack_require__("J5DO"); var createProperty = __webpack_require__("RvsJ"); var getIterFn = __webpack_require__("JuSo"); $export($export.S + $export.F * !__webpack_require__("GAJc")(function (iter) { Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iterFn = getIterFn(O); var length, result, step, iterator; if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = toLength(O.length); for (result = new C(length); length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); /***/ }), /***/ "qOD1": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); // eslint-disable-next-line es/no-weak-set -- safe var WeakSetPrototype = WeakSet.prototype; module.exports = { // eslint-disable-next-line es/no-weak-set -- safe WeakSet: WeakSet, add: uncurryThis(WeakSetPrototype.add), has: uncurryThis(WeakSetPrototype.has), remove: uncurryThis(WeakSetPrototype['delete']) }; /***/ }), /***/ "qPtA": /***/ (function(module, exports, __webpack_require__) { var $metadata = __webpack_require__("VpOn"); var anObject = __webpack_require__("PGRs"); var aFunction = __webpack_require__("B63G"); var toMetaKey = $metadata.key; var ordinaryDefineOwnMetadata = $metadata.set; $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { return function decorator(target, targetKey) { ordinaryDefineOwnMetadata( metadataKey, metadataValue, (targetKey !== undefined ? anObject : aFunction)(target), toMetaKey(targetKey) ); }; } }); /***/ }), /***/ "qRfI": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * @returns {string} The combined URL */ module.exports = function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; }; /***/ }), /***/ "qRls": /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from __webpack_require__("sGlJ")('WeakSet'); /***/ }), /***/ "qSkD": /***/ (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 Parallel = __webpack_require__("sYrQ"); var CoordinateSystem = __webpack_require__("rctg"); /* * 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. */ /** * Parallel coordinate system creater. */ function create(ecModel, api) { var coordSysList = []; ecModel.eachComponent('parallel', function (parallelModel, idx) { var coordSys = new Parallel(parallelModel, ecModel, api); coordSys.name = 'parallel_' + idx; coordSys.resize(parallelModel, api); parallelModel.coordinateSystem = coordSys; coordSys.model = parallelModel; coordSysList.push(coordSys); }); // Inject the coordinateSystems into seriesModel ecModel.eachSeries(function (seriesModel) { if (seriesModel.get('coordinateSystem') === 'parallel') { var parallelModel = ecModel.queryComponents({ mainType: 'parallel', index: seriesModel.get('parallelIndex'), id: seriesModel.get('parallelId') })[0]; seriesModel.coordinateSystem = parallelModel.coordinateSystem; } }); return coordSysList; } CoordinateSystem.register('parallel', { create: create }); /***/ }), /***/ "qVJQ": /***/ (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__("/gxq"); var each = _util.each; var isString = _util.isString; /* * 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 * we just support that stacked by index. * * @param {module:echarts/model/Series} seriesModel * @param {Array.} dimensionInfoList The same as the input of . * The input dimensionInfoList will be modified. * @param {Object} [opt] * @param {boolean} [opt.stackedCoordDimension=''] Specify a coord dimension if needed. * @param {boolean} [opt.byIndex=false] * @return {Object} calculationInfo * { * stackedDimension: string * stackedByDimension: string * isStackedByIndex: boolean * stackedOverDimension: string * stackResultDimension: string * } */ function enableDataStack(seriesModel, dimensionInfoList, opt) { opt = opt || {}; var byIndex = opt.byIndex; var stackedCoordDimension = opt.stackedCoordDimension; // Compatibal: when `stack` is set as '', do not stack. var mayStack = !!(seriesModel && seriesModel.get('stack')); var stackedByDimInfo; var stackedDimInfo; var stackResultDimension; var stackedOverDimension; each(dimensionInfoList, function (dimensionInfo, index) { if (isString(dimensionInfo)) { dimensionInfoList[index] = dimensionInfo = { name: dimensionInfo }; } if (mayStack && !dimensionInfo.isExtraCoord) { // Find the first ordinal dimension as the stackedByDimInfo. if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) { stackedByDimInfo = dimensionInfo; } // Find the first stackable dimension as the stackedDimInfo. if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) { stackedDimInfo = dimensionInfo; } } }); if (stackedDimInfo && !byIndex && !stackedByDimInfo) { // Compatible with previous design, value axis (time axis) only stack by index. // It may make sense if the user provides elaborately constructed data. byIndex = true; } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`. // That put stack logic in List is for using conveniently in echarts extensions, but it // might not be a good way. if (stackedDimInfo) { // Use a weird name that not duplicated with other names. stackResultDimension = '__\0ecstackresult'; stackedOverDimension = '__\0ecstackedover'; // Create inverted index to fast query index by value. if (stackedByDimInfo) { stackedByDimInfo.createInvertedIndices = true; } var stackedDimCoordDim = stackedDimInfo.coordDim; var stackedDimType = stackedDimInfo.type; var stackedDimCoordIndex = 0; each(dimensionInfoList, function (dimensionInfo) { if (dimensionInfo.coordDim === stackedDimCoordDim) { stackedDimCoordIndex++; } }); dimensionInfoList.push({ name: stackResultDimension, coordDim: stackedDimCoordDim, coordDimIndex: stackedDimCoordIndex, type: stackedDimType, isExtraCoord: true, isCalculationCoord: true }); stackedDimCoordIndex++; dimensionInfoList.push({ name: stackedOverDimension, // This dimension contains stack base (generally, 0), so do not set it as // `stackedDimCoordDim` to avoid extent calculation, consider log scale. coordDim: stackedOverDimension, coordDimIndex: stackedDimCoordIndex, type: stackedDimType, isExtraCoord: true, isCalculationCoord: true }); } return { stackedDimension: stackedDimInfo && stackedDimInfo.name, stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, isStackedByIndex: byIndex, stackedOverDimension: stackedOverDimension, stackResultDimension: stackResultDimension }; } /** * @param {module:echarts/data/List} data * @param {string} stackedDim */ function isDimensionStacked(data, stackedDim /*, stackedByDim*/ ) { // Each single series only maps to one pair of axis. So we do not need to // check stackByDim, whatever stacked by a dimension or stacked by index. return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); // && ( // stackedByDim != null // ? stackedByDim === data.getCalculationInfo('stackedByDimension') // : data.getCalculationInfo('isStackedByIndex') // ); } /** * @param {module:echarts/data/List} data * @param {string} targetDim * @param {string} [stackedByDim] If not input this parameter, check whether * stacked by index. * @return {string} dimension */ function getStackedDimension(data, targetDim) { return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim; } exports.enableDataStack = enableDataStack; exports.isDimensionStacked = isDimensionStacked; exports.getStackedDimension = getStackedDimension; /***/ }), /***/ "qXbz": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var isSubsetOf = __webpack_require__("AzDE"); var setMethodAcceptSetLike = __webpack_require__("Rb8c"); // `Set.prototype.isSubsetOf` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, { isSubsetOf: isSubsetOf }); /***/ }), /***/ "qYTp": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__("eqAp"); var $typed = __webpack_require__("Au7w"); var buffer = __webpack_require__("Ee0C"); var anObject = __webpack_require__("PGRs"); var toAbsoluteIndex = __webpack_require__("IfkE"); var toLength = __webpack_require__("J5DO"); var isObject = __webpack_require__("U9LJ"); var ArrayBuffer = __webpack_require__("vR0S").ArrayBuffer; var speciesConstructor = __webpack_require__("8rdt"); var $ArrayBuffer = buffer.ArrayBuffer; var $DataView = buffer.DataView; var $isView = $typed.ABV && ArrayBuffer.isView; var $slice = $ArrayBuffer.prototype.slice; var VIEW = $typed.VIEW; var ARRAY_BUFFER = 'ArrayBuffer'; $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { // 24.1.3.1 ArrayBuffer.isView(arg) isView: function isView(it) { return $isView && $isView(it) || isObject(it) && VIEW in it; } }); $export($export.P + $export.U + $export.F * __webpack_require__("HTem")(function () { return !new $ArrayBuffer(2).slice(1, undefined).byteLength; }), ARRAY_BUFFER, { // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) slice: function slice(start, end) { if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix var len = anObject(this).byteLength; var first = toAbsoluteIndex(start, len); var fin = toAbsoluteIndex(end === undefined ? len : end, len); var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); var viewS = new $DataView(this); var viewT = new $DataView(result); var index = 0; while (first < fin) { viewT.setUint8(index++, viewS.getUint8(first++)); } return result; } }); __webpack_require__("7QiM")(ARRAY_BUFFER); /***/ }), /***/ "qanJ": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); // `Date.prototype.toGMTString` method // https://tc39.es/ecma262/#sec-date.prototype.togmtstring $({ target: 'Date', proto: true }, { toGMTString: Date.prototype.toUTCString }); /***/ }), /***/ "qbKW": /***/ (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 echarts = __webpack_require__("Icdr"); __webpack_require__("FlXs"); __webpack_require__("+bDV"); __webpack_require__("2Ow2"); var parallelVisual = __webpack_require__("CWSg"); /* * 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. */ echarts.registerVisual(parallelVisual); /***/ }), /***/ "qbRp": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var from = __webpack_require__("n2L5"); // `Set.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from $({ target: 'Set', stat: true, forced: true }, { from: from }); /***/ }), /***/ "qe6/": /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__("hcE8"); var fails = __webpack_require__("r54x"); var uncurryThis = __webpack_require__("u4Az"); var toString = __webpack_require__("nnBu"); var trim = __webpack_require__("7pjn").trim; var whitespaces = __webpack_require__("8HLk"); var charAt = uncurryThis(''.charAt); var $parseFloat = global.parseFloat; var Symbol = global.Symbol; var ITERATOR = Symbol && Symbol.iterator; var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); })); // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string module.exports = FORCED ? function parseFloat(string) { var trimmedString = trim(toString(string)); var result = $parseFloat(trimmedString); return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result; } : $parseFloat; /***/ }), /***/ "qjrH": /***/ (function(module, exports, __webpack_require__) { var _util = __webpack_require__("/gxq"); 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__("3h1/"); var roundRectHelper = __webpack_require__("Sm9T"); var imageHelper = __webpack_require__("+Y0c"); var fixShadow = __webpack_require__("9b8q"); var _constant = __webpack_require__("28kU"); 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; /***/ }), /***/ "qjvV": /***/ (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; /***/ }), /***/ "qnda": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var $find = __webpack_require__("TRbm").find; var addToUnscopables = __webpack_require__("HLWT"); var FIND = 'find'; var SKIPS_HOLES = true; // Shouldn't skip holes // eslint-disable-next-line es/no-array-prototype-find -- testing if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND); /***/ }), /***/ "qpxo": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__("i9tX"); var toObject = __webpack_require__("EJk4"); var lengthOfArrayLike = __webpack_require__("H8Gx"); var setArrayLength = __webpack_require__("srEh"); var doesNotExceedSafeInteger = __webpack_require__("Qccm"); var fails = __webpack_require__("r54x"); var INCORRECT_TO_LENGTH = fails(function () { return [].push.call({ length: 0x100000000 }, 1) !== 4294967297; }); // V8 and Safari <= 15.4, FF < 23 throws InternalError // https://bugs.chromium.org/p/v8/issues/detail?id=12681 var properErrorOnNonWritableLength = function () { try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).push(); } catch (error) { return error instanceof TypeError; } }; var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength(); // `Array.prototype.push` method // https://tc39.es/ecma262/#sec-array.prototype.push $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` push: function push(item) { var O = toObject(this); var len = lengthOfArrayLike(O); var argCount = arguments.length; doesNotExceedSafeInteger(len + argCount); for (var i = 0; i < argCount; i++) { O[len] = arguments[i]; len++; } setArrayLength(O, len); return len; } }); /***/ }), /***/ "qs+f": /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__("zyKz")(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /***/ "qvDY": /***/ (function(module, exports, __webpack_require__) { // all object keys, includes non-enumerable and symbols var gOPN = __webpack_require__("XjC+"); var gOPS = __webpack_require__("xWqz"); var anObject = __webpack_require__("PGRs"); var Reflect = __webpack_require__("vR0S").Reflect; module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { var keys = gOPN.f(anObject(it)); var getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; /***/ }), /***/ "qwCV": /***/ (function(module, exports, __webpack_require__) { "use strict"; // TODO: Remove from `core-js@4` var $ = __webpack_require__("i9tX"); var ObjectIterator = __webpack_require__("WUgY"); // `Object.iterateEntries` method // https://github.com/tc39/proposal-object-iteration $({ target: 'Object', stat: true, forced: true }, { iterateEntries: function iterateEntries(object) { return new ObjectIterator(object, 'entries'); } }); /***/ }), /***/ "qz9Q": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $trimEnd = __webpack_require__("7pjn").end; var forcedStringTrimMethod = __webpack_require__("iydE"); // `String.prototype.{ trimEnd, trimRight }` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // https://tc39.es/ecma262/#String.prototype.trimright module.exports = forcedStringTrimMethod('trimEnd') ? function trimEnd() { return $trimEnd(this); // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimEnd; /***/ }), /***/ "r3+g": /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__("GCs6"); var anObject = __webpack_require__("FKWp"); var getKeys = __webpack_require__("pEGt"); module.exports = __webpack_require__("qs+f") ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; /***/ }), /***/ "r3E4": /***/ (function(module, exports, __webpack_require__) { /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__("AXMl"); var fails = __webpack_require__("r54x"); var global = __webpack_require__("hcE8"); var $String = global.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); /***/ }), /***/ "r4+w": /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__("celx"); var fixRegExpWellKnownSymbolLogic = __webpack_require__("ftyM"); var anObject = __webpack_require__("5+O3"); var isNullOrUndefined = __webpack_require__("HrgD"); var requireObjectCoercible = __webpack_require__("hiy0"); var sameValue = __webpack_require__("kRoP"); var toString = __webpack_require__("nnBu"); var getMethod = __webpack_require__("YLw8"); var regExpExec = __webpack_require__("B9ov"); // @@search logic fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) { return [ // `String.prototype.search` method // https://tc39.es/ecma262/#sec-string.prototype.search function search(regexp) { var O = requireObjectCoercible(this); var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH); return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@search function (string) { var rx = anObject(this); var S = toString(string); var res = maybeCallNative(nativeSearch, rx, S); if (res.done) return res.value; var previousLastIndex = rx.lastIndex; if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; var result = regExpExec(rx, S); if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; return result === null ? -1 : result.index; } ]; }); /***/ }), /***/ "r54x": /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /***/ "r9WW": /***/ (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 DataZoomModel = __webpack_require__("sJ4e"); /* * 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 _default = DataZoomModel.extend({ type: 'dataZoom.select' }); module.exports = _default; /***/ }), /***/ "rBVO": /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__("PGRs"); var IE8_DOM_DEFINE = __webpack_require__("thuU"); var toPrimitive = __webpack_require__("E2U5"); var dP = Object.defineProperty; exports.f = __webpack_require__("8yv5") ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /***/ "rDhn": /***/ (function(module, exports, __webpack_require__) { var lengthOfArrayLike = __webpack_require__("H8Gx"); module.exports = function (Constructor, list) { var index = 0; var length = lengthOfArrayLike(list); var result = new Constructor(length); while (length > index) result[index] = list[index++]; return result; }; /***/ }), /***/ "rF9q": /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__("raVe"); // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe module.exports = Array.isArray || function isArray(argument) { return classof(argument) == 'Array'; }; /***/ }), /***/ "rFvp": /***/ (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__("/gxq"); var graphic = __webpack_require__("0sHC"); var AxisBuilder = __webpack_require__("vjPX"); var AxisView = __webpack_require__("43ae"); /* * 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 = ['splitLine', 'splitArea', 'minorSplitLine']; var _default = AxisView.extend({ type: 'radiusAxis', axisPointerClass: 'PolarAxisPointer', 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(); var layout = layoutAxis(polar, radiusAxisModel, axisAngle); var axisBuilder = new AxisBuilder(radiusAxisModel, layout); zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder); this.group.add(axisBuilder.getGroup()); zrUtil.each(selfBuilderAttrs, function (name) { if (radiusAxisModel.get(name + '.show') && !radiusAxis.scale.isBlank()) { this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords); } }, this); }, /** * @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; 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 graphic.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(graphic.mergePath(splitLines[i], { style: zrUtil.defaults({ stroke: lineColors[i % lineColors.length], fill: null }, lineStyleModel.getLineStyle()), silent: true })); } }, /** * @private */ _minorSplitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) { if (!minorTicksCoords.length) { return; } var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine'); var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); var lines = []; for (var i = 0; i < minorTicksCoords.length; i++) { for (var k = 0; k < minorTicksCoords[i].length; k++) { lines.push(new graphic.Circle({ shape: { cx: polar.cx, cy: polar.cy, r: minorTicksCoords[i][k].coord } })); } } this.group.add(graphic.mergePath(lines, { style: zrUtil.defaults({ fill: null }, lineStyleModel.getLineStyle()), silent: true })); }, /** * @private */ _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { if (!ticksCoords.length) { return; } var splitAreaModel = radiusAxisModel.getModel('splitArea'); var areaStyleModel = splitAreaModel.getModel('areaStyle'); var areaColors = areaStyleModel.get('color'); var lineCount = 0; areaColors = areaColors instanceof Array ? areaColors : [areaColors]; var splitAreas = []; 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 graphic.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; } // Simple optimization // Batching the lines if color are the same for (var i = 0; i < splitAreas.length; i++) { this.group.add(graphic.mergePath(splitAreas[i], { style: zrUtil.defaults({ fill: areaColors[i % areaColors.length] }, areaStyleModel.getAreaStyle()), silent: true })); } } }); /** * @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 }; } module.exports = _default; /***/ }), /***/ "rNRh": /***/ (function(module, exports, __webpack_require__) { var MATCH = __webpack_require__("6hGG")('match'); module.exports = function (KEY) { var re = /./; try { '/./'[KEY](re); } catch (e) { try { re[MATCH] = false; return !'/./'[KEY](re); } catch (f) { /* empty */ } } return true; }; /***/ }), /***/ "rO/R": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var demethodize = __webpack_require__("lMbK"); // `Function.prototype.demethodize` method // https://github.com/js-choi/proposal-function-demethodize $({ target: 'Function', proto: true, forced: true }, { demethodize: demethodize }); /***/ }), /***/ "rQqJ": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); var arrayBufferByteLength = __webpack_require__("h0xg"); var slice = uncurryThis(ArrayBuffer.prototype.slice); module.exports = function (O) { if (arrayBufferByteLength(O) !== 0) return false; try { slice(O, 0, 0); return false; } catch (error) { return true; } }; /***/ }), /***/ "rZAI": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 Object.keys(O) var toObject = __webpack_require__("wXdB"); var $keys = __webpack_require__("pEGt"); __webpack_require__("30vf")('keys', function () { return function keys(it) { return $keys(toObject(it)); }; }); /***/ }), /***/ "rZYS": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var demethodize = __webpack_require__("lMbK"); // `Function.prototype.unThis` method // https://github.com/js-choi/proposal-function-demethodize // TODO: Remove from `core-js@4` $({ target: 'Function', proto: true, forced: true, name: 'demethodize' }, { unThis: demethodize }); /***/ }), /***/ "rZj8": /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__("q0qZ"); var uncurryThis = __webpack_require__("u4Az"); var defineBuiltInAccessor = __webpack_require__("5MpO"); var URLSearchParamsPrototype = URLSearchParams.prototype; var forEach = uncurryThis(URLSearchParamsPrototype.forEach); // `URLSearchParams.prototype.size` getter // https://github.com/whatwg/url/pull/734 if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { get: function size() { var count = 0; forEach(this, function () { count++; }); return count; }, configurable: true, enumerable: true }); } /***/ }), /***/ "raVe": /***/ (function(module, exports, __webpack_require__) { var uncurryThis = __webpack_require__("u4Az"); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; /***/ }), /***/ "rbn0": /***/ (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 vec2 = __webpack_require__("C7PF"); /* * 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 simpleLayout(seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } var graph = seriesModel.getGraph(); graph.eachNode(function (node) { var model = node.getModel(); node.setLayout([+model.get('x'), +model.get('y')]); }); simpleLayoutEdge(graph); } function simpleLayoutEdge(graph) { graph.eachEdge(function (edge) { var curveness = edge.getModel().get('lineStyle.curveness') || 0; var p1 = vec2.clone(edge.node1.getLayout()); var p2 = vec2.clone(edge.node2.getLayout()); var points = [p1, p2]; if (+curveness) { points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]); } edge.setLayout(points); }); } exports.simpleLayout = simpleLayout; exports.simpleLayoutEdge = simpleLayoutEdge; /***/ }), /***/ "rctg": /***/ (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__("/gxq"); /* * 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 coordinateSystemCreators = {}; function CoordinateSystemManager() { this._coordinateSystems = []; } CoordinateSystemManager.prototype = { constructor: CoordinateSystemManager, create: function (ecModel, api) { var coordinateSystems = []; zrUtil.each(coordinateSystemCreators, function (creater, type) { var list = creater.create(ecModel, api); coordinateSystems = coordinateSystems.concat(list || []); }); this._coordinateSystems = coordinateSystems; }, update: function (ecModel, api) { zrUtil.each(this._coordinateSystems, function (coordSys) { coordSys.update && coordSys.update(ecModel, api); }); }, getCoordinateSystems: function () { return this._coordinateSystems.slice(); } }; CoordinateSystemManager.register = function (type, coordinateSystemCreator) { coordinateSystemCreators[type] = coordinateSystemCreator; }; CoordinateSystemManager.get = function (type) { return coordinateSystemCreators[type]; }; var _default = CoordinateSystemManager; module.exports = _default; /***/ }), /***/ "rd8h": /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__("i9tX"); var global = __webpack_require__("hcE8"); var schedulersFix = __webpack_require__("yroH"); var setTimeout = schedulersFix(global.setTimeout, true); // Bun / IE9- setTimeout additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout $({ global: true, bind: true, forced: global.setTimeout !== setTimeout }, { setTimeout: setTimeout }); /***/ }), /***/ "ri8f": /***/ (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__("/gxq"); 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; /***/ }), /***/ "rjj0": /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ var hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } var listToStyles = __webpack_require__("tTVk") /* type StyleObject = { id: number; parts: Array } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ var stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) var singletonElement = null var singletonCounter = 0 var isProduction = false var noop = function () {} // Force single-tag solution on IE6-9, which has a hard limit on the # of